ILIAS  release_4-4 Revision
ilCOPageExporter Class Reference

Exporter class for meta data. More...

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

Public Member Functions

 init ()
 Initialisation. 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...
 
 getXmlRepresentation ($a_entity, $a_schema_version, $a_id)
 Get xml representation. More...
 
 getValidSchemaVersions ($a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __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...
 

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 More...
 
- 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

◆ getValidSchemaVersions()

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

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

159  {
160  if ($a_entity == "pg")
161  {
162  return array (
163  "4.2.0" => array(
164  "namespace" => "http://www.ilias.de/Services/COPage/pg/4_2",
165  "xsd_file" => "ilias_pg_4_2.xsd",
166  "min" => "4.2.0",
167  "max" => ""),
168  "4.1.0" => array(
169  "namespace" => "http://www.ilias.de/Services/COPage/pg/4_1",
170  "xsd_file" => "ilias_pg_4_1.xsd",
171  "min" => "4.1.0",
172  "max" => "4.1.99")
173  );
174  }
175  if ($a_entity == "pgtp")
176  {
177  return array (
178  "4.2.0" => array(
179  "namespace" => "http://www.ilias.de/Services/COPage/pgtp/4_1",
180  "xsd_file" => "ilias_pgtp_4_1.xsd",
181  "uses_dataset" => true,
182  "min" => "4.2.0",
183  "max" => "")
184  );
185  }
186  }

◆ getXmlExportHeadDependencies()

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"

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

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

38  {
39  if ($a_entity == "pg")
40  {
41  // get all media objects and files of the page
42  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
43  include_once("./Modules/File/classes/class.ilObjFile.php");
44  $mob_ids = array();
45  $file_ids = array();
46  foreach ($a_ids as $pg_id)
47  {
48  $pg_id = explode(":", $pg_id);
49 
50  // get media objects
51  $mids = ilObjMediaObject::_getMobsOfObject($pg_id[0].":pg", $pg_id[1]);
52  foreach ($mids as $mid)
53  {
54  if (ilObject::_lookupType($mid) == "mob")
55  {
56  $mob_ids[] = $mid;
57  }
58  }
59 
60  // get files
61  $files = ilObjFile::_getFilesOfObject($pg_id[0].":pg", $pg_id[1]);
62  foreach ($files as $file)
63  {
64  if (ilObject::_lookupType($file) == "file")
65  {
66  $file_ids[] = $file;
67  }
68  }
69  }
70 
71  return array (
72  array(
73  "component" => "Services/MediaObjects",
74  "entity" => "mob",
75  "ids" => $mob_ids),
76  array(
77  "component" => "Modules/File",
78  "entity" => "file",
79  "ids" => $file_ids)
80  );
81  }
82 
83  return array();
84  }
print $file
_getFilesOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_usage_lang="-")
get all files of an object
static _lookupType($a_id, $a_reference=false)
lookup object type
_getMobsOfObject($a_type, $a_id, $a_usage_hist_nr=0, $a_lang="-")
get mobs of object
+ Here is the call graph for this function:

◆ getXmlExportTailDependencies()

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"

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

95  {
96  if ($a_entity == "pgtp")
97  {
98  $pg_ids = array();
99  foreach ($a_ids as $id)
100  {
101  $pg_ids[] = "stys:".$id;
102  }
103 
104  return array(
105  array(
106  "component" => "Services/COPage",
107  "entity" => "pg",
108  "ids" => $pg_ids)
109  );
110  }
111 
112  return array();
113  }

◆ getXmlRepresentation()

ilCOPageExporter::getXmlRepresentation (   $a_entity,
  $a_schema_version,
  $a_id 
)

Get xml representation.

Parameters
stringentity
stringschema version
arrayids
Returns
string xml

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

References ilPageObjectFactory\getInstance().

125  {
126  if ($a_entity == "pg")
127  {
128  include_once("./Services/COPage/classes/class.ilPageObject.php");
129 
130  $id = explode(":", $a_id);
131 
132  include_once("./Services/COPage/classes/class.ilPageObjectFactory.php");
133  $page_object = ilPageObjectFactory::getInstance($id[0], $id[1]);
134  $page_object->buildDom();
135  $page_object->insertInstIntoIDs(IL_INST_ID);
136  $pxml = $page_object->getXMLFromDom(false, false, false, "", true);
137  $pxml = str_replace("&","&", $pxml);
138  $xml = "<PageObject>";
139  $xml.= $pxml;
140  $xml.= "</PageObject>";
141  $page_object->freeDom();
142 
143  return $xml;
144  }
145  if ($a_entity == "pgtp")
146  {
147  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
148  }
149  }
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
+ Here is the call graph for this function:

◆ init()

ilCOPageExporter::init ( )

Initialisation.

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

21  {
22  include_once("./Services/COPage/classes/class.ilCOPageDataSet.php");
23  $this->ds = new ilCOPageDataSet();
24  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25  $this->ds->setDSPrefix("ds");
26  }
COPage Data set class.

Field Documentation

◆ $ds

ilCOPageExporter::$ds
private

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


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