ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContentPageImporter Class Reference
+ Inheritance diagram for ilContentPageImporter:
+ Collaboration diagram for ilContentPageImporter:

Public Member Functions

 init ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
 finalProcessing (ilImportMapping $a_mapping)
 
- Public Member Functions inherited from ilXmlImporter
 __construct ()
 
 setImport (ilImport $a_val)
 
 getImport ()
 
 init ()
 
 setInstallId (string $a_val)
 
 getInstallId ()
 
 setInstallUrl (string $a_val)
 
 getInstallUrl ()
 
 setSchemaVersion (string $a_val)
 
 getSchemaVersion ()
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setSkipEntities (array $a_val)
 
 getSkipEntities ()
 
 exportedFromSameInstallation ()
 
 importXmlRepresentation (string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping)
 
 finalProcessing (ilImportMapping $a_mapping)
 
 afterContainerImportProcessing (ilImportMapping $mapping)
 

Protected Attributes

ilContentPageDataSet $ds
 
- Protected Attributes inherited from ilXmlImporter
array $skip_entities = array()
 
ilImport $imp
 
string $install_id
 
string $install_url
 
string $schema_version
 
string $import_directory
 

Private Attributes

PageMetricsService $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_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_COPAGE_EDIT = 'edit'
 
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_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

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

Member Function Documentation

◆ finalProcessing()

ilContentPageImporter::finalProcessing ( ilImportMapping  $a_mapping)

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

References ilPageObject\_writeParentId(), ilObjectFactory\getInstanceByObjId(), ilImportMapping\getMapping(), ilImportMapping\getMappingsOfEntity(), ILIAS\Repository\int(), and ilPageObject\lookupTranslations().

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

◆ importXmlRepresentation()

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

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

References ilXmlImporter\getSchemaVersion().

44  : void
45  {
46  $parser = new ilDataSetImportParser($a_entity, $this->getSchemaVersion(), $a_xml, $this->ds, $a_mapping);
47  }
Manifest parser for ILIAS standard export files.
+ Here is the call graph for this function:

◆ init()

ilContentPageImporter::init ( )

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

References $DIC, and ilXmlImporter\getImportDirectory().

30  : void
31  {
32  global $DIC;
33 
34  $this->ds = new ilContentPageDataSet();
35  $this->ds->setDSPrefix('ds');
36  $this->ds->setImportDirectory($this->getImportDirectory());
37 
38  $this->pageMetricsService = new PageMetricsService(
39  new PageMetricsRepositoryImp($DIC->database()),
40  $DIC->refinery()
41  );
42  }
global $DIC
Definition: feed.php:28
Class ilContentPageDataSet.
+ Here is the call graph for this function:

Field Documentation

◆ $ds

ilContentPageDataSet ilContentPageImporter::$ds
protected

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

◆ $pageMetricsService

PageMetricsService ilContentPageImporter::$pageMetricsService
private

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


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