ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilNewsExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Export/classes/class.ilXmlExporter.php");
5
14{
15 private $ds;
16
20 function init()
21 {
22 include_once("./Services/News/classes/class.ilNewsDataSet.php");
23 $this->ds = new ilNewsDataSet();
24 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25 $this->ds->setDSPrefix("ds");
26 }
27
28
37 function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
38 {
39
40 include_once("./Services/News/classes/class.ilNewsItem.php");
41 $mob_ids = array();
42
43 foreach ($a_ids as $id)
44 {
45 $mob_id = ilNewsItem::_lookupMobId($id);
46 if ($mob_id > 0)
47 {
48 $mob_ids[$mob_id] = $mob_id;
49 }
50 }
51
52 return array (
53 array(
54 "component" => "Services/MediaObjects",
55 "entity" => "mob",
56 "ids" => $mob_ids)
57 );
58 }
59
68 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
69 {
70 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
71 }
72
80 function getValidSchemaVersions($a_entity)
81 {
82 return array (
83 "4.1.0" => array(
84 "namespace" => "http://www.ilias.de/Services/News/news/4_1",
85 "xsd_file" => "ilias_news_4_1.xsd",
86 "uses_dataset" => true,
87 "min" => "4.1.0",
88 "max" => "")
89 );
90 }
91
92}
93
94?>
News data set class.
Exporter class for news.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
init()
Initialisation.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
static _lookupMobId($a_news_id)
Lookup mob id.
Xml Exporter class.