ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 141 of file class.ilGlossaryExporter.php.

References ilAdvancedMDRecord\_getSelectedRecordsByObject(), and array.

Referenced by getXmlExportTailDependencies().

142  {
143  $active = array();
144 
145  include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
146  foreach(ilAdvancedMDRecord::_getSelectedRecordsByObject("glo", $a_id, "term") as $record_obj)
147  {
148  $active[] = $record_obj->getRecordId();
149  }
150 
151  return $active;
152  }
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
Create styles array
The data for the language used.
+ 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 181 of file class.ilGlossaryExporter.php.

References array.

182  {
183  return array (
184  "5.1.0" => array(
185  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/4_1",
186  "xsd_file" => "ilias_glo_5_1.xsd",
187  "uses_dataset" => true,
188  "min" => "5.1.0",
189  "max" => ""),
190  "4.1.0" => array(
191  "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/4_1",
192  "xsd_file" => "ilias_glo_4_1.xsd",
193  "uses_dataset" => false,
194  "min" => "4.1.0",
195  "max" => "")
196  );
197  }
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, $t, array, getActiveAdvMDRecords(), ilGlossaryDefinition\getDefinitionList(), ilGlossaryTerm\getTermList(), and ilObjTaxonomy\getUsageOfObject().

37  {
38  if ($a_entity == "glo")
39  {
40  include_once("./Modules/Glossary/classes/class.ilGlossaryTerm.php");
41  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
42 
43  $md_ids = array();
44 
45  // glo related ids
46  foreach ($a_ids as $id)
47  {
48  $md_ids[] = $id.":0:glo";
49  }
50 
51  // definition related ids
52  $page_ids = array();
53  foreach ($a_ids as $id)
54  {
55  $terms = ilGlossaryTerm::getTermList($id);
56  foreach ($terms as $t)
57  {
59  foreach ($defs as $d)
60  {
61  $page_ids[] = "gdf:".$d["id"];
62  $md_ids[] = $id.":".$d["id"].":gdf";
63  }
64  }
65  }
66  // definition pages and their metadat
67  $deps = array (
68  array(
69  "component" => "Services/COPage",
70  "entity" => "pg",
71  "ids" => $page_ids),
72  array(
73  "component" => "Services/MetaData",
74  "entity" => "md",
75  "ids" => $md_ids),
76  );
77 
78  // taxonomy
79  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
80  $tax_ids = array();
81  foreach ($a_ids as $id)
82  {
83  $t_ids = ilObjTaxonomy::getUsageOfObject($id);
84  if (count($t_ids) > 0)
85  {
86  $tax_ids[$t_ids[0]] = $t_ids[0];
87  }
88  }
89  if(sizeof($tax_ids))
90  {
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  {
102  $rec_ids = $this->getActiveAdvMDRecords($id);
103  if(sizeof($rec_ids))
104  {
105  foreach($rec_ids as $rec_id)
106  {
107  $advmd_ids[] = $id.":".$rec_id;
108  }
109  }
110  }
111  if(sizeof($advmd_ids))
112  {
113  $deps[] = array(
114  "component" => "Services/AdvancedMetaData",
115  "entity" => "advmd",
116  "ids" => $advmd_ids
117  );
118  }
119 
120  // style
121  $obj_ids = (is_array($a_ids))
122  ? $a_ids
123  : array($a_ids);
124  $deps[] = array(
125  "component" => "Services/Style",
126  "entity" => "object_style",
127  "ids" => $obj_ids
128  );
129 
130  // service settings
131  $deps[] = array(
132  "component" => "Services/Object",
133  "entity" => "service_settings",
134  "ids" => $a_ids);
135 
136  return $deps;
137  }
138  return array();
139  }
static getDefinitionList($a_term_id)
static
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
for($col=0; $col< 50; $col++) $d
static getTermList($a_glo_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.
+ 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 162 of file class.ilGlossaryExporter.php.

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

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