ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilWebResourceExporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 
5 include_once './Modules/WebResource/classes/class.ilWebLinkXmlWriter.php';
6 include_once './Services/Export/classes/class.ilXmlExporter.php';
7 
18 {
19  private $writer = null;
20 
24  public function __construct()
25  {
26  }
27 
32  public function init()
33  {
34  }
35 
43  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
44  {
45  try {
46  $this->writer = new ilWebLinkXmlWriter(false);
47  $this->writer->setObjId($a_id);
48  $this->writer->write();
49  return $this->writer->xmlDumpMem(false);
50  } catch (UnexpectedValueException $e) {
51  $GLOBALS['ilLog']->write("Caught error: " . $e->getMessage());
52  return '';
53  }
54  }
55 
63  public function getValidSchemaVersions($a_entity)
64  {
65  return array(
66  "4.1.0" => array(
67  "namespace" => "http://www.ilias.de/Modules/WebResource/webr/4_1",
68  "xsd_file" => "ilias_webr_4_1.xsd",
69  "uses_dataset" => false,
70  "min" => "4.1.0",
71  "max" => "")
72  );
73  }
74 }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
Xml Exporter class.
Create styles array
The data for the language used.
XML writer for weblinks.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.