20 "copage" => array(
"class" =>
"ilCOPageDefReader")
34 foreach ($this->readers as $k =>
$reader)
37 $class_path =
"./setup/classes/class.".$class.
".php";
38 include_once($class_path);
39 $this->readers[$k][
"reader"] =
new $class();
42 $this->name = $a_name;
45 parent::__construct($a_path);
50 xml_set_object($a_xml_parser,$this);
51 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
52 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
62 $ilDB->manipulate(
"DELETE FROM il_object_def");
64 $ilDB->manipulate(
"DELETE FROM il_object_subobj");
66 $ilDB->manipulate(
"DELETE FROM il_object_group");
68 $ilDB->manipulate(
"DELETE FROM il_pluginslot");
70 $ilDB->manipulate(
"DELETE FROM il_component");
72 $ilDB->manipulate(
"DELETE FROM il_event_handling");
74 $ilDB->manipulate(
"DELETE FROM il_object_sub_type");
76 foreach ($this->readers as $k =>
$reader)
78 $this->readers[$k][
"reader"]->clearTables();
89 $ilDB->manipulateF(
"DELETE FROM il_object_def WHERE id = %s",
90 array(
"text"), array($a_id));
92 $ilDB->manipulateF(
"DELETE FROM il_object_subobj WHERE parent = %s OR subobj = %s",
93 array(
"text",
"text"), array($a_id, $a_id));
107 $this->current_tag = $a_name;
110 if (isset($this->readers[$a_name]))
112 $this->current_reader = $a_name;
116 if ($this->current_reader !=
"")
119 $this->current_component);
129 if($a_attribs[
"repository"] === NULL)
131 $a_attribs[
"repository"] =
true;
133 if($a_attribs[
"workspace"] === NULL)
135 $a_attribs[
"workspace"] =
false;
138 $this->current_object = $a_attribs[
"id"];
139 $ilDB->manipulateF(
"INSERT INTO il_object_def (id, class_name, component,location,".
140 "checkbox,inherit,translate,devmode,allow_link,allow_copy,rbac,default_pos,".
141 "default_pres_pos,sideblock,grp,system,export,repository,workspace,administration,amet) VALUES ".
142 "(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)",
143 array(
"text",
"text",
"text",
"text",
"integer",
"integer",
"text",
"integer",
"integer",
"integer",
144 "integer",
"integer",
"integer",
"integer",
"text",
"integer",
"integer",
"integer",
"integer",
'integer',
'integer'),
147 $a_attribs[
"class_name"],
148 $this->current_component,
149 $this->current_component.
"/".$a_attribs[
"dir"],
150 (
int) $a_attribs[
"checkbox"],
151 (
int) $a_attribs[
"inherit"],
152 $a_attribs[
"translate"],
153 (
int) $a_attribs[
"devmode"],
154 (
int) $a_attribs[
"allow_link"],
155 (
int) $a_attribs[
"allow_copy"],
156 (
int) $a_attribs[
"rbac"],
157 (
int) $a_attribs[
"default_pos"],
158 (
int) $a_attribs[
"default_pres_pos"],
159 (
int) $a_attribs[
"sideblock"],
161 (
int) $a_attribs[
"system"],
162 (
int) $a_attribs[
"export"],
163 (
int) $a_attribs[
"repository"],
164 (
int) $a_attribs[
"workspace"],
165 (
int) $a_attribs[
'administration'],
166 (
int) $a_attribs[
'amet']
171 $ilDB->manipulateF(
"INSERT INTO il_object_subobj (parent, subobj, mmax) VALUES (%s,%s,%s)",
172 array(
"text",
"text",
"integer"),
173 array($this->current_object, $a_attribs[
"id"], (
int) $a_attribs[
"max"]));
177 $ilDB->manipulateF(
"INSERT INTO il_object_subobj (parent, subobj, mmax) VALUES (%s,%s,%s)",
178 array(
"text",
"text",
"integer"),
179 array($a_attribs[
"id"], $this->current_object, (
int) $a_attribs[
"max"]));
183 $ilDB->manipulateF(
"INSERT INTO il_object_group (id, name, default_pres_pos) VALUES (%s,%s,%s)",
184 array(
"text",
"text",
"integer"),
185 array($a_attribs[
"id"], $a_attribs[
"name"], $a_attribs[
"default_pres_pos"]));
189 $this->current_object = $a_attribs[
"id"];
190 $q =
"INSERT INTO il_pluginslot (component, id, name) VALUES (".
191 $ilDB->quote($this->current_component,
"text").
",".
192 $ilDB->quote($a_attribs[
"id"],
"text").
",".
193 $ilDB->quote($a_attribs[
"name"],
"text").
")";
194 $ilDB->manipulate($q);
198 $component = $a_attribs[
"component"];
201 $component = $this->current_component;
203 $q =
"INSERT INTO il_event_handling (component, type, id) VALUES (".
204 $ilDB->quote($component,
"text").
",".
205 $ilDB->quote($a_attribs[
"type"],
"text").
",".
206 $ilDB->quote($a_attribs[
"id"],
"text").
")";
207 $ilDB->manipulate($q);
211 $component = $a_attribs[
"component"];
214 $component = $this->current_component;
216 include_once
"Services/Cron/classes/class.ilCronManager.php";
218 $this->has_cron[$component][] = $a_attribs[
"id"];
221 case 'mailtemplates':
222 $this->in_mail_templates =
true;
226 if(!$this->in_mail_templates)
231 $component = $a_attribs[
'component'];
234 $component = $this->current_component;
237 require_once
'Services/Mail/classes/class.ilMailTemplateService.php';
244 $this->mail_templates_by_component[$component][] = $a_attribs[
"id"];
248 $ilDB->manipulate(
"INSERT INTO il_object_sub_type ".
249 "(obj_type, sub_type, amet) VALUES (".
250 $ilDB->quote($this->current_object,
"text").
",".
251 $ilDB->quote($a_attribs[
"id"],
"text").
",".
252 $ilDB->quote($a_attribs[
"amet"],
"integer").
258 include_once
'./Services/SystemCheck/classes/class.ilSCGroups.php';
262 case 'systemcheck_task':
263 include_once
'./Services/SystemCheck/classes/class.ilSCGroups.php';
266 include_once
'./Services/SystemCheck/classes/class.ilSCTasks.php';
268 $tasks->updateFromComponentDefinition($a_attribs[
'identifier']);
272 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSecurePath.php');
277 $ilWACSecurePath->setPath($a_attribs[
"path"]);
278 $ilWACSecurePath->create();
280 $ilWACSecurePath->setCheckingClass($a_attribs[
"checking-class"]);
281 $ilWACSecurePath->setInSecFolder((
bool)$a_attribs[
"in-sec-folder"]);
282 $ilWACSecurePath->setComponentDirectory(dirname($this->xml_file));
283 $ilWACSecurePath->update();
287 include_once
'./Services/Logging/classes/class.ilLogComponentLevels.php';
292 include_once
"Services/Badge/classes/class.ilBadgeHandler.php";
309 if ($this->current_reader !=
"")
315 if($a_name ==
"module" || $a_name ==
"service")
317 include_once
"Services/Cron/classes/class.ilCronManager.php";
319 (array)$this->has_cron[$this->current_component]);
321 require_once
'Services/Mail/classes/class.ilMailTemplateService.php';
326 include_once
"Services/Badge/classes/class.ilBadgeHandler.php";
333 if (isset($this->readers[$a_name]))
335 $this->current_reader =
null;
350 $a_data = preg_replace(
"/\n/",
"",$a_data);
351 $a_data = preg_replace(
"/\t+/",
"",$a_data);
355 switch ($this->current_tag)
367 $this->component_id = $a_component_id;
static findOrFail($primary_key, array $add_constructor_args=array())
Tries to find the object and throws an Exception if object is not found, instead of returning null.
An exception for terminatinating execution or to throw for unit testing.
static updateFromXML($a_component_id)
Import component definition.
static updateFromXML($a_component, $a_id, $a_class, $a_path=null)
Process data from module.xml/service.xml.
static clearFromXML($a_component, array $a_xml_job_ids)
Clear job data.
static updateFromXML($a_component_id)
@global type $ilDB
static insertFromXML($a_component, $a_id, $a_class, $a_path)
static clearFromXml($a_component, array $a_new_templates)
Component definition reader (reads common tags in module.xml and service.xml files) Name is misleadin...
setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class @access private
handlerCharacterData($a_xml_parser, $a_data)
end tag handler
static deleteObjectDefinition($a_id)
Delete an object definition (this is currently needed for test cases)
handlerEndTag($a_xml_parser, $a_name)
End tag handler.
getComponentId()
Get component id.
setComponentId($a_component_id)
Set from module or service reader.
$mail_templates_by_component
clearTables()
clear the tables
__construct($a_path, $a_name, $a_type)
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
Start tag handler.
static getInstance()
Get singleton instance.
static getInstanceByGroupId($a_group_id)
Get singleton instance.
Base class for sax-based expat parsing extended classes need to overwrite the method setHandlers and ...