ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
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. 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... | |
Data Fields | |
$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 Member Functions | |
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 | |
$current_installation_id = "" | |
$db | |
$ds_log | |
Private Member Functions | |
addTypesXml ($a_writer, $a_entity, $a_schema_version) | |
Add types to xml writer. More... | |
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 | ( | ) |
Constructor.
Definition at line 50 of file class.ilDataSet.php.
References $DIC, and ilLoggerFactory\getLogger().
ilDataSet::addRecordsXml | ( | $a_writer, | |
$a_prefixes, | |||
$a_entity, | |||
$a_schema_version, | |||
$a_ids, | |||
$a_field = "" |
|||
) |
Add records xml.
Definition at line 327 of file class.ilDataSet.php.
References $d, $dircnt, afterXmlRecordWriting(), array, data, getDSPrefixString(), getXmlRecord(), getXmlTypes(), ilUtil\makeDirParents(), ilUtil\rCopy(), and readData().
Referenced by getXmlRepresentation().
|
private |
Add types to xml writer.
Definition at line 406 of file class.ilDataSet.php.
References $t, $w, array, getDSPrefixString(), and getXmlTypes().
Referenced by getXmlRepresentation().
ilDataSet::afterXmlRecordWriting | ( | $a_entity, | |
$a_version, | |||
$a_set | |||
) |
After xml record writing hook record.
Definition at line 397 of file class.ilDataSet.php.
Referenced by addRecordsXml().
ilDataSet::convertToLeadingUpper | ( | $a_str | ) |
Make xyz_abc a XyzAbc string.
Definition at line 206 of file class.ilDataSet.php.
Referenced by getDirectDataFromQuery(), getXMLEntityTag(), ilUserDataSet\importRecord(), ilMediaPoolDataSet\readData(), and ilLearningModuleDataSet\readData().
|
protected |
Build ilias export id.
string | $a_type | |
int | $a_id |
Definition at line 577 of file class.ilDataSet.php.
References $a_type.
Referenced by ilBlogDataSet\readData().
ilDataSet::getCurrentInstallationId | ( | ) |
Get current installation id.
Definition at line 565 of file class.ilDataSet.php.
References $current_installation_id.
Referenced by ilSurveyDataSet\importRecord(), ilGlossaryDataSet\importRecord(), ilMediaObjectDataSet\importRecord(), ilLearningModuleDataSet\importRecord(), and ilSkillDataSet\importRecord().
ilDataSet::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.
string | $a_query | |
bool | $a_convert_to_leading_upper | |
bool | $a_set | should internal data array already be set? |
Definition at line 175 of file class.ilDataSet.php.
References $db, $ilDB, $ret, array, convertToLeadingUpper(), and data.
Referenced by ilExternalFeedDataSet\readData(), ilHTMLLearningModuleDataSet\readData(), ilRatingDataSet\readData(), ilNewsDataSet\readData(), ilNotesDataSet\readData(), ilHelpDataSet\readData(), ilItemGroupDataSet\readData(), ilMediaCastDataSet\readData(), ilPortfolioDataSet\readData(), ilSurveyDataSet\readData(), ilObjectDataSet\readData(), ilBookmarkDataSet\readData(), ilCOPageDataSet\readData(), ilPollDataSet\readData(), ilTaxonomyDataSet\readData(), ilCalendarDataSet\readData(), ilGlossaryDataSet\readData(), ilSessionDataSet\readData(), ilBlogDataSet\readData(), ilMediaPoolDataSet\readData(), ilWikiDataSet\readData(), ilMediaObjectDataSet\readData(), ilUserDataSet\readData(), ilStyleDataSet\readData(), ilLearningModuleDataSet\readData(), ilSkillDataSet\readData(), and ilExerciseDataSet\readData().
ilDataSet::getDSPrefix | ( | ) |
Get XML dataset namespace prefix.
Definition at line 155 of file class.ilDataSet.php.
Referenced by getDSPrefixString().
ilDataSet::getDSPrefixString | ( | ) |
Definition at line 160 of file class.ilDataSet.php.
References getDSPrefix().
Referenced by addRecordsXml(), addTypesXml(), ilScormAiccDataSet\getExtendedXmlRepresentation(), and getXmlRepresentation().
ilDataSet::getImport | ( | ) |
Get import object.
Definition at line 545 of file class.ilDataSet.php.
Referenced by ilSurveyDataSet\importRecord().
ilDataSet::getImportDirectory | ( | ) |
Get import directory.
Definition at line 135 of file class.ilDataSet.php.
Referenced by ilBibliographicDataSet\importLibraryFile(), ilHTMLLearningModuleDataSet\importRecord(), ilScorm2004DataSet\importRecord(), ilPortfolioDataSet\importRecord(), ilPollDataSet\importRecord(), ilBlogDataSet\importRecord(), ilUserDataSet\importRecord(), ilMediaObjectDataSet\importRecord(), ilStyleDataSet\importRecord(), and ilExerciseDataSet\importRecord().
ilDataSet::getJsonEntityName | ( | $a_entity, | |
$a_version | |||
) |
Get entity name for json (may be overwritten)
Definition at line 525 of file class.ilDataSet.php.
Referenced by getJsonRepresentation().
ilDataSet::getJsonRecord | ( | $a_set | ) |
Get json record for version.
array | abstract data record |
Definition at line 474 of file class.ilDataSet.php.
Referenced by getJsonRepresentation().
|
final |
Get json representation.
Definition at line 221 of file class.ilDataSet.php.
References $d, $version, array, data, ilJsonUtil\encode(), getJsonEntityName(), getJsonRecord(), and getJsonTypes().
ilDataSet::getJsonTypes | ( | $a_entity, | |
$a_version | |||
) |
Get json types.
Definition at line 494 of file class.ilDataSet.php.
References getTypes().
Referenced by getJsonRepresentation().
ilDataSet::getNamespaces | ( | & | $namespaces, |
$a_entity, | |||
$a_schema_version | |||
) |
Get xml namespaces.
array | namespaces per entity |
string | entity |
string | target release |
Definition at line 442 of file class.ilDataSet.php.
References $w, and getXmlNamespace().
Referenced by getXmlRepresentation().
|
abstract |
Get supported version.
Referenced by init().
|
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!
Referenced by getJsonTypes(), getXmlTypes(), and init().
ilDataSet::getXMLEntityName | ( | $a_entity, | |
$a_version | |||
) |
Get entity name for xml (may be overwritten)
Definition at line 505 of file class.ilDataSet.php.
ilDataSet::getXMLEntityTag | ( | $a_entity, | |
$a_schema_version | |||
) |
Get entity tag.
Definition at line 516 of file class.ilDataSet.php.
References convertToLeadingUpper().
|
abstractprotected |
Get xml namespace.
Referenced by getNamespaces(), and init().
ilDataSet::getXmlRecord | ( | $a_entity, | |
$a_version, | |||
$a_set | |||
) |
Get xml record for version.
array | abstract data record |
Definition at line 463 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 263 of file class.ilDataSet.php.
References addRecordsXml(), addTypesXml(), array, getDSPrefixString(), and getNamespaces().
ilDataSet::getXmlTypes | ( | $a_entity, | |
$a_version | |||
) |
Get xml types.
Definition at line 484 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 70 of file class.ilDataSet.php.
References array, data, getSupportedVersions(), getTypes(), getXmlNamespace(), and readData().
|
protected |
Parse export id.
string | $a_id | |
int | $a_fallback_id |
Definition at line 589 of file class.ilDataSet.php.
References $id, $type, ilObject\_getIdForImportId(), ilObject\_lookupType(), and array.
Referenced by ilBlogDataSet\importRecord().
|
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(), and init().
ilDataSet::setCurrentInstallationId | ( | $a_val | ) |
Set current installation id.
string | $a_val | current installation id |
Definition at line 555 of file class.ilDataSet.php.
ilDataSet::setDSPrefix | ( | $a_val | ) |
Set XML dataset namespace prefix.
string | XML dataset namespace prefix |
Definition at line 145 of file class.ilDataSet.php.
ilDataSet::setExportDirectories | ( | $a_relative, | |
$a_absolute | |||
) |
ilDataSet::setImport | ( | $a_val | ) |
Set import object.
object | import object |
Definition at line 535 of file class.ilDataSet.php.
ilDataSet::setImportDirectory | ( | $a_val | ) |
Set import directory.
string | import directory |
Definition at line 125 of file class.ilDataSet.php.
|
protected |
Definition at line 27 of file class.ilDataSet.php.
Referenced by getCurrentInstallationId().
|
protected |
Definition at line 40 of file class.ilDataSet.php.
Referenced by ilSurveyDataSet\getDependencies(), ilSkillDataSet\getDependencies(), getDirectDataFromQuery(), ilScorm2004DataSet\readData(), ilExternalFeedDataSet\readData(), ilHTMLLearningModuleDataSet\readData(), ilRatingDataSet\readData(), ilNewsDataSet\readData(), ilNotesDataSet\readData(), ilHelpDataSet\readData(), ilItemGroupDataSet\readData(), ilMediaCastDataSet\readData(), ilPortfolioDataSet\readData(), ilSurveyDataSet\readData(), ilObjectDataSet\readData(), ilBookmarkDataSet\readData(), ilCOPageDataSet\readData(), ilPollDataSet\readData(), ilTaxonomyDataSet\readData(), ilGlossaryDataSet\readData(), ilBlogDataSet\readData(), ilMediaPoolDataSet\readData(), ilWikiDataSet\readData(), ilMediaObjectDataSet\readData(), ilStyleDataSet\readData(), ilLearningModuleDataSet\readData(), ilSkillDataSet\readData(), and ilExerciseDataSet\readData().
ilDataSet::$dircnt |
Definition at line 26 of file class.ilDataSet.php.
Referenced by addRecordsXml().
|
protected |
Definition at line 45 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID = 6 |
Definition at line 34 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_LOCAL = 2 |
Definition at line 30 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_LOCAL_INVALID = 3 |
Definition at line 31 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_REMOTE = 4 |
Definition at line 32 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_REMOTE_INVALID = 5 |
Definition at line 33 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_INVALID = 7 |
Definition at line 35 of file class.ilDataSet.php.
const ilDataSet::EXPORT_NO_INST_ID = 1 |
Definition at line 29 of file class.ilDataSet.php.