ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 include_once("./Services/Export/classes/class.ilXmlExporter.php");
5 
17 {
18  private $ds;
19 
23  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  function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
40  {
41  if ($a_entity == "personal_data")
42  {
43  include_once("./Services/Calendar/classes/class.ilCalendarCategories.php");
44  $cal_ids = array();
45  foreach ($a_ids as $user_id)
46  {
47  foreach (ilCalendarCategories::lookupPrivateCategories($user_id) as $ct)
48  {
49  $cal_ids[] = $ct["cat_id"];
50  }
51  }
52 
53  return array (
54  array(
55  "component" => "Services/User",
56  "entity" => "usr_profile",
57  "ids" => $a_ids),
58  array(
59  "component" => "Services/User",
60  "entity" => "usr_setting",
61  "ids" => $a_ids),
62  array(
63  "component" => "Services/Bookmarks",
64  "entity" => "bookmarks",
65  "ids" => $a_ids),
66  array(
67  "component" => "Services/Notes",
68  "entity" => "user_notes",
69  "ids" => $a_ids),
70  array(
71  "component" => "Services/Calendar",
72  "entity" => "calendar",
73  "ids" => $cal_ids)
74  );
75  }
76 
77  return parent::getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids);
78  }
79 
88  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
89  {
90  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
91  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
92  }
93 
101  function getValidSchemaVersions($a_entity)
102  {
103  return array (
104  "4.3.0" => array(
105  "namespace" => "http://www.ilias.de/Services/User/usr/4_3",
106  "xsd_file" => "ilias_usr_4_3.xsd",
107  "uses_dataset" => true,
108  "min" => "4.3.0",
109  "max" => "")
110  );
111  }
112 
113 
114 }
115 
116 ?>