ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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  }
28 
33  public function init()
34  {
35  }
36 
44  public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
45  {
46  try
47  {
48  $this->writer = new ilWebLinkXmlWriter(false);
49  $this->writer->setObjId($a_id);
50  $this->writer->write();
51  return $this->writer->xmlDumpMem(false);
52 
53  }
54  catch(UnexpectedValueException $e)
55  {
56  $GLOBALS['ilLog']->write("Caught error: ".$e->getMessage());
57  return '';
58  }
59  }
60 
68  public function getValidSchemaVersions($a_entity)
69  {
70  return array (
71  "4.1.0" => array(
72  "namespace" => "http://www.ilias.de/Modules/WebResource/webr/4_1",
73  "xsd_file" => "ilias_webr_4_1.xsd",
74  "uses_dataset" => false,
75  "min" => "4.1.0",
76  "max" => "")
77  );
78  }
79 
80 }
81 ?>
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
Xml Exporter class.
$GLOBALS['ct_recipient']
XML writer for weblinks.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.