Skip to content

Commit

Permalink
DataCollection: introduce LOM (#8053)
Browse files Browse the repository at this point in the history
* DataCollection: introduce LOM

* DataCollection: add initial PRIVACY.md

* DataCollection: remove almost empty PRIVACY.md, replace empty
  • Loading branch information
schmitz-ilias authored Oct 23, 2024
1 parent 1d33651 commit bc61518
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
1 change: 1 addition & 0 deletions components/ILIAS/DataCollection/LuceneObjectDefinition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<xi:include href="../../Services/Object/LuceneDataSource.xml"/>
<xi:include href="../../Services/Tagging/LuceneDataSource.xml"/>
<xi:include href="../../Modules/LearningModule/LucenePageEditorDataSource.xml"/>
<xi:include href="../../../components/ILIAS/MetaData/LuceneDataSource.xml" />
<DataSource type="JDBC" action="append">
<Query>
SELECT 1 as offline FROM il_dcl_data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ public function importRecord(
$new_obj->update(); //clone mode, so no table will be created
$this->import_dc_object = $new_obj;
$a_mapping->addMapping('components/ILIAS/DataCollection', 'dcl', $a_rec['id'], (string) $new_obj->getId());
$a_mapping->addMapping(
'components/ILIAS/MetaData',
'md',
$a_rec['id'] . ':0:dcl',
$new_obj->getId() . ':0:dcl'
);
break;
case 'il_dcl_table':
$table = new ilDclTable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public function getXmlExportHeadDependencies(string $a_entity, string $a_target_
*/
public function getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids): array
{
$deps = [];
$page_object_ids = [];
foreach ($a_ids as $dcl_obj_id) {
// If a DCL table has a detail view, we need to export the associated page objects!
Expand All @@ -141,15 +142,25 @@ public function getXmlExportTailDependencies(string $a_entity, string $a_target_
}
}
if (count($page_object_ids)) {
return [
[
'component' => 'components/ILIAS/COPage',
'entity' => 'pg',
'ids' => $page_object_ids,
],
$deps[] = [
'component' => 'components/ILIAS/COPage',
'entity' => 'pg',
'ids' => $page_object_ids
];
}

return [];
$md_ids = [];
foreach ($a_ids as $id) {
$md_ids[] = $id . ':0:dcl';
}
if ($md_ids !== []) {
$deps[] = [
'component' => 'components/ILIAS/MetaData',
'entity' => 'md',
'ids' => $md_ids,
];
}

return $deps;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ protected function doCreate(bool $clone_mode = false): void
$main_table->doCreate();
}

$this->createMetaData();

$this->db->insert(
"il_dcl_data",
[
Expand All @@ -84,12 +86,16 @@ protected function doDelete(): void
$table->doDelete(false, true);
}

$this->deleteMetaData();

$query = "DELETE FROM il_dcl_data WHERE id = " . $this->db->quote($this->getId(), "integer");
$this->db->manipulate($query);
}

protected function doUpdate(): void
{
$this->updateMetaData();

$this->db->update(
"il_dcl_data",
[
Expand Down Expand Up @@ -260,6 +266,8 @@ protected function doCloneObject(ilObject2 $new_obj, int $a_target_id, ?int $a_c
}

$new_obj->cloneStructure($this->getRefId());

$this->cloneMetaData($new_obj);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
* @ilCtrl_Calls ilObjDataCollectionGUI: ilRatingGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilPropertyFormGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilDclPropertyFormGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilObjectMetaDataGUI
* @ilCtrl_Calls ilObjDataCollectionGUI: ilObjectContentStyleSettingsGUI
*/
class ilObjDataCollectionGUI extends ilObject2GUI
{
Expand All @@ -39,6 +41,7 @@ class ilObjDataCollectionGUI extends ilObject2GUI

public const TAB_EDIT_DCL = 'settings';
public const TAB_LIST_TABLES = 'dcl_tables';
public const TAB_META_DATA = 'meta_data';
public const TAB_EXPORT = 'export';
public const TAB_LIST_PERMISSIONS = 'perm_settings';
public const TAB_INFO = 'info_short';
Expand Down Expand Up @@ -240,6 +243,14 @@ public function executeCommand(): void
$this->ctrl->forwardCommand($form);
break;

case strtolower(ilObjectMetaDataGUI::class):
$this->checkPermission('write');
$this->prepareOutput();
$this->tabs->activateTab(self::TAB_META_DATA);
$gui = new ilObjectMetaDataGUI($this->object);
$this->ctrl->forwardCommand($gui);
break;

case strtolower(ilObjectContentStyleSettingsGUI::class):
$this->prepareOutput();
$this->setEditTabs();
Expand Down Expand Up @@ -420,6 +431,11 @@ protected function setTabs(): void
$this->addTab(self::TAB_EDIT_DCL, $this->ctrl->getLinkTarget($this, "editObject"));
// list tables
$this->addTab(self::TAB_LIST_TABLES, $this->ctrl->getLinkTargetByClass(ilDclTableListGUI::class, "listTables"));
// metadata
$mdgui = new ilObjectMetaDataGUI($this->object);
if ($mdtab = $mdgui->getTab()) {
$this->tabs_gui->addTab(self::TAB_META_DATA, $this->lng->txt('meta_data'), $mdtab);
}
// export
$this->addTab(self::TAB_EXPORT, $this->ctrl->getLinkTargetByClass(ilDclExportGUI::class, ""));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ protected function isLOMAvailable(): bool
"crs",
'grp',
"file",
'dcl',
"glo",
"svy",
"spl",
Expand Down

0 comments on commit bc61518

Please sign in to comment.