ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCOPageImporter Class Reference

Importer class for pages. More...

+ Inheritance diagram for ilCOPageImporter:
+ Collaboration diagram for ilCOPageImporter:

Public Member Functions

 init ()
 Initialisation.
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import XML.
 finalProcessing ($a_mapping)
 Final processing.
- 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.

Additional Inherited Members

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

Detailed Description

Importer class for pages.

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

Member Function Documentation

ilCOPageImporter::finalProcessing (   $a_mapping)

Final processing.

Parameters
arraymapping array

Reimplemented from ilXmlImporter.

Definition at line 67 of file class.ilCOPageImporter.php.

References ilPageObject\_exists().

{
$pages = $a_mapping->getMappingsOfEntity("Services/COPage", "pg");
$media_objects = $a_mapping->getMappingsOfEntity("Services/MediaObjects", "mob");
$file_objects = $a_mapping->getMappingsOfEntity("Modules/File", "file");
if (count($media_objects) > 0 || count($file_objects) > 0)
{
foreach ($pages as $p)
{
$id = explode(":", $p);
if (count($id) == 2)
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
if (ilPageObject::_exists($id[0], $id[1]))
{
$new_page = new ilPageObject($id[0], $id[1]);
$new_page->buildDom();
$med = $new_page->resolveMediaAliases($media_objects);
$fil = $new_page->resolveFileItems($file_objects);
if ($med || $fil)
{
$new_page->update(false, true);
}
}
}
}
}
}

+ Here is the call graph for this function:

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

Import XML.

Parameters
@return

Reimplemented from ilXmlImporter.

Definition at line 32 of file class.ilCOPageImporter.php.

References ilXmlImporter\getSchemaVersion().

{
if ($a_entity == "pgtp")
{
include_once("./Services/DataSet/classes/class.ilDataSetImportParser.php");
$parser = new ilDataSetImportParser($a_entity, $this->getSchemaVersion(),
$a_xml, $this->ds, $a_mapping);
}
if ($a_entity == "pg")
{
$pg_id = $a_mapping->getMapping("Services/COPage", "pg", $a_id);
if ($pg_id != "")
{
$id = explode(":", $pg_id);
if (count($id) == 2)
{
include_once("./Services/COPage/classes/class.ilPageObject.php");
$new_page = new ilPageObject($id[0]);
$new_page->setId($id[1]);
$new_page->setXMLContent($a_xml);
//$new_page->saveMobUsage($a_xml); (will be done in final processing)
$new_page->createFromXML();
}
}
}
}

+ Here is the call graph for this function:

ilCOPageImporter::init ( )

Initialisation.

Reimplemented from ilXmlImporter.

Definition at line 18 of file class.ilCOPageImporter.php.

{
include_once("./Services/COPage/classes/class.ilCOPageDataSet.php");
$this->ds = new ilCOPageDataSet();
$this->ds->setDSPrefix("ds");
}

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