ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCourseImporter Class Reference

folder xml importer More...

+ Inheritance diagram for ilCourseImporter:
+ Collaboration diagram for ilCourseImporter:

Public Member Functions

 init ()
 Init.
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import XML.
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor.
 setInstallId ($a_val)
 Set installation id.
 getInstallId ()
 Get installation id.
 setInstallUrl ($a_val)
 Set installation url.
 getInstallUrl ()
 Get installation url.
 setSchemaVersion ($a_val)
 Set schema version.
 getSchemaVersion ()
 Get schema version.
 setImportDirectory ($a_val)
 Set import directory.
 getImportDirectory ()
 Get import directory.
 setSkipEntities ($a_val)
 Set skip entities.
 getSkipEntities ()
 Get skip entities.
 finalProcessing ($a_mapping)
 Final processing.

Private Attributes

 $course = null

Additional Inherited Members

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

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.ilCourseImporter.php.

Member Function Documentation

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

Import XML.

Parameters
@return

Reimplemented from ilXmlImporter.

Definition at line 30 of file class.ilCourseImporter.php.

References $GLOBALS, ilObject\_getAllReferences(), and ilObjectFactory\getInstanceByRefId().

{
include_once './Modules/Course/classes/class.ilCourseXMLParser.php';
include_once './Modules/Course/classes/class.ilObjCourse.php';
if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_id))
{
$refs = ilObject::_getAllReferences($new_id);
$this->course = ilObjectFactory::getInstanceByRefId(end($refs),false);
#$this->course = ilObjectFactory::getInstanceByObjId($new_id,false);
}
// Mapping for containers without subitems
elseif($new_id = $a_mapping->getMapping('Services/Container','refs',0))
{
$this->course = ilObjectFactory::getInstanceByRefId($new_id,false);
}
elseif(!$this->course instanceof ilObjCourse)
{
$this->course = new ilObjCourse();
$this->course->create(true);
}
try
{
$parser = new ilCourseXMLParser($this->course);
$parser->setXMLContent($a_xml);
$parser->startParsing();
$a_mapping->addMapping('Modules/Course','crs',$a_id,$this->course->getId());
}
{
$GLOBALS['ilLog']->write(__METHOD__.': Parsing failed with message, "'.$e->getMessage().'".');
}
catch(Exception $e)
{
$GLOBALS['ilLog']->write(__METHOD__.': Parsing failed with message, "'.$e->getMessage().'".');
}
}

+ Here is the call graph for this function:

ilCourseImporter::init ( )

Init.

Reimplemented from ilXmlImporter.

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

{
}

Field Documentation

ilCourseImporter::$course = null
private

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


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