ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilBlogExporter.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
15{
16 protected $ds;
17
18 public function init()
19 {
20 include_once("./Modules/Blog/classes/class.ilBlogDataSet.php");
21 $this->ds = new ilBlogDataSet();
22 $this->ds->setDSPrefix("ds");
23 }
24
25 public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
26 {
27 $res = array();
28
29 // postings
30 include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
31 $pg_ids = array();
32 foreach ($a_ids as $id)
33 {
35 foreach (array_keys($pages) as $p)
36 {
37 $pg_ids[] = "blp:".$p;
38 }
39 }
40 if(sizeof($pg_ids))
41 {
42 $res[] = array(
43 "component" => "Services/COPage",
44 "entity" => "pg",
45 "ids" => $pg_ids
46 );
47 }
48
49 // style
50 $style_ids = array();
51 foreach ($a_ids as $id)
52 {
53 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
54 $style_id = ilObjStyleSheet::lookupObjectStyle($id);
55 if ($style_id > 0)
56 {
57 $style_ids[] = $style_id;
58 }
59 }
60 if(sizeof($style_ids))
61 {
62 $res[] = array(
63 "component" => "Services/Style",
64 "entity" => "sty",
65 "ids" => $style_ids
66 );
67 }
68
69 return $res;
70 }
71
72 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
73 {
74 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
75 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
76 }
77
78 public function getValidSchemaVersions($a_entity)
79 {
80 return array (
81 "4.3.0" => array(
82 "namespace" => "http://www.ilias.de/Modules/Blog/4_3",
83 "xsd_file" => "ilias_blog_4_3.xsd",
84 "uses_dataset" => true,
85 "min" => "4.3.0",
86 "max" => "4.9.9"),
87 "5.0.0" => array(
88 "namespace" => "http://www.ilias.de/Modules/Blog/5_0",
89 "xsd_file" => "ilias_blog_5_0.xsd",
90 "uses_dataset" => true,
91 "min" => "5.0.0",
92 "max" => "")
93
94 );
95 }
96
97}
98?>
Blog Data set class.
Blog export definition.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
static lookupObjectStyle($a_obj_id)
Lookup object style.
Xml Exporter class.