ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilUserExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Export/classes/class.ilXmlExporter.php");
5
17{
18 private $ds;
19
23 public function init()
24 {
25 include_once("./Services/User/classes/class.ilUserDataSet.php");
26 $this->ds = new ilUserDataSet();
27 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
28 $this->ds->setDSPrefix("ds");
29 }
30
39 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
40 {
41 if ($a_entity == "personal_data") {
42 include_once("./Services/Calendar/classes/class.ilCalendarCategories.php");
43 $cal_ids = array();
44 foreach ($a_ids as $user_id) {
45 foreach (ilCalendarCategories::lookupPrivateCategories($user_id) as $ct) {
46 $cal_ids[] = $ct["cat_id"];
47 }
48 }
49
50 return array(
51 array(
52 "component" => "Services/User",
53 "entity" => "usr_profile",
54 "ids" => $a_ids),
55 array(
56 "component" => "Services/User",
57 "entity" => "usr_multi",
58 "ids" => $a_ids),
59 array(
60 "component" => "Services/User",
61 "entity" => "usr_setting",
62 "ids" => $a_ids),
63 array(
64 "component" => "Services/Notes",
65 "entity" => "user_notes",
66 "ids" => $a_ids),
67 array(
68 "component" => "Services/Calendar",
69 "entity" => "calendar",
70 "ids" => $cal_ids)
71 );
72 }
73
74 return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
75 }
76
85 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
86 {
87 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
88 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
89 }
90
98 public function getValidSchemaVersions($a_entity)
99 {
100 return array(
101 "4.3.0" => array(
102 "namespace" => "http://www.ilias.de/Services/User/usr/4_3",
103 "xsd_file" => "ilias_usr_4_3.xsd",
104 "uses_dataset" => true,
105 "min" => "4.3.0",
106 "max" => "4.4.99"),
107 "5.1.0" => array(
108 "namespace" => "http://www.ilias.de/Services/User/usr/5_1",
109 "xsd_file" => "ilias_usr_5_1.xsd",
110 "uses_dataset" => true,
111 "min" => "5.1.0",
112 "max" => "5.1.99"),
113 "5.2.0" => array(
114 "namespace" => "http://www.ilias.de/Services/User/usr/5_2",
115 "xsd_file" => "ilias_usr_5_2.xsd",
116 "uses_dataset" => true,
117 "min" => "5.2.0",
118 "max" => "5.2.99"),
119 "5.3.0" => array(
120 "namespace" => "http://www.ilias.de/Services/User/usr/5_3",
121 "xsd_file" => "ilias_usr_5_3.xsd",
122 "uses_dataset" => true,
123 "min" => "5.3.0",
124 "max" => "")
125 );
126 }
127}
An exception for terminatinating execution or to throw for unit testing.
static lookupPrivateCategories($a_user_id)
Lookup private categories of user.
Exercise data set class.
Exporter class for user data Note: this is currently NOT used for the classic user export/import It i...
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
init()
Initialisation.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
Xml Exporter class.