ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilXmlExporter Class Reference

Xml Exporter class. 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

ilExport $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 27 of file class.ilXmlExporter.php.

Constructor & Destructor Documentation

◆ __construct()

ilXmlExporter::__construct ( )

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

32  {
33  }

Member Function Documentation

◆ determineSchemaVersion()

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

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

References getValidSchemaVersions(), and ILIAS_VERSION_NUMERIC.

125  : array {
126  $svs = $this->getValidSchemaVersions($a_entity);
127  $rsv = [];
128  foreach ($svs as $k => $sv) {
129  $min_version = $sv["min"] ?? "";
130  $max_version = $sv["max"] ?? "";
131  if (
132  ($min_version === "" || version_compare($min_version, ILIAS_VERSION_NUMERIC, "<=")) &&
133  ($max_version === "" || version_compare($max_version, ILIAS_VERSION_NUMERIC, ">="))
134  ) {
135  $rsv = $sv;
136  $rsv["schema_version"] = $k;
137  break;
138  }
139  }
140  return $rsv;
141  }
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 40 of file class.ilXmlExporter.php.

References $exp.

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

40  : ilExport
41  {
42  return $this->exp;
43  }
+ Here is the caller graph for this function:

◆ getRelativeExportDirectory()

ilXmlExporter::getRelativeExportDirectory ( )

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

74  : string
75  {
76  return $this->exp->getRelativeExportDirectory();
77  }

◆ 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 88 of file class.ilXmlExporter.php.

92  : array {
93  return [];
94  }

◆ 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 100 of file class.ilXmlExporter.php.

References getValidSchemaVersions().

104  : array {
105  return array();
106  }
+ 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 45 of file class.ilXmlExporter.php.

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

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

◆ setExport()

ilXmlExporter::setExport ( ilExport  $a_exp)

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

35  : void
36  {
37  $this->exp = $a_exp;
38  }

◆ setExportDirectories()

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

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

69  : void
70  {
71  $this->exp->setExportDirectories($a_dir_relative, $a_dir_absolute);
72  }

Field Documentation

◆ $exp

ilExport ilXmlExporter::$exp
protected

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