4 include_once(
"./Services/Export/classes/class.ilXmlImporter.php");
20 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDataSet.php");
22 $this->ds->setDSPrefix(
"ds");
23 $this->config = $this->
getImport()->getConfig(
"Modules/Glossary");
34 if ($a_entity ==
"glo")
37 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_id))
45 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using XML file '.$xml_file);
48 if (file_exists($xml_file))
50 if (!is_object($newObj))
53 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
55 $newObj->setType(
"glo");
57 $newObj->create(
true);
60 include_once
'./Modules/LearningModule/classes/class.ilContObjParser.php';
67 $contParser->startParsing();
72 $term_map = $contParser->getGlossaryTermMap();
73 foreach ($term_map as $k => $v)
75 $a_mapping->addMapping(
"Services/Taxonomy",
"tax_item",
79 $a_mapping->addMapping(
"Services/Taxonomy",
"tax_item_obj_id",
80 "glo:term:".$k, $newObj->getId());
82 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"advmd_sub_item",
83 "advmd:term:".$k, $v);
86 $a_mapping->addMapping(
"Modules/Glossary",
"glo", $a_id, $newObj->getId());
87 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"parent", $a_id, $newObj->getId());
89 $this->current_glo = $newObj;
95 include_once(
"./Services/DataSet/classes/class.ilDataSetImportParser.php");
97 $a_xml, $this->ds, $a_mapping);
116 include_once(
"./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
117 $maps = $a_mapping->getMappingsOfEntity(
"Modules/Glossary",
"glo");
120 if (
$old !=
"new_id" && (
int)
$old > 0)
123 $new_tax_ids = $a_mapping->getMapping(
"Services/Taxonomy",
"tax_usage_of_obj",
$old);
124 if($new_tax_ids !==
false)
126 $tax_ids = explode(
":", $new_tax_ids);
127 foreach ($tax_ids as $tid)
136 include_once(
"./Modules/Glossary/classes/class.ilGlossaryAdvMetaDataAdapter.php");
137 $advmdco = $a_mapping->getMappingsOfEntity(
"Modules/Glossary",
"advmd_col_order");
138 foreach ($advmdco as $id => $order)
140 $id = explode(
":", $id);
141 $field_glo_id = $id[0];
143 if ($field_glo_id ==
$old)
146 $new_local_id = $a_mapping->getMapping(
"Services/AdvancedMetaData",
"lfld", $field_id);
149 $field_id = $new_local_id;
getSchemaVersion()
Get schema version.
getImportDirectory()
Get import directory.
Importer class for files.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Manifest parser for ILIAS standard export files.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
exportedFromSameInstallation()
Is exporting and importing installation identical?
finalProcessing($a_mapping)
Final processing.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static saveUsage($a_tax_id, $a_obj_id)
Save Usage.
static _writeImportId($a_obj_id, $a_import_id)
write import id to db (static)