4include_once 
'./Services/Export/classes/class.ilExportOptions.php';
 
   48        $this->obj_definition = 
$DIC[
"objDefinition"];
 
   64    public function parse($a_root_id)
 
   66        $this->sxml = simplexml_load_string($this->xml);
 
   67        $this->root_id = $a_root_id;
 
   69        foreach ($this->sxml->Item as $item) {
 
   70            $this->
initItem($item, $this->mapping->getTargetId());
 
   80    protected function initItem($item, $a_parent_node)
 
   84        $title = (string) $item[
'Title'];
 
   85        $ref_id = (string) $item[
'RefId'];
 
   86        $obj_id = (string) $item[
'Id'];
 
   87        $type = (string) $item[
'Type'];
 
   90        $new_ref = $this->
getMapping()->getMapping(
'Services/Container', 
'refs', $ref_id);
 
   94            ($obj_id == $this->root_id)
 
   98            $new_ref = $this->mapping->getMapping(
'Services/Container', 
'refs', 0);
 
  113        foreach ($item->Timing as $timing) {
 
  114            $this->
parseTiming($new_ref, $a_parent_node, $timing);
 
  117        foreach ($item->Item as $subitem) {
 
  118            $this->
initItem($subitem, $new_ref);
 
  121        $new_obj_id = $this->mapping->getMapping(
'Services/Container', 
'objs', $obj_id);
 
  124        if ((
int) $item[
'Style']) {
 
  125            self::$style_map[(int) $item[
'Style']][] = $new_obj_id;
 
  129        if (
$ilSetting->get(
'enable_cat_page_edit', 
false)) {
 
  130            if ($item[
'Page'] == 
"1") {
 
  131                $this->mapping->addMapping(
'Services/COPage', 
'pg', 
'cont:' . $obj_id, 
'cont:' . $new_obj_id);
 
  132                $this->cont_log->debug(
"add pg cont mapping, old: " . $obj_id . 
", new: " . $new_obj_id . 
", Page: -" . $item[
'Page'] . 
"-");
 
  135            if ($item[
'StartPage'] == 
"1") {
 
  136                $this->mapping->addMapping(
'Services/COPage', 
'pg', 
'cstr:' . $obj_id, 
'cstr:' . $new_obj_id);
 
  150        $type = (string) $timing[
'Type'];
 
  151        $visible = (string) $timing[
'Visible'];
 
  152        $changeable = (string) $timing[
'Changeable'];
 
  154        include_once 
'./Services/Object/classes/class.ilObjectActivation.php';
 
  156        $crs_item->setTimingType(
$type);
 
  157        $crs_item->toggleVisible((
bool) $visible);
 
  158        $crs_item->toggleChangeable((
bool) $changeable);
 
  160        foreach ($timing->children() as $sub) {
 
  161            switch ((
string) $sub->getName()) {
 
  172                case 'SuggestionStart':
 
  174                    $crs_item->setSuggestionStart($dt->get(
IL_CAL_UNIX));
 
  177                case 'SuggestionEnd':
 
  179                    $crs_item->setSuggestionEnd($dt->get(
IL_CAL_UNIX));
 
  182                case 'EarliestStart':
 
  184                    $crs_item->setEarliestStart($dt->get(
IL_CAL_UNIX));
 
  193        if ($crs_item->getTimingStart()) {
 
  194            $crs_item->update($a_ref_id, $a_parent_id);
 
  212        $new_obj_id = $this->
getMapping()->getMapping(
'Services/Container', 
'objs', $obj_id);
 
  214            include_once 
'./Services/Object/classes/class.ilObjectFactory.php';
 
  217                $obj->createReference();
 
  218                $obj->putInTree($parent_node);
 
  219                $obj->setPermissions($parent_node);
 
  220                $this->mapping->addMapping(
'Services/Container', 
'refs', $ref_id, $obj->getRefId());
 
  221                return $obj->getRefId();
 
  225        if (!$objDefinition->isAllowedInRepository(
$type) || $objDefinition->isInactivePlugin(
$type)) {
 
  226            $this->cont_log->notice(
'Cannot import object of type: ' . 
$type);
 
  230        $class_name = 
"ilObj" . $objDefinition->getClassName(
$type);
 
  233        include_once(
$location . 
"/class." . $class_name . 
".php");
 
  234        $new = 
new $class_name();
 
  235        $new->setTitle($title);
 
  237        $new->createReference();
 
  238        $new->putInTree($parent_node);
 
  239        $new->setPermissions($parent_node);
 
  241        $this->mapping->addMapping(
'Services/Container', 
'objs', $obj_id, $new->getId());
 
  242        $this->mapping->addMapping(
'Services/Container', 
'refs', $ref_id, $new->getRefId());
 
  244        return $new->getRefId();
 
An exception for terminatinating execution or to throw for unit testing.
XML parser for container structure.
initItem($item, $a_parent_node)
Init Item.
__construct(ilImportMapping $mapping, $xml='')
Constructor.
parseTiming($a_ref_id, $a_parent_id, $timing)
Parse timing info.
createObject($ref_id, $obj_id, $type, $title, $parent_node)
Create the objects.
getMapping()
Get ilImportMapping object.
@classDescription Date and time handling
static getLogger($a_component_id)
Get component logger.
Class ilObjectActivation.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObject Basic functions for all objects.
static _lookupObjId($a_id)