ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilBlogImporter.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
11 {
12  protected $ds;
13 
17  public function init()
18  {
19  $this->ds = new ilBlogDataSet();
20  $this->ds->setDSPrefix("ds");
21  }
22 
29  public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
30  {
31  $this->ds->setImportDirectory($this->getImportDirectory());
32  $parser = new ilDataSetImportParser(
33  $a_entity,
34  $this->getSchemaVersion(),
35  $a_xml,
36  $this->ds,
37  $a_mapping
38  );
39  }
40 
46  public function finalProcessing($a_mapping)
47  {
48  $blp_map = $a_mapping->getMappingsOfEntity("Services/COPage", "pg");
49  foreach ($blp_map as $blp_id) {
50  $blp_id = substr($blp_id, 4);
51  $blog_id = ilBlogPosting::lookupBlogId($blp_id);
52  ilBlogPosting::_writeParentId("blp", $blp_id, $blog_id);
53  }
54 
55  $sty_map = $a_mapping->getMappingsOfEntity("Services/Style", "sty");
56  foreach ($sty_map as $old_sty_id => $new_sty_id) {
57  if (is_array(ilBlogDataSet::$style_map[$old_sty_id])) {
58  foreach (ilBlogDataSet::$style_map[$old_sty_id] as $blog_id) {
59  ilObjStyleSheet::writeStyleUsage($blog_id, $new_sty_id);
60  }
61  }
62  }
63  }
64 }
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.
init()
Initialisation.
Xml importer class.