ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 132 of file class.ilGlossaryExporter.php.

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

Referenced by getXmlExportTailDependencies().

133  {
134  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
135  $active = array();
136  // selected globals
137  $sel_globals = ilAdvancedMDRecord::getObjRecSelection($a_id, "term");
138 
139  foreach (ilAdvancedMDRecord::_getActivatedRecordsByObjectType("glo", "term") as $record_obj) {
140  // local ones and globally activated for the object
141  if ($record_obj->getParentObject() == $a_id || in_array($record_obj->getRecordId(), $sel_globals)) {
142  $active[] = $record_obj->getRecordId();
143  }
144  }
145 
146  return $active;
147  }
Create styles array
The data for the language used.
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 176 of file class.ilGlossaryExporter.php.

References array.

177  {
178  return array(
179  "5.1.0" => array(
180  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/4_1",
181  "xsd_file" => "ilias_glo_5_1.xsd",
182  "uses_dataset" => true,
183  "min" => "5.1.0",
184  "max" => ""),
185  "4.1.0" => array(
186  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/4_1",
187  "xsd_file" => "ilias_glo_4_1.xsd",
188  "uses_dataset" => false,
189  "min" => "4.1.0",
190  "max" => "")
191  );
192  }
Create styles array
The data for the language used.

◆ 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(), array, 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  $terms = ilGlossaryTerm::getTermList($ref_id);
56  foreach ($terms as $t) {
58  foreach ($defs as $d) {
59  $page_ids[] = "gdf:" . $d["id"];
60  $md_ids[] = $id . ":" . $d["id"] . ":gdf";
61  }
62  }
63  }
64  // definition pages and their metadat
65  $deps = array(
66  array(
67  "component" => "Services/COPage",
68  "entity" => "pg",
69  "ids" => $page_ids),
70  array(
71  "component" => "Services/MetaData",
72  "entity" => "md",
73  "ids" => $md_ids),
74  );
75 
76  // taxonomy
77  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
78  $tax_ids = array();
79  foreach ($a_ids as $id) {
80  $t_ids = ilObjTaxonomy::getUsageOfObject($id);
81  if (count($t_ids) > 0) {
82  $tax_ids[$t_ids[0]] = $t_ids[0];
83  }
84  }
85  if (sizeof($tax_ids)) {
86  $deps[] = array(
87  "component" => "Services/Taxonomy",
88  "entity" => "tax",
89  "ids" => $tax_ids
90  );
91  }
92 
93  // advanced metadata
94  $advmd_ids = array();
95  foreach ($a_ids as $id) {
96  $rec_ids = $this->getActiveAdvMDRecords($id);
97  if (sizeof($rec_ids)) {
98  foreach ($rec_ids as $rec_id) {
99  $advmd_ids[] = $id . ":" . $rec_id;
100  }
101  }
102  }
103  if (sizeof($advmd_ids)) {
104  $deps[] = array(
105  "component" => "Services/AdvancedMetaData",
106  "entity" => "advmd",
107  "ids" => $advmd_ids
108  );
109  }
110 
111  // style
112  $obj_ids = (is_array($a_ids))
113  ? $a_ids
114  : array($a_ids);
115  $deps[] = array(
116  "component" => "Services/Style",
117  "entity" => "object_style",
118  "ids" => $obj_ids
119  );
120 
121  // service settings
122  $deps[] = array(
123  "component" => "Services/Object",
124  "entity" => "service_settings",
125  "ids" => $a_ids);
126 
127  return $deps;
128  }
129  return array();
130  }
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.
Create styles array
The data for the language used.
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 157 of file class.ilGlossaryExporter.php.

158  {
159  return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, $a_id, "", true, true);
160 
161  /*include_once './Modules/Glossary/classes/class.ilObjGlossary.php';
162  $glo = new ilObjGlossary($a_id,false);
163 
164  include_once './Modules/Glossary/classes/class.ilGlossaryExport.php';
165  $exp = new ilGlossaryExport($glo,'xml');
166  $zip = $exp->buildExportFile();*/
167  }

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