ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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{
36 public $obj_id;
37 public $title;
38 public $type;
41
42 public $structureObjects = array();
43
44
45 public function __construct($objId, $type, $title, $description, $parentRefId = null)
46 {
47 $this->setObjId($objId);
48 $this->setType($type);
49 $this->setTitle($title);
51 $this->parentRefId = $parentRefId;
52 }
53
58 public function addStructureObject($structureObject)
59 {
60 $this->structureObjects [$structureObject->getObjId()] = $structureObject;
61 }
62
67 public function getStructureObjects()
68 {
70 }
71
72
77 public function setObjId($value)
78 {
79 $this->obj_id= $value;
80 }
81
82
86 public function getObjId()
87 {
88 return $this->obj_id;
89 }
90
91
92
97 public function setTitle($value)
98 {
99 $this->title= $value;
100 }
101
102
107 public function getTitle()
108 {
109 return $this->title;
110 }
111
116 public function setDescription($value)
117 {
118 $this->description = $value;
119 }
120
121
126 public function getDescription()
127 {
128 return $this->description;
129 }
130
131
136 public function setType($value)
137 {
138 $this->type = $value;
139 }
140
141
146 public function getType()
147 {
148 return $this->type;
149 }
150
151
156 public function getGotoLink()
157 {
158 return ILIAS_HTTP_PATH . "/" . "goto.php?target=" . $this->getType() . "_" . $this->getObjId() . (is_numeric($this->getParentRefId())?"_" . $this->getParentRefId():"") . "&client_id=" . CLIENT_ID;
159 }
160
165 public function getInternalLink()
166 {
167 die("abstract");
168 }
169
174 public function _getXMLAttributes()
175 {
176 return array( 'type' => $this->getType(),
177 'obj_id' => $this->getObjId()
178 );
179 }
180
181 public function _getTagName()
182 {
183 return "StructureObject";
184 }
185
190 {
191 $this->parentRefId = $parentRefId;
192 }
193
194
198 public function getParentRefId()
199 {
200 return $this->parentRefId;
201 }
202
203
207 public function exportXML($xml_writer)
208 {
209 $attrs = $this->_getXMLAttributes();
210
211 // open tag
212 $xml_writer->xmlStartTag($this->_getTagName(), $attrs);
213
214 $xml_writer->xmlElement('Title', null, $this->getTitle());
215 $xml_writer->xmlElement('Description', null, $this->getDescription());
216 $xml_writer->xmlElement('InternalLink', null, $this->getInternalLink());
217 $xml_writer->xmlElement('GotoLink', null, $this->getGotoLink());
218
219 $xml_writer->xmlStartTag("StructureObjects");
220
221 // handle sub elements
223
224 foreach ($structureObjects as $structureObject) {
225 $structureObject->exportXML($xml_writer);
226 }
227
228 $xml_writer->xmlEndTag("StructureObjects");
229
230 $xml_writer->xmlEndTag($this->_getTagName());
231 }
232}
An exception for terminatinating execution or to throw for unit testing.
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
setDescription($value)
set current description
_getXMLAttributes()
get xml tag attributes
getStructureObjects()
returns sub structure elements
__construct($objId, $type, $title, $description, $parentRefId=null)
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)