ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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
22 public function __construct()
23 {
24
25 }
26
31 public static function lookupExportDirectory($a_obj_type, $a_obj_id, $a_export_type = 'xml', $a_entity = "")
32 {
33 $ent = ($a_entity == "")
34 ? ""
35 : "_".$a_entity;
36
37 if($a_export_type == 'xml')
38 {
39 return ilUtil::getDataDir()."/".$a_obj_type.$ent."_data"."/".$a_obj_type."_".$a_obj_id."/export";
40 }
41 return ilUtil::getDataDir()."/".$a_obj_type.$ent."_data"."/".$a_obj_type."_".$a_obj_id."/export_".$a_export_type;
42 }
43
52 abstract public function getXmlRepresentation($a_entity, $a_schema_version, $a_id);
53
54 abstract public function init();
55
56
63 public function setExportDirectories($a_dir_relative, $a_dir_absolute)
64 {
65 $this->dir_relative = $a_dir_relative;
66 $this->dir_absolute = $a_dir_absolute;
67 }
68
75 {
77 }
78
85 {
87 }
88
97 public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
98 {
99 return array();
100 }
101
110 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
111 {
112 return array();
113 }
114
131 abstract public function getValidSchemaVersions($a_entity);
132
139 public final function determineSchemaVersion($a_entity, $a_target_release)
140 {
141 $svs = $this->getValidSchemaVersions($a_entity);
142 $found = false;
143 foreach ($svs as $k => $sv)
144 {
145 if (!$found)
146 {
147 if (version_compare($sv["min"], ILIAS_VERSION_NUMERIC, "<=")
148 && ($sv["max"] == "" || version_compare($sv["max"], ILIAS_VERSION_NUMERIC, ">=")))
149 {
150 $rsv = $sv;
151 $rsv["schema_version"] = $k;
152 $found = true;
153 }
154 }
155 }
156
157 return $rsv;
158 }
159}
160?>
static getDataDir()
get data directory (outside webspace)
Xml Exporter class.
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