ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCOPageExporter Class Reference

Exporter class for meta data. More...

+ Inheritance diagram for ilCOPageExporter:
+ Collaboration diagram for ilCOPageExporter:

Public Member Functions

 init ()
 Initialisation.
 getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids)
 Get head dependencies.
 getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids)
 Get tail dependencies.
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation.
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to.
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 Constructor.
 setExportDirectories ($a_dir_relative, $a_dir_absolute)
 Export directories.
 getRelativeExportDirectory ()
 Get relative export directory.
 getAbsoluteExportDirectory ()
 Get absolute export directory.
 determineSchemaVersion ($a_entity, $a_target_release)
 Determine schema version.

Private Attributes

 $ds

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type= 'xml', $a_entity="")
 export directory lookup
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 $dir_absolute

Detailed Description

Exporter class for meta data.

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

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

Member Function Documentation

ilCOPageExporter::getValidSchemaVersions (   $a_entity)

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.

Returns

Reimplemented from ilXmlExporter.

Definition at line 157 of file class.ilCOPageExporter.php.

{
if ($a_entity == "pg")
{
return array (
"4.2.0" => array(
"namespace" => "http://www.ilias.de/Services/COPage/pg/4_2",
"xsd_file" => "ilias_pg_4_2.xsd",
"min" => "4.2.0",
"max" => ""),
"4.1.0" => array(
"namespace" => "http://www.ilias.de/Services/COPage/pg/4_1",
"xsd_file" => "ilias_pg_4_1.xsd",
"min" => "4.1.0",
"max" => "4.1.99")
);
}
if ($a_entity == "pgtp")
{
return array (
"4.2.0" => array(
"namespace" => "http://www.ilias.de/Services/COPage/pgtp/4_1",
"xsd_file" => "ilias_pgtp_4_1.xsd",
"uses_dataset" => true,
"min" => "4.2.0",
"max" => "")
);
}
}
ilCOPageExporter::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"

Reimplemented from ilXmlExporter.

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

References $file, ilObjFile\_getFilesOfObject(), ilObjMediaObject\_getMobsOfObject(), and ilObject\_lookupType().

{
if ($a_entity == "pg")
{
// get all media objects and files of the page
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
include_once("./Modules/File/classes/class.ilObjFile.php");
$mob_ids = array();
$file_ids = array();
foreach ($a_ids as $pg_id)
{
$pg_id = explode(":", $pg_id);
// get media objects
$mids = ilObjMediaObject::_getMobsOfObject($pg_id[0].":pg", $pg_id[1]);
foreach ($mids as $mid)
{
if (ilObject::_lookupType($mid) == "mob")
{
$mob_ids[] = $mid;
}
}
// get files
$files = ilObjFile::_getFilesOfObject($pg_id[0].":pg", $pg_id[1]);
foreach ($files as $file)
{
if (ilObject::_lookupType($file) == "file")
{
$file_ids[] = $file;
}
}
}
return array (
array(
"component" => "Services/MediaObjects",
"entity" => "mob",
"ids" => $mob_ids),
array(
"component" => "Modules/File",
"entity" => "file",
"ids" => $file_ids)
);
}
return array();
}

+ Here is the call graph for this function:

ilCOPageExporter::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"

Reimplemented from ilXmlExporter.

Definition at line 94 of file class.ilCOPageExporter.php.

{
if ($a_entity == "pgtp")
{
$pg_ids = array();
foreach ($a_ids as $id)
{
$pg_ids[] = "stys:".$id;
}
return array(
array(
"component" => "Services/COPage",
"entity" => "pg",
"ids" => $pg_ids)
);
}
return array();
}
ilCOPageExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)

Get xml representation.

Parameters
stringentity
stringschema version
arrayids
Returns
string xml

Reimplemented from ilXmlExporter.

Definition at line 124 of file class.ilCOPageExporter.php.

{
if ($a_entity == "pg")
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$id = explode(":", $a_id);
$page_object = new ilPageObject($id[0], $id[1]);
$page_object->buildDom();
$page_object->insertInstIntoIDs(IL_INST_ID);
$pxml = $page_object->getXMLFromDom(false, false, false, "", true);
$pxml = str_replace("&","&", $pxml);
$xml = "<PageObject>";
$xml.= $pxml;
$xml.= "</PageObject>";
$page_object->freeDom();
return $xml;
}
if ($a_entity == "pgtp")
{
return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
}
}
ilCOPageExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

Definition at line 20 of file class.ilCOPageExporter.php.

{
include_once("./Services/COPage/classes/class.ilCOPageDataSet.php");
$this->ds = new ilCOPageDataSet();
$this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
$this->ds->setDSPrefix("ds");
}

Field Documentation

ilCOPageExporter::$ds
private

Definition at line 15 of file class.ilCOPageExporter.php.


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