From bfae00e07fd2932f951622a4f25ecf593c0d46df Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 10 Apr 2014 14:43:05 +0200 Subject: if a validation error occure and SLTransformation is not empty then store SLTransformation in session --- .../gv/egovernment/moa/id/configuration/Constants.java | 1 + .../struts/action/EditGeneralConfigAction.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'id/ConfigWebTool/src/main/java/at/gv') 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) + 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"); -- cgit v1.2.3