ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilBlogImporter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("./Services/Export/classes/class.ilXmlImporter.php");
5 
14 {
15  protected $ds;
16 
20  public function init()
21  {
22  include_once("./Modules/Blog/classes/class.ilBlogDataSet.php");
23  $this->ds = new ilBlogDataSet();
24  $this->ds->setDSPrefix("ds");
25  }
26 
33  public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
34  {
35  $this->ds->setImportDirectory($this->getImportDirectory());
36  include_once("./Services/DataSet/classes/class.ilDataSetImportParser.php");
38  $a_entity,
39  $this->getSchemaVersion(),
40  $a_xml,
41  $this->ds,
42  $a_mapping
43  );
44  }
45 
51  public function finalProcessing($a_mapping)
52  {
53  include_once("./Modules/Blog/classes/class.ilBlogPosting.php");
54  $blp_map = $a_mapping->getMappingsOfEntity("Services/COPage", "pg");
55  foreach ($blp_map as $blp_id) {
56  $blp_id = substr($blp_id, 4);
57  $blog_id = ilBlogPosting::lookupBlogId($blp_id);
58  ilBlogPosting::_writeParentId("blp", $blp_id, $blog_id);
59  }
60 
61  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
62  $sty_map = $a_mapping->getMappingsOfEntity("Services/Style", "sty");
63  foreach ($sty_map as $old_sty_id => $new_sty_id) {
64  if (is_array(ilBlogDataSet::$style_map[$old_sty_id])) {
65  foreach (ilBlogDataSet::$style_map[$old_sty_id] as $blog_id) {
66  ilObjStyleSheet::writeStyleUsage($blog_id, $new_sty_id);
67  }
68  }
69  }
70  }
71 }
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
getSchemaVersion()
Get schema version.
finalProcessing($a_mapping)
Final processing.
static lookupBlogId($a_posting_id)
Lookup blog id.
getImportDirectory()
Get import directory.
Blog Data set class.
Manifest parser for ILIAS standard export files.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
static _writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.
Importer class for blog.
$parser
Definition: BPMN2Parser.php:23
init()
Initialisation.
Xml importer class.