ILIAS  release_8 Revision v8.24
ilGlossaryExporter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilGlossaryExporter:
+ Collaboration diagram for ilGlossaryExporter:

Public Member Functions

 init ()
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
- Public Member Functions inherited from ilXmlExporter
 __construct ()
 
 setExport (ilExport $a_exp)
 
 getExport ()
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 init ()
 
 setExportDirectories (string $a_dir_relative, string $a_dir_absolute)
 
 getRelativeExportDirectory ()
 
 getAbsoluteExportDirectory ()
 
 getXmlExportHeadDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get head dependencies. More...
 
 getXmlExportTailDependencies (string $a_entity, string $a_target_release, array $a_ids)
 Get tail dependencies. More...
 
 getValidSchemaVersions (string $a_entity)
 Returns schema versions that the component can export to. More...
 
 determineSchemaVersion (string $a_entity, string $a_target_release)
 

Protected Member Functions

 getActiveAdvMDRecords (int $a_id)
 

Private Attributes

ilGlossaryDataSet $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory (string $a_obj_type, int $a_obj_id, string $a_export_type='xml', string $a_entity="")
 
- Protected Attributes inherited from ilXmlExporter
string $dir_relative = ""
 
string $dir_absolute = ""
 
ilExport $exp
 

Detailed Description

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 Glossary XML export

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilGlossaryExporter.php.

Member Function Documentation

◆ getActiveAdvMDRecords()

ilGlossaryExporter::getActiveAdvMDRecords ( int  $a_id)
protected

Definition at line 154 of file class.ilGlossaryExporter.php.

154 : array
155 {
156 $active = array();
157 // selected globals
158 $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "term");
159
160 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("glo", "term") as $record_obj) {
161 // local ones and globally activated for the object
162 if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
163 $active[] = $record_obj->getRecordId();
164 }
165 }
166
167 return $active;
168 }
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), and ilAdvancedMDRecord\getObjRecSelection().

