From 57856ef6c39e9624a89dc2f23bf39f9dcc82bcaf Mon Sep 17 00:00:00 2001 From: v-dumas Date: Fri, 30 Jan 2026 17:23:55 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B08515=20-=20Use=20structural=20data=20ins?= =?UTF-8?q?tead=20of=20explicit=20load?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../en_us.data.itop-container-image-type.xml | 12 +++++++ .../data/en_us.data.itop-container-type.xml | 9 ----- .../module.itop-container-mgmt.php | 33 ++----------------- 3 files changed, 14 insertions(+), 40 deletions(-) create mode 100644 datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-image-type.xml diff --git a/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-image-type.xml b/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-image-type.xml new file mode 100644 index 000000000..35d246288 --- /dev/null +++ b/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-image-type.xml @@ -0,0 +1,12 @@ + + + + Docker Hardened Image + + + Docker Official Image + + + Verified Publisher + + \ No newline at end of file diff --git a/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-type.xml b/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-type.xml index b66bbad0e..96735c598 100644 --- a/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-type.xml +++ b/datamodels/2.x/itop-container-mgmt/data/en_us.data.itop-container-type.xml @@ -24,13 +24,4 @@ OpenShift - - Docker Hardened Image - - - Docker Official Image - - - Verified Publisher - \ No newline at end of file diff --git a/datamodels/2.x/itop-container-mgmt/module.itop-container-mgmt.php b/datamodels/2.x/itop-container-mgmt/module.itop-container-mgmt.php index 345789785..e853cf59e 100644 --- a/datamodels/2.x/itop-container-mgmt/module.itop-container-mgmt.php +++ b/datamodels/2.x/itop-container-mgmt/module.itop-container-mgmt.php @@ -31,6 +31,8 @@ SetupWebPage::AddModule( ), 'data.struct' => array( // add your 'structure' definition XML files here, + 'data/en_us.data.itop-container-type.xml', + 'data/en_us.data.itop-container-image-type.xml', ), 'data.sample' => array( // add your sample data XML files here, @@ -49,35 +51,4 @@ SetupWebPage::AddModule( ) ); -if (!class_exists('ContainerTypeInstaller')) -{ - // Module installation handler - // - class ContainerTypeInstaller extends ModuleInstallerAPI - { - /** - * Handler called after the creation/update of the database schema - * - * @param $oConfiguration Config The new configuration of the application - * @param $sPreviousVersion string Previous version number of the module (empty string in case of first install) - * @param $sCurrentVersion string Current version number of the module - * - * @throws \Exception - */ - public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion) - { - if ($sPreviousVersion == '') { // First installation - $oDataLoader = new XMLDataLoader(); - CMDBObject::SetTrackInfo("Initialization ContainerTypeInstaller"); - $oMyChange = CMDBObject::GetCurrentChange(); - $sFileName = dirname(__FILE__)."/data/en_us.data.itop-container-type.xml"; - SetupLog::Info("Uploading Typology values for Containers from file: $sFileName"); - $oDataLoader->StartSession($oMyChange); - $oDataLoader->LoadFile($sFileName, false, true); - $oDataLoader->EndSession(); - } - } - } -} - ?>