ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
class.ilGlossaryExporter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Export/classes/class.ilXmlExporter.php");
5
14{
15 private $ds;
16
20 function init()
21 {
22 }
23
32 function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
33 {
34 if ($a_entity == "glo")
35 {
36 $deps = array();
37
38 include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
39 $tax_ids = array();
40 foreach ($a_ids as $id)
41 {
43 if (count($t_ids) > 0)
44 {
45 $tax_ids[$t_ids[0]] = $t_ids[0];
46 }
47 }
48 if(sizeof($tax_ids))
49 {
50 $deps[] = array(
51 "component" => "Services/Taxonomy",
52 "entity" => "tax",
53 "ids" => $tax_ids
54 );
55 }
56
57 $advmd_ids = array();
58 foreach($a_ids as $id)
59 {
60 $rec_ids = $this->getActiveAdvMDRecords($id);
61 if(sizeof($rec_ids))
62 {
63 foreach($rec_ids as $rec_id)
64 {
65 $advmd_ids[] = $id.":".$rec_id;
66 }
67 }
68 }
69 if(sizeof($advmd_ids))
70 {
71 $deps[] = array(
72 "component" => "Services/AdvancedMetaData",
73 "entity" => "advmd",
74 "ids" => $advmd_ids
75 );
76 }
77
78 return $deps;
79 }
80 return array();
81 }
82
83 protected function getActiveAdvMDRecords($a_id)
84 {
85 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
86 $active = array();
87 foreach(ilAdvancedMDRecord::_getActivatedRecordsByObjectType("glo", "term") as $record_obj)
88 {
89 $active[] = $record_obj->getRecordId();
90 }
91 return array_intersect($active, ilAdvancedMDRecord::getObjRecSelection($a_id, "term"));
92 }
93
102 public function getXmlRepresentation($a_entity, $a_schema_version, $a_id)
103 {
104 include_once './Modules/Glossary/classes/class.ilObjGlossary.php';
105 $glo = new ilObjGlossary($a_id,false);
106
107 include_once './Modules/Glossary/classes/class.ilGlossaryExport.php';
108 $exp = new ilGlossaryExport($glo,'xml');
109 $zip = $exp->buildExportFile();
110 }
111
119 function getValidSchemaVersions($a_entity)
120 {
121 return array (
122 "4.1.0" => array(
123 "namespace" => "http://www.ilias.de/Modules/Glossary/htlm/4_1",
124 "xsd_file" => "ilias_glo_4_1.xsd",
125 "uses_dataset" => false,
126 "min" => "4.1.0",
127 "max" => "")
128 );
129 }
130
131}
132
133?>
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="")
Get activated records by object type.
static getObjRecSelection($a_obj_id, $a_sub_type="")
Get repository object record selection.
Export class for content objects.
Exporter class for html learning modules.
getXmlRepresentation($a_entity, $a_schema_version, $a_id)
Get xml representation.
getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
Get tail dependencies.
getValidSchemaVersions($a_entity)
Returns schema versions that the component can export to.
Class ilObjGlossary.
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
Xml Exporter class.