ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilXmlExporter Class Reference

Xml Exporter class. More...

+ Inheritance diagram for ilXmlExporter:
+ Collaboration diagram for ilXmlExporter:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setExport (ilExport $a_exp)
 Set export object. More...
 
 getExport ()
 Get export. More...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 init ()
 
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories. More...
 
 getRelativeExportDirectory ()
 Get relative export directory. More...
 
 getAbsoluteExportDirectory ()
 Get absolute export directory. More...
 
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version. More...
 

Static Public Member Functions

static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 

Protected Attributes

 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

Xml Exporter class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilXmlExporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilXmlExporter::__construct ( )

Constructor.

Parameters

Definition at line 23 of file class.ilXmlExporter.php.

24  {
25  }

Member Function Documentation

◆ determineSchemaVersion()

ilXmlExporter::determineSchemaVersion (   $a_entity,
  $a_target_release 
)
final

Determine schema version.

Parameters

Definition at line 158 of file class.ilXmlExporter.php.

References getValidSchemaVersions(), and ILIAS_VERSION_NUMERIC.

159  {
160  $svs = $this->getValidSchemaVersions($a_entity);
161  $found = false;
162  foreach ($svs as $k => $sv) {
163  if (!$found) {
164  if (version_compare($sv["min"], ILIAS_VERSION_NUMERIC, "<=")
165  && ($sv["max"] == "" || version_compare($sv["max"], ILIAS_VERSION_NUMERIC, ">="))) {
166  $rsv = $sv;
167  $rsv["schema_version"] = $k;
168  $found = true;
169  }
170  }
171  }
172 
173  return $rsv;
174  }
const ILIAS_VERSION_NUMERIC
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
+ Here is the call graph for this function:

◆ getAbsoluteExportDirectory()

◆ getExport()

ilXmlExporter::getExport ( )

Get export.

Returns
ilExport export object

Definition at line 42 of file class.ilXmlExporter.php.

References $exp.

Referenced by ilLearningModuleExporter\getXmlRepresentation(), ilSkillExporter\init(), ilMediaPoolExporter\init(), and ilLearningModuleExporter\init().

43  {
44  return $this->exp;
45  }
+ Here is the caller graph for this function:

◆ getRelativeExportDirectory()

ilXmlExporter::getRelativeExportDirectory ( )

Get relative export directory.

Returns
string relative directory

Definition at line 93 of file class.ilXmlExporter.php.

References $dir_relative.

Referenced by ilStyleExporter\getXmlRepresentation(), ilForumExporter\getXmlRepresentation(), and ilFileExporter\getXmlRepresentation().

94  {
95  return $this->dir_relative;
96  }
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilXmlExporter::getValidSchemaVersions (   $a_entity)
abstract

Returns schema versions that the component can export to.

ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top. Example:

            return array (
    "4.1.0" => array(
            "namespace" => "http://www.ilias.de/Services/MetaData/md/4_1",
            "xsd_file" => "ilias_md_4_1.xsd",
            "min" => "4.1.0",
            "max" => "")
    );
Returns
array

Referenced by determineSchemaVersion(), and getXmlExportTailDependencies().

+ Here is the caller graph for this function:

◆ getXmlExportHeadDependencies()

ilXmlExporter::getXmlExportHeadDependencies (   $a_entity,
  $a_target_release,
  $a_ids 
)

Get head dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 116 of file class.ilXmlExporter.php.

117  {
118  return array();
119  }

◆ getXmlExportTailDependencies()

ilXmlExporter::getXmlExportTailDependencies (   $a_entity,
  $a_target_release,
  $a_ids 
)

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Definition at line 129 of file class.ilXmlExporter.php.

References getValidSchemaVersions().

130  {
131  return array();
132  }
+ Here is the call graph for this function:

◆ getXmlRepresentation()

ilXmlExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)
abstract

Get xml representation.

Parameters
stringentity
stringschema version
stringid
Returns
string xml string

Referenced by lookupExportDirectory().

+ Here is the caller graph for this function:

◆ init()

ilXmlExporter::init ( )
abstract

Referenced by lookupExportDirectory().

+ Here is the caller graph for this function:

◆ lookupExportDirectory()

static ilXmlExporter::lookupExportDirectory (   $a_obj_type,
  $a_obj_id,
  $a_export_type = 'xml',
  $a_entity = "" 
)
static

export directory lookup

Returns
string export directory

Definition at line 51 of file class.ilXmlExporter.php.

References ilUtil\getDataDir(), getXmlRepresentation(), and init().

52  {
53  $ent = ($a_entity == "")
54  ? ""
55  : "_" . $a_entity;
56 
57  if ($a_export_type == 'xml') {
58  return ilUtil::getDataDir() . "/" . $a_obj_type . $ent . "_data" . "/" . $a_obj_type . "_" . $a_obj_id . "/export";
59  }
60  return ilUtil::getDataDir() . "/" . $a_obj_type . $ent . "_data" . "/" . $a_obj_type . "_" . $a_obj_id . "/export_" . $a_export_type;
61  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ setExport()

ilXmlExporter::setExport ( ilExport  $a_exp)

Set export object.

Parameters
ilExport$a_expexport object

Definition at line 32 of file class.ilXmlExporter.php.

33  {
34  $this->exp = $a_exp;
35  }

◆ setExportDirectories()

ilXmlExporter::setExportDirectories (   $a_dir_relative,
  $a_dir_absolute 
)

Export directories.

Parameters
stringrelative directory
stringabsolute directory

Definition at line 82 of file class.ilXmlExporter.php.

83  {
84  $this->dir_relative = $a_dir_relative;
85  $this->dir_absolute = $a_dir_absolute;
86  }

Field Documentation

◆ $dir_absolute

ilXmlExporter::$dir_absolute
protected

Definition at line 14 of file class.ilXmlExporter.php.

Referenced by getAbsoluteExportDirectory().

◆ $dir_relative

ilXmlExporter::$dir_relative
protected

Definition at line 13 of file class.ilXmlExporter.php.

Referenced by getRelativeExportDirectory().

◆ $exp

ilXmlExporter::$exp
protected

The documentation for this class was generated from the following file: