diff --git a/installation/resource/installer/install.xml b/installation/resource/installer/install.xml index 3c9698c8997de198411c48fd27990cfe02477d70..a3b7682b71e770df9e255d0bf8d002a67c808676 100644 --- a/installation/resource/installer/install.xml +++ b/installation/resource/installer/install.xml @@ -105,7 +105,7 @@ <panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.TECHNOLOGIES" condition="isStandardTechnologies"> <actions> <action stage="preactivate" classname="ch.systemsx.cisd.openbis.installer.izpack.SetTechnologyCheckBoxesAction" /> - <action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.SetDisableTechnologiesVariableAction" /> + <action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.SetEnableTechnologiesVariableAction" /> </actions> </panel> diff --git a/installation/resource/tarball/console.properties b/installation/resource/tarball/console.properties index 30d335214be6ae86cd513dd2e05456b8a403f33b..1c57768f17b9bb5d9a2a8acd5e1916ddcf01443a 100644 --- a/installation/resource/tarball/console.properties +++ b/installation/resource/tarball/console.properties @@ -35,11 +35,11 @@ KEY_STORE_PASSWORD = changeit # Password of the key KEY_PASSWORD = changeit -# Standard technology PROTEOMICS is enabled by default -#PROTEOMICS = false +# Standard technology PROTEOMICS is disabled by default +#PROTEOMICS = true -# Standard technology SCREENING is enabled by default -#SCREENING = false +# Standard technology SCREENING is disabled by default +#SCREENING = true -# Standard technology ILLUMINA-NGS is enabled by default -#ILLUMINA-NGS = false \ No newline at end of file +# Standard technology ILLUMINA-NGS is disabled by default +#ILLUMINA-NGS = true \ No newline at end of file diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetDisableTechnologiesVariableAction.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetEnableTechnologiesVariableAction.java similarity index 88% rename from installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetDisableTechnologiesVariableAction.java rename to installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetEnableTechnologiesVariableAction.java index 56a9e34cd6d04578008a253e72ca22de4f01ae08..fa2206ea34a70f27dcabeb10d3d3cd63bb31f553 100644 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetDisableTechnologiesVariableAction.java +++ b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetEnableTechnologiesVariableAction.java @@ -39,9 +39,10 @@ import ch.systemsx.cisd.common.shared.basic.utils.CommaSeparatedListBuilder; * * @author Franz-Josef Elmer */ -public class SetDisableTechnologiesVariableAction implements PanelAction +public class SetEnableTechnologiesVariableAction implements PanelAction { static final String ENABLED_TECHNOLOGIES_VARNAME = "ENABLED_TECHNOLOGIES"; + static final String DISABLED_TECHNOLOGIES_VARNAME = "DISABLED_TECHNOLOGIES"; static final String DISABLED_CORE_PLUGINS_KEY = "disabled-core-plugins"; public void initialize(PanelActionConfiguration configuration) @@ -58,6 +59,7 @@ public class SetDisableTechnologiesVariableAction implements PanelAction void updateEnabledTechnologyProperty(AutomatedInstallData data, boolean isFirstTimeInstallation, File installDir) { + data.setVariable(DISABLED_TECHNOLOGIES_VARNAME, createListOfDisabledTechnologies(data)); String newTechnologyList = createListOfEnabledTechnologies(data); data.setVariable(ENABLED_TECHNOLOGIES_VARNAME, newTechnologyList); if (isFirstTimeInstallation == false) @@ -149,5 +151,19 @@ public class SetDisableTechnologiesVariableAction implements PanelAction } return builder.toString(); } + + private String createListOfDisabledTechnologies(AutomatedInstallData data) + { + CommaSeparatedListBuilder builder = new CommaSeparatedListBuilder(); + for (String technology : GlobalInstallationContext.TECHNOLOGIES) + { + String technologyFlag = data.getVariable(technology); + if (technologyFlag == null || Boolean.FALSE.toString().equalsIgnoreCase(technologyFlag)) + { + builder.append(technology.toLowerCase()); + } + } + return builder.toString(); + } } diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetTechnologyCheckBoxesAction.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetTechnologyCheckBoxesAction.java index ebf8593ed8e206600cf814c411ca6932f3957e3f..320fcb4f92b4481eadeb0dc9597e9a9a8330d53e 100644 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetTechnologyCheckBoxesAction.java +++ b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetTechnologyCheckBoxesAction.java @@ -29,7 +29,7 @@ import com.izforge.izpack.data.PanelAction; * Action which sets the variables which are the values of check boxes on the technology page. If * the variable is already set nothing is done. Otherwise the behavior depends on whether this is * installation or upgrading. In case of installation the flag will be <code>true</code>. In case of - * upgrading <code>service.properties</code> files are scanned in order to check whether a certain + * upgrading <code>service.properties</code> file of AS is scanned in order to check whether a certain * technology is enabled or not. * * @author Franz-Josef Elmer @@ -98,7 +98,7 @@ public class SetTechnologyCheckBoxesAction implements PanelAction String variable = data.getVariable(technology); if (variable == null) { - boolean technologyFlag = true; + boolean technologyFlag = false; if (GlobalInstallationContext.isUpdateInstallation) { technologyFlag = diff --git a/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetDisableTechnologiesVariableActionTest.java b/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetEnableTechnologiesVariableActionTest.java similarity index 78% rename from installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetDisableTechnologiesVariableActionTest.java rename to installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetEnableTechnologiesVariableActionTest.java index ea82bd5f50b77f2f83aee4786550040639954bae..8aee1ddb64fc3130abc4149d903c6cc7bf4218bb 100644 --- a/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetDisableTechnologiesVariableActionTest.java +++ b/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetEnableTechnologiesVariableActionTest.java @@ -18,8 +18,8 @@ package ch.systemsx.cisd.openbis.installer.izpack; import static ch.systemsx.cisd.openbis.installer.izpack.GlobalInstallationContext.TECHNOLOGY_PROTEOMICS; import static ch.systemsx.cisd.openbis.installer.izpack.GlobalInstallationContext.TECHNOLOGY_SCREENING; -import static ch.systemsx.cisd.openbis.installer.izpack.SetDisableTechnologiesVariableAction.DISABLED_CORE_PLUGINS_KEY; -import static ch.systemsx.cisd.openbis.installer.izpack.SetDisableTechnologiesVariableAction.ENABLED_TECHNOLOGIES_VARNAME; +import static ch.systemsx.cisd.openbis.installer.izpack.SetEnableTechnologiesVariableAction.DISABLED_CORE_PLUGINS_KEY; +import static ch.systemsx.cisd.openbis.installer.izpack.SetEnableTechnologiesVariableAction.ENABLED_TECHNOLOGIES_VARNAME; import static ch.systemsx.cisd.openbis.installer.izpack.SetTechnologyCheckBoxesAction.ENABLED_TECHNOLOGIES_KEY; import java.io.File; @@ -43,7 +43,7 @@ import ch.systemsx.cisd.common.filesystem.FileUtilities; * * @author Franz-Josef Elmer */ -public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystemTestCase +public class SetEnableTechnologiesVariableActionTest extends AbstractFileSystemTestCase { private File configFile; private File dssConfigFile; @@ -79,7 +79,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "true"); variables.setProperty(TECHNOLOGY_SCREENING, "false"); - AutomatedInstallData data = updateDisabledTechnologyProperties(variables, true); + AutomatedInstallData data = updateEnabledTechnologyProperties(variables, true); assertEquals("proteomics", data.getVariable(ENABLED_TECHNOLOGIES_VARNAME)); } @@ -91,7 +91,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "false"); variables.setProperty(TECHNOLOGY_SCREENING, "false"); - AutomatedInstallData data = updateDisabledTechnologyProperties(variables, true); + AutomatedInstallData data = updateEnabledTechnologyProperties(variables, true); assertEquals("", data.getVariable(ENABLED_TECHNOLOGIES_VARNAME)); } @@ -105,7 +105,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem try { - updateDisabledTechnologyProperties(variables, false); + updateEnabledTechnologyProperties(variables, false); fail("Exception expected."); } catch (RuntimeException ex) { @@ -124,7 +124,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "true"); variables.setProperty(TECHNOLOGY_SCREENING, "false"); - updateDisabledTechnologyProperties(variables, false); + updateEnabledTechnologyProperties(variables, false); assertEquals("[abc = 123, " + ENABLED_TECHNOLOGIES_KEY + "=proteomics]", FileUtilities .loadToStringList(configFile).toString()); @@ -139,7 +139,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "true"); variables.setProperty(TECHNOLOGY_SCREENING, "true"); - updateDisabledTechnologyProperties(variables, false); + updateEnabledTechnologyProperties(variables, false); assertEquals("[abc = 123, " + ENABLED_TECHNOLOGIES_KEY + " = proteomics, screening, answer = 42]", FileUtilities .loadToStringList(configFile).toString()); @@ -155,7 +155,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "false"); variables.setProperty(TECHNOLOGY_SCREENING, "true"); - updateDisabledTechnologyProperties(variables, false); + updateEnabledTechnologyProperties(variables, false); assertEquals("[abc = 123, " + ENABLED_TECHNOLOGIES_KEY + " = screening]", FileUtilities .loadToStringList(configFile).toString()); @@ -163,6 +163,23 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem .loadToStringList(dssConfigFile).toString()); } + @Test + public void testUpdateAppendPropertyWithEmptyDisabledCorePluginsProperty() + { + FileUtilities.writeToFile(configFile, "abc = 123"); + FileUtilities.writeToFile(dssConfigFile, DISABLED_CORE_PLUGINS_KEY + "= "); + Properties variables = new Properties(); + variables.setProperty(TECHNOLOGY_PROTEOMICS, "false"); + variables.setProperty(TECHNOLOGY_SCREENING, "true"); + + updateEnabledTechnologyProperties(variables, false); + + assertEquals("[abc = 123, " + ENABLED_TECHNOLOGIES_KEY + " = screening]", FileUtilities + .loadToStringList(configFile).toString()); + assertEquals("[" + DISABLED_CORE_PLUGINS_KEY + " = proteomics]", FileUtilities + .loadToStringList(dssConfigFile).toString()); + } + @Test public void testUpdateDisabledPluginsForSwitchedTechnologies() { @@ -173,7 +190,7 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "false"); variables.setProperty(TECHNOLOGY_SCREENING, "true"); - updateDisabledTechnologyProperties(variables, false); + updateEnabledTechnologyProperties(variables, false); assertEquals("[a = b, " + DISABLED_CORE_PLUGINS_KEY + " = proteomics:a:b, proteomics, " + "gamma = alpha]", FileUtilities.loadToStringList(dssConfigFile).toString()); @@ -189,14 +206,14 @@ public class SetDisableTechnologiesVariableActionTest extends AbstractFileSystem variables.setProperty(TECHNOLOGY_PROTEOMICS, "false"); variables.setProperty(TECHNOLOGY_SCREENING, "true"); - updateDisabledTechnologyProperties(variables, false); + updateEnabledTechnologyProperties(variables, false); } - private AutomatedInstallData updateDisabledTechnologyProperties(Properties variables, + private AutomatedInstallData updateEnabledTechnologyProperties(Properties variables, boolean isFirstTimeInstallation) { InstallData data = new InstallData(variables, new VariableSubstitutorImpl(new Properties())); - SetDisableTechnologiesVariableAction action = new SetDisableTechnologiesVariableAction(); + SetEnableTechnologiesVariableAction action = new SetEnableTechnologiesVariableAction(); action.updateEnabledTechnologyProperty(data, isFirstTimeInstallation, workingDirectory); return data; }