From 5304a281d530abbe2aa57dc2583bc72d7988c949 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Feb 2014 14:57:42 +0100 Subject: config gui for vidp mockups --- .../data/oa/AttributeProviderPlugin.java | 24 ++++++++++++++++++++++ .../id/configuration/data/oa/OASTORKConfig.java | 12 +++++++++++ 2 files changed, 36 insertions(+) create mode 100644 id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java (limited to 'id/ConfigWebTool/src/main/java') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java new file mode 100644 index 000000000..275bc81c4 --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java @@ -0,0 +1,24 @@ +package at.gv.egovernment.moa.id.configuration.data.oa; + +import at.gv.egovernment.moa.id.protocols.stork2.StorkAttributeRequestProvider; + +public class AttributeProviderPlugin { + private String url = "demourl"; + private Class plugin = StorkAttributeRequestProvider.class; + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public Class getPlugin() { + return plugin; + } + + public void setPlugin(Class plugin) { + this.plugin = plugin; + } +} 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 da07b10b0..f084115c4 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 @@ -126,4 +126,16 @@ public class OASTORKConfig { public void setHelperAttributes(List attributes) { this.attributes = attributes; } + + + public List getAttributeProviderPlugins() { + List result = new ArrayList(); + result.add(new AttributeProviderPlugin()); + + return result; + } + + public boolean isVidpEnabled() { + return true; + } } -- cgit v1.2.3 From ea9d46e1fb39ad31d9bfe6226442b71b8bb11539 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Feb 2014 15:09:55 +0100 Subject: available attribute provider dropdown selection --- .../gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'id/ConfigWebTool/src/main/java') 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 f084115c4..99d783f4f 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 @@ -128,6 +128,13 @@ public class OASTORKConfig { } + public List getAvailableAttributeProviderPlugins() { + List result = new ArrayList(); + result.add(new AttributeProviderPlugin().getPlugin().getSimpleName()); + + return result; + } + public List getAttributeProviderPlugins() { List result = new ArrayList(); result.add(new AttributeProviderPlugin()); -- cgit v1.2.3 From 44b1f27b00306cac728f6921befd0c1eddb97f81 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Feb 2014 16:23:43 +0100 Subject: drafted config saving --- .../data/oa/AttributeProviderPlugin.java | 8 +++---- .../id/configuration/data/oa/OASTORKConfig.java | 26 +++++++++++++++++----- 2 files changed, 23 insertions(+), 11 deletions(-) (limited to 'id/ConfigWebTool/src/main/java') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java index 275bc81c4..00b7b09ce 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java @@ -1,10 +1,8 @@ package at.gv.egovernment.moa.id.configuration.data.oa; -import at.gv.egovernment.moa.id.protocols.stork2.StorkAttributeRequestProvider; - public class AttributeProviderPlugin { private String url = "demourl"; - private Class plugin = StorkAttributeRequestProvider.class; + private String plugin = "demo"; public String getUrl() { return url; @@ -14,11 +12,11 @@ public class AttributeProviderPlugin { this.url = url; } - public Class getPlugin() { + public String getPlugin() { return plugin; } - public void setPlugin(Class plugin) { + public void setPlugin(String plugin) { this.plugin = plugin; } } 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 99d783f4f..23181076a 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 @@ -77,6 +77,10 @@ public class OASTORKConfig { attributes.add(tmp); } + + // fetch vidp config + attributeProviderPlugins = new ArrayList(); + attributeProviderPlugins.add(new AttributeProviderPlugin()); } } } @@ -126,7 +130,12 @@ public class OASTORKConfig { public void setHelperAttributes(List attributes) { this.attributes = attributes; } - + + /* + * VIDP settings below + */ + private boolean vidpEnabled = false; + private List attributeProviderPlugins; public List getAvailableAttributeProviderPlugins() { List result = new ArrayList(); @@ -136,13 +145,18 @@ public class OASTORKConfig { } public List getAttributeProviderPlugins() { - List result = new ArrayList(); - result.add(new AttributeProviderPlugin()); - - return result; + return attributeProviderPlugins; + } + + public void setAttributeProviderPlugins(List update) { + attributeProviderPlugins = update; } public boolean isVidpEnabled() { - return true; + return vidpEnabled; + } + + public void setVidpEnabled(boolean update) { + vidpEnabled = update; } } -- cgit v1.2.3 From 42c8940c7b813744933d261e4c414f17762062cd Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Feb 2014 16:57:14 +0100 Subject: ap plugins are persisted now --- .../data/oa/AttributeProviderPlugin.java | 22 ---------------------- .../id/configuration/data/oa/OASTORKConfig.java | 12 ++++++++++-- .../configuration/struts/action/EditOAAction.java | 2 ++ 3 files changed, 12 insertions(+), 24 deletions(-) delete mode 100644 id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java (limited to 'id/ConfigWebTool/src/main/java') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java deleted file mode 100644 index 00b7b09ce..000000000 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/AttributeProviderPlugin.java +++ /dev/null @@ -1,22 +0,0 @@ -package at.gv.egovernment.moa.id.configuration.data.oa; - -public class AttributeProviderPlugin { - private String url = "demourl"; - private String plugin = "demo"; - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getPlugin() { - return plugin; - } - - public void setPlugin(String plugin) { - this.plugin = plugin; - } -} 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 23181076a..72fc6e3a1 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,6 +26,7 @@ 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; @@ -79,8 +80,15 @@ public class OASTORKConfig { } // fetch vidp config - attributeProviderPlugins = new ArrayList(); - attributeProviderPlugins.add(new AttributeProviderPlugin()); + 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()); } } } 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 775443689..c257c76c8 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 @@ -984,6 +984,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) { -- cgit v1.2.3 From 4c2406224be2df8b09050178630cdcff979c5ebf Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Mon, 24 Feb 2014 11:42:44 +0100 Subject: introduced attributeproviderfactory --- .../gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'id/ConfigWebTool/src/main/java') 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 72fc6e3a1..430bafbf5 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 @@ -24,7 +24,6 @@ package at.gv.egovernment.moa.id.configuration.data.oa; 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; @@ -32,6 +31,7 @@ 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.id.protocols.stork2.AttributeProviderFactory; public class OASTORKConfig { @@ -146,10 +146,7 @@ public class OASTORKConfig { private List attributeProviderPlugins; public List getAvailableAttributeProviderPlugins() { - List result = new ArrayList(); - result.add(new AttributeProviderPlugin().getPlugin().getSimpleName()); - - return result; + return AttributeProviderFactory.getAvailablePlugins(); } public List getAttributeProviderPlugins() { -- cgit v1.2.3 From e220daf9bc0eac36c3e20406865f99f4760a30d3 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Feb 2014 08:45:04 +0100 Subject: config validators --- .../validation/oa/OASTORKConfigValidation.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'id/ConfigWebTool/src/main/java') 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; } -- cgit v1.2.3