ILIAS  release_7 Revision v7.30-3-g800a261c036
ilGlossaryExporter Class Reference

Glossary XML export. More...

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

Public Member Functions

 init ()
 Initialisation. 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...
 
- Public Member Functions inherited from ilXmlExporter
 __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...
 

Protected Member Functions

 getActiveAdvMDRecords ($a_id)
 

Private Attributes

 $ds
 

Additional Inherited Members

- Static Public Member Functions inherited from ilXmlExporter
static lookupExportDirectory ($a_obj_type, $a_obj_id, $a_export_type='xml', $a_entity="")
 export directory lookup More...
 
- Protected Attributes inherited from ilXmlExporter
 $dir_relative
 
 $dir_absolute
 
 $exp
 

Detailed Description

Glossary XML export.

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

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

Member Function Documentation

◆ getActiveAdvMDRecords()

ilGlossaryExporter::getActiveAdvMDRecords (   $a_id)
protected

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

138 {
139 $active = array();
140 // selected globals
141 $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "term");
142
143 foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("glo", "term") as $record_obj) {
144 // local ones and globally activated for the object
145 if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
146 $active[] = $record_obj->getRecordId();
147 }
148 }
149
150 return $active;
151 }
static getObjRecSelection($a_obj_id, $a_sub_type="")
Get repository object record selection.
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $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 (   $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

Reimplemented from ilXmlExporter.

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

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

◆ getXmlExportTailDependencies()

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

Get tail dependencies.

Parameters
stringentity
stringtarget release
arrayids
Returns
array array of array with keys "component", entity", "ids"

Reimplemented from ilXmlExporter.

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

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

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

+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

Get xml representation.

Parameters
stringentity
stringtarget release
stringid
Returns
string xml string

Reimplemented from ilXmlExporter.

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

162 {
163 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
164 }

◆ init()

ilGlossaryExporter::init ( )

Initialisation.

Reimplemented from ilXmlExporter.

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

19 {
20 $this->ds = new ilGlossaryDataSet();
21 $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
22 $this->ds->setDSPrefix("ds");
23 }
Glossary Data set class.

Field Documentation

◆ $ds

ilGlossaryExporter::$ds
private

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


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