4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
32 parent::__construct();
42 return array(
"5.1.0");
53 return "http://www.ilias.de/xml/Modules/Glossary/".$a_entity;
63 protected function getTypes($a_entity, $a_version)
65 if ($a_entity ==
"glo")
73 "Description" =>
"text",
76 "SnippetLength" =>
"integer",
77 "GloMenuActive" =>
"text",
78 "ShowTax" =>
"integer" 83 if ($a_entity ==
"glo_term")
98 if ($a_entity ==
"glo_definition")
105 "TermId" =>
"integer",
106 "ShortText" =>
"text",
108 "ShortTextDirty" =>
"integer" 113 if ($a_entity ==
"glo_advmd_col_order")
119 "GloId" =>
"integer",
121 "OrderNr" =>
"integer" 134 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
138 if (!is_array($a_ids))
140 $a_ids =
array($a_ids);
143 if ($a_entity ==
"glo")
148 $this->
getDirectDataFromQuery(
"SELECT o.title, o.description, g.id, g.virtual, pres_mode, snippet_length, show_tax, glo_menu_active".
149 " FROM glossary g JOIN object_data o ".
150 " ON (g.id = o.obj_id) ".
151 " WHERE ".$ilDB->in(
"g.id", $a_ids,
false,
"integer"));
156 if ($a_entity ==
"glo_term")
163 " FROM glossary_term ".
164 " WHERE ".$ilDB->in(
"glo_id", $a_ids,
false,
"integer"));
169 if ($a_entity ==
"glo_definition")
175 " FROM glossary_definition ".
176 " WHERE ".$ilDB->in(
"term_id", $a_ids,
false,
"integer"));
181 if ($a_entity ==
"glo_advmd_col_order")
187 " FROM glo_advmd_col_order ".
188 " WHERE ".$ilDB->in(
"glo_id", $a_ids,
false,
"integer"));
203 "glo_term" =>
array(
"ids" => $a_rec[
"Id"]),
204 "glo_advmd_col_order" =>
array(
"ids" => $a_rec[
"Id"])
209 "glo_definition" =>
array(
"ids" => $a_rec[
"Id"])
223 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
229 include_once(
"./Modules/Glossary/classes/class.ilObjGlossary.php");
230 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
237 $newObj->create(
true);
240 $newObj->setTitle($a_rec[
"Title"]);
241 $newObj->setDescription($a_rec[
"Description"]);
242 $newObj->setVirtualMode($a_rec[
"Virtual"]);
243 $newObj->setPresentationMode($a_rec[
"PresMode"]);
244 $newObj->setSnippetLength($a_rec[
"SnippetLength"]);
245 $newObj->setActiveGlossaryMenu($a_rec[
"GloMenuActive"]);
246 $newObj->setShowTaxonomy($a_rec[
"ShowTax"]);
247 $newObj->update(
true);
249 $this->current_obj = $newObj;
250 $this->old_glo_id = $a_rec[
"Id"];
251 $a_mapping->addMapping(
"Modules/Glossary",
"glo", $a_rec[
"Id"], $newObj->getId());
252 $a_mapping->addMapping(
"Services/Object",
"obj", $a_rec[
"Id"], $newObj->getId());
253 $a_mapping->addMapping(
"Services/MetaData",
"md",
254 $a_rec[
"Id"].
":0:glo", $newObj->getId().
":0:glo");
255 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"parent", $a_rec[
"Id"], $newObj->getId());
262 include_once(
"./Modules/Glossary/classes/class.ilGlossaryTerm.php");
263 $glo_id = (int) $a_mapping->getMapping(
"Modules/Glossary",
"glo", $a_rec[
"GloId"]);
265 $term->setGlossaryId($glo_id);
266 $term->setTerm($a_rec[
"Term"]);
267 $term->setLanguage($a_rec[
"Language"]);
273 $term_id = $term->getId();
274 $this->log->debug(
"glo_term, import id: ".$term->getImportId().
", term id: ".$term_id);
276 $a_mapping->addMapping(
"Modules/Glossary",
"term",
277 $a_rec[
"Id"], $term_id);
279 $a_mapping->addMapping(
"Services/Taxonomy",
"tax_item",
280 "glo:term:".$a_rec[
"Id"], $term_id);
282 $a_mapping->addMapping(
"Services/Taxonomy",
"tax_item_obj_id",
283 "glo:term:".$a_rec[
"Id"], $glo_id);
285 $a_mapping->addMapping(
"Services/AdvancedMetaData",
"advmd_sub_item",
286 "advmd:term:".$a_rec[
"Id"], $term_id);
289 case "glo_definition":
293 include_once(
"./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
294 $term_id = (int) $a_mapping->getMapping(
"Modules/Glossary",
"term", $a_rec[
"TermId"]);
295 if ((
int) $term_id == 0)
297 $this->log->debug(
"ERROR: Did not find glossary term glo_term id '".$a_rec[
"TermId"].
"' for definition id '".$a_rec[
"Id"].
"'.");
302 $def->setTermId($term_id);
303 $def->setShortText($a_rec[
"ShortText"]);
304 $def->setNr($a_rec[
"Nr"]);
305 $def->setShortTextDirty($a_rec[
"ShortTextDirty"]);
307 $def->create(
true,
true);
309 $a_mapping->addMapping(
"Modules/Glossary",
"def", $a_rec[
"Id"], $def->getId());
310 $a_mapping->addMapping(
"Services/COPage",
"pg",
"gdf:" . $a_rec[
"Id"],
311 "gdf:" . $def->getId());
312 $a_mapping->addMapping(
"Services/MetaData",
"md",
313 $this->old_glo_id .
":" . $a_rec[
"Id"] .
":gdf", $this->current_obj->getId() .
":" . $def->getId() .
":gdf");
317 case "glo_advmd_col_order":
321 $a_mapping->addMapping(
"Modules/Glossary",
"advmd_col_order", $a_rec[
"GloId"].
":".$a_rec[
"FieldId"], $a_rec[
"OrderNr"]);
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getSupportedVersions()
Get supported versions.
getCurrentInstallationId()
Get current installation id.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
Class ilGlossaryDefinition.
__construct()
Constructor.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
static getLogger($a_component_id)
Get component logger.
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getTypes($a_entity, $a_version)
Get field types for entity.