ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjectDataSet Class Reference

Object data set class. More...

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

Public Member Functions

 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 Constructor. More...
 
 init ($a_entity, $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 Get supported version. More...
 
 readData ($a_entity, $a_version, $a_ids)
 Read data from DB. More...
 
 setExportDirectories ($a_relative, $a_absolute)
 Set export directories. More...
 
 setImportDirectory ($a_val)
 Set import directory. More...
 
 getImportDirectory ()
 Get import directory. More...
 
 setDSPrefix ($a_val)
 Set XML dataset namespace prefix. More...
 
 getDSPrefix ()
 Get XML dataset namespace prefix. More...
 
 getDSPrefixString ()
 
 getDirectDataFromQuery ($a_query, $a_convert_to_leading_upper=true, $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper ($a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getJsonRepresentation ()
 Get json representation. More...
 
 getXmlRepresentation ( $a_entity, $a_schema_version, $a_ids, $a_field="", $a_omit_header=false, $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 ($a_writer, $a_prefixes, $a_entity, $a_schema_version, $a_ids, $a_field="")
 Add records xml. More...
 
 afterXmlRecordWriting ($a_entity, $a_version, $a_set)
 After xml record writing hook record. More...
 
 getNamespaces (&$namespaces, $a_entity, $a_schema_version)
 Get xml namespaces. More...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record for version. More...
 
 getJsonRecord ($a_set)
 Get json record for version. More...
 
 getXmlTypes ($a_entity, $a_version)
 Get xml types. More...
 
 getJsonTypes ($a_entity, $a_version)
 Get json types. More...
 
 getXMLEntityName ($a_entity, $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag ($a_entity, $a_schema_version)
 Get entity tag. More...
 
 getJsonEntityName ($a_entity, $a_version)
 Get entity name for json (may be overwritten) More...
 
 setImport ($a_val)
 Set import object. More...
 
 getImport ()
 Get import object. More...
 
 setCurrentInstallationId ($a_val)
 Set current installation id. More...
 
 getCurrentInstallationId ()
 Get current installation id. More...
 

Protected Member Functions

 getTypes ($a_entity, $a_version)
 Get field types for entity. More...
 
 getDependencies ($a_entity, $a_version, $a_rec, $a_ids)
 Determine the dependent sets of data. More...
 
- Protected Member Functions inherited from ilDataSet
 getTypes ($a_entity, $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 createObjectExportId ($a_type, $a_id)
 Build ilias export id. More...
 
 parseObjectExportId ($a_id, $a_fallback_id=null)
 Parse export id. More...
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
 $dircnt
 
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
 
- Protected Attributes inherited from ilDataSet
 $current_installation_id = ""
 
 $db
 
 $ds_log
 

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
Version
$Id$

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

Member Function Documentation

◆ getDependencies()

ilObjectDataSet::getDependencies (   $a_entity,
  $a_version,
  $a_rec,
  $a_ids 
)
protected

Determine the dependent sets of data.

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

240  {
241  switch ($a_entity) {
242  case "common":
243  return array(
244  "transl" => array("ids" => $a_rec["ObjId"]),
245  "service_settings" => array("ids" => $a_rec["ObjId"]),
246  "tile" => array("ids" => $a_rec["ObjId"]),
247  "icon" => array("ids" => $a_rec["ObjId"])
248  );
249 
250  case "transl":
251  return array(
252  "transl_entry" => array("ids" => $a_rec["ObjId"])
253  );
254  }
255 
256  return false;
257  }

◆ getSupportedVersions()

ilObjectDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

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

26  {
27  return array("4.4.0", "5.1.0", "5.2.0", "5.4.0");
28  }

◆ getTypes()

ilObjectDataSet::getTypes (   $a_entity,
  $a_version 
)
protected

Get field types for entity.

Parameters

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

References ilDataSet\$db, $DIC, $id, $ilDB, $s, ilContainer\_lookupContainerSetting(), ilObject\_lookupType(), ilObjectServiceSettingsGUI\AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI\CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI\CUSTOM_METADATA, data, ilDataSet\getDirectDataFromQuery(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, ilObjectServiceSettingsGUI\NEWS_VISIBILITY, ilDataSet\readData(), ilObjectServiceSettingsGUI\TAG_CLOUD, ilObjectServiceSettingsGUI\TAXONOMIES, and ilObjectServiceSettingsGUI\USE_NEWS.

48  {
49  if ($a_entity == "transl_entry") {
50  switch ($a_version) {
51  case "4.4.0":
52  case "5.1.0":
53  case "5.2.0":
54  case "5.4.0":
55  return array(
56  "ObjId" => "integer",
57  "Title" => "text",
58  "Description" => "text",
59  "LangCode" => "text",
60  "LangDefault" => "integer");
61  }
62  }
63  if ($a_entity == "transl") {
64  switch ($a_version) {
65  case "4.4.0":
66  case "5.1.0":
67  case "5.2.0":
68  case "5.4.0":
69  return array(
70  "ObjId" => "integer",
71  "MasterLang" => "text");
72  }
73  }
74  if ($a_entity == "service_settings") {
75  switch ($a_version) {
76  case "5.1.0":
77  case "5.2.0":
78  case "5.4.0":
79  return array(
80  "ObjId" => "integer",
81  "Setting" => "text",
82  "Value" => "text");
83  }
84  }
85  if ($a_entity == "common") {
86  switch ($a_version) {
87  case "5.4.0":
88  return array(
89  "ObjId" => "integer"
90  );
91  }
92  }
93  if ($a_entity == "icon") {
94  switch ($a_version) {
95  case "5.4.0":
96  return array(
97  "ObjId" => "integer",
98  "Filename" => "text",
99  "Dir" => "directory");
100  }
101  }
102  if ($a_entity == "tile") {
103  switch ($a_version) {
104  case "5.4.0":
105  return array(
106  "ObjId" => "integer",
107  "Extension" => "text",
108  "Dir" => "directory");
109  }
110  }
111  }
+ Here is the call graph for this function:

◆ getXmlNamespace()

ilObjectDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

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

37  {
38  return "http://www.ilias.de/xml/Services/Object/" . $a_entity;
39  }

◆ importRecord()

ilObjectDataSet::importRecord (   $a_entity,
  $a_types,
  $a_rec,
  $a_mapping,
  $a_schema_version 
)

Import record.

Parameters

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

References $DIC, $m, $map, $type, ilObject\_lookupType(), ilContainer\_writeContainerSetting(), ilObjectServiceSettingsGUI\AUTO_RATING_NEW_OBJECTS, ilObjectServiceSettingsGUI\CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilDataSet\getImportDirectory(), ilObjectTranslation\getInstance(), ilObjectServiceSettingsGUI\INFO_TAB_VISIBILITY, ilObjectServiceSettingsGUI\NEWS_VISIBILITY, ilObjectServiceSettingsGUI\TAG_CLOUD, ilObjectServiceSettingsGUI\TAXONOMIES, and ilObjectServiceSettingsGUI\USE_NEWS.

267  {
268  global $DIC;
269 
270  switch ($a_entity) {
271  case "transl_entry":
272  $new_id = $this->getNewObjId($a_mapping, $a_rec['ObjId']);
273  if ($new_id > 0) {
274  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
275  $transl = ilObjectTranslation::getInstance($new_id);
276  $transl->addLanguage(
277  $a_rec["LangCode"],
278  $a_rec["Title"],
279  $a_rec["Description"],
280  $a_rec["LangDefault"],
281  true
282  );
283  $transl->save();
284  }
285  break;
286 
287  case "transl":
288  $new_id = $this->getNewObjId($a_mapping, $a_rec['ObjId']);
289  if ($new_id > 0) {
290  include_once("./Services/Object/classes/class.ilObjectTranslation.php");
291  $transl = ilObjectTranslation::getInstance($new_id);
292  $transl->setMasterLanguage($a_rec["MasterLang"]);
293  $transl->save();
294  }
295  break;
296 
297  case "service_settings":
298  include_once("./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
299  include_once("./Services/Container/classes/class.ilContainer.php");
300 
301  // info, news, custom metadata, tags, taxonomies, auto rating (all stored in container settings)
302  $settings = array(
311  );
312  $new_id = $this->getNewObjId($a_mapping, $a_rec['ObjId']);
313  if ($new_id > 0) {
314  if (in_array($a_rec["Setting"], $settings)) {
315  ilContainer::_writeContainerSetting($new_id, $a_rec["Setting"], $a_rec["Value"]);
316  }
317  }
318  break;
319 
320  case "icon":
321  $new_id = $this->getNewObjId($a_mapping, $a_rec['ObjId']);
322  $dir = str_replace("..", "", $a_rec["Dir"]);
323  if ($dir != "" && $this->getImportDirectory() != "") {
324  $source_dir = $this->getImportDirectory() . "/" . $dir;
325 
326  $customIconFactory = $DIC['object.customicons.factory'];
327  $customIcon = $customIconFactory->getByObjId($new_id, ilObject::_lookupType($new_id));
328  $customIcon->createFromImportDir($source_dir, $a_rec["Filename"]);
329  }
330  break;
331 
332  case "tile":
333  $new_id = $this->getNewObjId($a_mapping, $a_rec['ObjId']);
334  $dir = str_replace("..", "", $a_rec["Dir"]);
335  if ($new_id > 0 && $dir != "" && $this->getImportDirectory() != "") {
336  $source_dir = $this->getImportDirectory() . "/" . $dir;
337  $cs = $DIC->object()->commonSettings();
338  $ti = $cs->tileImage()->getByObjId($new_id);
339  $ti->createFromImportDir($source_dir, $a_rec["Extension"]);
340  }
341  break;
342  }
343  }
global $DIC
Definition: saml.php:7
getImportDirectory()
Get import directory.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance($a_obj_id)
Get instance.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

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