ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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)
 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 ...> ... </types> <set entity="table_name"> <rec> <field_1>content</field_1> <field_2>my_date</field_2> <field_3>my_number</field_3> </rec> ... </set> </dataset> 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 = ""
 

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 95 of file class.ilHTMLLearningModuleDataSet.php.

96 {
97 return false;
98 }

◆ getSupportedVersions()

ilHTMLLearningModuleDataSet::getSupportedVersions ( )

Get supported versions.

Parameters

return

Reimplemented from ilDataSet.

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

22 {
23 return array("4.1.0");
24 }

◆ getTypes()

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

Get field types for entity.

Parameters

return

Reimplemented from ilDataSet.

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

44 {
45 if ($a_entity == "htlm")
46 {
47 switch ($a_version)
48 {
49 case "4.1.0":
50 return array(
51 "Id" => "integer",
52 "Title" => "text",
53 "Description" => "text",
54 "StartFile" => "text",
55 "Dir" => "directory");
56 }
57 }
58
59 }

◆ getXmlNamespace()

ilHTMLLearningModuleDataSet::getXmlNamespace (   $a_entity,
  $a_schema_version 
)

Get xml namespace.

Parameters

return

Reimplemented from ilDataSet.

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

return

Reimplemented from ilDataSet.

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

108 {
109 include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
110 $lm = new ilObjFileBasedLM($a_set["Id"], false);
111 $dir = $lm->getDataDirectory();
112 $a_set["Dir"] = $dir;
113
114 return $a_set;
115 }
File Based Learning Module (HTML) object.

◆ importRecord()

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

Import record.

Parameters

return

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

124 {
125//echo $a_entity;
126//var_dump($a_rec);
127
128 switch ($a_entity)
129 {
130 case "htlm":
131
132 include_once("./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
133 if($new_id = $a_mapping->getMapping('Services/Container','objs',$a_rec['Id']))
134 {
135 $newObj = ilObjectFactory::getInstanceByObjId($new_id,false);
136 }
137 else
138 {
139 $newObj = new ilObjFileBasedLM();
140 $newObj->setType("htlm");
141 $newObj->create(true);
142 }
143
144 $newObj->setTitle($a_rec["Title"]);
145 $newObj->setDescription($a_rec["Description"]);
146 $newObj->setStartFile($a_rec["StartFile"], true);
147 $newObj->update();
148 $this->current_obj = $newObj;
149
150 $dir = str_replace("..", "", $a_rec["Dir"]);
151 if ($dir != "" && $this->getImportDirectory() != "")
152 {
153 $source_dir = $this->getImportDirectory()."/".$dir;
154 $target_dir = $newObj->getDataDirectory();
155 ilUtil::rCopy($source_dir, $target_dir);
156 }
157
158 $a_mapping->addMapping("Modules/HTMLLearningModule", "htlm", $a_rec["Id"], $newObj->getId());
159 $a_mapping->addMapping("Services/MetaData", "md",
160 $a_rec["Id"].":0:htlm", $newObj->getId().":0:htlm");
161 break;
162 }
163 }
getImportDirectory()
Get import directory.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.

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

+ Here is the call graph for this function:

◆ readData()

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

Read data.

Parameters

return

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

68 {
69 global $ilDB;
70
71 if (!is_array($a_ids))
72 {
73 $a_ids = array($a_ids);
74 }
75
76 if ($a_entity == "htlm")
77 {
78 switch ($a_version)
79 {
80 case "4.1.0":
81 $this->getDirectDataFromQuery("SELECT id, title, description, ".
82 " startfile start_file ".
83 " FROM file_based_lm JOIN object_data ON (file_based_lm.id = object_data.obj_id) ".
84 "WHERE ".
85 $ilDB->in("id", $a_ids, false, "integer"));
86 break;
87 }
88 }
89
90 }
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
global $ilDB

References $ilDB, and ilDataSet\getDirectDataFromQuery().

+ Here is the call graph for this function:

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