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.java40
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java2
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OASTORKConfigValidation.java14
3 files changed, 56 insertions, 0 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 c35bff633..9f1e9cfd8 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
@@ -26,12 +26,14 @@ import java.util.ArrayList;
import java.util.List;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute;
import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute;
import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.id.protocols.stork2.AttributeProviderFactory;
public class OASTORKConfig {
@@ -78,6 +80,18 @@ public class OASTORKConfig {
tmp = new AttributeHelper(current);
attributes.add(tmp);
+ }
+
+ // fetch vidp config
+ setVidpEnabled(config.isVidpEnabled());
+
+ attributeProviderPlugins = config.getAttributeProviders();
+ // - if no attribute providers are configured, add a dummy
+ // TODO this is a dirty hack since we have to have one entry to
+ // clone from in the web form. Happens when time is short.
+ // Sorry.
+ if (attributeProviderPlugins.isEmpty())
+ attributeProviderPlugins.add(new AttributeProviderPlugin());
} } catch (NullPointerException ex) {
Logger.error("Nullpointerexception encountered in Configurationinterface");
}
@@ -130,4 +144,30 @@ public class OASTORKConfig {
public void setHelperAttributes(List<AttributeHelper> attributes) {
this.attributes = attributes;
}
+
+ /*
+ * VIDP settings below
+ */
+ private boolean vidpEnabled = false;
+ private List<AttributeProviderPlugin> attributeProviderPlugins;
+
+ public List<String> getAvailableAttributeProviderPlugins() {
+ return AttributeProviderFactory.getAvailablePlugins();
+ }
+
+ public List<AttributeProviderPlugin> getAttributeProviderPlugins() {
+ return attributeProviderPlugins;
+ }
+
+ public void setAttributeProviderPlugins(List<AttributeProviderPlugin> update) {
+ attributeProviderPlugins = update;
+ }
+
+ public boolean isVidpEnabled() {
+ return vidpEnabled;
+ }
+
+ public void setVidpEnabled(boolean update) {
+ vidpEnabled = update;
+ }
}
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 fd4030937..99bdfdc9c 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
@@ -1070,6 +1070,8 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware,
stork.setStorkLogonEnabled(storkOA.isStorkLogonEnabled());
stork.setQaa(storkOA.getQaa());
stork.setOAAttributes(storkOA.getAttributes());
+ stork.setVidpEnabled(storkOA.isVidpEnabled());
+ stork.setAttributeProviders(storkOA.getAttributeProviderPlugins());
try {
if (newentry) {
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 f72999020..25e0d751c 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
@@ -27,8 +27,11 @@ import java.util.List;
import org.apache.log4j.Logger;
+import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin;
import at.gv.egovernment.moa.id.configuration.data.oa.OASTORKConfig;
import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper;
+import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper;
+import at.gv.egovernment.moa.util.MiscUtil;
public class OASTORKConfigValidation {
@@ -45,6 +48,17 @@ public class OASTORKConfigValidation {
errors.add(LanguageHelper.getErrorString("validation.stork.qaa.outofrange",
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.valid"));
+ }
+ }
return errors;
}