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 "service_settings" => array(
"ids" => $a_rec[
"ObjId"]),
246 "tile" => array(
"ids" => $a_rec[
"ObjId"]),
247 "icon" => array(
"ids" => $a_rec[
"ObjId"])
252 "transl_entry" => array(
"ids" => $a_rec[
"ObjId"])
266 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
272 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
274 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
276 $transl->addLanguage(
279 $a_rec[
"Description"],
280 $a_rec[
"LangDefault"],
288 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
290 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
292 $transl->setMasterLanguage($a_rec[
"MasterLang"]);
297 case "service_settings":
298 include_once(
"./Services/Object/classes/class.ilObjectServiceSettingsGUI.php");
299 include_once(
"./Services/Container/classes/class.ilContainer.php");
312 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
314 if (in_array($a_rec[
"Setting"], $settings)) {
321 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
322 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
326 $customIconFactory = $DIC[
'object.customicons.factory'];
328 $customIcon->createFromImportDir($source_dir, $a_rec[
"Filename"]);
333 $new_id = $this->getNewObjId($a_mapping, $a_rec[
'ObjId']);
334 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
337 $cs = $DIC->object()->commonSettings();
338 $ti = $cs->tileImage()->getByObjId($new_id);
339 $ti->createFromImportDir($source_dir, $a_rec[
"Extension"]);
352 public function getNewObjId($a_mapping, $old_id)
357 $objDefinition = $DIC[
"objDefinition"];
359 $new_id = $a_mapping->getMapping(
'Services/Container',
'objs', $old_id);
361 $new_id = $a_mapping->getMapping(
'Services/Object',
'objs', $old_id);
364 $new_id = $a_mapping->getMapping(
'Services/Object',
'obj', $old_id);
367 foreach ($a_mapping->getAllMappings() as $k =>
$m) {
368 if (substr($k, 0, 8) ==
"Modules/") {
371 if ($objDefinition->isRBACObject(
$type)) {
372 $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 ...
if(!array_key_exists('StateId', $_REQUEST)) $id
getImportDirectory()
Get import directory.
readData($a_entity, $a_version, $a_ids)
Read data from DB.
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.