From 7fb3ae0e4922ec76e998937b771df244574be394 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 14 Jan 2014 13:45:24 +0100 Subject: refactored stork-related database structure --- .../id/configuration/data/GeneralStorkConfig.java | 4 +++- .../id/configuration/data/oa/AttributeHelper.java | 3 +-- .../id/configuration/data/oa/OASTORKConfig.java | 28 +++++++++++++--------- .../struts/action/EditGeneralConfigAction.java | 2 +- .../configuration/struts/action/EditOAAction.java | 2 +- .../src/main/webapp/jsp/editOAGeneral.jsp | 7 +++--- 6 files changed, 26 insertions(+), 20 deletions(-) (limited to 'id/ConfigWebTool/src') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java index 854334bed..ce4803978 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java @@ -34,12 +34,14 @@ public class GeneralStorkConfig { cpepslist.add(current); } - List tmp = stork.getRequestedAttributes(); + List tmp = stork.getAttributes(); if(null != tmp) { attributes = new ArrayList(); for(StorkAttribute current : tmp) attributes.add(current); } + if(attributes.isEmpty()) + attributes.add(new StorkAttribute()); try { qaa = stork.getQualityAuthenticationAssuranceLevel(); diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeHelper.java index 1590918c6..349f3bf4a 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeHelper.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeHelper.java @@ -15,9 +15,8 @@ public class AttributeHelper { public AttributeHelper(OAStorkAttribute attribute) { isUsed = true; - name = attribute.getAttribute().getName(); + name = attribute.getName(); mandatory = attribute.isMandatory(); - readonly = attribute.getAttribute().isMandatory(); } public AttributeHelper(StorkAttribute attribute) { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index 42501b4d1..10ebbe112 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -43,11 +43,11 @@ public class OASTORKConfig { // prepare attribute helper list attributes = new ArrayList(); - for(StorkAttribute current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getRequestedAttributes()) { + for(StorkAttribute current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes()) { AttributeHelper tmp = null; - for(OAStorkAttribute sepp : config.getAttributes()) - if(sepp.getAttribute().equals(current)) + for(OAStorkAttribute sepp : config.getOAAttributes()) + if(sepp.getName().equals(current.getName())) tmp = new AttributeHelper(sepp); if(null == tmp) @@ -77,15 +77,21 @@ public class OASTORKConfig { public List getAttributes() { List result = new ArrayList(); + + if(null == getHelperAttributes()) + return result; + for(AttributeHelper current : getHelperAttributes()) { - if(current.isUsed()) { - OAStorkAttribute tmp = new OAStorkAttribute(); - for(StorkAttribute currentAttribute : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getRequestedAttributes()) - if(currentAttribute.getName().equals(current.getName())) - tmp.setAttribute(currentAttribute); - tmp.setMandatory(current.isMandatory()); - result.add(tmp); - } + for(StorkAttribute currentAttribute : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes()) + if(currentAttribute.getName().equals(current.getName())) { + if(current.isUsed() || currentAttribute.isMandatory()) { + OAStorkAttribute tmp = new OAStorkAttribute(); + tmp.setName(current.getName()); + tmp.setMandatory(current.isMandatory()); + result.add(tmp); + } + break; + } } return result; 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 1de440506..1c0cc5c89 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 @@ -398,7 +398,7 @@ public class EditGeneralConfigAction extends ActionSupport oldstork = new STORK(); oldstork.setQualityAuthenticationAssuranceLevel(storkconfig.getDefaultQaa()); - oldstork.setRequestedAttributes(storkconfig.getAttributes()); + oldstork.setAttributes(storkconfig.getAttributes()); oldstork.setCPEPS(storkconfig.getCpepslist()); dbforeign.setSTORK(oldstork); } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java index 59d5f7302..ca027e578 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java @@ -968,7 +968,7 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware, // transfer the incoming data to the database model stork.setStorkLogonEnabled(storkOA.isStorkLogonEnabled()); stork.setQaa(storkOA.getQaa()); - stork.setAttributes(storkOA.getAttributes()); + stork.setOAAttributes(storkOA.getAttributes()); try { if (newentry) { diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index 413298724..b58b997ec 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -322,10 +322,9 @@ - - - - + + +
verwendetAttributnamemandatory
" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/>
-- cgit v1.2.3