aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-04-10 14:43:05 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-04-10 14:43:05 +0200
commitbfae00e07fd2932f951622a4f25ecf593c0d46df (patch)
tree05503435351b9339c8125c2695d1504a3716443f /id/ConfigWebTool/src/main/java/at
parentb3d3d3af963ed03704d73272aaf906e2eb109c0d (diff)
downloadmoa-id-spss-bfae00e07fd2932f951622a4f25ecf593c0d46df.tar.gz
moa-id-spss-bfae00e07fd2932f951622a4f25ecf593c0d46df.tar.bz2
moa-id-spss-bfae00e07fd2932f951622a4f25ecf593c0d46df.zip
if a validation error occure and SLTransformation is not empty then store SLTransformation in session
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java1
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java18
2 files changed, 19 insertions, 0 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
index 69ac58d15..70241fafb 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
@@ -56,6 +56,7 @@ public class Constants {
public static final String SESSION_OAUTH20SECRET = "oauth20secret";
public static final String SESSION_BKUSELECTIONTEMPLATE = "bkuSelectionTemplate";
public static final String SESSION_SENDASSERTIONTEMPLATE = "sendAssertionTemplate";
+ public static final String SESSION_SLTRANSFORMATION = "slTransformation";
public static final String SESSION_I18n = "WW_TRANS_I18N_LOCALE";
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
index cb3a2a1ff..a54d6c74a 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java
@@ -165,13 +165,31 @@ public class EditGeneralConfigAction extends BasicAction {
log.info("General MOA-ID configuration has some errors.");
for (String el : errors)
addActionError(el);
+
+ if (moaconfig.getSecLayerTransformation() != null) {
+ session.setAttribute(Constants.SESSION_SLTRANSFORMATION, moaconfig.getSecLayerTransformation());
+ }
formID = Random.nextRandom();
session.setAttribute(Constants.SESSION_FORMID, formID);
+
return Constants.STRUTS_ERROR_VALIDATION;
+
+ } else {
+ if (moaconfig.getSecLayerTransformation() == null &&
+ session.getAttribute(Constants.SESSION_SLTRANSFORMATION) != null &&
+ session.getAttribute(Constants.SESSION_SLTRANSFORMATION) instanceof Map<?, ?> ) {
+ moaconfig.setSecLayerTransformation((Map<String, byte[]>)
+ session.getAttribute(Constants.SESSION_SLTRANSFORMATION));
+
+ }
}
+
+
String error = saveFormToDatabase();
+
+ session.setAttribute(Constants.SESSION_SLTRANSFORMATION, null);
if (error != null) {
log.warn("General MOA-ID config can not be stored in Database");