Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00034 class ilSoapStructureObject
00035 {
00036 var $obj_id;
00037 var $title;
00038 var $type;
00039 var $description;
00040 var $parentRefId;
00041
00042 var $structureObjects = array ();
00043
00044
00045 function ilSoapStructureObject ($objId, $type, $title, $description, $parentRefId = null) {
00046 $this->setObjId ($objId);
00047 $this->setType ($type);
00048 $this->setTitle ($title);
00049 $this->setDescription ($description);
00050 $this->parentRefId = $parentRefId;
00051 }
00052
00057 function addStructureObject ($structureObject)
00058 {
00059 $this->structureObjects [$structureObject->getObjId()] = $structureObject;
00060 }
00061
00066 function getStructureObjects () {
00067 return $this->structureObjects;
00068 }
00069
00070
00075 function setObjId ($value) {
00076 $this->obj_id= $value;
00077 }
00078
00079
00083 function getObjId()
00084 {
00085 return $this->obj_id;
00086 }
00087
00088
00089
00094 function setTitle ($value) {
00095 $this->title= $value;
00096 }
00097
00098
00103 function getTitle () {
00104 return $this->title;
00105 }
00106
00111 function setDescription ($value) {
00112 $this->description = $value;
00113 }
00114
00115
00120 function getDescription () {
00121 return $this->description;
00122 }
00123
00124
00129 function setType ($value)
00130 {
00131 $this->type = $value;
00132 }
00133
00134
00139 function getType ()
00140 {
00141 return $this->type;
00142 }
00143
00144
00149 function getGotoLink ()
00150 {
00151 return ILIAS_HTTP_PATH."/". "goto.php?target=".$this->getType()."_".$this->getObjId().(is_numeric ($this->getParentRefId())?"_".$this->getParentRefId():"")."&client_id=".CLIENT_ID;
00152 }
00153
00158 function getInternalLink ()
00159 {
00160 die ("abstract");
00161 }
00162
00167 function _getXMLAttributes ()
00168 {
00169 return array( 'type' => $this->getType(),
00170 'obj_id' => $this->getObjId()
00171 );
00172 }
00173
00174 function _getTagName ()
00175 {
00176 return "StructureObject";
00177 }
00178
00182 function setParentRefId ($parentRefId)
00183 {
00184 $this->parentRefId = $parentRefId;
00185 }
00186
00187
00191 function getParentRefId()
00192 {
00193 return $this->parentRefId;
00194 }
00195
00196
00200 function exportXML ($xml_writer) {
00201 $attrs = $this->_getXMLAttributes();
00202
00203
00204 $xml_writer->xmlStartTag($this->_getTagName(), $attrs);
00205
00206 $xml_writer->xmlElement('Title',null,$this->getTitle());
00207 $xml_writer->xmlElement('Description',null,$this->getDescription());
00208 $xml_writer->xmlElement('InternalLink',null,$this->getInternalLink());
00209 $xml_writer->xmlElement('GotoLink',null,$this->getGotoLink());
00210
00211 $xml_writer->xmlStartTag("StructureObjects");
00212
00213
00214 $structureObjects = $this->getStructureObjects();
00215
00216 foreach ($structureObjects as $structureObject)
00217 {
00218 $structureObject->exportXML ($xml_writer);
00219 }
00220
00221 $xml_writer->xmlEndTag("StructureObjects");
00222
00223 $xml_writer->xmlEndTag($this->_getTagName());
00224
00225 }
00226
00227
00228 }
00229
00230 ?>