From 51d622a9cb1bd50c49ec3ba1b1299b1f5b5aa233 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Mon, 21 Aug 2017 07:02:21 +0000 Subject: [PATCH] SSDM-5512: PATHINFO_DB_ENABLED flag removed SVN: 38636 --- installation/resource/installer/install.xml | 1 - .../resource/installer/userInputSpec.xml | 7 -- .../resource/tarball/console.properties | 5 -- .../izpack/ExecuteSetupScriptsAction.java | 40 ++++----- .../izpack/GlobalInstallationContext.java | 2 - .../izpack/SetPathinfoDBCheckBoxAction.java | 52 ------------ .../izpack/ExecuteSetupScriptsActionTest.java | 52 +----------- .../SetPathinfoDBCheckBoxActionTest.java | 81 ------------------- 8 files changed, 18 insertions(+), 222 deletions(-) delete mode 100644 installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxAction.java delete mode 100644 installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxActionTest.java diff --git a/installation/resource/installer/install.xml b/installation/resource/installer/install.xml index 30aa7dcf312..bc5a002a0c5 100644 --- a/installation/resource/installer/install.xml +++ b/installation/resource/installer/install.xml @@ -145,7 +145,6 @@ <panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.TECHNOLOGIES"> <actions> <action stage="preactivate" classname="ch.systemsx.cisd.openbis.installer.izpack.SetTechnologyCheckBoxesAction" /> - <action stage="preactivate" classname="ch.systemsx.cisd.openbis.installer.izpack.SetPathinfoDBCheckBoxAction" /> <action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.SetEnableTechnologiesVariableAction" /> </actions> </panel> diff --git a/installation/resource/installer/userInputSpec.xml b/installation/resource/installer/userInputSpec.xml index 8d6af8a1ef1..7e388185c12 100644 --- a/installation/resource/installer/userInputSpec.xml +++ b/installation/resource/installer/userInputSpec.xml @@ -71,13 +71,6 @@ <field type="check" variable="FLOW"> <spec txt="Flow Cytometry" true="true" false="false"/> </field> - - <field type="space"/> - <field type="staticText" align="left" - txt="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." /> - <field type="check" variable="PATHINFO_DB_ENABLED"> - <spec txt="Fast data set file browsing" true="true" false="false"/> - </field> </panel> <panel id="UserInputPanel.ELN_MASTER_DATA"> diff --git a/installation/resource/tarball/console.properties b/installation/resource/tarball/console.properties index f624b7c7b7c..e6b782b2761 100644 --- a/installation/resource/tarball/console.properties +++ b/installation/resource/tarball/console.properties @@ -56,11 +56,6 @@ KEY_PASSWORD = changeit # Full ELN/LIMS master data is enabled by default. This setting is meaningful only if ELN-LIMS is enabled ELN-LIMS-MASTER-DATA = false -# 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. -# Default value is true. -#PATHINFO_DB_ENABLED = true - # # Comma-separated list of databases to backup. If the list is empty or undefined all databases # will be backauped. diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsAction.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsAction.java index ed374f975fd..273ad5eea29 100644 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsAction.java +++ b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsAction.java @@ -98,9 +98,7 @@ public class ExecuteSetupScriptsAction extends AbstractScriptExecutor data.getVariable(GlobalInstallationContext.KEY_STORE_PASSWORD_VARNAME); String certificatePassword = data.getVariable(GlobalInstallationContext.KEY_PASSWORD_VARNAME); - String pathinfoDBEnabled = - data.getVariable(GlobalInstallationContext.PATHINFO_DB_ENABLED); - enablePathinfoDB("false".equalsIgnoreCase(pathinfoDBEnabled) == false, installDir); + enablePathinfoDB(installDir); installKeyStore(keyStoreFileName, installDir); String previousJettyVersion = getJettyVersion(installDir); if (previousJettyVersion.equals(JETTY_BEFORE_9_2)) @@ -209,35 +207,27 @@ public class ExecuteSetupScriptsAction extends AbstractScriptExecutor } } - void enablePathinfoDB(boolean enableFlag, File installDir) + void enablePathinfoDB(File installDir) { File dssServicePropertiesFile = new File(installDir, Utils.DSS_PATH + Utils.SERVICE_PROPERTIES_PATH); - if (enableFlag) + for (int i = 0; i < KEYS.length; i++) { - for (int i = 0; i < KEYS.length; i++) + String key = KEYS[i]; + String newTerm = TERMS[i]; + Utils.removeTermFromPropertyList(dssServicePropertiesFile, key, newTerm); + String classProperty = newTerm + "." + CLASS_POSTFIX[i]; + int indexOfDot = key.indexOf('.'); + if (indexOfDot >= 0) { - String key = KEYS[i]; - String newTerm = TERMS[i]; - String classProperty = newTerm + "." + CLASS_POSTFIX[i]; - int indexOfDot = key.indexOf('.'); - if (indexOfDot >= 0) - { - classProperty = key.substring(0, indexOfDot) + "." + classProperty; - } - String className = - Utils.tryToGetProperties(dssServicePropertiesFile).getProperty( - classProperty); - if (className != null) - { - Utils.addTermToPropertyList(dssServicePropertiesFile, key, newTerm); - } + classProperty = key.substring(0, indexOfDot) + "." + classProperty; } - } else - { - for (int i = 0; i < KEYS.length; i++) + String className = + Utils.tryToGetProperties(dssServicePropertiesFile).getProperty( + classProperty); + if (className != null) { - Utils.removeTermFromPropertyList(dssServicePropertiesFile, KEYS[i], TERMS[i]); + Utils.addTermToPropertyList(dssServicePropertiesFile, key, newTerm); } } } diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/GlobalInstallationContext.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/GlobalInstallationContext.java index 8ee2a703c08..e574491916c 100644 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/GlobalInstallationContext.java +++ b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/GlobalInstallationContext.java @@ -58,8 +58,6 @@ public class GlobalInstallationContext public static final String TECHNOLOGY_SHARED_MICROSCOPY_FLOW_CYTOMETRY = "SHARED"; - public static final String PATHINFO_DB_ENABLED = "PATHINFO_DB_ENABLED"; - public static final String[] TECHNOLOGIES = { TECHNOLOGY_PROTEOMICS, TECHNOLOGY_SCREENING, TECHNOLOGY_ILLUMINA_NGS, TECHNOLOGY_ELN_LIMS, TECHNOLOGY_MICROSCOPY, TECHNOLOGY_FLOW_CYTOMETRY }; diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxAction.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxAction.java deleted file mode 100644 index 7c99a18258d..00000000000 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2013 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 com.izforge.izpack.api.data.AutomatedInstallData; -import com.izforge.izpack.api.data.PanelActionConfiguration; -import com.izforge.izpack.api.handler.AbstractUIHandler; -import com.izforge.izpack.data.PanelAction; - -/** - * Action which sets the boolean variable PATHINFO_DB_ENABLED - * - * @author Franz-Josef Elmer - */ -public class SetPathinfoDBCheckBoxAction implements PanelAction -{ - @Override - public void initialize(PanelActionConfiguration configuration) - { - } - - @Override - public void executeAction(AutomatedInstallData data, AbstractUIHandler handler) - { - boolean pathinfoDBEnabled = true; - String dataSources = - Utils.tryToGetServicePropertyOfDSS(GlobalInstallationContext.installDir, - ExecuteSetupScriptsAction.DATA_SOURCES_KEY); - if (dataSources != null) - { - pathinfoDBEnabled = - dataSources.contains(ExecuteSetupScriptsAction.PATHINFO_DB_DATA_SOURCE); - } - data.setVariable(GlobalInstallationContext.PATHINFO_DB_ENABLED, - Boolean.toString(pathinfoDBEnabled)); - } - -} diff --git a/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsActionTest.java b/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsActionTest.java index 648ec9fcd76..a4555e9a01b 100644 --- a/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsActionTest.java +++ b/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/ExecuteSetupScriptsActionTest.java @@ -86,47 +86,11 @@ public class ExecuteSetupScriptsActionTest extends AbstractFileSystemTestCase } @Test - public void testDisableAndEnablePathinfoDB() throws Exception - { - Properties properties = loadProperties(dssServicePropertiesFile); - assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_DATA_SOURCE, - properties.getProperty(ExecuteSetupScriptsAction.DATA_SOURCES_KEY).trim()); - assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_FEEDING_TASK, - properties.getProperty(ExecuteSetupScriptsAction.POST_REGISTRATION_TASKS_KEY)); - assertEquals("post-registration, " + ExecuteSetupScriptsAction.PATHINFO_DB_DELETION_TASK, - properties.getProperty(ExecuteSetupScriptsAction.MAINTENANCE_PLUGINS_KEY)); - assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_CHECK, - properties.getProperty(ExecuteSetupScriptsAction.PROCESSING_PLUGINS_KEY)); - - action.enablePathinfoDB(false, workingDirectory); - - properties = loadProperties(dssServicePropertiesFile); - assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.DATA_SOURCES_KEY)); - assertEquals("", - properties.getProperty(ExecuteSetupScriptsAction.POST_REGISTRATION_TASKS_KEY)); - assertEquals("post-registration", - properties.getProperty(ExecuteSetupScriptsAction.MAINTENANCE_PLUGINS_KEY)); - assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.PROCESSING_PLUGINS_KEY)); - - action.enablePathinfoDB(true, workingDirectory); - - properties = loadProperties(dssServicePropertiesFile); - assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_DATA_SOURCE, - properties.getProperty(ExecuteSetupScriptsAction.DATA_SOURCES_KEY)); - assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_FEEDING_TASK, - properties.getProperty(ExecuteSetupScriptsAction.POST_REGISTRATION_TASKS_KEY)); - assertEquals("post-registration, " + ExecuteSetupScriptsAction.PATHINFO_DB_DELETION_TASK, - properties.getProperty(ExecuteSetupScriptsAction.MAINTENANCE_PLUGINS_KEY)); - assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_CHECK, - properties.getProperty(ExecuteSetupScriptsAction.PROCESSING_PLUGINS_KEY)); - } - - @Test - public void testDisableAndEnablePathinfoDBNotDefinedInServiceProperties() throws Exception + public void testEnablePathinfoDBNotDefinedInServiceProperties() throws Exception { FileUtilities.writeToFile(dssServicePropertiesFile, ""); - action.enablePathinfoDB(false, workingDirectory); + action.enablePathinfoDB(workingDirectory); Properties properties = loadProperties(dssServicePropertiesFile); assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.DATA_SOURCES_KEY)); @@ -135,16 +99,6 @@ public class ExecuteSetupScriptsActionTest extends AbstractFileSystemTestCase assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.MAINTENANCE_PLUGINS_KEY)); assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.PROCESSING_PLUGINS_KEY)); - - action.enablePathinfoDB(true, workingDirectory); - - properties = loadProperties(dssServicePropertiesFile); - assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.DATA_SOURCES_KEY)); - assertEquals("", - properties.getProperty(ExecuteSetupScriptsAction.POST_REGISTRATION_TASKS_KEY)); - assertEquals("", - properties.getProperty(ExecuteSetupScriptsAction.MAINTENANCE_PLUGINS_KEY)); - assertEquals("", properties.getProperty(ExecuteSetupScriptsAction.PROCESSING_PLUGINS_KEY)); } @Test @@ -158,7 +112,7 @@ public class ExecuteSetupScriptsActionTest extends AbstractFileSystemTestCase assertEquals("post-registration, " + ExecuteSetupScriptsAction.PATHINFO_DB_DELETION_TASK, properties.getProperty(ExecuteSetupScriptsAction.MAINTENANCE_PLUGINS_KEY)); - action.enablePathinfoDB(true, workingDirectory); + action.enablePathinfoDB(workingDirectory); properties = loadProperties(dssServicePropertiesFile); assertEquals(ExecuteSetupScriptsAction.PATHINFO_DB_DATA_SOURCE, diff --git a/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxActionTest.java b/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxActionTest.java deleted file mode 100644 index a20b384188e..00000000000 --- a/installation/sourceTest/java/ch/systemsx/cisd/openbis/installer/izpack/SetPathinfoDBCheckBoxActionTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2013 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 java.io.File; -import java.io.IOException; -import java.util.Properties; - -import org.apache.commons.io.FileUtils; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import com.izforge.izpack.installer.data.InstallData; - -import ch.systemsx.cisd.base.tests.AbstractFileSystemTestCase; -import ch.systemsx.cisd.common.filesystem.FileUtilities; - -/** - * @author Franz-Josef Elmer - */ -public class SetPathinfoDBCheckBoxActionTest extends AbstractFileSystemTestCase -{ - private File dssServicePropertiesFile; - - private SetPathinfoDBCheckBoxAction action; - - @BeforeMethod - public void setUpFiles() throws IOException - { - dssServicePropertiesFile = - new File(workingDirectory, Utils.DSS_PATH + Utils.SERVICE_PROPERTIES_PATH); - FileUtils.copyFile(new File("../openbis_standard_technologies/dist/etc/service.properties/"), - dssServicePropertiesFile); - GlobalInstallationContext.installDir = workingDirectory; - action = new SetPathinfoDBCheckBoxAction(); - } - - @Test - public void testDefaultServiceProperties() - { - InstallData data = new InstallData(new Properties(), null); - action.executeAction(data, null); - - assertEquals("true", data.getVariable(GlobalInstallationContext.PATHINFO_DB_ENABLED)); - } - - @Test - public void testRemovedPathinfoDatasource() - { - Utils.updateOrAppendProperty(dssServicePropertiesFile, - ExecuteSetupScriptsAction.DATA_SOURCES_KEY, "halihalo"); - InstallData data = new InstallData(new Properties(), null); - action.executeAction(data, null); - - assertEquals("false", data.getVariable(GlobalInstallationContext.PATHINFO_DB_ENABLED)); - } - - @Test - public void testNonExistingServiceProperties() - { - FileUtilities.delete(dssServicePropertiesFile); - InstallData data = new InstallData(new Properties(), null); - action.executeAction(data, null); - - assertEquals("true", data.getVariable(GlobalInstallationContext.PATHINFO_DB_ENABLED)); - } -} -- GitLab