ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilHTMLLearningModuleDataSet Class Reference

HTML learning module data set class. More...

+ Inheritance diagram for ilHTMLLearningModuleDataSet:
+ Collaboration diagram for ilHTMLLearningModuleDataSet:

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...
 
 getXmlRecord ($a_entity, $a_version, $a_set)
 Get xml record. 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

HTML learning module 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.ilHTMLLearningModuleDataSet.php.

Member Function Documentation

◆ getDependencies()

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

Determine the dependent sets of data.

Definition at line 88 of file class.ilHTMLLearningModuleDataSet.php.

89  {
90  return false;
91  }

◆ getSupportedVersions()

ilHTMLLearningModuleDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

Definition at line 21 of file class.ilHTMLLearningModuleDataSet.php.

References array.

22  {
23  return array("4.1.0");
24  }
Create styles array
The data for the language used.

◆ getTypes()

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

Get field types for entity.

Parameters

Definition at line 43 of file class.ilHTMLLearningModuleDataSet.php.

References array.

44  {
45  if ($a_entity == "htlm") {
46  switch ($a_version) {
47  case "4.1.0":
48  return array(
49  "Id" => "integer",
50  "Title" => "text",
51  "Description" => "text",
52  "StartFile" => "text",
53  "Dir" => "directory");
54  }
55  }
56  }
Create styles array
The data for the language used.

◆ getXmlNamespace()

ilHTMLLearningModuleDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

Definition at line 32 of file class.ilHTMLLearningModuleDataSet.php.

33  {
34  return "http://www.ilias.de/xml/Modules/HTMLLearningModule/" . $a_entity;
35  }

◆ getXmlRecord()

ilHTMLLearningModuleDataSet::getXmlRecord (   $a_entity,
  $a_version,
  $a_set 
)

Get xml record.

Parameters

Definition at line 100 of file class.ilHTMLLearningModuleDataSet.php.

101  {
102  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
103  $lm = new ilObjFileBasedLM($a_set["Id"], false);
104  $dir = $lm->getDataDirectory();
105  $a_set["Dir"] = $dir;
106 
107  return $a_set;
108  }
File Based Learning Module (HTML) object.

◆ importRecord()

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

Import record.

Parameters

Definition at line 116 of file class.ilHTMLLearningModuleDataSet.php.

References ilDataSet\getImportDirectory(), ilObjectFactory\getInstanceByObjId(), and ilUtil\rCopy().

117  {
118  //echo $a_entity;
119  //var_dump($a_rec);
120 
121  switch ($a_entity) {
122  case "htlm":
123 
124  include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
125  if ($new_id = $a_mapping->getMapping('Services/Container', 'objs', $a_rec['Id'])) {
126  $newObj = ilObjectFactory::getInstanceByObjId($new_id, false);
127  } else {
128  $newObj = new ilObjFileBasedLM();
129  $newObj->setType("htlm");
130  $newObj->create(true);
131  }
132 
133  $newObj->setTitle($a_rec["Title"]);
134  $newObj->setDescription($a_rec["Description"]);
135  $newObj->setStartFile($a_rec["StartFile"], true);
136  $newObj->update(true);
137  $this->current_obj = $newObj;
138 
139  $dir = str_replace("..", "", $a_rec["Dir"]);
140  if ($dir != "" && $this->getImportDirectory() != "") {
141  $source_dir = $this->getImportDirectory() . "/" . $dir;
142  $target_dir = $newObj->getDataDirectory();
143  ilUtil::rCopy($source_dir, $target_dir);
144  }
145 
146  $a_mapping->addMapping("Modules/HTMLLearningModule", "htlm", $a_rec["Id"], $newObj->getId());
147  $a_mapping->addMapping(
148  "Services/MetaData",
149  "md",
150  $a_rec["Id"] . ":0:htlm",
151  $newObj->getId() . ":0:htlm"
152  );
153  break;
154  }
155  }
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
File Based Learning Module (HTML) object.
getImportDirectory()
Get import directory.
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()

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

Read data.

Parameters

Definition at line 64 of file class.ilHTMLLearningModuleDataSet.php.

References ilDataSet\$db, $ilDB, array, and ilDataSet\getDirectDataFromQuery().

65  {
66  $ilDB = $this->db;
67 
68  if (!is_array($a_ids)) {
69  $a_ids = array($a_ids);
70  }
71 
72  if ($a_entity == "htlm") {
73  switch ($a_version) {
74  case "4.1.0":
75  $this->getDirectDataFromQuery("SELECT id, title, description, " .
76  " startfile start_file " .
77  " FROM file_based_lm JOIN object_data ON (file_based_lm.id = object_data.obj_id) " .
78  "WHERE " .
79  $ilDB->in("id", $a_ids, false, "integer"));
80  break;
81  }
82  }
83  }
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 ...
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:

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