ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
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_target_release, $a_id)
45  {
46  //$GLOBALS['ilLog']->write(__METHOD__.': entity: '.$a_entity.', target release: '.$a_target_release.', id: '.$a_id);
47 
48  try
49  {
50  $this->writer = new ilWebLinkXmlWriter(false);
51  $this->writer->setObjId($a_id);
52  $this->writer->write();
53  return $this->writer->xmlDumpMem(false);
54 
55  }
56  catch(UnexpectedValueException $e)
57  {
58  $GLOBALS['ilLog']->write("Caught error: ".$e->getMessage());
59  return '';
60  }
61  }
62 
70  public function getValidSchemaVersions($a_entity)
71  {
72  return array (
73  "4.1.0" => array(
74  "namespace" => "http://www.ilias.de/Modules/WebResource/webr/4_1",
75  "xsd_file" => "ilias_webr_4_1.xsd",
76  "uses_dataset" => false,
77  "min" => "4.1.0",
78  "max" => "")
79  );
80  }
81 
82 }
83 ?>