ILIAS  release_7 Revision v7.30-3-g800a261c036
ilContentPageImporter Class Reference

Class ilContentPageImporter. More...

+ Inheritance diagram for ilContentPageImporter:
+ Collaboration diagram for ilContentPageImporter:

Public Member Functions

 init ()
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 
 finalProcessing ($a_mapping)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 Constructor. More...
 
 setImport ($a_val)
 Set import. More...
 
 getImport ()
 Get import. More...
 
 init ()
 Init. More...
 
 setInstallId ($a_val)
 Set installation id. More...
 
 getInstallId ()
 Get installation id. More...
 
 setInstallUrl ($a_val)
 Set installation url. More...
 
 getInstallUrl ()
 Get installation url. More...
 
 setSchemaVersion ($a_val)
 Set schema version. More...
 
 getSchemaVersion ()
 Get schema version. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setSkipEntities ($a_val)
 Set skip entities. More...
 
 getSkipEntities ()
 Get skip entities. More...
 
 exportedFromSameInstallation ()
 Is exporting and importing installation identical? More...
 
 importXmlRepresentation ($a_entity, $a_id, $a_xml, $a_mapping)
 Import xml representation. More...
 
 finalProcessing ($a_mapping)
 Final processing. More...
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 Called after all container objects have been implemented. More...
 

Protected Attributes

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

Private Attributes

 $pageMetricsService
 

Additional Inherited Members

- Data Fields inherited from ilContentPageObjectConstants
const OBJ_TYPE = 'copa'
 
const HTTP_PARAM_PAGE_EDITOR_STYLE_CONTEXT = 'page_editor_style'
 
const UI_CMD_VIEW = 'view'
 
const UI_CMD_EDIT = 'edit'
 
const UI_CMD_UPDATE = 'update'
 
const UI_CMD_COPAGE_EDIT = 'edit'
 
const UI_CMD_COPAGE_DOWNLOAD_FILE = 'downloadFile'
 
const UI_CMD_COPAGE_DISPLAY_FULLSCREEN = 'displayMediaFullscreen'
 
const UI_CMD_COPAGE_DISPLAY_MEDIA = 'displayMedia'
 
const UI_CMD_COPAGE_DOWNLOAD_PARAGRAPH = 'download_paragraph'
 
const UI_CMD_STYLES_EDIT = 'editStyleProperties'
 
const UI_TAB_ID_CONTENT = 'content'
 
const UI_TAB_ID_INFO = 'info_short'
 
const UI_TAB_ID_SETTINGS = 'settings'
 
const UI_TAB_ID_ICON = 'icon'
 
const UI_TAB_ID_STYLE = 'style'
 
const UI_TAB_ID_I18N = 'i18n'
 
const UI_TAB_ID_LP = 'learning_progress'
 
const UI_TAB_ID_EXPORT = 'export'
 
const UI_TAB_ID_PERMISSIONS = 'perm_settings'
 

Detailed Description

Class ilContentPageImporter.

Definition at line 11 of file class.ilContentPageImporter.php.

Member Function Documentation

◆ finalProcessing()

ilContentPageImporter::finalProcessing (   $a_mapping)

Definition at line 46 of file class.ilContentPageImporter.php.

References ilPageObject\_writeParentId(), ilObjectFactory\getInstanceByObjId(), and ilPageObject\lookupTranslations().

47  {
48  parent::finalProcessing($a_mapping);
49 
50  $copaMap = $a_mapping->getMappingsOfEntity('Services/COPage', 'pg');
51  foreach ($copaMap as $oldCopaId => $newCopaId) {
52  $newCopaId = substr($newCopaId, strlen(self::OBJ_TYPE) + 1);
53 
54  ilContentPagePage::_writeParentId(self::OBJ_TYPE, $newCopaId, $newCopaId);
55 
56  $translations = ilContentPagePage::lookupTranslations(self::OBJ_TYPE, $newCopaId);
57  foreach ($translations as $language) {
58  $this->pageMetricsService->store(
60  (int) $newCopaId,
61  $language
62  )
63  );
64  }
65  }
66 
67  $styleMapping = $a_mapping->getMappingsOfEntity('Modules/ContentPage', 'style');
68  foreach ($styleMapping as $newCopaId => $oldStyleId) {
69  $newStyleId = (int) $a_mapping->getMapping('Services/Style', 'sty', $oldStyleId);
70  if ($newCopaId > 0 && $newStyleId > 0) {
71  $copa = ilObjectFactory::getInstanceByObjId($newCopaId, false);
72  if (!$copa || !($copa instanceof ilObjContentPage)) {
73  continue;
74  }
75  $copa->writeStyleSheetId($newStyleId);
76  $copa->update();
77  }
78  }
79  }
static _writeParentId($a_parent_type, $a_pg_id, $a_par_id)
Write parent id.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjContentPage.
static lookupTranslations($a_parent_type, $a_id)
Lookup translations.
+ Here is the call graph for this function:

◆ importXmlRepresentation()

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

Definition at line 38 of file class.ilContentPageImporter.php.

References ilXmlImporter\getSchemaVersion().

39  {
40  $parser = new ilDataSetImportParser($a_entity, $this->getSchemaVersion(), $a_xml, $this->ds, $a_mapping);
41  }
getSchemaVersion()
Get schema version.
Manifest parser for ILIAS standard export files.
+ Here is the call graph for this function:

◆ init()

ilContentPageImporter::init ( )

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

References $DIC, and ilXmlImporter\getImportDirectory().

22  {
23  global $DIC;
24 
25  $this->ds = new ilContentPageDataSet();
26  $this->ds->setDSPrefix('ds');
27  $this->ds->setImportDirectory($this->getImportDirectory());
28 
29  $this->pageMetricsService = new PageMetricsService(
30  new PageMetricsRepositoryImp($DIC->database()),
31  $DIC->refinery()
32  );
33  }
getImportDirectory()
Get import directory.
global $DIC
Definition: goto.php:24
Class ilContentPageDataSet.
+ Here is the call graph for this function:

Field Documentation

◆ $ds

ilContentPageImporter::$ds
protected

Definition at line 14 of file class.ilContentPageImporter.php.

◆ $pageMetricsService

ilContentPageImporter::$pageMetricsService
private

Definition at line 16 of file class.ilContentPageImporter.php.


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