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.ilAdvancedMDValue.php");
30 $parts = explode(
":", $a_obj_id);
31 $this->obj_id = $parts[0];
32 $this->mapping = $a_mapping;
38 $this->sax_controller->setHandlers($a_xml_parser);
39 $this->sax_controller->setDefaultElementHandler($this);
53 case 'AdvancedMetaData':
57 $this->
initValue($a_attribs[
'id'], $a_attribs[
'sub_type'], $a_attribs[
'sub_id']);
66 case 'AdvancedMetaData':
70 $value = trim($this->cdata);
71 if(is_object($this->current_value) && $value !=
"")
73 $this->current_value->setValue($value);
74 $this->current_value->save();
86 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
88 $this->cdata .= $a_data;
92 protected function initValue($a_import_id, $a_sub_type =
"", $a_sub_id = 0)
94 $this->current_value = null;
98 $new_parent_id = $this->mapping->getMapping(
"Services/AdvancedMetaData",
"parent", $this->obj_id);
106 $new_sub_id = $this->mapping->getMapping(
"Services/AdvancedMetaData",
"advmd_sub_item",
"advmd:".$a_sub_type.
":".$a_sub_id);
111 $md_value =
new ilAdvancedMDValue($field_id, $new_parent_id, $a_sub_type, $new_sub_id);
117 $this->current_value = $md_value;
119 $this->field_ids[$new_parent_id][$a_sub_type][] = $field_id;