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

Media cast data set class. More...

+ Inheritance diagram for ilMediaCastDataSet:
+ Collaboration diagram for ilMediaCastDataSet:

Public Member Functions

 getSupportedVersions ()
 Get supported versions. More...
 
 getXmlNamespace ($a_entity, $a_schema_version)
 Get xml namespace. More...
 
 readData ($a_entity, $a_version, $a_ids, $a_field="")
 Read data. More...
 
 importRecord ($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
 Import record. More...
 
 getOrder ()
 
- 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...
 

Protected Attributes

 $order = array()
 
- Protected Attributes inherited from ilDataSet
 $current_installation_id = ""
 
 $db
 
 $ds_log
 

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
 

Detailed Description

Media cast data set class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 13 of file class.ilMediaCastDataSet.php.

Member Function Documentation

◆ getDependencies()

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

Determine the dependent sets of data.

Definition at line 135 of file class.ilMediaCastDataSet.php.

136  {
137  return false;
138  }

◆ getOrder()

ilMediaCastDataSet::getOrder ( )

Definition at line 210 of file class.ilMediaCastDataSet.php.

References $order.

211  {
212  return $this->order;
213  }

◆ getSupportedVersions()

ilMediaCastDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

Definition at line 23 of file class.ilMediaCastDataSet.php.

24  {
25  return array("5.0.0", "4.1.0");
26  }

◆ getTypes()

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

Get field types for entity.

Parameters

Definition at line 45 of file class.ilMediaCastDataSet.php.

46  {
47  if ($a_entity == "mcst") {
48  switch ($a_version) {
49  case "4.1.0":
50  return array(
51  "Id" => "integer",
52  "Title" => "text",
53  "Description" => "text",
54  "PublicFiles" => "integer",
55  "Downloadable" => "integer",
56  "DefaultAccess" => "integer");
57 
58  case "5.0.0":
59  return array(
60  "Id" => "integer",
61  "Title" => "text",
62  "Description" => "text",
63  "PublicFiles" => "integer",
64  "Downloadable" => "integer",
65  "DefaultAccess" => "integer",
66  "Sortmode" => "integer",
67  "Viewmode" => "text",
68  "PublicFeed" => "integer",
69  "KeepRssMin" => "integer",
70  "Order" => "text"
71  );
72  }
73  }
74  }

◆ getXmlNamespace()

ilMediaCastDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

Definition at line 34 of file class.ilMediaCastDataSet.php.

35  {
36  return "http://www.ilias.de/xml/Modules/MediaCast/" . $a_entity;
37  }

◆ importRecord()

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

Import record.

Parameters

Definition at line 147 of file class.ilMediaCastDataSet.php.

References ilBlockSetting\_write(), and ilObjectFactory\getInstanceByObjId().

148  {
149  //echo $a_entity;
150  //var_dump($a_rec);
151 
152  switch ($a_entity) {
153  case "mcst":
154  include_once("./Modules/MediaCast/classes/class.ilObjMediaCast.php");
155 
156  if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_rec['Id'])) {
157  $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
158  } else {
159  $newObj = new ilObjMediaCast();
160  $newObj->setType("mcst");
161  $newObj->create(true);
162  }
163 
164  $newObj->setTitle($a_rec["Title"]);
165  $newObj->setDescription($a_rec["Description"]);
166  $newObj->setDefaultAccess($a_rec["DefaultAccess"]);
167  $newObj->setDownloadable($a_rec["Downloadable"]);
168  $newObj->setPublicFiles($a_rec["PublicFiles"]);
169 
170  if ($a_schema_version == "5.0.0") {
171  $newObj->setOrder($a_rec["Sortmode"]);
172  $newObj->setViewMode($a_rec["Viewmode"]);
173 
174  if ($a_rec["Order"]) {
175  $this->order[$newObj->getId()] = explode(";", $a_rec["Order"]);
176  }
177 
178  include_once("./Services/Block/classes/class.ilBlockSetting.php");
180  "news",
181  "public_feed",
182  $a_rec["PublicFeed"],
183  0,
184  $newObj->getId()
185  );
186 
188  "news",
189  "keep_rss_min",
190  $a_rec["KeepRssMin"],
191  0,
192  $newObj->getId()
193  );
194  }
195 
196  $newObj->update(true);
197  $this->current_obj = $newObj;
198  $a_mapping->addMapping("Modules/MediaCast", "mcst", $a_rec["Id"], $newObj->getId());
199  $a_mapping->addMapping(
200  "Services/News",
201  "news_context",
202  $a_rec["Id"] . ":mcst:0:",
203  $newObj->getId() . ":mcst:0:"
204  );
205 //var_dump($a_mapping->mappings["Services/News"]["news_context"]);
206  break;
207  }
208  }
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
Class ilObjMediaCast.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ readData()

ilMediaCastDataSet::readData (   $a_entity,
  $a_version,
  $a_ids,
  $a_field = "" 
)

Read data.

Parameters

Definition at line 82 of file class.ilMediaCastDataSet.php.

References ilDataSet\$db, $ilDB, $order, $row, ilBlockSetting\_lookup(), data, and ilDataSet\getDirectDataFromQuery().

83  {
84  $ilDB = $this->db;
85 
86  if (!is_array($a_ids)) {
87  $a_ids = array($a_ids);
88  }
89 
90  if ($a_entity == "mcst") {
91  switch ($a_version) {
92  case "4.1.0":
93  $this->getDirectDataFromQuery("SELECT id, title, description, " .
94  " public_files, downloadable, def_access default_access" .
95  " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
96  "WHERE " .
97  $ilDB->in("id", $a_ids, false, "integer"));
98  break;
99 
100  case "5.0.0":
101  $this->getDirectDataFromQuery("SELECT id, title, description, " .
102  " public_files, downloadable, def_access default_access, sortmode, viewmode" .
103  " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) " .
104  "WHERE " .
105  $ilDB->in("id", $a_ids, false, "integer"));
106 
107  // #17174 - manual order?
108  $order = array();
109  $set = $ilDB->query("SELECT * FROM il_media_cast_data_ord" .
110  " WHERE " . $ilDB->in("obj_id", $a_ids, false, "integer") .
111  " ORDER BY pos");
112  while ($row = $ilDB->fetchAssoc($set)) {
113  $order[$row["obj_id"]][] = $row["item_id"];
114  }
115 
116  include_once("./Services/Block/classes/class.ilBlockSetting.php");
117  foreach ($this->data as $k => $v) {
118  $this->data[$k]["PublicFeed"] = ilBlockSetting::_lookup("news", "public_feed", 0, $v["Id"]);
119  $this->data[$k]["KeepRssMin"] = (int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $v["Id"]);
120 
121  // manual order?
122  if ($this->data[$k]["Sortmode"] == 4 &&
123  array_key_exists($v["Id"], $order)) {
124  $this->data[$k]["Order"] = implode(";", $order[$v["Id"]]);
125  }
126  }
127  break;
128  }
129  }
130  }
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 ...
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
$row
$this data['403_header']
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $order

ilMediaCastDataSet::$order = array()
protected

Definition at line 15 of file class.ilMediaCastDataSet.php.

Referenced by getOrder(), and readData().


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