aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-04-07 10:44:11 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-04-07 10:44:11 +0200
commit4b932484d66ef161bb547a419fdc32f04677fe57 (patch)
treea99bbc8c9357e6a55c1cff24267b244309d4a775 /id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts
parent2fb3856bb3412bc825ea789f8d98177a8c527964 (diff)
downloadmoa-id-spss-4b932484d66ef161bb547a419fdc32f04677fe57.tar.gz
moa-id-spss-4b932484d66ef161bb547a419fdc32f04677fe57.tar.bz2
moa-id-spss-4b932484d66ef161bb547a419fdc32f04677fe57.zip
fix some possible problems with STORK configuration in config-GUI
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java99
1 files changed, 67 insertions, 32 deletions
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 504b598c0..d12c1342c 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
@@ -542,42 +542,77 @@ public class EditGeneralConfigAction extends BasicAction {
forcon.setURL(moaconfig.getSzrgwURL());
}
- ForeignIdentities foreign = dbauth.getForeignIdentities();
- if (foreign != null) {
- STORK stork = foreign.getSTORK();
- if (stork == null) {
- stork = new STORK();
- foreign.setSTORK(stork);
-
- }
-
- try {
- log.error("QAAAA " + storkconfig.getDefaultQaa());
- stork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa());
+ ForeignIdentities foreign = dbauth.getForeignIdentities();
+ if (foreign != null) {
+ STORK stork = foreign.getSTORK();
+ if (stork == null) {
+ stork = new STORK();
+ foreign.setSTORK(stork);
- if (storkconfig.getAttributes() != null)
- stork.setAttributes(storkconfig.getAttributes());
-
- else
+ }
+
+ try {
+ log.error("QAAAA " + storkconfig.getDefaultQaa());
+ stork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa());
+
+ if (storkconfig.getAttributes() != null) {
+ List<StorkAttribute> dbStorkAttr = stork.getAttributes();
+ if (dbStorkAttr == null) {
+ dbStorkAttr = new ArrayList<StorkAttribute>();
+ stork.setAttributes(dbStorkAttr);
+
+ }
+
+ for (StorkAttribute attr : storkconfig.getAttributes()) {
+ if (attr != null && MiscUtil.isNotEmpty(attr.getName()))
+ dbStorkAttr.add(attr);
+
+ else
+ log.info("Remove null or empty STORK attribute");
+ }
+
+ } else
stork.setAttributes((List<StorkAttribute>) (new ArrayList<StorkAttribute>()));
- if (storkconfig.getCpepslist() != null)
-
- stork.setCPEPS(storkconfig.getCpepslist());
- else
- stork.setCPEPS((List<CPEPS>) (new ArrayList<CPEPS>()));
+ if (storkconfig.getCpepslist() != null) {
+ List<CPEPS> dbStorkCPEPS = stork.getCPEPS();
+ if (dbStorkCPEPS == null) {
+ dbStorkCPEPS = new ArrayList<CPEPS>();
+ stork.setCPEPS(dbStorkCPEPS);
+ }
+
+ for (CPEPS cpeps : storkconfig.getCpepslist()) {
+ if (cpeps != null && MiscUtil.isNotEmpty(cpeps.getURL()) &&
+ MiscUtil.isNotEmpty(cpeps.getCountryCode())) {
+
+ if (cpeps.getCountryCode().equals("CC") &&
+ cpeps.getURL().equals("http://"))
+ log.info("Remove dummy STORK CPEPS entry.");
+
+ else
+ dbStorkCPEPS.add(cpeps);
+
+ } else
+ log.info("Remove null or emtpy STORK CPEPS configuration");
+ }
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- try{
- log.info("CPEPS LIST: " + storkconfig.getCpepslist().size() );
- log.trace("CPEPS 1:" + storkconfig.getCpepslist().get(0).getCountryCode() +storkconfig.getCpepslist().get(0).getURL());
- } catch (Exception ex) {
- log.info("CPEPS LIST is null");
- }
- }
+ } else
+ stork.setCPEPS((List<CPEPS>) (new ArrayList<CPEPS>()));
+
+ } catch (Exception e) {
+ e.printStackTrace();
+
+ }
+
+ try{
+ log.info("CPEPS LIST: " + storkconfig.getCpepslist().size() );
+ log.trace("CPEPS 1:" + storkconfig.getCpepslist().get(0).getCountryCode() +storkconfig.getCpepslist().get(0).getURL());
+
+ } catch (Exception ex) {
+ log.info("CPEPS LIST is null");
+
+ }
+ }
if (MiscUtil.isNotEmpty(moaconfig.getMandateURL())) {
OnlineMandates dbmandate = dbauth.getOnlineMandates();