ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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
 
ILIAS Style Content DomainService $content_style_domain
 

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'
 
const UI_TAB_ID_MD = 'meta_data'
 

Detailed Description

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

Member Function Documentation

◆ finalProcessing()

ilContentPageImporter::finalProcessing ( ilImportMapping  $a_mapping)

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

References ilContentPageDataSet\$style_map, ilPageObject\_writeParentId(), ilImportMapping\getMappingsOfEntity(), ILIAS\Repository\int(), and ilPageObject\lookupTranslations().

54  : void
55  {
56  parent::finalProcessing($a_mapping);
57 
58  $copaMap = $a_mapping->getMappingsOfEntity('components/ILIAS/COPage', 'pg');
59  foreach ($copaMap as $oldCopaId => $newCopaId) {
60  $newCopaId = (int) substr($newCopaId, strlen(self::OBJ_TYPE) + 1);
61 
62  ilContentPagePage::_writeParentId(self::OBJ_TYPE, $newCopaId, $newCopaId);
63 
64  $translations = ilContentPagePage::lookupTranslations(self::OBJ_TYPE, $newCopaId);
65  foreach ($translations as $language) {
66  $this->pageMetricsService->store(
68  $newCopaId,
69  $language
70  )
71  );
72  }
73  }
74 
75  $style_map = $a_mapping->getMappingsOfEntity('components/ILIAS/Style', 'sty');
76  foreach ($style_map as $old_style_id => $new_style_id) {
77  if (isset(ilContentPageDataSet::$style_map[$old_style_id]) &&
78  is_array(ilContentPageDataSet::$style_map[$old_style_id])) {
79  foreach (ilContentPageDataSet::$style_map[$old_style_id] as $new_copa_id) {
80  $this->content_style_domain
81  ->styleForObjId($new_copa_id)
82  ->updateStyleId((int) $new_style_id);
83  }
84  }
85  }
86  }
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.
getMappingsOfEntity(string $a_comp, string $a_entity)
+ 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 49 of file class.ilContentPageImporter.php.

References ilXmlImporter\getSchemaVersion().

49  : void
50  {
51  $parser = new ilDataSetImportParser($a_entity, $this->getSchemaVersion(), $a_xml, $this->ds, $a_mapping);
52  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ init()

ilContentPageImporter::init ( )

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

References $DIC, and ilXmlImporter\getImportDirectory().

31  : void
32  {
33  global $DIC;
34 
35  $this->ds = new ilContentPageDataSet();
36  $this->ds->setDSPrefix('ds');
37  $this->ds->setImportDirectory($this->getImportDirectory());
38 
39  $this->content_style_domain = $DIC
40  ->contentStyle()
41  ->domain();
42 
43  $this->pageMetricsService = new PageMetricsService(
44  new PageMetricsRepositoryImp($DIC->database()),
45  $DIC->refinery()
46  );
47  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Field Documentation

◆ $content_style_domain

ILIAS Style Content DomainService ilContentPageImporter::$content_style_domain
private

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

◆ $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: