ILIAS
Release_4_1_x_branch Revision 61804
|
A dataset contains in data in a common structure that can be shared and transformed for different purposes easily, examples. More...
Public Member Functions | |
__construct () | |
Constructor. | |
init ($a_entity, $a_target_release) | |
Init. | |
getSupportedVersions ($a_entity) | |
Get supported version. | |
readData ($a_entity, $a_version, $a_ids) | |
Read data from DB. | |
setExportDirectories ($a_relative, $a_absolute) | |
Set export directories. | |
setImportDirectory ($a_val) | |
Set import directory. | |
getImportDirectory () | |
Get import directory. | |
setDSPrefix ($a_val) | |
Set XML dataset namespace prefix. | |
getDSPrefix () | |
Get XML dataset namespace prefix. | |
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. | |
convertToLeadingUpper ($a_str) | |
Make xyz_abc a XyzAbc string. | |
getJsonRepresentation () | |
Get json representation. | |
getXmlRepresentation ($a_entity, $a_target_release, $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 ...> ... | |
addRecordsXml ($a_writer, $a_prefixes, $a_entity, $a_target_release, $a_ids, $a_field="") | |
Add records xml. | |
getNamespaces (&$namespaces, $a_entity, $a_target_release) | |
Get xml namespaces. | |
getXmlRecord ($a_entity, $a_version, $a_set) | |
Get xml record for version. | |
getJsonRecord ($a_set) | |
Get json record for version. | |
getXmlTypes ($a_entity, $a_version) | |
Get xml types. | |
getJsonTypes ($a_entity, $a_version) | |
Get json types. | |
getXMLEntityName ($a_entity, $a_version) | |
Get entity name for xml (may be overwritten) | |
getXMLEntityTag ($a_entity, $a_target_release) | |
Get entity tag. | |
getJsonEntityName ($a_entity, $a_version) | |
Get entity name for json (may be overwritten) | |
setImport ($a_val) | |
Set import object. | |
getImport () | |
Get import object. |
Data Fields | |
$dircnt |
Protected Member Functions | |
getTypes ($a_entity, $a_version) | |
Get (abstract) types for (abstract) field names. | |
getXmlNamespace ($a_entity, $a_target_release) | |
Get xml namespace. |
Private Member Functions | |
addTypesXml ($a_writer, $a_entity, $a_target_release) | |
Add types to xml writer. |
A dataset contains in data in a common structure that can be shared and transformed for different purposes easily, examples.
The general structure is:
Definition at line 24 of file class.ilDataSet.php.
ilDataSet::__construct | ( | ) |
ilDataSet::addRecordsXml | ( | $a_writer, | |
$a_prefixes, | |||
$a_entity, | |||
$a_target_release, | |||
$a_ids, | |||
$a_field = "" |
|||
) |
Add records xml.
@return |
Definition at line 299 of file class.ilDataSet.php.
References $d, $dircnt, getDSPrefixString(), getXmlRecord(), getXmlTypes(), ilUtil\makeDirParents(), ilUtil\rCopy(), and readData().
Referenced by getXmlRepresentation().
|
private |
Add types to xml writer.
Definition at line 370 of file class.ilDataSet.php.
References $t, getDSPrefixString(), and getXmlTypes().
Referenced by getXmlRepresentation().
ilDataSet::convertToLeadingUpper | ( | $a_str | ) |
Make xyz_abc a XyzAbc string.
@return |
Definition at line 181 of file class.ilDataSet.php.
Referenced by getDirectDataFromQuery(), and getXMLEntityTag().
ilDataSet::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.
@return |
Definition at line 152 of file class.ilDataSet.php.
References $ilDB, and convertToLeadingUpper().
Referenced by ilExternalFeedDataSet\readData(), ilHTMLLearningModuleDataSet\readData(), ilMediaCastDataSet\readData(), ilNewsDataSet\readData(), ilExerciseDataSet\readData(), ilWikiDataSet\readData(), ilMediaPoolDataSet\readData(), ilSessionDataSet\readData(), and ilMediaObjectDataSet\readData().
ilDataSet::getDSPrefix | ( | ) |
Get XML dataset namespace prefix.
Definition at line 132 of file class.ilDataSet.php.
Referenced by getDSPrefixString().
ilDataSet::getDSPrefixString | ( | ) |
Definition at line 137 of file class.ilDataSet.php.
References getDSPrefix().
Referenced by addRecordsXml(), addTypesXml(), and getXmlRepresentation().
ilDataSet::getImport | ( | ) |
Get import object.
Definition at line 513 of file class.ilDataSet.php.
ilDataSet::getImportDirectory | ( | ) |
Get import directory.
Definition at line 112 of file class.ilDataSet.php.
Referenced by ilHTMLLearningModuleDataSet\importRecord(), ilExerciseDataSet\importRecord(), and ilMediaObjectDataSet\importRecord().
ilDataSet::getJsonEntityName | ( | $a_entity, | |
$a_version | |||
) |
Get entity name for json (may be overwritten)
Definition at line 493 of file class.ilDataSet.php.
Referenced by getJsonRepresentation().
ilDataSet::getJsonRecord | ( | $a_set | ) |
Get json record for version.
array | abstract data record |
Definition at line 442 of file class.ilDataSet.php.
Referenced by getJsonRepresentation().
|
final |
Get json representation.
Definition at line 197 of file class.ilDataSet.php.
References $d, ilJsonUtil\encode(), getJsonEntityName(), getJsonRecord(), and getJsonTypes().
ilDataSet::getJsonTypes | ( | $a_entity, | |
$a_version | |||
) |
Get json types.
Definition at line 462 of file class.ilDataSet.php.
References getTypes().
Referenced by getJsonRepresentation().
ilDataSet::getNamespaces | ( | & | $namespaces, |
$a_entity, | |||
$a_target_release | |||
) |
Get xml namespaces.
array | namespaces per entity |
string | entity |
string | target release |
Definition at line 407 of file class.ilDataSet.php.
References getXmlNamespace().
Referenced by getXmlRepresentation().
|
abstract |
Get supported version.
Reimplemented in ilMediaObjectDataSet, ilMediaPoolDataSet, ilWikiDataSet, ilExerciseDataSet, ilExternalFeedDataSet, ilForumDataSet, ilHTMLLearningModuleDataSet, ilMediaCastDataSet, ilSessionDataSet, and ilNewsDataSet.
|
abstractprotected |
Get (abstract) types for (abstract) field names.
Please note that the abstract fields/types only depend on the version! Not on a choosen representation!
Reimplemented in ilMediaObjectDataSet, ilMediaPoolDataSet, ilWikiDataSet, ilSessionDataSet, ilExerciseDataSet, ilExternalFeedDataSet, ilForumDataSet, ilHTMLLearningModuleDataSet, ilMediaCastDataSet, and ilNewsDataSet.
Referenced by getJsonTypes(), and getXmlTypes().
ilDataSet::getXMLEntityName | ( | $a_entity, | |
$a_version | |||
) |
Get entity name for xml (may be overwritten)
Definition at line 473 of file class.ilDataSet.php.
ilDataSet::getXMLEntityTag | ( | $a_entity, | |
$a_target_release | |||
) |
Get entity tag.
@return |
Definition at line 484 of file class.ilDataSet.php.
References convertToLeadingUpper().
|
abstractprotected |
Get xml namespace.
Reimplemented in ilMediaObjectDataSet, ilMediaPoolDataSet, ilWikiDataSet, ilSessionDataSet, ilExerciseDataSet, ilExternalFeedDataSet, ilForumDataSet, ilHTMLLearningModuleDataSet, ilMediaCastDataSet, and ilNewsDataSet.
Referenced by getNamespaces().
ilDataSet::getXmlRecord | ( | $a_entity, | |
$a_version, | |||
$a_set | |||
) |
Get xml record for version.
array | abstract data record |
Reimplemented in ilMediaObjectDataSet, ilSessionDataSet, ilExerciseDataSet, and ilHTMLLearningModuleDataSet.
Definition at line 431 of file class.ilDataSet.php.
Referenced by addRecordsXml().
|
final |
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>
Definition at line 241 of file class.ilDataSet.php.
References addRecordsXml(), addTypesXml(), getDSPrefixString(), and getNamespaces().
ilDataSet::getXmlTypes | ( | $a_entity, | |
$a_version | |||
) |
Get xml types.
Definition at line 452 of file class.ilDataSet.php.
References getTypes().
Referenced by addRecordsXml(), and addTypesXml().
|
final |
Init.
string | (abstract) entity name |
string | version string, always the ILIAS release versions that defined the a structure or made changes to it, never use another version. Example: structure is defined in 4.1.0 and changed in 4.3.0 -> use these values only, not 4.2.0 (ask for the 4.1.0 version in ILIAS 4.2.0) |
Definition at line 47 of file class.ilDataSet.php.
|
abstract |
Read data from DB.
This should result in the abstract field structure of the version set in the constructor.
array | one or multiple ids |
Referenced by addRecordsXml().
ilDataSet::setDSPrefix | ( | $a_val | ) |
Set XML dataset namespace prefix.
string | XML dataset namespace prefix |
Definition at line 122 of file class.ilDataSet.php.
ilDataSet::setExportDirectories | ( | $a_relative, | |
$a_absolute | |||
) |
Set export directories.
@return |
Definition at line 91 of file class.ilDataSet.php.
ilDataSet::setImport | ( | $a_val | ) |
Set import object.
object | import object |
Definition at line 503 of file class.ilDataSet.php.
ilDataSet::setImportDirectory | ( | $a_val | ) |
Set import directory.
string | import directory |
Definition at line 102 of file class.ilDataSet.php.
ilDataSet::$dircnt |
Definition at line 26 of file class.ilDataSet.php.
Referenced by addRecordsXml().