ILIAS  release_7 Revision v7.30-3-g800a261c036
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 public 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 public function getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
38 {
39 include_once("./Services/News/classes/class.ilNewsItem.php");
40 $mob_ids = array();
41
42 foreach ($a_ids as $id) {
43 $mob_id = ilNewsItem::_lookupMobId($id);
44 if ($mob_id > 0) {
45 $mob_ids[$mob_id] = $mob_id;
46 }
47 }
48
49 return array(
50 array(
51 "component" => "Services/MediaObjects",
52 "entity" => "mob",
53 "ids" => $mob_ids)
54 );
55 }
56
65 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
66 {
67 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
68 }
69
77 public function getValidSchemaVersions($a_entity)
78 {
79 return array(
80 "5.4.0" => array(
81 "namespace" => "http://www.ilias.de/Services/News/news/5_4",
82 "xsd_file" => "ilias_news_5_4.xsd",
83 "uses_dataset" => true,
84 "min" => "5.4.0",
85 "max" => ""),
86 "4.1.0" => array(
87 "namespace" => "http://www.ilias.de/Services/News/news/4_1",
88 "xsd_file" => "ilias_news_4_1.xsd",
89 "uses_dataset" => true,
90 "min" => "4.1.0",
91 "max" => "")
92 );
93 }
94}
An exception for terminatinating execution or to throw for unit testing.
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.