Skip to content
Snippets Groups Projects
Commit 6d3471d5 authored by anttil's avatar anttil
Browse files

SSDM-3591: Installer: have option to install ELN with or without masterdata

SVN: 36675
parent 40c56627
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
BASE=`dirname "$0"`
if [ ${BASE#/} == ${BASE} ]; then
BASE="`pwd`/${BASE}"
fi
echo "Removing ELN master data script"
rm $BASE/../servers/core-plugins/eln-lims/1/as/initialize-master-data.py
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
<variable name="INSTALL_OPENBIS_TMPEXTRACT" value="$INSTALL_TMPEXTRACT/openBIS-server" /> <variable name="INSTALL_OPENBIS_TMPEXTRACT" value="$INSTALL_TMPEXTRACT/openBIS-server" />
<!-- temporary extract folder the "data" contents --> <!-- temporary extract folder the "data" contents -->
<variable name="DATA_TMPEXTRACT" value="$INSTALL_PATH/data-tmp-extract" /> <variable name="DATA_TMPEXTRACT" value="$INSTALL_PATH/data-tmp-extract" />
<variable name="ELN_MASTER_DATA_PANEL" value="true" condition="isInstallELN+isElnMasterDataNotInstalled" />
<variable name="ELN_MASTER_DATA_PANEL" value="false" condition="!isInstallELN|!isElnMasterDataNotInstalled" />
</dynamicvariables> </dynamicvariables>
<conditions> <conditions>
...@@ -96,6 +98,21 @@ ...@@ -96,6 +98,21 @@
<name>INSTALL_BEEWM</name> <name>INSTALL_BEEWM</name>
<value>true</value> <value>true</value>
</condition> </condition>
<condition type="variable" id="isInstallELN">
<name>ELN-LIMS</name>
<value>true</value>
</condition>
<condition type="java" id="isElnMasterDataNotInstalled">
<java>
<class>ch.systemsx.cisd.openbis.installer.izpack.GlobalInstallationContext</class>
<field>isElnMasterDataNotInstalled</field>
</java>
<returnvalue type="boolean">true</returnvalue>
</condition>
<condition type="variable" id="shouldShowElnMasterDataPanel">
<name>ELN_MASTER_DATA_PANEL</name>
<value>true</value>
</condition>
</conditions> </conditions>
<!-- The panels section. We indicate here which panels we want to use. The order will be respected. --> <!-- The panels section. We indicate here which panels we want to use. The order will be respected. -->
...@@ -137,6 +154,9 @@ ...@@ -137,6 +154,9 @@
</actions> </actions>
</panel> </panel>
<panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.ELN_MASTER_DATA" condition="shouldShowElnMasterDataPanel">
</panel>
<panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.BEEWM"> <panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.BEEWM">
</panel> </panel>
...@@ -165,6 +185,7 @@ ...@@ -165,6 +185,7 @@
<actions> <actions>
<action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.ExecuteSetupScriptsAction" /> <action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.ExecuteSetupScriptsAction" />
<action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.OpenGettingStartedPageAction" /> <action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.OpenGettingStartedPageAction" />
<action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.ELNMasterDataAction" />
</actions> </actions>
</panel> </panel>
...@@ -227,7 +248,6 @@ ...@@ -227,7 +248,6 @@
<arg value="$JAVA_PATH"/> <arg value="$JAVA_PATH"/>
</args> </args>
</executable> </executable>
</pack> </pack>
</packs> </packs>
......
...@@ -73,7 +73,19 @@ ...@@ -73,7 +73,19 @@
<spec txt="Fast data set file browsing" true="true" false="false"/> <spec txt="Fast data set file browsing" true="true" false="false"/>
</field> </field>
</panel> </panel>
<panel id="UserInputPanel.ELN_MASTER_DATA">
<field type="title" txt="ELN/LIMS master data" bold="true" size="2" />
<field type="radio" variable="ELN-LIMS-MASTER-DATA">
<description align="left" txt="Should ELN/LIMS master data be installed?" />
<spec>
<choice txt="Yes" value="true"/>
<choice txt="No" value="false" set="true"/>
</spec>
</field>
</panel>
<panel id="UserInputPanel.MISC"> <panel id="UserInputPanel.MISC">
<field type="title" txt="Misc" bold="true" size="2" /> <field type="title" txt="Misc" bold="true" size="2" />
<field type="password" align="left" variable="ADMIN_PASSWORD"> <field type="password" align="left" variable="ADMIN_PASSWORD">
......
...@@ -47,6 +47,9 @@ KEY_PASSWORD = changeit ...@@ -47,6 +47,9 @@ KEY_PASSWORD = changeit
# Standard technology ELN-LIMS is disabled by default # Standard technology ELN-LIMS is disabled by default
#ELN-LIMS = true #ELN-LIMS = true
#ELN/LIMS master data is disabled by default. This setting is meaningful only if ELN-LIMS is enabled
#ELN-LIMS-MASTER-DATA = true
# Fast data set file browsing improves the performance of browsing of data sets with a large number of files. # Fast data set file browsing improves the performance of browsing of data sets with a large number of files.
# We recommend leaving it on for all instances, and especially screening instances. # We recommend leaving it on for all instances, and especially screening instances.
# Default value is true. # Default value is true.
......
/*
* Copyright 2011 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.installer.izpack;
import static ch.systemsx.cisd.openbis.installer.izpack.GlobalInstallationContext.TECHNOLOGY_ELN_LIMS;
import java.util.HashMap;
import com.izforge.izpack.api.data.AutomatedInstallData;
import com.izforge.izpack.api.data.PanelActionConfiguration;
/**
* Executes a script that removes eln master data python script, if required.
*/
public class ELNMasterDataAction extends AbstractScriptExecutor
{
/**
* a script that creates a installation backup.
*/
private static final String CREATE_BACKUP_SCRIPT = "delete-eln-master-data-script.sh";
@Override
public synchronized void executeAction(AutomatedInstallData data)
{
String script = getAdminScript(data, CREATE_BACKUP_SCRIPT);
String elnEnabled = data.getVariable(TECHNOLOGY_ELN_LIMS);
String elnMasterDataEnabled = data.getVariable("ELN-LIMS-MASTER-DATA");
if (elnMasterDataEnabled == null)
{
elnMasterDataEnabled = "true";
}
if ("true".equals(elnEnabled) && "false".equals(elnMasterDataEnabled))
{
executeAdminScript(new HashMap<String, String>(), script);
}
}
@Override
public void initialize(PanelActionConfiguration arg0)
{
}
}
...@@ -55,7 +55,7 @@ public class GlobalInstallationContext ...@@ -55,7 +55,7 @@ public class GlobalInstallationContext
public static final String PATHINFO_DB_ENABLED = "PATHINFO_DB_ENABLED"; public static final String PATHINFO_DB_ENABLED = "PATHINFO_DB_ENABLED";
public static final String[] TECHNOLOGIES = public static final String[] TECHNOLOGIES =
{ TECHNOLOGY_PROTEOMICS, TECHNOLOGY_SCREENING, TECHNOLOGY_ILLUMINA_NGS, TECHNOLOGY_ELN_LIMS }; { TECHNOLOGY_PROTEOMICS, TECHNOLOGY_SCREENING, TECHNOLOGY_ILLUMINA_NGS, TECHNOLOGY_ELN_LIMS };
/** /**
* set to true if the installation process is trying to update an existing openBIS installation. * set to true if the installation process is trying to update an existing openBIS installation.
...@@ -83,6 +83,8 @@ public class GlobalInstallationContext ...@@ -83,6 +83,8 @@ public class GlobalInstallationContext
public static File installDir; public static File installDir;
public static boolean isElnMasterDataNotInstalled = false;
public static void initialize(AutomatedInstallData data) public static void initialize(AutomatedInstallData data)
{ {
String installPath = data.getInstallPath(); String installPath = data.getInstallPath();
...@@ -116,6 +118,10 @@ public class GlobalInstallationContext ...@@ -116,6 +118,10 @@ public class GlobalInstallationContext
{ {
populateFirstTimeInstallVariables(data); populateFirstTimeInstallVariables(data);
} }
isElnMasterDataNotInstalled = (isFirstTimeInstallation == true) ||
(new File(installDir, "servers/core-plugins/eln-lims/1/as/initialize-master-data.py").exists() == false) ||
(new SetTechnologyCheckBoxesAction().isTechnologyEnabled(installDir, TECHNOLOGY_ELN_LIMS) == false);
} }
private static boolean installationExists() private static boolean installationExists()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment