34 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
35 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
71 $this->mode = $a_mode;
98 include_once(
'./Services/Xml/exceptions/class.ilSaxParserException.php');
111 xml_set_object($a_xml_parser,$this);
112 xml_set_element_handler($a_xml_parser,
'handlerBeginTag',
'handlerEndTag');
113 xml_set_character_data_handler($a_xml_parser,
'handlerCharacterData');
125 case 'AdvancedMetaDataRecords':
126 $this->is_error =
false;
127 $this->error_msg = array();
133 $this->current_field = null;
134 $this->current_record = null;
135 if(!strlen($a_attribs[
'id']) or !isset($a_attribs[
'active']))
152 if(!strlen($a_attribs[
'id']) or !isset($a_attribs[
'searchable']) or !isset($a_attribs[
'fieldType']))
160 switch($a_attribs[
'fieldType'])
179 $this->
appendErrorMessage(
'Invalid attribute value given for element "Record::FieldType".');
184 $this->
getCurrentField()->enableSearchable($a_attribs[
'searchable'] ==
'Yes' ?
true :
false);
188 case 'FieldDescription':
189 case 'FieldPosition':
204 case 'AdvancedMetaDataRecords':
231 case 'FieldDescription':
235 case 'FieldPosition':
257 $a_data = preg_replace(
"/\t+/",
" ",$a_data);
259 $this->cdata .= $a_data;
274 case self::MODE_INSERT:
275 case self::MODE_INSERT_VALIDATION:
297 case self::MODE_INSERT:
298 case self::MODE_INSERT_VALIDATION:
300 $this->
fields[] = $this->current_field;
304 $this->current_field = ilAdvancedMDRecord::_getInstanceByFieldId($this->extractFieldId($a_id));
320 return $this->current_record;
330 return $this->current_field;
345 $this->record_exists =
true;
362 $this->is_error =
true;
363 $this->error_msg[] = $a_msg;
377 case self::MODE_INSERT_VALIDATION:
378 case self::MODE_UPDATE_VALIDATION:
381 case self::MODE_INSERT:
385 foreach($this->
fields as $field)
390 case self::MODE_INSERT: