From 7ea7407652abd15dd1a02ec2b3d1fdf5b2a8ffd5 Mon Sep 17 00:00:00 2001 From: felmer <felmer> Date: Wed, 10 Oct 2012 06:32:07 +0000 Subject: [PATCH] SP-319, BIS-209: Show wizard page for key store passwords only if key store file has been chosen. SVN: 27125 --- installation/resource/installer/install.xml | 17 +++++++++++++---- .../resource/installer/userInputSpec.xml | 7 ++++--- .../izpack/GlobalInstallationContext.java | 2 ++ .../installer/izpack/KeystoreAction.java | 4 ++++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/installation/resource/installer/install.xml b/installation/resource/installer/install.xml index 13505bb4c5b..b79f7408931 100644 --- a/installation/resource/installer/install.xml +++ b/installation/resource/installer/install.xml @@ -77,6 +77,13 @@ <name>IS_STANDARD_TECHNOLOGIES</name> <value>true</value> </condition> + <condition type="java" id="presentKeyStoreFile"> + <java> + <class>ch.systemsx.cisd.openbis.installer.izpack.GlobalInstallationContext</class> + <field>presentKeyStoreFile</field> + </java> + <returnvalue type="boolean">true</returnvalue> + </condition> </conditions> <!-- The panels section. We indicate here which panels we want to use. The order will be respected. --> @@ -97,12 +104,15 @@ </panel> <panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.KEY_STORE" > - <validator classname="ch.systemsx.cisd.openbis.installer.izpack.KeyStoreValidator" /> <actions> - <action stage="preactivate" classname="ch.systemsx.cisd.openbis.installer.izpack.KeystoreAction" /> + <action stage="postvalidate" classname="ch.systemsx.cisd.openbis.installer.izpack.KeystoreAction" /> </actions> </panel> + <panel classname="com.izforge.izpack.panels.userinput.UserInputPanel" id="UserInputPanel.KEY_STORE_PASSWORDS" condition="presentKeyStoreFile"> + <validator classname="ch.systemsx.cisd.openbis.installer.izpack.KeyStoreValidator" /> + </panel> + <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" /> @@ -125,9 +135,8 @@ <panel classname="com.izforge.izpack.panels.packs.PacksPanel"/> <panel classname="com.izforge.izpack.panels.install.InstallPanel"> - <validator classname="ch.systemsx.cisd.openbis.installer.izpack.KeyStoreValidator" /> <actions> - <action stage="prevalidate" 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" /> </actions> </panel> diff --git a/installation/resource/installer/userInputSpec.xml b/installation/resource/installer/userInputSpec.xml index e9f7ac1f08e..dc3e886bdb5 100644 --- a/installation/resource/installer/userInputSpec.xml +++ b/installation/resource/installer/userInputSpec.xml @@ -16,10 +16,11 @@ <spec txt="Key store" size="20" set="" mustExist="true" allowEmptyValue="true" /> </field> - <field type="space"/> + </panel> + + <panel id="UserInputPanel.KEY_STORE_PASSWORDS"> + <field type="title" txt="Key Store Passwords" bold="true" size="2" /> - <field type="staticText" align="left" - txt="Passwords are needed to be changed only if a new key store with different passwords has been selected." /> <field type="password" align="left" variable="KEY_STORE_PASSWORD"> <spec> <pwd txt="Key store password" size="20" set="" /> 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 aba75901053..9e0c175c6ce 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 @@ -70,6 +70,8 @@ public class GlobalInstallationContext public static boolean noPsqlToolsOnPath = (false == PostgresInstallationDetectorUtils .areCommandLineToolsOnPath()); + public static boolean presentKeyStoreFile = false; + public static File installDir; public static void initialize(AutomatedInstallData data) diff --git a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/KeystoreAction.java b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/KeystoreAction.java index 21e44642d21..0c6d613a8e8 100644 --- a/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/KeystoreAction.java +++ b/installation/source/java/ch/systemsx/cisd/openbis/installer/izpack/KeystoreAction.java @@ -45,6 +45,10 @@ public class KeystoreAction implements PanelAction getDssServiceProperty(Utils.DSS_KEYSTORE_PASSWORD_KEY, DEFAULT_PASSWORD)); data.setVariable(GlobalInstallationContext.KEY_PASSWORD_VARNAME, getDssServiceProperty(Utils.DSS_KEYSTORE_KEY_PASSWORD_KEY, DEFAULT_KEY_PASSWORD)); + String keyStoreFilePath = + data.getVariable(GlobalInstallationContext.KEY_STORE_FILE_VARNAME); + GlobalInstallationContext.presentKeyStoreFile = + keyStoreFilePath != null && keyStoreFilePath.length() > 0; } public String getDssServiceProperty(String propertyKey, String defaultValue) -- GitLab