ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilXmlExporter Class Reference

Xml Exporter class. More...

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

Public Member Functions

 __construct ()
 Constructor. 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
 

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

23  {
24 
25  }

Member Function Documentation

◆ determineSchemaVersion()

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

Determine schema version.

Parameters

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

References getValidSchemaVersions(), and ILIAS_VERSION_NUMERIC.

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  }
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()

ilXmlExporter::getAbsoluteExportDirectory ( )

◆ getRelativeExportDirectory()

ilXmlExporter::getRelativeExportDirectory ( )

Get relative export directory.

Returns
string relative directory

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

References $dir_relative.

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

75  {
76  return $this->dir_relative;
77  }
+ 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 97 of file class.ilXmlExporter.php.

98  {
99  return array();
100  }

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

References getValidSchemaVersions().

111  {
112  return array();
113  }
+ 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 31 of file class.ilXmlExporter.php.

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

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  }
static getDataDir()
get data directory (outside webspace)
+ Here is the call graph for this function:

◆ setExportDirectories()

ilXmlExporter::setExportDirectories (   $a_dir_relative,
  $a_dir_absolute 
)

Export directories.

Parameters
stringrelative directory
stringabsolute directory

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

64  {
65  $this->dir_relative = $a_dir_relative;
66  $this->dir_absolute = $a_dir_absolute;
67  }

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().


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