ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilGlossaryExporter Class Reference

Exporter class for html learning modules. 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

Exporter class for html learning modules.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id

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

Member Function Documentation

◆ getActiveAdvMDRecords()

ilGlossaryExporter::getActiveAdvMDRecords (   $a_id)
protected

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

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

Referenced by getXmlExportTailDependencies().

145  {
146  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
147  $active = array();
148  // selected globals
149  $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "term");
150 
151  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("glo", "term") as $record_obj) {
152  // local ones and globally activated for the object
153  if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
154  $active[] = $record_obj->getRecordId();
155  }
156  }
157 
158  return $active;
159  }
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="", $a_only_optional=false)
Get activated records by object type.
static getObjRecSelection($a_obj_id, $a_sub_type="")
Get repository object record selection.
+ 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

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

189  {
190  return array(
191  "5.4.0" => array(
192  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/5_4",
193  "xsd_file" => "ilias_glo_5_4.xsd",
194  "uses_dataset" => true,
195  "min" => "5.4.0",
196  "max" => ""),
197  "5.1.0" => array(
198  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/5_1",
199  "xsd_file" => "ilias_glo_5_1.xsd",
200  "uses_dataset" => true,
201  "min" => "5.1.0",
202  "max" => ""),
203  "4.1.0" => array(
204  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/4_1",
205  "xsd_file" => "ilias_glo_4_1.xsd",
206  "uses_dataset" => false,
207  "min" => "4.1.0",
208  "max" => "")
209  );
210  }

◆ 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"

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

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

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

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

170  {
171  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
172 
173  /*include_once './Modules/Glossary/classes/class.ilObjGlossary.php';
174  $glo = new ilObjGlossary($a_id,false);
175 
176  include_once './Modules/Glossary/classes/class.ilGlossaryExport.php';
177  $exp = new ilGlossaryExport($glo,'xml');
178  $zip = $exp->buildExportFile();*/
179  }

◆ init()

ilGlossaryExporter::init ( )

Initialisation.

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

21  {
22  include_once("./Modules/Glossary/classes/class.ilGlossaryDataSet.php");
23  $this->ds = new ilGlossaryDataSet();
24  $this->ds->setExportDirectories($this->dir_relative, $this->dir_absolute);
25  $this->ds->setDSPrefix("ds");
26  }
Glossary Data set class.

Field Documentation

◆ $ds

ilGlossaryExporter::$ds
private

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


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