aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java53
1 files changed, 37 insertions, 16 deletions
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 d26fe8a89..c0e1eaaf7 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
@@ -41,7 +41,8 @@ import at.gv.egovernment.moa.id.config.webgui.exception.ConfigurationException;
import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser;
import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.configuration.validation.oa.OASTORKConfigValidation;
-import at.gv.egovernment.moa.id.protocols.stork2.AttributeProviderFactory;
+import at.gv.egovernment.moa.util.MiscUtil;
+//import at.gv.egovernment.moa.id.protocols.stork2.AttributeProviderFactory;
public class OASTORKConfig implements IOnlineApplicationData{
@@ -120,8 +121,10 @@ public class OASTORKConfig implements IOnlineApplicationData{
enabledCitizenCountries = new ArrayList<String>();
- for(CPEPS current : config.getCPEPS())
- enabledCitizenCountries.add(current.getCountryCode());
+ if (config.getCPEPS() != null) {
+ for(CPEPS current : config.getCPEPS())
+ enabledCitizenCountries.add(current.getCountryCode());
+ }
// prepare attribute helper list
attributes = new ArrayList<AttributeHelper>();
@@ -130,9 +133,11 @@ public class OASTORKConfig implements IOnlineApplicationData{
for(StorkAttribute current : dbconfig.getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes()) {
AttributeHelper tmp = null;
- for(OAStorkAttribute sepp : config.getOAAttributes())
- if(sepp.getName().equals(current.getName()))
- tmp = new AttributeHelper(sepp);
+ if (config.getOAAttributes() != null) {
+ for(OAStorkAttribute sepp : config.getOAAttributes())
+ if(sepp.getName() != null && sepp.getName().equals(current.getName()))
+ tmp = new AttributeHelper(sepp);
+ }
if(null == tmp)
tmp = new AttributeHelper(current);
@@ -237,16 +242,29 @@ public class OASTORKConfig implements IOnlineApplicationData{
return result;
for(AttributeHelper current : getHelperAttributes()) {
- for(StorkAttribute currentAttribute : dbconfig.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);
+ List<StorkAttribute> generalConfStorkAttr = null;
+ try {
+ generalConfStorkAttr = dbconfig.getAuthComponentGeneral().getForeignIdentities().getSTORK().getAttributes();
+
+ } catch (NullPointerException e) {
+ log.trace("No STORK attributes in 'General Configuration'");
+
+ }
+
+ if (generalConfStorkAttr != null) {
+ for(StorkAttribute currentAttribute : generalConfStorkAttr)
+ if(MiscUtil.isNotEmpty(currentAttribute.getName()) &&
+ 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;
}
- break;
- }
+ }
}
return result;
@@ -293,7 +311,10 @@ public class OASTORKConfig implements IOnlineApplicationData{
}
public List<String> getAvailableAttributeProviderPlugins() {
- return AttributeProviderFactory.getAvailablePlugins();
+ //TODO: remove in final version
+
+ return new ArrayList<String>();
+ //return AttributeProviderFactory.getAvailablePlugins();
}
public List<AttributeProviderPlugin> getAttributeProviderPlugins() {