Referenced by getXmlExportTailDependencies().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilGlossaryExporter::getValidSchemaVersions ( string  $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. Example: return array ( "4.1.0" => array( "namespace" => "http://www.ilias.de/Services/MetaData/md/4_1", "xsd_file" => "ilias_md_4_1.xsd", "min" => "4.1.0", "max" => "") );

Reimplemented from ilXmlExporter.

Definition at line 178 of file class.ilGlossaryExporter.php.

178 : array
179 {
180 return array(
181 "5.4.0" => array(
182 "namespace" => "https://www.ilias.de/Modules/Glossary/htlm/5_4",
183 "xsd_file" => "ilias_glo_5_4.xsd",
184 "uses_dataset" => true,
185 "min" => "5.4.0",
186 "max" => ""),
187 "5.1.0" => array(
188 "namespace" => "https://www.ilias.de/Modules/Glossary/htlm/5_1",
189 "xsd_file" => "ilias_glo_5_1.xsd",
190 "uses_dataset" => true,
191 "min" => "5.1.0",
192 "max" => ""),
193 "4.1.0" => array(
194 "namespace" => "https://www.ilias.de/Modules/Glossary/htlm/4_1",
195 "xsd_file" => "ilias_glo_4_1.xsd",
196 "uses_dataset" => false,
197 "min" => "4.1.0",
198 "max" => "")
199 );
200 }

◆ getXmlExportTailDependencies()

ilGlossaryExporter::getXmlExportTailDependencies ( string  $a_entity,
string  $a_target_release,
array  $a_ids 
)

Get tail dependencies.

Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

Definition at line 35 of file class.ilGlossaryExporter.php.

39 : array {
40 if ($a_entity == "glo") {
41 $md_ids = array();
42
43 // glo related ids
44 foreach ($a_ids as $id) {
45 $md_ids[] = $id . ":0:glo";
46 }
47
48 // definition related ids
49 $page_ids = array();
50 foreach ($a_ids as $id) {
51 // workaround for #0023923
53 $ref_id = current($all_refs);
54
55 // see #29014, we include referenced terms in the export as well
57 [$ref_id],
58 "",
59 "",
60 "",
61 0,
62 false,
63 null,
64 true
65 );
66
67 foreach ($terms as $t) {
69 foreach ($defs as $d) {
70 $page_ids[] = "gdf:" . $d["id"];
71 $md_ids[] = $id . ":" . $d["id"] . ":gdf";
72 }
73 }
74 }
75 // definition pages and their metadat
76 $deps = array(
77 array(
78 "component" => "Services/COPage",
79 "entity" => "pg",
80 "ids" => $page_ids),
81 array(
82 "component" => "Services/MetaData",
83 "entity" => "md",
84 "ids" => $md_ids),
85 );
86
87 // taxonomy
88 $tax_ids = array();
89 foreach ($a_ids as $id) {
91 if (count($t_ids) > 0) {
92 $tax_ids[$t_ids[0]] = $t_ids[0];
93 }
94 }
95 if (count($tax_ids)) {
96 $deps[] = array(
97 "component" => "Services/Taxonomy",
98 "entity" => "tax",
99 "ids" => $tax_ids
100 );
101 }
102
103 // advanced metadata
104 $advmd_ids = array();
105 foreach ($a_ids as $id) {
106 $rec_ids = $this->getActiveAdvMDRecords($id);
107 if (count($rec_ids)) {
108 foreach ($rec_ids as $rec_id) {
109 $advmd_ids[] = $id . ":" . $rec_id;
110 }
111 }
112 }
113 if (count($advmd_ids)) {
114 $deps[] = array(
115 "component" => "Services/AdvancedMetaData",
116 "entity" => "advmd",
117 "ids" => $advmd_ids
118 );
119 }
120
121 // style
122 $obj_ids = (is_array($a_ids))
123 ? $a_ids
124 : array($a_ids);
125 $deps[] = array(
126 "component" => "Services/Style",
127 "entity" => "object_style",
128 "ids" => $obj_ids
129 );
130
131 // service settings
132 $deps[] = array(
133 "component" => "Services/Object",
134 "entity" => "common",
135 "ids" => $a_ids);
136
137 $md_ids = [];
138 foreach ($a_ids as $crs_id) {
139 $md_ids[] = $crs_id . ":0:glo";
140 }
141 if ($md_ids !== []) {
142 $deps[] = [
143 "component" => "Services/MetaData",
144 "entity" => "md",
145 "ids" => $md_ids
146 ];
147 }
148
149 return $deps;
150 }
151 return array();
152 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getDefinitionList(int $a_term_id)
static getTermList(array $a_glo_ref_id, string $searchterm="", string $a_first_letter="", string $a_def="", int $a_tax_node=0, bool $a_add_amet_fields=false, array $a_amet_filter=null, bool $a_include_references=false)
Get all terms for given set of glossary ids.
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
static _getAllReferences(int $id)
get all reference ids for object ID
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$ref_id
Definition: ltiauth.php:67

References $d, $id, $ref_id, ilObject\_getAllReferences(), getActiveAdvMDRecords(), ilGlossaryDefinition\getDefinitionList(), ilGlossaryTerm\getTermList(), and ilObjTaxonomy\getUsageOfObject().

+ Here is the call graph for this function:

◆ getXmlRepresentation()

ilGlossaryExporter::getXmlRepresentation ( string  $a_entity,
string  $a_schema_version,
string  $a_id 
)

Reimplemented from ilXmlExporter.

Definition at line 170 of file class.ilGlossaryExporter.php.

174 : string {
175 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
176 }

◆ init()

ilGlossaryExporter::init ( )

Reimplemented from ilXmlExporter.

Definition at line 28 of file class.ilGlossaryExporter.php.

28 : void
29 {
30 $this->ds = new ilGlossaryDataSet();
31 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
32 $this->ds->setDSPrefix("ds");
33 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Field Documentation

◆ $ds

ilGlossaryDataSet ilGlossaryExporter::$ds
private

Definition at line 26 of file class.ilGlossaryExporter.php.


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