ILIAS  trunk Revision v11.0_alpha-1838-g59fc79e306b
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
 getXmlRepresentation (string $a_entity, string $a_schema_version, string $a_id)
 
 getValidSchemaVersions (string $a_entity)
 
- 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)
 

Protected Attributes

ILIAS Glossary Metadata MetadataManager $metadata
 
- Protected Attributes inherited from ilXmlExporter
ilExport $exp
 

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="")
 

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 143 of file class.ilGlossaryExporter.php.

References $ref_id, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilObject\_getAllReferences(), and ilAdvancedMDRecord\getObjRecSelection().

Referenced by getXmlExportTailDependencies().

143  : array
144  {
145  $active = [];
146  foreach (ilObject::_getAllReferences($a_id) as $ref_id) {
147  foreach ($this->metadata->getActiveAdvMDRecords($ref_id) as $rec) {
148  $active[$rec->getRecordId()] = $rec;
149  }
150  }
151  return $active;
152 
153  $active = array();
154  // selected globals
155  $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "term");
156 
157  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("glo", "term") as $record_obj) {
158  // local ones and globally activated for the object
159  if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
160  $active[] = $record_obj->getRecordId();
161  }
162  }
163 
164  return $active;
165  }
static _getActivatedRecordsByObjectType(string $a_obj_type, string $a_sub_type="", bool $a_only_optional=false)
Get activated records by object type.
static _getAllReferences(int $id)
get all reference ids for object ID
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValidSchemaVersions()

ilGlossaryExporter::getValidSchemaVersions ( string  $a_entity)

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

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

◆ getXmlExportTailDependencies()

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

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

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

43  : array {
44  if ($a_entity == "glo") {
45  // definition related ids
46  $page_ids = array();
47  foreach ($a_ids as $id) {
48  // workaround for #0023923
49  $all_refs = ilObject::_getAllReferences($id);
50  $ref_id = current($all_refs);
51 
52  // see #29014, we include referenced terms in the export as well
54  [$ref_id],
55  "",
56  "",
57  "",
58  0,
59  false,
60  null,
61  true
62  );
63 
64  foreach ($terms as $t) {
65  $page_ids[] = "term:" . $t["id"];
66  }
67  }
68  // definition pages and their metadat
69  $deps = array(
70  array(
71  "component" => "components/ILIAS/COPage",
72  "entity" => "pg",
73  "ids" => $page_ids)
74  );
75 
76  // taxonomy
77  $tax_ids = array();
78  foreach ($a_ids as $id) {
79  $t_ids = ilObjTaxonomy::getUsageOfObject((int) $id);
80  if (count($t_ids) > 0) {
81  $tax_ids[$t_ids[0]] = $t_ids[0];
82  }
83  }
84  if (count($tax_ids)) {
85  $deps[] = array(
86  "component" => "components/ILIAS/Taxonomy",
87  "entity" => "tax",
88  "ids" => $tax_ids
89  );
90  }
91 
92  // advanced metadata
93  $advmd_ids = array();
94  foreach ($a_ids as $id) {
95  $rec_ids = $this->getActiveAdvMDRecords($id);
96  if (count($rec_ids)) {
97  foreach ($rec_ids as $rec_id) {
98  $advmd_ids[] = $id . ":" . $rec_id->getRecordId();
99  }
100  }
101  }
102  if (count($advmd_ids)) {
103  $deps[] = array(
104  "component" => "components/ILIAS/AdvancedMetaData",
105  "entity" => "advmd",
106  "ids" => $advmd_ids
107  );
108  }
109 
110  // style
111  $obj_ids = (is_array($a_ids))
112  ? $a_ids
113  : array($a_ids);
114  $deps[] = array(
115  "component" => "components/ILIAS/Style",
116  "entity" => "object_style",
117  "ids" => $obj_ids
118  );
119 
120  // service settings
121  $deps[] = array(
122  "component" => "components/ILIAS/ILIASObject",
123  "entity" => "common",
124  "ids" => $a_ids);
125 
126  $md_ids = [];
127  foreach ($a_ids as $crs_id) {
128  $md_ids[] = $crs_id . ":0:glo";
129  }
130  if ($md_ids !== []) {
131  $deps[] = [
132  "component" => "components/ILIAS/MetaData",
133  "entity" => "md",
134  "ids" => $md_ids
135  ];
136  }
137 
138  return $deps;
139  }
140  return array();
141  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getUsageOfObject(int $a_obj_id, bool $a_include_titles=false)
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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getXmlRepresentation()

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

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

171  : string {
172  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id], "", true, true);
173  }

◆ init()

ilGlossaryExporter::init ( )

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

References $DIC.

29  : void
30  {
31  global $DIC;
32 
33  $this->ds = new ilGlossaryDataSet();
34  $this->ds->initByExporter($this);
35  $this->ds->setDSPrefix("ds");
36  $this->metadata = $DIC->glossary()->internal()->domain()->metadata();
37  }
global $DIC
Definition: shib_login.php:22
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.

◆ $metadata

ILIAS Glossary Metadata MetadataManager ilGlossaryExporter::$metadata
protected

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


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