ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ilObjectDataSet Class Reference

Object data set class. More...

+ Inheritance diagram for ilObjectDataSet:
+ Collaboration diagram for ilObjectDataSet:

Public Member Functions

 getSupportedVersions ()
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 
 init (string $a_entity, string $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 
 readData (string $a_entity, string $a_version, array $a_ids)
 Read data from DB. More...
 
 initByExporter (ilXmlExporter $xml_exporter)
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setDSPrefix (string $a_val)
 
 getDSPrefix ()
 
 getDSPrefixString ()
 
 getDirectDataFromQuery (string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper (string $a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, ?array $a_ids, string $a_field="", bool $a_omit_header=false, bool $a_omit_types=false)
 Get xml representation <dataset install_id="123" install_url="..."> <types entity="table_name" version="4.0.1"> <ftype name="field_1" type="text"> <ftype name="field_2" type="date"> <ftype name="field_3" type="integer"> </types> <types ...> ... More...
 
 addRecordsXml (ilXmlWriter $a_writer, array $a_prefixes, string $a_entity, string $a_schema_version, array $a_ids, ?string $a_field="")
 
 afterXmlRecordWriting (string $a_entity, string $a_version, array $a_set)
 
 getNamespaces (array &$namespaces, string $a_entity, string $a_schema_version)
 
 getXmlRecord (string $a_entity, string $a_version, array $a_set)
 Get xml record for version. More...
 
 getXmlTypes (string $a_entity, string $a_version)
 Get xml types. More...
 
 getXMLEntityName (string $a_entity, string $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag (string $a_entity, string $a_schema_version)
 Get entity tag. More...
 
 setImport (ilSurveyImporter $a_val)
 
 getImport ()
 
 setCurrentInstallationId (string $a_val)
 
 getCurrentInstallationId ()
 
 importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
 Needs to be overwritten for import use case. More...
 
 getCollection (array $record, string $entity, string $schema_version, string $field, string $value)
 
 getContainerExportConfig (array $record, string $entity, string $schema_version, string $field, string $value)
 

Protected Member Functions

 getXmlNamespace (string $entity, string $schema_version)
 
 getTypes (string $entity, string $version)
 Get field types for entity. More...
 
 getDependencies (string $entity, string $version, ?array $rec=null, ?array $ids=null)
 Determine the dependent sets of data. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes (string $a_entity, string $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 getExportDirInContainer (string $exp_dir)
 
 getIRSSContainerExportConfig (StorableResource $source_container, string $source_path, string $target_path="")
 
 getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
 
 createObjectExportId (string $a_type, string $a_id)
 Build ilias export id. More...
 
 parseObjectExportId (string $a_id, ?string $a_fallback_id=null)
 Parse export id. More...
 
 stripTags (array $rec, array $omit_keys=[])
 

Protected Attributes

LocalDIC $obj_dic
 
ResourceStorage $storage
 
Aggregator $properties_aggregator
 
TranslationsRepository $translations_repository
 
- Protected Attributes inherited from ilDataSet
ILIAS ResourceStorage Services $irss
 
string $current_installation_id = ""
 
array $data = []
 
ilDBInterface $db
 
ilLogger $ds_log
 
string $import_directory = ""
 
string $entity = ""
 
string $schema_version = ""
 
string $component_export_dir = ""
 
string $ds_prefix = "ds"
 
string $version = ""
 
ilSurveyImporter $import
 
ilExport $export
 

Private Member Functions

 copyTileToTempFolderForExport (string $rid)
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
const DATASET_NS = 'http://www.ilias.de/Services/DataSet/ds/4_3'
 
const DATASET_NS_PREFIX = 'ds'
 
const EXPORT_NO_INST_ID = 1
 
const EXPORT_ID_ILIAS_LOCAL = 2
 
const EXPORT_ID_ILIAS_LOCAL_INVALID = 3
 
const EXPORT_ID_ILIAS_REMOTE = 4
 
const EXPORT_ID_ILIAS_REMOTE_INVALID = 5
 
const EXPORT_ID = 6
 
const EXPORT_ID_INVALID = 7
 
int $dircnt = 0
 

Detailed Description

Object data set class.

This class implements the following entities:

  • transl_entry: data from object_translation
  • transl: data from obj_content_master_lang
Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 36 of file class.ilObjectDataSet.php.

Member Function Documentation

◆ copyTileToTempFolderForExport()

ilObjectDataSet::copyTileToTempFolderForExport ( string  $rid)
private

Definition at line 252 of file class.ilObjectDataSet.php.

References CLIENT_ID, and ILIAS_DATA_DIR.

Referenced by getTypes().

252  : string
253  {
254  $i = $this->storage->manage()->find($rid);
255  $stream = $this->storage->consume()->stream(
256  $i
257  );
258  $title = $this->storage->manage()->getCurrentRevision($i)->getTitle();
259 
260  $temp_dir = implode(
261  DIRECTORY_SEPARATOR,
262  [ILIAS_DATA_DIR, CLIENT_ID, 'temp', uniqid('tmp')]
263  );
264  mkdir($temp_dir);
265  file_put_contents($temp_dir . DIRECTORY_SEPARATOR . $title, $stream->getStream()->getContents());
266  return $temp_dir;
267  }
const CLIENT_ID
Definition: constants.php:41
const ILIAS_DATA_DIR
Definition: constants.php:44
+ Here is the caller graph for this function:

◆ getDependencies()

ilObjectDataSet::getDependencies ( string  $entity,
string  $version,
?array  $rec = null,
?array  $ids = null 
)
protected

Determine the dependent sets of data.

Definition at line 271 of file class.ilObjectDataSet.php.

References $DIC, ilDataSet\$schema_version, ilObject\_lookupType(), ilContainer\_writeContainerSetting(), ilObjectServiceSettingsGUI\AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI\CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilImportMapping\getAllMappings(), ilDataSet\getImportDirectory(), ilImportMapping\getMapping(), ilDataSet\importRecord(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, ILIAS\Repository\int(), ilObjectServiceSettingsGUI\NEWS_VISIBILITY, null, ilObjectServiceSettingsGUI\TAG_CLOUD, ilObjectServiceSettingsGUI\TAXONOMIES, and ilObjectServiceSettingsGUI\USE_NEWS.

276  : array {
277  $rec['ObjId'] = $rec['ObjId'] ?? null;
278  switch ($entity) {
279  case 'common':
280  return [
281  'transl' => ['ids' => $rec['ObjId']],
282  'transl_entry' => ['ids' => $rec['ObjId']],
283  'service_settings' => ['ids' => $rec['ObjId']],
284  'tile' => ['ids' => $rec['ObjId']],
285  'icon' => ['ids' => $rec['ObjId']]
286  ];
287  }
288 
289  return [];
290  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $entity
+ Here is the call graph for this function:

◆ getSupportedVersions()

ilObjectDataSet::getSupportedVersions ( )

Definition at line 55 of file class.ilObjectDataSet.php.

55  : array
56  {
57  return ['4.4.0', '5.1.0', '5.2.0', '5.4.0'];
58  }

◆ getTypes()

ilObjectDataSet::getTypes ( string  $entity,
string  $version 
)
protected

Get field types for entity.

Definition at line 68 of file class.ilObjectDataSet.php.

References $DIC, ilDataSet\$entity, $id, ilDataSet\$version, ilContainer\_hasContainerSetting(), ilContainer\_lookupContainerSetting(), ilObject\_lookupType(), ilObjectServiceSettingsGUI\AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI\CALENDAR_VISIBILITY, copyTileToTempFolderForExport(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilDataSet\getDirectDataFromQuery(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, ilObjectServiceSettingsGUI\NEWS_VISIBILITY, null, ilDataSet\readData(), ilObjectServiceSettingsGUI\TAG_CLOUD, ilObjectServiceSettingsGUI\TAXONOMIES, and ilObjectServiceSettingsGUI\USE_NEWS.

68  : array
69  {
70  if ($entity == 'transl_entry') {
71  switch ($version) {
72  case '4.4.0':
73  case '5.1.0':
74  case '5.2.0':
75  case '5.4.0':
76  return [
77  'ObjId' => 'integer',
78  'Title' => 'text',
79  'Description' => 'text',
80  'LangCode' => 'text',
81  'LangDefault' => 'integer'
82  ];
83  }
84  }
85  if ($entity == 'transl') {
86  switch ($version) {
87  case '4.4.0':
88  case '5.1.0':
89  case '5.2.0':
90  case '5.4.0':
91  return [
92  'ObjId' => 'integer',
93  'MasterLang' => 'text'
94  ];
95  }
96  }
97  if ($entity == 'service_settings') {
98  switch ($version) {
99  case '5.1.0':
100  case '5.2.0':
101  case '5.4.0':
102  return [
103  'ObjId' => 'integer',
104  'Setting' => 'text',
105  'Value' => 'text'
106  ];
107  }
108  }
109  if ($entity == 'common') {
110  if ($version == '5.4.0') {
111  return [
112  'ObjId' => 'integer'
113  ];
114  }
115  }
116  if ($entity == 'icon') {
117  if ($version == '5.4.0') {
118  return [
119  'ObjId' => 'integer',
120  'Filename' => 'text',
121  'Dir' => 'directory'
122  ];
123  }
124  }
125  if ($entity == 'tile') {
126  if ($version == '5.4.0') {
127  return [
128  'ObjId' => 'integer',
129  'Dir' => 'directory'
130  ];
131  }
132  }
133  return [];
134  }
string $version
string $entity
+ Here is the call graph for this function:

◆ getXmlNamespace()

ilObjectDataSet::getXmlNamespace ( string  $entity,
string  $schema_version 
)
protected

Definition at line 60 of file class.ilObjectDataSet.php.

References ilDataSet\$entity.

60  : string
61  {
62  return 'http://www.ilias.de/xml/Services/Object/' . $entity;
63  }
string $entity

Field Documentation

◆ $obj_dic

LocalDIC ilObjectDataSet::$obj_dic
protected

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

◆ $properties_aggregator

Aggregator ilObjectDataSet::$properties_aggregator
protected

Definition at line 40 of file class.ilObjectDataSet.php.

◆ $storage

ResourceStorage ilObjectDataSet::$storage
protected

Definition at line 39 of file class.ilObjectDataSet.php.

◆ $translations_repository

TranslationsRepository ilObjectDataSet::$translations_repository
protected

Definition at line 41 of file class.ilObjectDataSet.php.


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