aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-03-17 11:35:59 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-03-17 11:35:59 +0100
commitab9c1d3b201ca110f33831133a85ea2da353e5d8 (patch)
treed1f5f775900abba04bad20027b714d993be0ecca /id/ConfigWebTool/src/main/java/at/gv
parenta442134f88a2e766ea6fdce9b80075c5a9a8b420 (diff)
downloadmoa-id-spss-ab9c1d3b201ca110f33831133a85ea2da353e5d8.tar.gz
moa-id-spss-ab9c1d3b201ca110f33831133a85ea2da353e5d8.tar.bz2
moa-id-spss-ab9c1d3b201ca110f33831133a85ea2da353e5d8.zip
change mandate profile configuration
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/OAGeneralConfig.java30
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java19
2 files changed, 41 insertions, 8 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
index ba58701fc..990227738 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java
@@ -37,6 +37,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector;
import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates;
+import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem;
import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType;
import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType;
@@ -212,15 +213,32 @@ public class OAGeneralConfig {
Mandates mandates = oaauth.getMandates();
if (mandates != null) {
- if (MiscUtil.isNotEmpty(mandates.getProfiles())) {
- mandateProfiles = mandates.getProfiles();
- useMandates = true;
+ mandateProfiles = null;
+
+ List<MandatesProfileNameItem> profileList = mandates.getProfileNameItems();
+ for (MandatesProfileNameItem el : profileList) {
+ if (mandateProfiles == null)
+ mandateProfiles = el.getItem();
- } else {
- mandateProfiles = new String();
- useMandates = false;
+ else
+ mandateProfiles += "," + el.getItem();
}
+ //TODO: only for RC1
+ if (MiscUtil.isNotEmpty(mandates.getProfiles())) {
+ if (mandateProfiles == null)
+ mandateProfiles = mandates.getProfiles();
+
+ else
+ mandateProfiles += "," + mandates.getProfiles();
+
+ }
+
+ if (mandateProfiles != null)
+ useMandates = true;
+
+ else
+ useMandates = false;
}
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..131a27935 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
@@ -45,6 +45,7 @@ import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
+import org.bouncycastle.asn1.InMemoryRepresentable;
import at.gv.egovernment.moa.id.auth.builder.LoginFormBuilder;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
@@ -57,6 +58,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector;
import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates;
+import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAOAUTH20;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2;
import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1;
@@ -909,10 +911,23 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware,
Mandates mandates = new Mandates();
if (generalOA.isUseMandates()) {
- mandates.setProfiles(generalOA.getMandateProfiles());
+ if (MiscUtil.isNotEmpty(generalOA.getMandateProfiles())) {
+ List<MandatesProfileNameItem> profileList = new ArrayList<MandatesProfileNameItem>();
+ String[] inputList = generalOA.getMandateProfiles().split(",");
+ for (int i=0; i<inputList.length; i++) {
+
+ MandatesProfileNameItem item = new MandatesProfileNameItem();
+ item.setItem(inputList[i]);
+ profileList.add(item);
+ }
+ mandates.setProfileNameItems(profileList );
+ mandates.setProfiles(null);
+ }
+
} else {
- mandates.setProfiles(new String());
+ mandates.setProfiles(null);
+ mandates.setProfileNameItems(null);
}
authoa.setMandates(mandates);