4 include_once(
"Services/Xml/classes/class.ilSaxParser.php");
5 include_once(
"Services/Utilities/classes/class.ilSaxController.php");
6 include_once(
"Services/Utilities/interfaces/interface.ilSaxSubsetParser.php");
7 include_once(
"Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php");
8 include_once(
"Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
34 $parts = explode(
":", $a_obj_id);
35 $this->obj_id = $parts[0];
36 $this->mapping = $a_mapping;
42 $this->sax_controller->setHandlers($a_xml_parser);
43 $this->sax_controller->setDefaultElementHandler($this);
50 case 'AdvancedMetaData':
56 $this->
initValue($a_attribs[
'id'], $a_attribs[
'sub_type'], $a_attribs[
'sub_id']);
65 case 'AdvancedMetaData':
67 foreach($this->value_records as $record)
74 $value = trim($this->cdata);
75 if(is_object($this->current_value) && $value !=
"")
77 $this->current_value->importValueFromXML($value);
89 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
91 $this->cdata .= $a_data;
95 protected function initValue($a_import_id, $a_sub_type =
"", $a_sub_id = 0)
97 $this->current_value = null;
101 $rec_id = $field->getRecordId();
103 $new_parent_id = $this->mapping->getMapping(
"Services/AdvancedMetaData",
"parent", $this->obj_id);
111 $new_sub_id = $this->mapping->getMapping(
"Services/AdvancedMetaData",
"advmd_sub_item",
"advmd:".$a_sub_type.
":".$a_sub_id);
117 $rec_idx =
$rec_id.
";".$a_sub_type.
";".$new_sub_id;
118 if(!array_key_exists($rec_idx, $this->value_records))
126 if(!array_key_exists($rec_idx, $this->value_records))
133 $this->value_records[$rec_idx]->getADTGroup();
135 foreach($this->value_records[$rec_idx]->getDefinitions() as $def)
137 if($a_import_id == $def->getImportId())
139 $this->current_value = $def;
145 if($this->current_value)
147 $this->record_ids[$new_parent_id][$a_sub_type][] =
$rec_id;