ILIAS  trunk Revision v11.0_alpha-1851-ga8564da6fed
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilScorm2004DataSet Class Reference

Class ilScorm2004DataSet. More...

+ Inheritance diagram for ilScorm2004DataSet:
+ Collaboration diagram for ilScorm2004DataSet:

Public Member Functions

 getSupportedVersions ()
 Note: this is currently used for SCORM authoring lms Get supported versions. More...
 
 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 readData (string $a_entity, string $a_version, array $a_ids)
 
 afterXmlRecordWriting (string $a_entity, string $a_version, array $a_set)
 Determine the dependent sets of data. More...
 
- Public Member Functions inherited from ilDataSet
 __construct ()
 
 init (string $a_entity, string $a_schema_version)
 Init. More...
 
 getSupportedVersions ()
 
 readData (string $a_entity, string $a_version, array $a_ids)
 Read data from DB. More...
 
 initByExporter (ilXmlExporter $xml_exporter)
 
 setImportDirectory (string $a_val)
 
 getImportDirectory ()
 
 setDSPrefix (string $a_val)
 
 getDSPrefix ()
 
 getDSPrefixString ()
 
 getDirectDataFromQuery (string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
 Get data from query.This is a standard procedure, all db field names are directly mapped to abstract fields. More...
 
 convertToLeadingUpper (string $a_str)
 Make xyz_abc a XyzAbc string. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, ?array $a_ids, string $a_field="", bool $a_omit_header=false, bool $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 (ilXmlWriter $a_writer, array $a_prefixes, string $a_entity, string $a_schema_version, array $a_ids, ?string $a_field="")
 
 afterXmlRecordWriting (string $a_entity, string $a_version, array $a_set)
 
 getNamespaces (array &$namespaces, string $a_entity, string $a_schema_version)
 
 getXmlRecord (string $a_entity, string $a_version, array $a_set)
 Get xml record for version. More...
 
 getXmlTypes (string $a_entity, string $a_version)
 Get xml types. More...
 
 getXMLEntityName (string $a_entity, string $a_version)
 Get entity name for xml (may be overwritten) More...
 
 getXMLEntityTag (string $a_entity, string $a_schema_version)
 Get entity tag. More...
 
 setImport (ilSurveyImporter $a_val)
 
 getImport ()
 
 setCurrentInstallationId (string $a_val)
 
 getCurrentInstallationId ()
 
 importRecord (string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
 Needs to be overwritten for import use case. More...
 
 getCollection (array $record, string $entity, string $schema_version, string $field, string $value)
 
 getContainerExportConfig (array $record, string $entity, string $schema_version, string $field, string $value)
 

Protected Member Functions

 getTypes (string $a_entity, string $a_version)
 
- Protected Member Functions inherited from ilDataSet
 getTypes (string $a_entity, string $a_version)
 Get (abstract) types for (abstract) field names. More...
 
 getXmlNamespace (string $a_entity, string $a_schema_version)
 
 getExportDirInContainer (string $exp_dir)
 
 getIRSSContainerExportConfig (StorableResource $source_container, string $source_path, string $target_path="")
 
 getDependencies (string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
 
 createObjectExportId (string $a_type, string $a_id)
 Build ilias export id. More...
 
 parseObjectExportId (string $a_id, ?string $a_fallback_id=null)
 Parse export id. More...
 
 stripTags (array $rec, array $omit_keys=[])
 

Protected Attributes

array $temp_dir = array()
 
- Protected Attributes inherited from ilDataSet
ILIAS ResourceStorage Services $irss
 
string $current_installation_id = ""
 
array $data = []
 
ilDBInterface $db
 
ilLogger $ds_log
 
string $import_directory = ""
 
string $entity = ""
 
string $schema_version = ""
 
string $component_export_dir = ""
 
string $ds_prefix = "ds"
 
string $version = ""
 
ilSurveyImporter $import
 
ilExport $export
 

Additional Inherited Members

- Data Fields inherited from ilDataSet
const DATASET_NS = 'http://www.ilias.de/Services/DataSet/ds/4_3'
 
const DATASET_NS_PREFIX = 'ds'
 
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
 
int $dircnt = 0
 

Detailed Description

Class ilScorm2004DataSet.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 25 of file class.ilScorm2004DataSet.php.

Member Function Documentation

◆ afterXmlRecordWriting()

ilScorm2004DataSet::afterXmlRecordWriting ( string  $a_entity,
string  $a_version,
array  $a_set 
)

Determine the dependent sets of data.

Returns
mixed[] Get xml record
Parameters
string$a_entity
string$a_version
array$a_set
Returns
array
Exceptions
ilFileUtilsException

Definition at line 144 of file class.ilScorm2004DataSet.php.

References ilFileUtils\delDir().

144  : void
145  {
146  if ($a_entity === "sahs") {
147  // delete our temp dir
148  if (isset($this->temp_dir[$a_set["Id"]]) && is_dir($this->temp_dir[$a_set["Id"]])) {
149  ilFileUtils::delDir($this->temp_dir[$a_set["Id"]]);
150  }
151  }
152  }
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
+ Here is the call graph for this function:

◆ getSupportedVersions()

ilScorm2004DataSet::getSupportedVersions ( )

Note: this is currently used for SCORM authoring lms Get supported versions.

Returns
string[]

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

34  : array
35  {
36  return array("5.1.0");
37  }

◆ getTypes()

ilScorm2004DataSet::getTypes ( string  $a_entity,
string  $a_version 
)
protected
Returns
array<string, class-string<>>|array<string, string>

Definition at line 47 of file class.ilScorm2004DataSet.php.

47  : array
48  {
49  if ($a_entity === "sahs") {
50  switch ($a_version) {
51  case "5.1.0":
52  return array(
53  "Id" => "integer",
54  "Title" => "text",
55  "Description" => "text",
56  "Editable" => "integer",
57  "Dir" => "directory",
58  "File" => "text"
59  );
60  }
61  }
62  return [];
63  }

◆ getXmlNamespace()

ilScorm2004DataSet::getXmlNamespace ( string  $a_entity,
string  $a_schema_version 
)

Definition at line 39 of file class.ilScorm2004DataSet.php.

39  : string
40  {
41  return "http://www.ilias.de/xml/Modules/Scorm2004/" . $a_entity;
42  }

◆ readData()

ilScorm2004DataSet::readData ( string  $a_entity,
string  $a_version,
array  $a_ids 
)

Definition at line 65 of file class.ilScorm2004DataSet.php.

References ilDataSet\$db, $ilDB, ilObject\_lookupDescription(), ilObject\_lookupTitle(), and ilObject\_lookupType().

65  : void
66  {
67  $ilDB = $this->db;
68 
69  if (!is_array($a_ids)) {
70  $a_ids = array($a_ids);
71  }
72 
73  // sahs
74  if ($a_entity === "sahs") {
75  $this->data = array();
76 
77  switch ($a_version) {
78  case "5.1.0":
79  foreach ($a_ids as $sahs_id) {
80  if (ilObject::_lookupType((int) $sahs_id) === "sahs") {
81  $this->data[] = array("Id" => $sahs_id,
82  "Title" => ilObject::_lookupTitle((int) $sahs_id),
83  "Description" => ilObject::_lookupDescription((int) $sahs_id),
84  "Editable" => 1
85  );
86  }
87  }
88  break;
89  }
90  }
91  }
ilDBInterface $db
static _lookupTitle(int $obj_id)
static _lookupDescription(int $obj_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

Field Documentation

◆ $temp_dir

array ilScorm2004DataSet::$temp_dir = array()
protected

Definition at line 27 of file class.ilScorm2004DataSet.php.


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