20 "copage" => array(
"class" =>
"ilCOPageDefReader")
34 foreach ($this->readers as $k =>
$reader) {
36 $class_path =
"./setup/classes/class." . $class .
".php";
37 include_once($class_path);
38 $this->readers[$k][
"reader"] =
new $class();
41 $this->name = $a_name;
44 parent::__construct($a_path);
49 xml_set_object($a_xml_parser, $this);
50 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
51 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
61 $ilDB->manipulate(
"DELETE FROM il_object_def");
63 $ilDB->manipulate(
"DELETE FROM il_object_subobj");
65 $ilDB->manipulate(
"DELETE FROM il_object_group");
67 $ilDB->manipulate(
"DELETE FROM il_pluginslot");
69 $ilDB->manipulate(
"DELETE FROM il_component");
74 $ilDB->manipulate(
"DELETE FROM il_event_handling WHERE component NOT LIKE 'Plugins/%'");
76 $ilDB->manipulate(
"DELETE FROM il_object_sub_type");
78 foreach ($this->readers as $k =>
$reader) {
79 $this->readers[$k][
"reader"]->clearTables();
91 "DELETE FROM il_object_def WHERE id = %s",
97 "DELETE FROM il_object_subobj WHERE parent = %s OR subobj = %s",
98 array(
"text",
"text"),
114 $this->current_tag = $a_name;
117 if (isset($this->readers[$a_name])) {
118 $this->current_reader = $a_name;
122 if ($this->current_reader !=
"") {
127 $this->current_component
135 if ($a_attribs[
"repository"] ===
null) {
136 $a_attribs[
"repository"] =
true;
138 if ($a_attribs[
"workspace"] ===
null) {
139 $a_attribs[
"workspace"] =
false;
142 $this->current_object = $a_attribs[
"id"];
144 "INSERT INTO il_object_def (id, class_name, component,location," .
145 "checkbox,inherit,translate,devmode,allow_link,allow_copy,rbac,default_pos," .
146 "default_pres_pos,sideblock,grp,system,export,repository,workspace,administration,amet,orgunit_permissions,lti_provider) VALUES " .
147 "(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)",
148 array(
"text",
"text",
"text",
"text",
"integer",
"integer",
"text",
"integer",
"integer",
"integer",
149 "integer",
"integer",
"integer",
"integer",
"text",
"integer",
"integer",
"integer",
"integer",
'integer',
'integer',
'integer',
'integer'),
152 $a_attribs[
"class_name"],
153 $this->current_component,
154 $this->current_component .
"/" . $a_attribs[
"dir"],
155 (
int) $a_attribs[
"checkbox"],
156 (
int) $a_attribs[
"inherit"],
157 $a_attribs[
"translate"],
158 (
int) $a_attribs[
"devmode"],
159 (
int) $a_attribs[
"allow_link"],
160 (
int) $a_attribs[
"allow_copy"],
161 (
int) $a_attribs[
"rbac"],
162 (
int) $a_attribs[
"default_pos"],
163 (
int) $a_attribs[
"default_pres_pos"],
164 (
int) $a_attribs[
"sideblock"],
166 (
int) $a_attribs[
"system"],
167 (
int) $a_attribs[
"export"],
168 (
int) $a_attribs[
"repository"],
169 (
int) $a_attribs[
"workspace"],
170 (
int) $a_attribs[
'administration'],
171 (
int) $a_attribs[
'amet'],
172 (
int) $a_attribs[
'orgunit_permissions'],
173 (
int) $a_attribs[
'lti_provider']
180 "INSERT INTO il_object_subobj (parent, subobj, mmax) VALUES (%s,%s,%s)",
181 array(
"text",
"text",
"integer"),
182 array($this->current_object, $a_attribs[
"id"], (
int) $a_attribs[
"max"])
188 "INSERT INTO il_object_subobj (parent, subobj, mmax) VALUES (%s,%s,%s)",
189 array(
"text",
"text",
"integer"),
190 array($a_attribs[
"id"], $this->current_object, (
int) $a_attribs[
"max"])
196 "INSERT INTO il_object_group (id, name, default_pres_pos) VALUES (%s,%s,%s)",
197 array(
"text",
"text",
"integer"),
198 array($a_attribs[
"id"], $a_attribs[
"name"], $a_attribs[
"default_pres_pos"])
203 $this->current_object = $a_attribs[
"id"];
204 $q =
"INSERT INTO il_pluginslot (component, id, name) VALUES (" .
205 $ilDB->quote($this->current_component,
"text") .
"," .
206 $ilDB->quote($a_attribs[
"id"],
"text") .
"," .
207 $ilDB->quote($a_attribs[
"name"],
"text") .
")";
208 $ilDB->manipulate($q);
212 $component = $a_attribs[
"component"];
214 $component = $this->current_component;
216 $q =
"INSERT INTO il_event_handling (component, type, id) VALUES (" .
217 $ilDB->quote($component,
"text") .
"," .
218 $ilDB->quote($a_attribs[
"type"],
"text") .
"," .
219 $ilDB->quote($a_attribs[
"id"],
"text") .
")";
220 $ilDB->manipulate($q);
224 $component = $a_attribs[
"component"];
226 $component = $this->current_component;
228 include_once
"Services/Cron/classes/class.ilCronManager.php";
230 $this->has_cron[$component][] = $a_attribs[
"id"];
233 case 'mailtemplates':
234 $this->in_mail_templates =
true;
238 if (!$this->in_mail_templates) {
242 $component = $a_attribs[
'component'];
244 $component = $this->current_component;
247 require_once
'Services/Mail/classes/class.ilMailTemplateService.php';
254 $this->mail_templates_by_component[$component][] = $a_attribs[
"id"];
258 $ilDB->manipulate(
"INSERT INTO il_object_sub_type " .
259 "(obj_type, sub_type, amet) VALUES (" .
260 $ilDB->quote($this->current_object,
"text") .
"," .
261 $ilDB->quote($a_attribs[
"id"],
"text") .
"," .
262 $ilDB->quote($a_attribs[
"amet"],
"integer") .
268 include_once
'./Services/SystemCheck/classes/class.ilSCGroups.php';
272 case 'systemcheck_task':
273 include_once
'./Services/SystemCheck/classes/class.ilSCGroups.php';
276 include_once
'./Services/SystemCheck/classes/class.ilSCTasks.php';
278 $tasks->updateFromComponentDefinition($a_attribs[
'identifier']);
282 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSecurePath.php');
287 $ilWACSecurePath->setPath($a_attribs[
"path"]);
288 $ilWACSecurePath->create();
290 $ilWACSecurePath->setCheckingClass($a_attribs[
"checking-class"]);
291 $ilWACSecurePath->setInSecFolder((
bool) $a_attribs[
"in-sec-folder"]);
292 $ilWACSecurePath->setComponentDirectory(dirname($this->xml_file));
293 $ilWACSecurePath->update();
297 include_once
'./Services/Logging/classes/class.ilLogComponentLevels.php';
302 include_once
"Services/Badge/classes/class.ilBadgeHandler.php";
308 require_once
'./Services/PDFGeneration/classes/class.ilPDFCompInstaller.php';
324 if ($this->current_reader !=
"") {
327 if ($a_name ==
"module" || $a_name ==
"service") {
328 include_once
"Services/Cron/classes/class.ilCronManager.php";
330 $this->current_component,
331 (array) $this->has_cron[$this->current_component]
334 require_once
'Services/Mail/classes/class.ilMailTemplateService.php';
337 if (!in_array($this->
getComponentId(), (array) $this->has_badges)) {
338 include_once
"Services/Badge/classes/class.ilBadgeHandler.php";
345 if (isset($this->readers[$a_name])) {
346 $this->current_reader =
null;
361 $a_data = preg_replace(
"/\n/",
"", $a_data);
362 $a_data = preg_replace(
"/\t+/",
"", $a_data);
364 if (!empty($a_data)) {
365 switch ($this->current_tag) {
376 $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 updateFromXML($service, $purpose, $preferred)
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 ...