ILIAS  Release_4_1_x_branch Revision 61804
 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

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

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 47 of file class.ilCOPageImporter.php.

{
$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");
$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);
}
}
}
}
}
ilCOPageImporter::importXmlRepresentation (   $a_entity,
  $a_id,
  $a_xml,
  $a_mapping 
)

Import XML.

Parameters
@return

Reimplemented from ilXmlImporter.

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

{
//echo $a_id;
//var_dump($a_xml);
$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();
}
}
}

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