ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 = ""
 

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 145 of file class.ilMediaCastDataSet.php.

146  {
147  return false;
148  }

◆ getOrder()

ilMediaCastDataSet::getOrder ( )

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

References $order.

216  {
217  return $this->order;
218  }

◆ getSupportedVersions()

ilMediaCastDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

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

References array.

24  {
25  return array("5.0.0", "4.1.0");
26  }
Create styles array
The data for the language used.

◆ getTypes()

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

Get field types for entity.

Parameters

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

References array.

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

◆ 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 157 of file class.ilMediaCastDataSet.php.

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

158  {
159 //echo $a_entity;
160 //var_dump($a_rec);
161 
162  switch ($a_entity)
163  {
164  case "mcst":
165  include_once("./Modules/MediaCast/classes/class.ilObjMediaCast.php");
166 
167  if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_rec['Id']))
168  {
169  $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
170  }
171  else
172  {
173  $newObj = new ilObjMediaCast();
174  $newObj->setType("mcst");
175  $newObj->create(true);
176  }
177 
178  $newObj->setTitle($a_rec["Title"]);
179  $newObj->setDescription($a_rec["Description"]);
180  $newObj->setDefaultAccess($a_rec["DefaultAccess"]);
181  $newObj->setDownloadable($a_rec["Downloadable"]);
182  $newObj->setPublicFiles($a_rec["PublicFiles"]);
183 
184  if ($a_schema_version == "5.0.0")
185  {
186  $newObj->setOrder($a_rec["Sortmode"]);
187  $newObj->setViewMode($a_rec["Viewmode"]);
188 
189  if($a_rec["Order"])
190  {
191  $this->order[$newObj->getId()] = explode(";", $a_rec["Order"]);
192  }
193 
194  include_once("./Services/Block/classes/class.ilBlockSetting.php");
195  ilBlockSetting::_write("news", "public_feed",
196  $a_rec["PublicFeed"],
197  0, $newObj->getId());
198 
199  ilBlockSetting::_write("news", "keep_rss_min",
200  $a_rec["KeepRssMin"],
201  0, $newObj->getId());
202  }
203 
204  $newObj->update(true);
205  $this->current_obj = $newObj;
206  $a_mapping->addMapping("Modules/MediaCast", "mcst", $a_rec["Id"], $newObj->getId());
207  $a_mapping->addMapping("Services/News", "news_context",
208  $a_rec["Id"].":mcst:0:",
209  $newObj->getId().":mcst:0:");
210 //var_dump($a_mapping->mappings["Services/News"]["news_context"]);
211  break;
212  }
213  }
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 85 of file class.ilMediaCastDataSet.php.

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

86  {
87  global $ilDB;
88 
89  if (!is_array($a_ids))
90  {
91  $a_ids = array($a_ids);
92  }
93 
94  if ($a_entity == "mcst")
95  {
96  switch ($a_version)
97  {
98  case "4.1.0":
99  $this->getDirectDataFromQuery("SELECT id, title, description, ".
100  " public_files, downloadable, def_access default_access".
101  " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) ".
102  "WHERE ".
103  $ilDB->in("id", $a_ids, false, "integer"));
104  break;
105 
106  case "5.0.0":
107  $this->getDirectDataFromQuery("SELECT id, title, description, ".
108  " public_files, downloadable, def_access default_access, sortmode, viewmode".
109  " FROM il_media_cast_data JOIN object_data ON (il_media_cast_data.id = object_data.obj_id) ".
110  "WHERE ".
111  $ilDB->in("id", $a_ids, false, "integer"));
112 
113  // #17174 - manual order?
114  $order = array();
115  $set = $ilDB->query("SELECT * FROM il_media_cast_data_ord".
116  " WHERE ".$ilDB->in("obj_id", $a_ids, false, "integer").
117  " ORDER BY pos");
118  while($row = $ilDB->fetchAssoc($set))
119  {
120  $order[$row["obj_id"]][] = $row["item_id"];
121  }
122 
123  include_once("./Services/Block/classes/class.ilBlockSetting.php");
124  foreach ($this->data as $k => $v)
125  {
126  $this->data[$k]["PublicFeed"] = ilBlockSetting::_lookup("news", "public_feed", 0, $v["Id"]);
127  $this->data[$k]["KeepRssMin"] = (int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $v["Id"]);
128 
129  // manual order?
130  if($this->data[$k]["Sortmode"] == 4 &&
131  array_key_exists($v["Id"], $order))
132  {
133  $this->data[$k]["Order"] = implode(";", $order[$v["Id"]]);
134  }
135  }
136  break;
137  }
138  }
139 
140  }
Add some data
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.
Create styles array
The data for the language used.
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: