41         $this->db = $DIC->database();
    48         return array(
"5.1.0", 
"5.4.0", 
"9.0.0");
    51     protected function getXmlNamespace(
string $a_entity, 
string $a_schema_version): string
    53         return "https://www.ilias.de/xml/Modules/Glossary/" . $a_entity;
    56     protected function getTypes(
string $a_entity, 
string $a_version): array
    58         if ($a_entity == 
"glo") {
    66                         "Description" => 
"text",
    69                         "SnippetLength" => 
"integer",
    70                         "GloMenuActive" => 
"text",
    71                         "ShowTax" => 
"integer"    76         if ($a_entity == 
"glo_term") {
    87                         "ShortText" => 
"text",
    88                         "ShortTextDirty" => 
"text"    93         if ($a_entity == 
"glo_definition") {
    99                         "TermId" => 
"integer",
   100                         "ShortText" => 
"text",
   102                         "ShortTextDirty" => 
"integer"   107         if ($a_entity == 
"glo_advmd_col_order") {
   108             switch ($a_version) {
   113                         "GloId" => 
"integer",
   115                         "OrderNr" => 
"integer"   120         if ($a_entity == 
"glo_auto_glossaries") {
   121             switch ($a_version) {
   125                         "GloId" => 
"integer",
   126                         "AutoGloId" => 
"text"   133     public function readData(
string $a_entity, 
string $a_version, array $a_ids): void
   137         if ($a_entity == 
"glo") {
   138             switch ($a_version) {
   142                     $this->
getDirectDataFromQuery(
"SELECT o.title, o.description, g.id, g.virtual, pres_mode, snippet_length, show_tax, glo_menu_active" .
   143                         " FROM glossary g JOIN object_data o " .
   144                         " ON (g.id = o.obj_id) " .
   145                         " WHERE " . 
$ilDB->in(
"g.id", $a_ids, 
false, 
"integer"));
   150         if ($a_entity == 
"glo_term") {
   151             switch ($a_version) {
   154                         " FROM glossary_term " .
   155                         " WHERE " . 
$ilDB->in(
"glo_id", $a_ids, 
false, 
"integer"));
   160                         " FROM glossary_term " .
   161                         " WHERE " . 
$ilDB->in(
"glo_id", $a_ids, 
false, 
"integer"));
   163                     $set = 
$ilDB->query(
"SELECT r.term_id, r.glo_id, t.term, t.language " .
   164                         "FROM glo_term_reference r JOIN glossary_term t ON (r.term_id = t.id) " .
   165                         " WHERE " . 
$ilDB->in(
"r.glo_id", $a_ids, 
false, 
"integer"));
   166                     while ($rec = 
$ilDB->fetchAssoc($set)) {
   168                             "Id" => $rec[
"term_id"],
   169                             "GloId" => $rec[
"glo_id"],
   170                             "Term" => $rec[
"term"],
   171                             "Language" => $rec[
"language"],
   177                         " FROM glossary_term " .
   178                         " WHERE " . 
$ilDB->in(
"glo_id", $a_ids, 
false, 
"integer"));
   180                     $set = 
$ilDB->query(
"SELECT r.term_id, r.glo_id, t.term, t.language, " .
   181                         "t.short_text, t.short_text_dirty " .
   182                         "FROM glo_term_reference r JOIN glossary_term t ON (r.term_id = t.id) " .
   183                         " WHERE " . 
$ilDB->in(
"r.glo_id", $a_ids, 
false, 
"integer"));
   184                     while ($rec = 
$ilDB->fetchAssoc($set)) {
   186                             "Id" => $rec[
"term_id"],
   187                             "GloId" => $rec[
"glo_id"],
   188                             "Term" => $rec[
"term"],
   189                             "Language" => $rec[
"language"],
   190                             "ShortText" => $rec[
"short_text"],
   191                             "ShortTextDirty" => $rec[
"short_text_dirty"]
   198         if ($a_entity == 
"glo_definition") {
   199             switch ($a_version) {
   203                         " FROM glossary_definition " .
   204                         " WHERE " . 
$ilDB->in(
"term_id", $a_ids, 
false, 
"integer"));
   209         if ($a_entity == 
"glo_advmd_col_order") {
   210             switch ($a_version) {
   215                         " FROM glo_advmd_col_order " .
   216                         " WHERE " . 
$ilDB->in(
"glo_id", $a_ids, 
false, 
"integer"));
   221         if ($a_entity == 
"glo_auto_glossaries") {
   222             switch ($a_version) {
   225                     $set = 
$ilDB->query(
"SELECT * FROM glo_glossaries " .
   226                         " WHERE " . 
$ilDB->in(
"id", $a_ids, 
false, 
"integer"));
   228                     while ($rec = 
$ilDB->fetchAssoc($set)) {
   230                             "GloId" => $rec[
"id"],
   231                             "AutoGloId" => 
"il_" . 
IL_INST_ID . 
"_glo_" . $rec[
"glo_id"]
   245         ?array $a_rec = null,
   251                     "glo_term" => array(
"ids" => $a_rec[
"Id"] ?? null),
   252                     "glo_advmd_col_order" => array(
"ids" => $a_rec[
"Id"] ?? null),
   253                     "glo_auto_glossaries" => array(
"ids" => $a_rec[
"Id"] ?? null)
   266         string $a_schema_version
   272                 if ($new_id = $a_mapping->
getMapping(
'components/ILIAS/Container', 
'objs', $a_rec[
'Id'])) {
   276                     $newObj->create(
true);
   279                 $newObj->setTitle($a_rec[
"Title"]);
   280                 $newObj->setDescription($a_rec[
"Description"]);
   281                 $newObj->setVirtualMode($a_rec[
"Virtual"]);
   282                 $newObj->setPresentationMode($a_rec[
"PresMode"]);
   283                 $newObj->setSnippetLength((
int) ($a_rec[
"SnippetLength"] ?? 0));
   284                 $newObj->setActiveGlossaryMenu((
bool) ($a_rec[
"GloMenuActive"] ?? 
false));
   285                 $newObj->setShowTaxonomy((
bool) ($a_rec[
"ShowTax"] ?? 
false));
   286                 $newObj->setActiveFlashcards((
bool) ($a_rec[
"FlashActive"] ?? 
false));
   287                 $newObj->setFlashcardsMode($a_rec[
"FlashMode"] ?? 
"");
   293                 $this->current_obj = $newObj;
   294                 $this->old_glo_id = $a_rec[
"Id"];
   295                 $a_mapping->
addMapping(
"components/ILIAS/Glossary", 
"glo", $a_rec[
"Id"], $newObj->getId());
   296                 $a_mapping->
addMapping(
"components/ILIAS/ILIASObject", 
"obj", $a_rec[
"Id"], $newObj->getId());
   298                     "components/ILIAS/MetaData",
   300                     $a_rec[
"Id"] . 
":0:glo",
   301                     $newObj->getId() . 
":0:glo"   303                 $a_mapping->
addMapping(
"components/ILIAS/AdvancedMetaData", 
"parent", $a_rec[
"Id"], $newObj->getId());
   306             case "glo_definition":
   310                 $term_id = (
int) $a_mapping->
getMapping(
"Modules/Glossary", 
"term", $a_rec[
"TermId"]);
   312                     $this->log->debug(
"ERROR: Did not find glossary term glo_term id '" . $a_rec[
"TermId"] . 
"' for definition id '" . $a_rec[
"Id"] . 
"'.");
   313                 } elseif (!in_array($term_id, $this->used_term_ids)) {
   317                         "gdf:" . $a_rec[
"Id"],
   321                     $this->used_term_ids[] = $term_id;
   329                 $glo_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Glossary", 
"glo", $a_rec[
"GloId"]);
   331                 $term->setGlossaryId($glo_id);
   332                 $term->setTerm($a_rec[
"Term"]);
   333                 $term->setLanguage($a_rec[
"Language"]);
   334                 $term->setShortText($a_rec[
"ShortText"] ?? 
"");
   335                 $term->setShortTextDirty($a_rec[
"ShortTextDirty"] ?? 
true);
   340                 $term_id = $term->getId();
   341                 $this->log->debug(
"glo_term, import id: " . $term->getImportId() . 
", term id: " . $term_id);
   344                     "components/ILIAS/Glossary",
   351                     "components/ILIAS/Taxonomy",
   353                     "glo:term:" . $a_rec[
"Id"],
   358                     "components/ILIAS/Taxonomy",
   360                     "glo:term:" . $a_rec[
"Id"],
   365                     "components/ILIAS/AdvancedMetaData",
   367                     "advmd:term:" . $a_rec[
"Id"],
   372                     "components/ILIAS/COPage",
   374                     "term:" . $a_rec[
"Id"],
   379             case "glo_advmd_col_order":
   383                 $a_mapping->
addMapping(
"components/ILIAS/Glossary", 
"advmd_col_order", $a_rec[
"GloId"] . 
":" . $a_rec[
"FieldId"], $a_rec[
"OrderNr"]);
   386             case "glo_auto_glossaries":
   388                 $glo_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Glossary", 
"glo", $a_rec[
"GloId"]);
   391                     $glo->addAutoGlossary($auto_glo_id);
   392                     $glo->updateAutoGlossaries();
 
getDependencies(string $a_entity, string $a_version, ?array $a_rec=null, ?array $a_ids=null)
Determine the dependent sets of data. 
 
static _lookupObjIdByImportId(string $import_id)
Get (latest) object id for an import id. 
 
importRecord(string $a_entity, array $a_types, array $a_rec, ilImportMapping $a_mapping, string $a_schema_version)
 
readData(string $a_entity, string $a_version, array $a_ids)
 
static getLogger(string $a_component_id)
Get component logger. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
 
getXmlNamespace(string $a_entity, string $a_schema_version)
 
getTypes(string $a_entity, string $a_version)
 
getMapping(string $a_comp, string $a_entity, string $a_old_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getCurrentInstallationId()
 
getDirectDataFromQuery(string $a_query, bool $a_convert_to_leading_upper=true, bool $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
__construct(Container $dic, ilPlugin $plugin)
 
stripTags(array $rec, array $omit_keys=[])
 
static _lookupType(int $id, bool $reference=false)
 
ilObjGlossary $current_obj