aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java3
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java1
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java39
3 files changed, 23 insertions, 20 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 f1cc4277c..d5355a421 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
@@ -50,9 +50,6 @@ public class OASTORKConfig {
private boolean requireConsent = false;
public OASTORKConfig() {
- if (attributeProviderPlugins.isEmpty()) {
- attributeProviderPlugins.add(new AttributeProviderPlugin());
- }
}
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 80f74ff54..78747eca6 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
@@ -221,6 +221,7 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware,
//VIDP attribute provider configuration
storkOA = new OASTORKConfig();
+ storkOA.getAttributeProviderPlugins().add(new AttributeProviderPlugin());
newOA = true;
formID = Random.nextRandom();
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java
index 9e877605e..554aa9ff0 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java
@@ -49,26 +49,31 @@ public class OASTORKConfigValidation {
new Object[] {qaa} ));
}
- for(AttributeProviderPlugin current : oageneral.getAttributeProviderPlugins()) {
- if (MiscUtil.isEmpty(current.getUrl()) || !ValidationHelper.validateURL(current.getUrl())) {
- log.info("AttributeProviderPlugin URL has no valid form.");
- errors.add(LanguageHelper.getErrorString("validation.stork.ap.url.valid"));
- }
- if (MiscUtil.isEmpty(current.getName())) {
- log.info("AttributeProviderPlugin Name is empty.");
- errors.add(LanguageHelper.getErrorString("validation.stork.ap.name.empty"));
+ if (oageneral.isVidpEnabled()) {
+ for(AttributeProviderPlugin current : oageneral.getAttributeProviderPlugins()) {
+ if (MiscUtil.isEmpty(current.getUrl()) || !ValidationHelper.validateURL(current.getUrl())) {
+ log.info("AttributeProviderPlugin URL has no valid form.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.url.valid"));
+ }
+ if (MiscUtil.isEmpty(current.getName())) {
+ log.info("AttributeProviderPlugin Name is empty.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.name.empty"));
+
+ } else {
+ if (!oageneral.getAvailableAttributeProviderPlugins().contains(current.getName())) {
+ log.info("AttributeProviderPlugin Name is not supported.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.name.valid"));
+ }
+ }
- } else {
- if (!oageneral.getAvailableAttributeProviderPlugins().contains(current.getName())) {
- log.info("AttributeProviderPlugin Name is not supported.");
- errors.add(LanguageHelper.getErrorString("validation.stork.ap.name.valid"));
- }
+ if (MiscUtil.isEmpty(current.getAttributes()) || !current.getAttributes().matches("[a-zA-Z]+(, ?[a-zA-Z]+)*")) {
+ log.info("AttributeProviderPlugin attributes are empty or do not match csv format.");
+ errors.add(LanguageHelper.getErrorString("validation.stork.ap.attributes.valid"));
+ }
}
- if (MiscUtil.isEmpty(current.getAttributes()) || !current.getAttributes().matches("[a-zA-Z]+(, ?[a-zA-Z]+)*")) {
- log.info("AttributeProviderPlugin attributes are empty or do not match csv format.");
- errors.add(LanguageHelper.getErrorString("validation.stork.ap.attributes.valid"));
- }
+ } else {
+ oageneral.setAttributeProviderPlugins(null);
}
return errors;