ILIAS  release_8 Revision v8.23
ilXmlExporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Static Public Member Functions

static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 

Protected Attributes

string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 27 of file class.ilXmlExporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilXmlExporter::__construct ( )

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

34  {
35  }

Member Function Documentation

◆ determineSchemaVersion()

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

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

References getValidSchemaVersions(), and ILIAS_VERSION_NUMERIC.

128  : array {
129  $svs = $this->getValidSchemaVersions($a_entity);
130  $found = false;
131  $rsv = [];
132  foreach ($svs as $k => $sv) {
133  if (!$found) {
134  if (version_compare($sv["min"], ILIAS_VERSION_NUMERIC, "<=")
135  && ($sv["max"] == "" || version_compare($sv["max"], ILIAS_VERSION_NUMERIC, ">="))) {
136  $rsv = $sv;
137  $rsv["schema_version"] = $k;
138  $found = true;
139  }
140  }
141  }
142  return $rsv;
143  }
const ILIAS_VERSION_NUMERIC
getValidSchemaVersions(string $a_entity)
Returns schema versions that the component can export to.
+ Here is the call graph for this function:

◆ getAbsoluteExportDirectory()

◆ getExport()

ilXmlExporter::getExport ( )

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

References $exp.

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

42  : ilExport
43  {
44  return $this->exp;
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getRelativeExportDirectory()

ilXmlExporter::getRelativeExportDirectory ( )

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

References $dir_relative.

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

77  : string
78  {
79  return $this->dir_relative;
80  }
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilXmlExporter::getValidSchemaVersions ( string  $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" => "") );

Referenced by determineSchemaVersion(), and getXmlExportTailDependencies().

+ Here is the caller graph for this function:

◆ getXmlExportHeadDependencies()

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

Get head dependencies.

Returns
array array of array with keys "component", entity", "ids"

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

95  : array {
96  return [];
97  }

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Returns
array array of array with keys "component", entity", "ids"

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

References getValidSchemaVersions().

107  : array {
108  return array();
109  }
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

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 ( string  $a_obj_type,
int  $a_obj_id,
string  $a_export_type = 'xml',
string  $a_entity = "" 
)
static

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

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

52  : string {
53  $ent = ($a_entity == "")
54  ? ""
55  : "_" . $a_entity;
56 
57  if ($a_export_type == 'xml') {
58  return ilFileUtils::getDataDir() . "/" . $a_obj_type . $ent . "_data" . "/" . $a_obj_type . "_" . $a_obj_id . "/export";
59  }
60  return ilFileUtils::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)

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

37  : void
38  {
39  $this->exp = $a_exp;
40  }

◆ setExportDirectories()

ilXmlExporter::setExportDirectories ( string  $a_dir_relative,
string  $a_dir_absolute 
)

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

71  : void
72  {
73  $this->dir_relative = $a_dir_relative;
74  $this->dir_absolute = $a_dir_absolute;
75  }

Field Documentation

◆ $dir_absolute

string ilXmlExporter::$dir_absolute = ""
protected

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

Referenced by getAbsoluteExportDirectory().

◆ $dir_relative

string ilXmlExporter::$dir_relative = ""
protected

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

Referenced by getRelativeExportDirectory().

◆ $exp

ilExport ilXmlExporter::$exp
protected

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