ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilAdvancedMetaDataImporter.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  function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
16  {
17  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDParser.php";
18  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php";
19  include_once "Services/Container/classes/class.ilContainer.php";
20  include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
21 
22  $parser = new ilAdvancedMDParser($a_id, $a_mapping);
23  $parser->setXMLContent($a_xml);
24  $parser->startParsing();
25 
26  // records with imported values should be selected
27  foreach($parser->getRecordIds() as $obj_id => $sub_types)
28  {
30 
31  foreach($sub_types as $sub_type => $rec_ids)
32  {
33  ilAdvancedMDRecord::saveObjRecSelection($obj_id, $sub_type, array_unique($rec_ids), false);
34  }
35  }
36  }
37 }
38 
39 ?>
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
$parser
Definition: BPMN2Parser.php:24
static _writeContainerSetting($a_id, $a_keyword, $a_value)
Xml importer class.