ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSoapStructureObject.php
Go to the documentation of this file.
1<?php
2 /*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22 */
23
24
35{
37 var $title;
38 var $type;
41
42 var $structureObjects = array ();
43
44
46 $this->setObjId ($objId);
47 $this->setType ($type);
48 $this->setTitle ($title);
49 $this->setDescription ($description);
50 $this->parentRefId = $parentRefId;
51 }
52
57 function addStructureObject ($structureObject)
58 {
59 $this->structureObjects [$structureObject->getObjId()] = $structureObject;
60 }
61
66 function getStructureObjects () {
68 }
69
70
75 function setObjId ($value) {
76 $this->obj_id= $value;
77 }
78
79
83 function getObjId()
84 {
85 return $this->obj_id;
86 }
87
88
89
94 function setTitle ($value) {
95 $this->title= $value;
96 }
97
98
103 function getTitle () {
104 return $this->title;
105 }
106
111 function setDescription ($value) {
112 $this->description = $value;
113 }
114
115
120 function getDescription () {
121 return $this->description;
122 }
123
124
129 function setType ($value)
130 {
131 $this->type = $value;
132 }
133
134
139 function getType ()
140 {
141 return $this->type;
142 }
143
144
149 function getGotoLink ()
150 {
151 return ILIAS_HTTP_PATH."/". "goto.php?target=".$this->getType()."_".$this->getObjId().(is_numeric ($this->getParentRefId())?"_".$this->getParentRefId():"")."&client_id=".CLIENT_ID;
152 }
153
158 function getInternalLink ()
159 {
160 die ("abstract");
161 }
162
167 function _getXMLAttributes ()
168 {
169 return array( 'type' => $this->getType(),
170 'obj_id' => $this->getObjId()
171 );
172 }
173
174 function _getTagName ()
175 {
176 return "StructureObject";
177 }
178
182 function setParentRefId ($parentRefId)
183 {
184 $this->parentRefId = $parentRefId;
185 }
186
187
191 function getParentRefId()
192 {
193 return $this->parentRefId;
194 }
195
196
200 function exportXML ($xml_writer) {
201 $attrs = $this->_getXMLAttributes();
202
203 // open tag
204 $xml_writer->xmlStartTag($this->_getTagName(), $attrs);
205
206 $xml_writer->xmlElement('Title',null,$this->getTitle());
207 $xml_writer->xmlElement('Description',null,$this->getDescription());
208 $xml_writer->xmlElement('InternalLink',null,$this->getInternalLink());
209 $xml_writer->xmlElement('GotoLink',null,$this->getGotoLink());
210
211 $xml_writer->xmlStartTag("StructureObjects");
212
213 // handle sub elements
215
216 foreach ($structureObjects as $structureObject)
217 {
218 $structureObject->exportXML ($xml_writer);
219 }
220
221 $xml_writer->xmlEndTag("StructureObjects");
222
223 $xml_writer->xmlEndTag($this->_getTagName());
224
225 }
226
227
228}
229
230?>
setObjId($value)
set current ObjId
addStructureObject($structureObject)
add structure object to its parent
setTitle($value)
set current title
getInternalLink()
return current internal_link
setType($value)
set current type
getGotoLink()
return current goto_link
exportXML($xml_writer)
export to xml writer
ilSoapStructureObject($objId, $type, $title, $description, $parentRefId=null)
setDescription($value)
set current description
_getXMLAttributes()
get xml tag attributes
getStructureObjects()
returns sub structure elements
getObjId()
return current object id
getDescription()
return current description
getParentRefId()
read access to parents ref id
setParentRefId($parentRefId)
set ref id for parent object (used for permanent link if set)