4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
27 return array(
"4.4.0",
"5.1.0",
"5.2.0",
"5.4.0");
38 return "http://www.ilias.de/xml/Services/Object/" . $a_entity;
47 protected function getTypes($a_entity, $a_version)
49 if ($a_entity ==
"transl_entry") {
58 "Description" =>
"text",
60 "LangDefault" =>
"integer");
63 if ($a_entity ==
"transl") {
71 "MasterLang" =>
"text");
74 if ($a_entity ==
"service_settings") {
85 if ($a_entity ==
"common") {
93 if ($a_entity ==
"icon") {
99 "Dir" =>
"directory");
102 if ($a_entity ==
"tile") {
103 switch ($a_version) {
106 "ObjId" =>
"integer",
107 "Extension" =>
"text",
108 "Dir" =>
"directory");
119 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
125 if (!is_array($a_ids)) {
126 $a_ids = array($a_ids);
129 if ($a_entity ==
"transl_entry") {
130 switch ($a_version) {
136 " lang_code, lang_default" .
137 " FROM object_translation" .
138 " WHERE " .
$ilDB->in(
"obj_id", $a_ids,
false,
"integer"));
143 if ($a_entity ==
"transl") {
144 switch ($a_version) {
150 " FROM obj_content_master_lng" .
151 " WHERE " .
$ilDB->in(
"obj_id", $a_ids,
false,
"integer"));
156 if ($a_entity ==
"service_settings") {
157 switch ($a_version) {
161 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
162 include_once(
"./Services/Container/classes/class.ilContainer.php");
164 $this->data = array();
165 foreach ($a_ids as $id) {
176 if ($a_version ==
"5.2.0") {
179 foreach ($settings as $s) {
182 $this->data[] = array(
194 if ($a_entity ==
"common") {
196 foreach ($a_ids as $id) {
203 if ($a_entity ==
"tile") {
204 $cs = $DIC->object()->commonSettings();
206 foreach ($a_ids as $id) {
207 $ti = $cs->tileImage()->getByObjId($id);
211 "Extension" => $ti->getExtension(),
212 "Dir" => dirname($ti->getFullPath())
219 if ($a_entity ==
"icon") {
220 $customIconFactory = $DIC[
'object.customicons.factory'];
222 foreach ($a_ids as $id) {
225 if ($customIcon->exists()) {
228 "Filename" => pathinfo($customIcon->getFullPath(), PATHINFO_BASENAME),
229 "Dir" => dirname($customIcon->getFullPath())
244 "transl" => array(
"ids" => $a_rec[
"ObjId"]),
245 "transl_entry" => array(
"ids" => $a_rec[
"ObjId"]),
246 "service_settings" => array(
"ids" => $a_rec[
"ObjId"]),
247 "tile" => array(
"ids" => $a_rec[
"ObjId"]),
248 "icon" => array(
"ids" => $a_rec[
"ObjId"])
262 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
268 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
270 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
272 $transl->addLanguage(
279 $a_rec[
'Description'],
282 $a_rec[
"LangDefault"],
290 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
292 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
294 $transl->setMasterLanguage($a_rec[
"MasterLang"]);
299 case "service_settings":
300 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
301 include_once(
"./Services/Container/classes/class.ilContainer.php");
314 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
316 if (in_array($a_rec[
"Setting"], $settings)) {
323 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
324 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
328 $customIconFactory = $DIC[
'object.customicons.factory'];
330 $customIcon->createFromImportDir($source_dir, $a_rec[
"Filename"]);
335 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
336 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
339 $cs = $DIC->object()->commonSettings();
340 $ti = $cs->tileImage()->getByObjId($new_id);
341 $ti->createFromImportDir($source_dir, $a_rec[
"Extension"]);
354 public function getNewObjId($a_mapping, $old_id)
359 $objDefinition = $DIC[
"objDefinition"];
361 $new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $old_id);
363 $new_id = $a_mapping->getMapping(
'Services/Object',
'objs', $old_id);
366 $new_id = $a_mapping->getMapping(
'Services/Object',
'obj', $old_id);
369 foreach ($a_mapping->getAllMappings() as $k => $m) {
370 if (substr($k, 0, 8) ==
"Modules/") {
371 foreach ($m as
$type => $map) {
373 if ($objDefinition->isRBACObject(
$type)) {
374 $new_id = $a_mapping->getMapping($k,
$type, $old_id);
const CALENDAR_VISIBILITY
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 ...
getImportDirectory()
Get import directory.
readData($a_entity, $a_version, $a_ids)
Read data from DB.
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
static _lookupType($a_id, $a_reference=false)
lookup object type
const AUTO_RATING_NEW_OBJECTS
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getSupportedVersions()
Get supported versions.
static getInstance($a_obj_id)
Get instance.
const INFO_TAB_VISIBILITY
static _writeContainerSetting($a_id, $a_keyword, $a_value)
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getTypes($a_entity, $a_version)
Get field types for entity.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.