aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-01-17 11:56:10 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-01-17 11:56:10 +0100
commit8b4b3a97cdbdfc4158781982f6e9fc2900871198 (patch)
treeea924998ca61ef36a2fafb888b6477af966df8b1 /id/ConfigWebTool/src/main/java/at/gv/egovernment
parentd7404bc44ae84df98031a87052ff2d71ac960bd1 (diff)
downloadmoa-id-spss-8b4b3a97cdbdfc4158781982f6e9fc2900871198.tar.gz
moa-id-spss-8b4b3a97cdbdfc4158781982f6e9fc2900871198.tar.bz2
moa-id-spss-8b4b3a97cdbdfc4158781982f6e9fc2900871198.zip
Exthex Version 0.2
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java3
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAOAuth20Config.java27
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java21
3 files changed, 20 insertions, 31 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
index 7f3a2129a..536cc0522 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java
@@ -48,11 +48,8 @@ public class Constants {
public static final String PUBLICSERVICE_URL_POSTFIX = ".gv.at";
public static final String IDENIFICATIONTYPE_FN = "FN";
- public static final String IDENIFICATIONTYPE_FN_TYPE = "Firmenbuchnummer";
public static final String IDENIFICATIONTYPE_ERSB = "ERSB";
- public static final String IDENIFICATIONTYPE_ERSB_TYPE = "ERJPZahl";
public static final String IDENIFICATIONTYPE_ZVR = "ZVR";
- public static final String IDENIFICATIONTYPE_ZVR_TYPE = "Vereinsnummer";
public static final String IDENIFICATIONTYPE_BASEID = "urn:publicid:gv.at:baseid+";
public static final String IDENIFICATIONTYPE_BASEID_FN = IDENIFICATIONTYPE_BASEID + "X" + IDENIFICATIONTYPE_FN;
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAOAuth20Config.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAOAuth20Config.java
index 3d2e35ec5..63aa1a1cb 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAOAuth20Config.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAOAuth20Config.java
@@ -29,22 +29,27 @@ public class OAOAuth20Config {
AuthComponentOA authdata = dbOAConfig.getAuthComponentOA();
if (authdata != null) {
- OAOAUTH20 config = authdata.getOAOAUTH20();
// set client id to public url prefix
this.clientId = dbOAConfig.getPublicURLPrefix();
- // validate secret
- if (config != null && StringUtils.isNotEmpty(config.getOAuthClientSecret())) {
- this.clientSecret = config.getOAuthClientSecret();
- } else {
- this.generateClientSecret();
- }
+ OAOAUTH20 config = authdata.getOAOAUTH20();
- // validate redirectUri
- if (config != null && StringUtils.isNotEmpty(config.getOAuthRedirectUri()) && OAuth20Util.isUrl(config.getOAuthRedirectUri())) {
- this.redirectUri = config.getOAuthRedirectUri();
+ if (config != null) {
+ // validate secret
+ if (StringUtils.isNotEmpty(config.getOAuthClientSecret())) {
+ this.clientSecret = config.getOAuthClientSecret();
+ } else {
+ this.generateClientSecret();
+ }
+
+ // validate redirectUri
+ if (StringUtils.isNotEmpty(config.getOAuthRedirectUri()) && OAuth20Util.isUrl(config.getOAuthRedirectUri())) {
+ this.redirectUri = config.getOAuthRedirectUri();
+ } else {
+ errors.add(LanguageHelper.getErrorString("error.oa.oauth.redirecturi"));
+ }
} else {
- errors.add(LanguageHelper.getErrorString("error.oa.oauth.redirecturi"));
+ this.generateClientSecret();
}
}
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 f6f742c5c..fc66eede4 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
@@ -724,34 +724,21 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware,
dboa.setType(Constants.MOA_CONFIG_BUSINESSSERVICE);
String num = generalOA.getIdentificationNumber().replaceAll(" ", "");
- String type = null;
if (num.startsWith(Constants.IDENIFICATIONTYPE_FN)) {
num = num.substring(Constants.IDENIFICATIONTYPE_FN.length());
num = at.gv.egovernment.moa.util.StringUtils.deleteLeadingZeros(num);
// num = StringUtils.leftPad(num, 7, '0');
- type = Constants.IDENIFICATIONTYPE_FN_TYPE;
}
- if (num.startsWith(Constants.IDENIFICATIONTYPE_ZVR)) {
- num = num.substring(Constants.IDENIFICATIONTYPE_ZVR.length());
- type = Constants.IDENIFICATIONTYPE_ZVR_TYPE;
- }
+ if (num.startsWith(Constants.IDENIFICATIONTYPE_ZVR)) num = num.substring(Constants.IDENIFICATIONTYPE_ZVR.length());
- if (num.startsWith(Constants.IDENIFICATIONTYPE_ERSB)) {
- num = num.substring(Constants.IDENIFICATIONTYPE_ERSB.length());
- type = Constants.IDENIFICATIONTYPE_ERSB_TYPE;
- }
+ if (num.startsWith(Constants.IDENIFICATIONTYPE_ERSB)) num = num.substring(Constants.IDENIFICATIONTYPE_ERSB.length());
IdentificationNumber idnumber = new IdentificationNumber();
- idnumber.setType(type);
- idnumber.setValue(
- Constants.PREFIX_WPBK +
- generalOA.getIdentificationType() +
- "+" +
- num);
-
+ idnumber.setValue(Constants.PREFIX_WPBK + generalOA.getIdentificationType() + "+" + num);
+
authoa.setIdentificationNumber(idnumber);
} else {