ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
4include_once("./Services/Export/classes/class.ilXmlImporter.php");
5
14{
15 private $logger = null;
16
20 public function __construct()
21 {
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}
$parser
Definition: BPMN2Parser.php:23
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
An exception for terminatinating execution or to throw for unit testing.
static saveObjRecSelection($a_obj_id, $a_sub_type="", array $a_records=null, $a_delete_before=true)
Save repository object record selection.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import xml representation.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
Xml importer class.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc