ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
4 include_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  $pages = ilBlogPosting::getAllPostings($id);
34  foreach (array_keys($pages) as $p) {
35  $pg_ids[] = "blp:" . $p;
36  }
37  }
38  if (sizeof($pg_ids)) {
39  $res[] = array(
40  "component" => "Services/COPage",
41  "entity" => "pg",
42  "ids" => $pg_ids
43  );
44  }
45 
46  // style
47  $style_ids = array();
48  foreach ($a_ids as $id) {
49  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
50  $style_id = ilObjStyleSheet::lookupObjectStyle($id);
51  if ($style_id > 0) {
52  $style_ids[] = $style_id;
53  }
54  }
55  if (sizeof($style_ids)) {
56  $res[] = array(
57  "component" => "Services/Style",
58  "entity" => "sty",
59  "ids" => $style_ids
60  );
61  }
62 
63  // service settings
64  $res[] = array(
65  "component" => "Services/Object",
66  "entity" => "common",
67  "ids" => $a_ids);
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 }
Blog export definition.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
if(!array_key_exists('StateId', $_REQUEST)) $id
Blog Data set class.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
static lookupObjectStyle($a_obj_id)
Lookup object style.
Xml Exporter class.
static getAllPostings($a_blog_id, $a_limit=1000, $a_offset=0)
Get all postings of blog.
foreach($_POST as $key=> $value) $res
getValidSchemaVersions($a_entity)