Export class for adv md.
More...
|
| init () |
| Initialisation. More...
|
|
| getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids) |
| Get head dependencies. More...
|
|
| getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids) |
| Get tail dependencies. More...
|
|
| getXmlRepresentation ($a_entity, $a_schema_version, $a_id) |
| Get xml representation. More...
|
|
| getValidSchemaVersions ($a_entity) |
| Returns schema versions that the component can export to. More...
|
|
| __construct () |
| Constructor. More...
|
|
| setExport (ilExport $a_exp) |
| Set export object. More...
|
|
| getExport () |
| Get export. More...
|
|
| getXmlRepresentation ($a_entity, $a_schema_version, $a_id) |
| Get xml representation. More...
|
|
| init () |
|
| setExportDirectories ($a_dir_relative, $a_dir_absolute) |
| Export directories. More...
|
|
| getRelativeExportDirectory () |
| Get relative export directory. More...
|
|
| getAbsoluteExportDirectory () |
| Get absolute export directory. More...
|
|
| getXmlExportHeadDependencies ($a_entity, $a_target_release, $a_ids) |
| Get head dependencies. More...
|
|
| getXmlExportTailDependencies ($a_entity, $a_target_release, $a_ids) |
| Get tail dependencies. More...
|
|
| getValidSchemaVersions ($a_entity) |
| Returns schema versions that the component can export to. More...
|
|
| determineSchemaVersion ($a_entity, $a_target_release) |
| Determine schema version. More...
|
|
◆ getValidSchemaVersions()
ilAdvancedMetaDataExporter::getValidSchemaVersions |
( |
|
$a_entity | ) |
|
Returns schema versions that the component can export to.
ILIAS chooses the first one, that has min/max constraints which fit to the target release. Please put the newest on top.
- Returns
Definition at line 170 of file class.ilAdvancedMetaDataExporter.php.
174 "namespace" =>
"http://www.ilias.de/Services/AdvancedMetaData/advmd/4_4",
175 "xsd_file" =>
"ilias_advmd_4_4.xsd",
176 "uses_dataset" =>
true,
◆ getXmlExportHeadDependencies()
ilAdvancedMetaDataExporter::getXmlExportHeadDependencies |
( |
|
$a_entity, |
|
|
|
$a_target_release, |
|
|
|
$a_ids |
|
) |
| |
Get head dependencies.
- Parameters
-
string | entity |
string | target release |
array | ids |
- Returns
- array array of array with keys "component", entity", "ids"
Definition at line 34 of file class.ilAdvancedMetaDataExporter.php.
◆ getXmlExportTailDependencies()
ilAdvancedMetaDataExporter::getXmlExportTailDependencies |
( |
|
$a_entity, |
|
|
|
$a_target_release, |
|
|
|
$a_ids |
|
) |
| |
Get tail dependencies.
- Parameters
-
string | entity |
string | target release |
array | ids |
- Returns
- array array of array with keys "component", entity", "ids"
Definition at line 48 of file class.ilAdvancedMetaDataExporter.php.
◆ getXmlRepresentation()
ilAdvancedMetaDataExporter::getXmlRepresentation |
( |
|
$a_entity, |
|
|
|
$a_schema_version, |
|
|
|
$a_id |
|
) |
| |
Get xml representation.
- Parameters
-
string | entity |
string | schema version |
string | id |
- Returns
- string xml string
Definition at line 61 of file class.ilAdvancedMetaDataExporter.php.
References $def, $xml, and ilAdvancedMDValues\findByObjectId().
63 $parts = explode(
":", $a_id);
64 if (
sizeof($parts) != 2) {
71 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
79 foreach ($raw as $item) {
80 $sub_items[$item[
"sub_type"]][] = $item[
"sub_id"];
85 foreach ($sub_items as $sub_type => $sub_ids) {
86 foreach (array_unique($sub_ids) as $sub_id) {
88 $defs = $values_record->getDefinitions();
89 $values_record->read();
90 foreach ($values_record->getADTGroup()->getElements() as $element_id => $element) {
91 if (!$element->isNull()) {
92 $def = $defs[$element_id];
93 $items[$rec_id][] = array(
94 'id' =>
$def->generateImportId(
$def->getFieldId()),
95 'sub_type' => $sub_type,
97 'value' =>
$def->getValueForXML($element)
105 $local_recs = array();
107 if ($rec_obj->getParentObject()) {
109 $rec_obj->toXML(
$xml);
112 $local_recs[$rec_obj->getRecordId()] = base64_encode(
$xml);
116 if (
sizeof($items)) {
119 foreach ($items as $record_id => $record_items) {
120 $xml->xmlStartTag(
'AdvancedMetaData');
122 $is_local = array_key_exists($record_id, $local_recs);
127 if (!array_key_exists($record_id, self::$local_recs_done)) {
130 array(
'local_id' => $record_id),
131 $local_recs[$record_id]
134 self::$local_recs_done[] = $record_id;
138 foreach ($record_items as $item) {
141 'sub_type' => $item[
'sub_type'],
142 'sub_id' => $item[
'sub_id']
146 $att[
'local_rec_id'] = $record_id;
156 $xml->xmlEndTag(
'AdvancedMetaData');
159 return $xml->xmlDumpMem(
false);
static findByObjectId($a_obj_id)
Find all entries for object (regardless of sub-type/sub-id)
◆ init()
ilAdvancedMetaDataExporter::init |
( |
| ) |
|
◆ $ds
ilAdvancedMetaDataExporter::$ds |
|
private |
◆ $local_recs_done
ilAdvancedMetaDataExporter::$local_recs_done = array() |
|
staticprivate |
The documentation for this class was generated from the following file: