4 include_once(
"./Services/Export/classes/class.ilXmlExporter.php");
63 $parts = explode(
":", $a_id);
64 if (
sizeof($parts) != 2) {
71 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
79 foreach ($raw as $item) {
80 $sub_items[$item[
"sub_type"]][] = $item[
"sub_id"];
85 foreach ($sub_items as $sub_type => $sub_ids) {
86 foreach (array_unique($sub_ids) as $sub_id) {
88 $defs = $values_record->getDefinitions();
89 $values_record->read();
90 foreach ($values_record->getADTGroup()->getElements() as $element_id => $element) {
91 if (!$element->isNull()) {
92 $def = $defs[$element_id];
93 $items[$rec_id][] = array(
94 'id' =>
$def->generateImportId(
$def->getFieldId()),
95 'sub_type' => $sub_type,
97 'value' =>
$def->getValueForXML($element)
105 $local_recs = array();
107 if ($rec_obj->getParentObject()) {
109 $rec_obj->toXML(
$xml);
112 $local_recs[$rec_obj->getRecordId()] = base64_encode(
$xml);
116 if (
sizeof($items)) {
119 foreach ($items as $record_id => $record_items) {
120 $xml->xmlStartTag(
'AdvancedMetaData');
122 $is_local = array_key_exists($record_id, $local_recs);
127 if (!array_key_exists($record_id, self::$local_recs_done)) {
130 array(
'local_id' => $record_id),
131 $local_recs[$record_id]
134 self::$local_recs_done[] = $record_id;
138 foreach ($record_items as $item) {
141 'sub_type' => $item[
'sub_type'],
142 'sub_id' => $item[
'sub_id']
146 $att[
'local_rec_id'] = $record_id;
156 $xml->xmlEndTag(
'AdvancedMetaData');
159 return $xml->xmlDumpMem(
false);
174 "namespace" =>
"http://www.ilias.de/Services/AdvancedMetaData/advmd/4_4",
175 "xsd_file" =>
"ilias_advmd_4_4.xsd",
176 "uses_dataset" =>
true,
static findByObjectId($a_obj_id)
Find all entries for object (regardless of sub-type/sub-id)