ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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['DIC']->logger()->webr()->warning("Caught error: " . $e->getMessage());
52  return '';
53  }
54  }
55 
64  public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
65  {
66  $deps = [];
67 
68  // service settings
69  $deps[] = [
70  "component" => "Services/Object",
71  "entity" => "common",
72  "ids" => $a_ids
73  ];
74 
75  return $deps;
76  }
77 
85  public function getValidSchemaVersions($a_entity)
86  {
87  return array(
88  "4.1.0" => array(
89  "namespace" => "http://www.ilias.de/Modules/WebResource/webr/4_1",
90  "xsd_file" => "ilias_webr_4_1.xsd",
91  "uses_dataset" => false,
92  "min" => "4.1.0",
93  "max" => "")
94  );
95  }
96 }
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
Xml Exporter class.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
XML writer for weblinks.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.