ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilFileImporter Class Reference

Importer class for files. More...

+ Inheritance diagram for ilFileImporter:
+ Collaboration diagram for ilFileImporter:

Public Member Functions

 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import XML.
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor.
 init ()
 Init.
 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.

Additional Inherited Members

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

Detailed Description

Importer class for files.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:

Definition at line 13 of file class.ilFileImporter.php.

Member Function Documentation

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

Import XML.

Parameters
@return

Reimplemented from ilXmlImporter.

Definition at line 21 of file class.ilFileImporter.php.

References ilXmlImporter\getImportDirectory(), and ilObjectFactory\getInstanceByObjId().

{
include_once './Modules/File/classes/class.ilObjFile.php';
// case i container
if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_id))
{
$newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
}
else // case ii, non container
{
$newObj = new ilObjFile();
$newObj->create(true);
}
include_once("./Modules/File/classes/class.ilFileXMLParser.php");
$parser = new ilFileXMLParser($newObj, $a_xml);
$parser->setImportDirectory($this->getImportDirectory());
$parser->startParsing();
$newObj->createProperties(false,false);
$parser->setFileContents();
$this->current_obj = $newObj;
$newObj->update(); // this is necessary for case ii (e.g. wiki import)
$a_mapping->addMapping("Modules/File", "file", $a_id, $newObj->getId());
$a_mapping->addMapping("Services/MetaData", "md", $a_id.":0:file",
$newObj->getId().":0:file");
}

+ Here is the call graph for this function:


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