4include_once(
"./Services/Export/classes/class.ilXmlExporter.php");
 
   41    public function init()
 
   45        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
   47        include_once(
"./Services/COPage/classes/class.ilCOPageDataSet.php");
 
   49        $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
 
   50        $this->ds->setDSPrefix(
"ds");
 
   51        $this->config = $this->
getExport()->getConfig(
"Services/COPage");
 
   52        if ($this->config->getMasterLanguageOnly()) {
 
   53            $this->ds->setMasterLanguageOnly(
true);
 
   57        require_once(
'Services/COPage/classes/class.ilPageComponentPluginExporter.php');
 
   59            if ($ilPluginAdmin->supportsExport(
IL_COMP_SERVICE, 
"COPage", 
"pgcp", $plugin_name)) {
 
   60                require_once(
'Customizing/global/plugins/Services/COPage/PageComponent/' 
   61                    . $plugin_name . 
'/classes/class.il' . $plugin_name . 
'Exporter.php');
 
   63                $this->plugin_dependencies[$plugin_name] = array(
 
   64                    "component" => 
"Plugins/" . $plugin_name,
 
   83        if ($a_entity == 
"pg") {
 
   85            include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
 
   86            include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
   89            foreach ($a_ids as $pg_id) {
 
   90                $pg_id = explode(
":", $pg_id);
 
   92                $lang = ($this->config->getMasterLanguageOnly())
 
   97                if ($this->config->getIncludeMedia()) {
 
   99                    foreach ($mids as $mid) {
 
  107                $files = ilObjFile::_getFilesOfObject($pg_id[0] . 
":pg", $pg_id[1], 0, 
$lang);
 
  108                foreach ($files as $file) {
 
  117                    "component" => 
"Services/MediaObjects",
 
  121                    "component" => 
"Modules/File",
 
  140        if ($a_entity == 
"pgtp") {
 
  142            foreach ($a_ids as $id) {
 
  143                $pg_ids[] = 
"stys:" . $id;
 
  148                    "component" => 
"Services/COPage",
 
  154        if (!empty($this->plugin_dependencies)) {
 
  156            return array_values($this->plugin_dependencies);
 
  173        if ($a_entity == 
"pg") {
 
  174            include_once(
"./Services/COPage/classes/class.ilPageObject.php");
 
  176            $id = explode(
":", $a_id);
 
  179            if (!$this->config->getMasterLanguageOnly()) {
 
  181                foreach ($trans as $t) {
 
  188            include_once(
"./Services/COPage/classes/class.ilPageObjectFactory.php");
 
  190            foreach ($langs as $l) {
 
  192                $page_object->buildDom();
 
  194                $this->extractPluginProperties($page_object);
 
  195                $pxml = $page_object->getXMLFromDom(
false, 
false, 
false, 
"", 
true);
 
  196                $pxml = str_replace(
"&", 
"&", $pxml);
 
  197                $a_media = ($this->config->getIncludeMedia())
 
  199                    : 
'WithoutMedia="1"';
 
  200                $xml .= 
'<PageObject Language="' . $l . 
'" Active="' . $page_object->getActive() . 
'" ActivationStart="' . $page_object->getActivationStart() . 
'" ActivationEnd="' .
 
  201                    $page_object->getActivationEnd() . 
'" ShowActivationInfo="' . $page_object->getShowActivationInfo() . 
'" ' . $a_media . 
'>';
 
  203                $xml .= 
"</PageObject>";
 
  204                $page_object->freeDom();
 
  209        if ($a_entity == 
"pgtp") {
 
  210            return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, 
"", 
true, 
true);
 
  223        if ($a_entity == 
"pg") {
 
  226                    "namespace" => 
"http://www.ilias.de/Services/COPage/pg/4_2",
 
  227                    "xsd_file" => 
"ilias_pg_4_2.xsd",
 
  231                    "namespace" => 
"http://www.ilias.de/Services/COPage/pg/4_1",
 
  232                    "xsd_file" => 
"ilias_pg_4_1.xsd",
 
  237        if ($a_entity == 
"pgtp") {
 
  240                    "namespace" => 
"http://www.ilias.de/Services/COPage/pgtp/4_1",
 
  241                    "xsd_file" => 
"ilias_pgtp_4_1.xsd",
 
  242                    "uses_dataset" => 
true,
 
  259    protected function extractPluginProperties($a_page)
 
  261        if (empty($this->plugin_dependencies)) {
 
  266        $domdoc = $a_page->getDomDoc();
 
  267        $xpath = 
new DOMXPath($domdoc);
 
  268        $nodes = $xpath->query(
"//PageContent[child::Plugged]");
 
  271        foreach ($nodes as $pcnode) {
 
  273            $pc_id = $pcnode->getAttribute(
'PCID');
 
  274            $plnode = $pcnode->childNodes->item(0);
 
  275            $plugin_name = $plnode->getAttribute(
'PluginName');
 
  276            $plugin_version = $plnode->getAttribute(
'PluginVersion');
 
  279            if (isset($this->plugin_dependencies[$plugin_name])) {
 
  281                $id = $a_page->getParentType()
 
  282                    . 
':' . $a_page->getId()
 
  283                    . 
':' . $a_page->getLanguage()
 
  286                $properties = array();
 
  288                foreach ($plnode->childNodes as $child) {
 
  289                    $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
 
  297                $this->plugin_dependencies[$plugin_name][
'ids'][] = $id;
 
An exception for terminatinating execution or to throw for unit testing.
Exporter class for meta data.
getXmlExportHeadDependencies($a_entity, $a_target_release, $a_ids)
Get head dependencies.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
static _lookupType($a_id, $a_reference=false)
lookup object type
static setPCVersion($a_id, $a_version)
Set the version of a plugged page content This method is used by ilCOPageExporter to provide the vers...
static setPCProperties($a_id, $a_properties)
Set the properties of a plugged page content This method is used by ilCOPageExporter to provide the p...
static getInstance($a_parent_type, $a_id=0, $a_old_nr=0, $a_lang="-")
Get page object instance.
static lookupTranslations($a_parent_type, $a_id)
Lookup translations.
static getActivePluginsForSlot($a_ctype, $a_cname, $a_slot_id)
Get all active plugins for a slot.