ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  private $logger = null;
16 
20  public function __construct()
21  {
22  parent::__construct();
23  $this->logger = $GLOBALS['DIC']->logger()->amet();
24  }
25 
26 
27  public function importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
28  {
29  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDParser.php";
30  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php";
31  include_once "Services/Container/classes/class.ilContainer.php";
32  include_once "Services/Object/classes/class.ilObjectServiceSettingsGUI.php";
33 
34  $parser = new ilAdvancedMDParser($a_id, $a_mapping);
35  $parser->setXMLContent($a_xml);
36  $parser->startParsing();
37 
38  // records with imported values should be selected
39  foreach ($parser->getRecordIds() as $obj_id => $sub_types) {
41 
42  foreach ($sub_types as $sub_type => $rec_ids) {
43  ilAdvancedMDRecord::saveObjRecSelection($obj_id, $sub_type, array_unique($rec_ids), false);
44  }
45  }
46  }
47 }
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:23
static _writeContainerSetting($a_id, $a_keyword, $a_value)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Xml importer class.