ILIAS  release_7 Revision v7.30-3-g800a261c036
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
5include_once './Modules/WebResource/classes/class.ilWebLinkXmlWriter.php';
6include_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);
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}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
An exception for terminatinating execution or to throw for unit testing.
XML writer for weblinks.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml.
Xml Exporter class.