mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°8515 - Use structural data instead of explicit load
This commit is contained in:
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Set>
|
||||||
|
<ContainerImageType alias="ContainerImageType" id="1">
|
||||||
|
<name>Docker Hardened Image</name>
|
||||||
|
</ContainerImageType>
|
||||||
|
<ContainerImageType alias="ContainerImageType" id="2">
|
||||||
|
<name>Docker Official Image</name>
|
||||||
|
</ContainerImageType>
|
||||||
|
<ContainerImageType alias="ContainerImageType" id="3">
|
||||||
|
<name>Verified Publisher</name>
|
||||||
|
</ContainerImageType>
|
||||||
|
</Set>
|
||||||
@@ -24,13 +24,4 @@
|
|||||||
<ContainerType alias="ContainerType" id="8">
|
<ContainerType alias="ContainerType" id="8">
|
||||||
<name>OpenShift</name>
|
<name>OpenShift</name>
|
||||||
</ContainerType>
|
</ContainerType>
|
||||||
<ContainerImageType alias="ContainerImageType" id="1">
|
|
||||||
<name>Docker Hardened Image</name>
|
|
||||||
</ContainerImageType>
|
|
||||||
<ContainerImageType alias="ContainerImageType" id="2">
|
|
||||||
<name>Docker Official Image</name>
|
|
||||||
</ContainerImageType>
|
|
||||||
<ContainerImageType alias="ContainerImageType" id="3">
|
|
||||||
<name>Verified Publisher</name>
|
|
||||||
</ContainerImageType>
|
|
||||||
</Set>
|
</Set>
|
||||||
@@ -31,6 +31,8 @@ SetupWebPage::AddModule(
|
|||||||
),
|
),
|
||||||
'data.struct' => array(
|
'data.struct' => array(
|
||||||
// add your 'structure' definition XML files here,
|
// 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(
|
'data.sample' => array(
|
||||||
// add your sample data XML files here,
|
// 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user