ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilForumImporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Export/classes/class.ilXmlImporter.php");
5
14{
21 public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
22 {
23 include_once 'Modules/Forum/classes/class.ilObjForum.php';
24
25 // case i container
26 if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_id))
27 {
28 $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
29 }
30 else // case ii, non container
31 {
32 $newObj = new ilObjForum();
33 $newObj->setType('frm');
34 $newObj->create(true);
35 }
36
37 include_once 'Modules/Forum/classes/class.ilForumXMLParser.php';
38 $parser = new ilForumXMLParser($newObj, $a_xml);
39 $parser->setImportDirectory($this->getImportDirectory());
40 $parser->setImportInstallId($this->getInstallId());
41 $parser->setSchemaVersion($this->getSchemaVersion());
42 $parser->startParsing();
43
44 $a_mapping->addMapping("Modules/Forum", "frm", $a_id, $newObj->getId());
45 }
46}
47?>
Importer class for forums.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
Class ilObjForum.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Xml importer class.
getSchemaVersion()
Get schema version.
getInstallId()
Get installation id.
getImportDirectory()
Get import directory.