4include_once(
"./Services/Export/classes/class.ilXmlImporter.php");
 
   27                include_once(
"./Modules/LearningModule/classes/class.ilLearningModuleDataSet.php");
 
   29                $this->ds->setDSPrefix(
"ds");
 
   33                $this->config = $this->
getImport()->getConfig(
"Modules/LearningModule");
 
   34                if ($this->config->getTranslationImportMode())
 
   36                        $this->ds->setTranslationImportMode(
 
   37                                $this->config->getTranslationLM(),
 
   38                                $this->config->getTranslationLang());
 
   39                        $cop_config = $this->
getImport()->getConfig(
"Services/COPage");
 
   40                        $cop_config->setUpdateIfExists(
true);
 
   41                        $cop_config->setForceLanguage($this->config->getTranslationLang());
 
   42                        $cop_config->setReuseOriginallyExportedMedia(
true);
 
   43                        $cop_config->setSkipInternalLinkResolve(
true);
 
   45                        $mob_config = $this->
getImport()->getConfig(
"Services/MediaObjects");
 
   46                        $mob_config->setUsePreviousImportIds(
true);
 
   59                include_once 
'./Modules/File/classes/class.ilObjFile.php';
 
   61                $this->log->debug(
"import XML Representation");
 
   64                if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_id))
 
   67                        $newObj->createLMTree();
 
   68                        $this->log->debug(
"got mapping, new id is: ".$new_id);
 
   79                if (file_exists($xml_file))
 
   83                        $this->log->debug(
"imported from directory ($mess)");
 
   84                        $a_mapping->addMapping(
"Modules/LearningModule", 
"lm", $a_id, $newObj->getId());
 
   85                        $a_mapping->addMapping(
"Services/Object", 
"obj", $a_id, $newObj->getId());
 
   89                        $this->log->debug(
"create ilDataSetIportParser instance");
 
   90                        include_once(
"./Services/DataSet/classes/class.ilDataSetImportParser.php");
 
   92                                $a_xml, $this->ds, $a_mapping);
 
   96                $this->log->debug(
"import qti data");
 
   98                $this->qtis = array();
 
   99                if (is_file($qti_file))
 
  101                        include_once 
"./Services/QTI/classes/class.ilQTIParser.php";
 
  102                        include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
  105                        $result = $qtiParser->startParsing ();
 
  106                        $founditems = & $qtiParser->getFoundItems ();
 
  108                        if (count($founditems) > 0)
 
  111                                $qtiParser->setTestObject($testObj);
 
  112                                $result = $qtiParser->startParsing();
 
  113                                $this->qtis = array_merge($this->qtis, $qtiParser->getImportMapping());
 
  125                $pg_map = $a_mapping->getMappingsOfEntity(
"Modules/LearningModule", 
"pg");
 
  127                include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
 
  128                include_once(
"./Modules/LearningModule/classes/class.ilLMPageObject.php");
 
  129                foreach ($pg_map as $pg_id)
 
  136                foreach ($a_mapping->getMappingsOfEntity(
"Modules/LearningModule", 
"lm_header_page") as $old_id => $dummy)
 
  138                        $new_page_id = (int) $a_mapping->getMapping(
"Modules/LearningModule", 
"pg", $old_id);
 
  139                        if ($new_page_id > 0)
 
  145                foreach ($a_mapping->getMappingsOfEntity(
"Modules/LearningModule", 
"lm_footer_page") as $old_id => $dummy)
 
  147                        $new_page_id = (int) $a_mapping->getMapping(
"Modules/LearningModule", 
"pg", $old_id);
 
  148                        if ($new_page_id > 0)
 
  156                $link_map = $a_mapping->getMappingsOfEntity(
"Modules/LearningModule", 
"link");
 
  157                $pages = $a_mapping->getMappingsOfEntity(
"Services/COPage", 
"pgl");
 
  158                foreach ($pages as $p)
 
  160                        $id = explode(
":", $p);
 
  163                                include_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
  166                                        include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
 
  168                                        $new_page->buildDom();
 
  171                                        $updated = $new_page->resolveQuestionReferences($this->qtis);
 
  175                                        if ($this->config->getTranslationImportMode())
 
  177                                                $il = $new_page->resolveIntLinks($link_map);
 
  186                                                $new_page->update(
false, 
true);
 
  193                $alls_map = $a_mapping->getMappingsOfEntity(
"Modules/LearningModule", 
"lm_style");
 
  194                foreach ($alls_map as $new_lm_id => $old_style_id)
 
  196                        $new_style_id = (int) $a_mapping->getMapping(
"Services/Style", 
"sty", $old_style_id);
 
  197                        if ($new_lm_id > 0 && $new_style_id > 0)
 
  199                                include_once(
"./Modules/LearningModule/classes/class.ilObjLearningModule.php");
 
  201                                $lm->writeStyleSheetId($new_style_id);
 
Manifest parser for ILIAS standard export files.
_lookupContObjID($a_id)
get learning module / digibook id for lm object
LearningModule Data set class.
Importer class for files.
importXmlRepresentation($a_entity, $a_id, $a_xml, $a_mapping)
Import XML.
finalProcessing($a_mapping)
Final processing.
static getLogger($a_component_id)
Get component logger.
static writeHeaderPage($a_lm_id, $a_page_id)
Write header page.
static writeFooterPage($a_lm_id, $a_page_id)
Write footer page.
Class ilObjLearningModule.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
_writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
getSchemaVersion()
Get schema version.
getImportDirectory()
Get import directory.