ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_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  $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
28  } else { // case ii, non container
29  $newObj = new ilObjForum();
30  $newObj->setType('frm');
31  $newObj->create();
32  }
33 
34  include_once 'Modules/Forum/classes/class.ilForumXMLParser.php';
35  $parser = new ilForumXMLParser($newObj, $a_xml);
36  $parser->setImportDirectory($this->getImportDirectory());
37  $parser->setImportInstallId($this->getInstallId());
38  $parser->setSchemaVersion($this->getSchemaVersion());
39  $parser->startParsing();
40 
41  $a_mapping->addMapping("Modules/Forum", "frm", $a_id, $newObj->getId());
42  }
43 }
getSchemaVersion()
Get schema version.
getImportDirectory()
Get import directory.
Importer class for forums.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$parser
Definition: BPMN2Parser.php:23
getInstallId()
Get installation id.
Class ilObjForum.
Xml importer class.