ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilXmlExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11abstract class ilXmlExporter
12{
13 protected $dir_relative;
14 protected $dir_absolute;
15 protected $exp;
16
23 public function __construct()
24 {
25
26 }
27
33 function setExport(ilExport $a_exp)
34 {
35 $this->exp = $a_exp;
36 }
37
43 function getExport()
44 {
45 return $this->exp;
46 }
47
52 public static function lookupExportDirectory($a_obj_type, $a_obj_id, $a_export_type = 'xml', $a_entity = "")
53 {
54 $ent = ($a_entity == "")
55 ? ""
56 : "_".$a_entity;
57
58 if($a_export_type == 'xml')
59 {
60 return ilUtil::getDataDir()."/".$a_obj_type.$ent."_data"."/".$a_obj_type."_".$a_obj_id."/export";
61 }
62 return ilUtil::getDataDir()."/".$a_obj_type.$ent."_data"."/".$a_obj_type."_".$a_obj_id."/export_".$a_export_type;
63 }
64
73 abstract public function getXmlRepresentation($a_entity, $a_schema_version, $a_id);
74
75 abstract public function init();
76
77
84 public function setExportDirectories($a_dir_relative, $a_dir_absolute)
85 {
86 $this->dir_relative = $a_dir_relative;
87 $this->dir_absolute = $a_dir_absolute;
88 }
89
96 {
98 }
99
106 {
107 return $this->dir_absolute;
108 }
109
118 public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
119 {
120 return array();
121 }
122
131 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
132 {
133 return array();
134 }
135
152 abstract public function getValidSchemaVersions($a_entity);
153
160 public final function determineSchemaVersion($a_entity, $a_target_release)
161 {
162 $svs = $this->getValidSchemaVersions($a_entity);
163 $found = false;
164 foreach ($svs as $k => $sv)
165 {
166 if (!$found)
167 {
168 if (version_compare($sv["min"], ILIAS_VERSION_NUMERIC, "<=")
169 && ($sv["max"] == "" || version_compare($sv["max"], ILIAS_VERSION_NUMERIC, ">=")))
170 {
171 $rsv = $sv;
172 $rsv["schema_version"] = $k;
173 $found = true;
174 }
175 }
176 }
177
178 return $rsv;
179 }
180}
181?>
static getDataDir()
get data directory (outside webspace)
Xml Exporter class.
getExport()
Get export.
setExport(ilExport $a_exp)
Set export object.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getRelativeExportDirectory()
Get relative export directory.
determineSchemaVersion($a_entity, $a_target_release)
Determine schema version.
setExportDirectories($a_dir_relative, $a_dir_absolute)
Export directories.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
__construct()
Constructor.
static lookupExportDirectory($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
export directory lookup
getAbsoluteExportDirectory()
Get absolute export directory.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
const ILIAS_VERSION_NUMERIC