ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilContainerReferenceImporter Class Reference

folder xml importer More...

+ Inheritance diagram for ilContainerReferenceImporter:
+ Collaboration diagram for ilContainerReferenceImporter:

Public Member Functions

 init ()
 Init. More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import XML. More...
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor. More...
 
 setImport ($a_val)
 Set import. More...
 
 getImport ()
 Get import. More...
 
 init ()
 Init. More...
 
 setInstallId ($a_val)
 Set installation id. More...
 
 getInstallId ()
 Get installation id. More...
 
 setInstallUrl ($a_val)
 Set installation url. More...
 
 getInstallUrl ()
 Get installation url. More...
 
 setSchemaVersion ($a_val)
 Set schema version. More...
 
 getSchemaVersion ()
 Get schema version. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setSkipEntities ($a_val)
 Set skip entities. More...
 
 getSkipEntities ()
 Get skip entities. More...
 
 exportedFromSameInstallation ()
 Is exporting and importing installation identical? More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import xml representation. More...
 
 finalProcessing ($a_mapping)
 Final processing. More...
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 Called after all container objects have been implemented. More...
 

Protected Member Functions

 initReference ($a_ref_id=0)
 Init reference. More...
 
 getType ()
 Get reference type. More...
 
 initParser ($a_xml)
 Init xml parser. More...
 
 getReference ()
 get reference More...
 

Protected Attributes

 $ref = null
 
- Protected Attributes inherited from ilXmlImporter
 $skip_entities = array()
 
 $imp
 

Detailed Description

folder xml importer

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilContainerReferenceImporter.php.

Member Function Documentation

◆ getReference()

ilContainerReferenceImporter::getReference ( )
protected

get reference

Returns
ilContainerReference

Definition at line 47 of file class.ilContainerReferenceImporter.php.

References $ref.

Referenced by importXmlRepresentation().

+ Here is the caller graph for this function:

◆ getType()

ilContainerReferenceImporter::getType ( )
abstractprotected

Get reference type.

Reimplemented in ilCategoryReferenceImporter, and ilCourseReferenceImporter.

Referenced by importXmlRepresentation().

+ Here is the caller graph for this function:

◆ importXmlRepresentation()

ilContainerReferenceImporter::importXmlRepresentation (   $a_entity,
  $a_id,
  $a_xml,
  $a_mapping 
)

Import XML.

Parameters

return

Reimplemented from ilXmlImporter.

Definition at line 58 of file class.ilContainerReferenceImporter.php.

59 {
60 include_once './Modules/Category/classes/class.ilObjCategory.php';
61 if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_id))
62 {
63 $refs = ilObject::_getAllReferences($new_id);
64 $this->initReference(end($refs));
65 }
66 // Mapping for containers without subitems
67 elseif($new_id = $a_mapping->getMapping('Services/Container','refs',0))
68 {
69 $this->initReference($new_id);
70 }
71 elseif(!$this->getReference() instanceof ilContainerReference)
72 {
73 $this->initReference();
74 $this->getReference()->create(true);
75 }
76
77 try
78 {
79 $parser = $this->initParser($a_xml);
80 $parser->setReference($this->getReference());
82 $parser->startParsing();
83
84 $a_mapping->addMapping(
85 $GLOBALS['objDefinition']->getComponentForType($this->getType()),
86 $this->getType(),
87 $a_id,
88 $this->getReference()->getId()
89 );
90 }
91 catch(ilSaxParserException $e)
92 {
93 $GLOBALS['ilLog']->write(__METHOD__.': Parsing failed with message, "'.$e->getMessage().'".');
94 }
95 catch(Exception $e)
96 {
97 $GLOBALS['ilLog']->write(__METHOD__.': Parsing failed with message, "'.$e->getMessage().'".');
98 }
99 }
initParser($a_xml)
Init xml parser.
getType()
Get reference type.
static _getAllReferences($a_id)
get all reference ids of object
SaxParserException thrown by ilSaxParser if property throwException is set.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, ilObject\_getAllReferences(), getReference(), getType(), initParser(), initReference(), and ilContainerReferenceXmlParser\MODE_UPDATE.

+ Here is the call graph for this function:

◆ init()

ilContainerReferenceImporter::init ( )

Init.

Reimplemented from ilXmlImporter.

Definition at line 20 of file class.ilContainerReferenceImporter.php.

21 {
22 }

◆ initParser()

ilContainerReferenceImporter::initParser (   $a_xml)
abstractprotected

Init xml parser.

Reimplemented in ilCategoryReferenceImporter, and ilCourseReferenceImporter.

Referenced by importXmlRepresentation().

+ Here is the caller graph for this function:

◆ initReference()

ilContainerReferenceImporter::initReference (   $a_ref_id = 0)
protected

Init reference.

Returns
ilContainerReference

Definition at line 28 of file class.ilContainerReferenceImporter.php.

29 {
30 $this->ref = ilObjectFactory::getInstanceByRefId($a_ref_id,true);
31 }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id

References ilObjectFactory\getInstanceByRefId().

Referenced by importXmlRepresentation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ref

ilContainerReferenceImporter::$ref = null
protected

Definition at line 17 of file class.ilContainerReferenceImporter.php.

Referenced by getReference().


The documentation for this class was generated from the following file: