ILIAS
release_8 Revision v8.19
|
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...
Public Member Functions | |
__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... | |
setExportDirectories (string $a_relative, string $a_absolute) | |
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... | |
Data Fields | |
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 |
Protected Member Functions | |
getTypes (string $a_entity, string $a_version) | |
Get (abstract) types for (abstract) field names. More... | |
getXmlNamespace (string $a_entity, string $a_schema_version) | |
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 | |
string | $current_installation_id = "" |
array | $data = [] |
ilDBInterface | $db |
ilLogger | $ds_log |
string | $import_directory = "" |
string | $entity = "" |
string | $schema_version = "" |
string | $relative_export_dir = "" |
string | $absolute_export_dir = "" |
string | $ds_prefix = "ds" |
string | $version = "" |
ilSurveyImporter | $import |
Private Member Functions | |
addTypesXml (ilXmlWriter $a_writer, string $a_entity, string $a_schema_version) | |
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning 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 36 of file class.ilDataSet.php.
ilDataSet::__construct | ( | ) |
Definition at line 60 of file class.ilDataSet.php.
References $DIC, and ilLoggerFactory\getLogger().
ilDataSet::addRecordsXml | ( | ilXmlWriter | $a_writer, |
array | $a_prefixes, | ||
string | $a_entity, | ||
string | $a_schema_version, | ||
array | $a_ids, | ||
?string | $a_field = "" |
||
) |
Definition at line 261 of file class.ilDataSet.php.
References $c, $d, $dircnt, Vendor\Package\$e, Vendor\Package\$f, afterXmlRecordWriting(), getDependencies(), getDSPrefixString(), getXMLEntityName(), getXMLEntityTag(), getXmlRecord(), getXmlTypes(), ilFileUtils\makeDirParents(), ilFileUtils\rCopy(), readData(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().
Referenced by getXmlRepresentation().
|
private |
Definition at line 333 of file class.ilDataSet.php.
References Vendor\Package\$f, getDependencies(), getDSPrefixString(), getXMLEntityName(), getXmlTypes(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().
Referenced by getXmlRepresentation().
ilDataSet::afterXmlRecordWriting | ( | string | $a_entity, |
string | $a_version, | ||
array | $a_set | ||
) |
Definition at line 328 of file class.ilDataSet.php.
Referenced by addRecordsXml().
ilDataSet::convertToLeadingUpper | ( | string | $a_str | ) |
Make xyz_abc a XyzAbc string.
Definition at line 179 of file class.ilDataSet.php.
Referenced by getDirectDataFromQuery(), getXMLEntityTag(), ilUserDataSet\importRecord(), ilMediaPoolDataSet\readData(), and ilLearningModuleDataSet\readData().
|
protected |
Build ilias export id.
Definition at line 432 of file class.ilDataSet.php.
References IL_INST_ID.
Referenced by ilBlogDataSet\readData().
ilDataSet::getCurrentInstallationId | ( | ) |
Definition at line 424 of file class.ilDataSet.php.
References $current_installation_id.
Referenced by ilSurveyDataSet\importRecord(), ilGlossaryDataSet\importRecord(), ilMediaObjectDataSet\importRecord(), ilLearningModuleDataSet\importRecord(), and ilSkillDataSet\importRecord().
|
protected |
Definition at line 318 of file class.ilDataSet.php.
Referenced by addRecordsXml(), addTypesXml(), and getNamespaces().
ilDataSet::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.
Definition at line 148 of file class.ilDataSet.php.
References $db, $ilDB, and convertToLeadingUpper().
Referenced by ilObjectDataSet\getTypes(), ilCmiXapiDataSet\getTypes(), ilHTMLLearningModuleDataSet\readData(), ilRatingDataSet\readData(), ilHelpDataSet\readData(), ilItemGroupDataSet\readData(), ilCOPageDataSet\readData(), ilSurveyDataSet\readData(), ilNewsDataSet\readData(), ilNotesDataSet\readData(), ilMediaCastDataSet\readData(), ilPortfolioDataSet\readData(), ilTaxonomyDataSet\readData(), ilPollDataSet\readData(), ilCalendarDataSet\readData(), ilGlossaryDataSet\readData(), ilMediaPoolDataSet\readData(), ilBlogDataSet\readData(), ilMediaObjectDataSet\readData(), ilUserDataSet\readData(), ilWikiDataSet\readData(), ilSessionDataSet\readData(), ilLearningModuleDataSet\readData(), ilStyleDataSet\readData(), ilSkillDataSet\readData(), and ilExerciseDataSet\readData().
ilDataSet::getDSPrefix | ( | ) |
Definition at line 131 of file class.ilDataSet.php.
References $ds_prefix.
Referenced by getDSPrefixString().
ilDataSet::getDSPrefixString | ( | ) |
Definition at line 136 of file class.ilDataSet.php.
References getDSPrefix().
Referenced by addRecordsXml(), addTypesXml(), and getXmlRepresentation().
ilDataSet::getImport | ( | ) |
Definition at line 414 of file class.ilDataSet.php.
References $import.
Referenced by ilSurveyDataSet\importRecord().
ilDataSet::getImportDirectory | ( | ) |
Definition at line 121 of file class.ilDataSet.php.
References $import_directory.
Referenced by ilObjectDataSet\getDependencies(), ilHTMLLearningModuleDataSet\getXmlRecord(), ilPollDataSet\getXmlRecord(), ilBibliographicDataSet\importLibraryFile(), ilPortfolioDataSet\importRecord(), ilBlogDataSet\importRecord(), ilUserDataSet\importRecord(), ilMediaObjectDataSet\importRecord(), ilStyleDataSet\importRecord(), and ilExerciseDataSet\importRecord().
ilDataSet::getNamespaces | ( | array & | $namespaces, |
string | $a_entity, | ||
string | $a_schema_version | ||
) |
Definition at line 361 of file class.ilDataSet.php.
References getDependencies(), and getXmlNamespace().
Referenced by getXmlRepresentation().
|
abstract |
|
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 getXmlTypes(), and init().
ilDataSet::getXMLEntityName | ( | string | $a_entity, |
string | $a_version | ||
) |
Get entity name for xml (may be overwritten)
Definition at line 396 of file class.ilDataSet.php.
Referenced by addRecordsXml(), and addTypesXml().
ilDataSet::getXMLEntityTag | ( | string | $a_entity, |
string | $a_schema_version | ||
) |
Get entity tag.
Definition at line 404 of file class.ilDataSet.php.
References convertToLeadingUpper().
Referenced by addRecordsXml().
|
abstractprotected |
ilDataSet::getXmlRecord | ( | string | $a_entity, |
string | $a_version, | ||
array | $a_set | ||
) |
Get xml record for version.
array | $a_set | abstract data record |
Definition at line 378 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 212 of file class.ilDataSet.php.
References $entity, addRecordsXml(), addTypesXml(), getDSPrefixString(), getNamespaces(), and IL_INST_ID.
ilDataSet::getXmlTypes | ( | string | $a_entity, |
string | $a_version | ||
) |
Get xml types.
Definition at line 387 of file class.ilDataSet.php.
References getTypes().
Referenced by addRecordsXml(), and addTypesXml().
ilDataSet::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.
Definition at line 495 of file class.ilDataSet.php.
Referenced by ilItemGroupDataSet\getDependencies(), ilObjectDataSet\getDependencies(), ilBibliographicDataSet\getXmlNamespace(), ilDataCollectionDataSet\getXmlNamespace(), ilHTMLLearningModuleDataSet\getXmlRecord(), and ilPollDataSet\getXmlRecord().
|
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 80 of file class.ilDataSet.php.
References getSupportedVersions(), getTypes(), getXmlNamespace(), and readData().
|
protected |
Parse export id.
Definition at line 441 of file class.ilDataSet.php.
References $id, $parts, $type, ilObject\_getIdForImportId(), ilObject\_lookupType(), and IL_INST_ID.
Referenced by ilBlogDataSet\importRecord().
|
abstract |
Read data from DB.
This should result in the abstract field structure of the version set in the constructor.
Referenced by addRecordsXml(), ilCmiXapiDataSet\getDependencies(), ilObjectDataSet\getTypes(), ilCmiXapiDataSet\getTypes(), and init().
ilDataSet::setCurrentInstallationId | ( | string | $a_val | ) |
Definition at line 419 of file class.ilDataSet.php.
ilDataSet::setDSPrefix | ( | string | $a_val | ) |
Definition at line 126 of file class.ilDataSet.php.
ilDataSet::setExportDirectories | ( | string | $a_relative, |
string | $a_absolute | ||
) |
Definition at line 110 of file class.ilDataSet.php.
ilDataSet::setImport | ( | ilSurveyImporter | $a_val | ) |
Definition at line 409 of file class.ilDataSet.php.
ilDataSet::setImportDirectory | ( | string | $a_val | ) |
Definition at line 116 of file class.ilDataSet.php.
|
protected |
Definition at line 504 of file class.ilDataSet.php.
References ilUtil\stripSlashes().
Referenced by ilItemGroupDataSet\getDependencies(), ilHTMLLearningModuleDataSet\getXmlRecord(), ilPollDataSet\getXmlRecord(), ilHelpDataSet\importRecord(), ilRatingDataSet\importRecord(), ilNotesDataSet\importRecord(), ilCOPageDataSet\importRecord(), ilNewsDataSet\importRecord(), ilSurveyDataSet\importRecord(), ilPortfolioDataSet\importRecord(), ilMediaCastDataSet\importRecord(), ilTaxonomyDataSet\importRecord(), ilGlossaryDataSet\importRecord(), ilMediaPoolDataSet\importRecord(), ilBlogDataSet\importRecord(), ilWikiDataSet\importRecord(), ilMediaObjectDataSet\importRecord(), ilLearningModuleDataSet\importRecord(), ilStyleDataSet\importRecord(), and ilExerciseDataSet\importRecord().
|
protected |
Definition at line 55 of file class.ilDataSet.php.
|
protected |
Definition at line 47 of file class.ilDataSet.php.
Referenced by getCurrentInstallationId().
|
protected |
Definition at line 48 of file class.ilDataSet.php.
Referenced by ilIndividualAssessmentDataSet\_readData(), ilBibliographicDataSet\_readData(), ilDataCollectionDataSet\_readData(), ilDataCollectionDataSet\buildCache(), and ilCmiXapiDataSet\getTypes().
|
protected |
Definition at line 49 of file class.ilDataSet.php.
Referenced by ilSurveyDataSet\getDependencies(), ilSkillDataSet\getDependencies(), getDirectDataFromQuery(), ilHTMLLearningModuleDataSet\readData(), ilRatingDataSet\readData(), ilScorm2004DataSet\readData(), ilHelpDataSet\readData(), ilItemGroupDataSet\readData(), ilCOPageDataSet\readData(), ilSurveyDataSet\readData(), ilNewsDataSet\readData(), ilNotesDataSet\readData(), ilMediaCastDataSet\readData(), ilPortfolioDataSet\readData(), ilTaxonomyDataSet\readData(), ilPollDataSet\readData(), ilGlossaryDataSet\readData(), ilMediaPoolDataSet\readData(), ilBlogDataSet\readData(), ilMediaObjectDataSet\readData(), ilWikiDataSet\readData(), ilSessionDataSet\readData(), ilLearningModuleDataSet\readData(), ilStyleDataSet\readData(), ilSkillDataSet\readData(), and ilExerciseDataSet\readData().
int ilDataSet::$dircnt = 0 |
Definition at line 46 of file class.ilDataSet.php.
Referenced by addRecordsXml().
|
protected |
Definition at line 50 of file class.ilDataSet.php.
|
protected |
Definition at line 56 of file class.ilDataSet.php.
Referenced by getDSPrefix().
|
protected |
Definition at line 52 of file class.ilDataSet.php.
Referenced by ilObjectDataSet\getTypes(), ilObjectDataSet\getXmlNamespace(), getXmlRepresentation(), and ilContentPageDataSet\readData().
|
protected |
Definition at line 58 of file class.ilDataSet.php.
Referenced by getImport().
|
protected |
Definition at line 51 of file class.ilDataSet.php.
Referenced by getImportDirectory().
|
protected |
Definition at line 54 of file class.ilDataSet.php.
|
protected |
Definition at line 53 of file class.ilDataSet.php.
Referenced by ilObjectDataSet\getDependencies().
|
protected |
Definition at line 57 of file class.ilDataSet.php.
Referenced by ilObjectDataSet\getTypes().
const ilDataSet::EXPORT_ID = 6 |
Definition at line 43 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_LOCAL = 2 |
Definition at line 39 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_LOCAL_INVALID = 3 |
Definition at line 40 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_REMOTE = 4 |
Definition at line 41 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_ILIAS_REMOTE_INVALID = 5 |
Definition at line 42 of file class.ilDataSet.php.
const ilDataSet::EXPORT_ID_INVALID = 7 |
Definition at line 44 of file class.ilDataSet.php.
const ilDataSet::EXPORT_NO_INST_ID = 1 |
Definition at line 38 of file class.ilDataSet.php.