aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2013-10-01 14:18:25 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2013-10-01 14:18:25 +0200
commita49bdd53d713a73f706d120f3e386a1ed71ae67e (patch)
tree55160b6d3157e29460c215fa40afccfe5731df5a /id/ConfigWebTool/src
parent1dbab6b07a8996a7f291e0ddc4b02c0d3e15a64d (diff)
downloadmoa-id-spss-a49bdd53d713a73f706d120f3e386a1ed71ae67e.tar.gz
moa-id-spss-a49bdd53d713a73f706d120f3e386a1ed71ae67e.tar.bz2
moa-id-spss-a49bdd53d713a73f706d120f3e386a1ed71ae67e.zip
@MOA-ID ConfigWebTool:
--update commercial-register number input validator --some short bugfixes @MOA-ID: --update advanced statistic logger --Move Exception classes to a special package --add to Exception types
Diffstat (limited to 'id/ConfigWebTool/src')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/MetaDataVerificationFilter.java2
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java1
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java34
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java30
-rw-r--r--id/ConfigWebTool/src/main/resources/struts.xml2
5 files changed, 49 insertions, 20 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/MetaDataVerificationFilter.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/MetaDataVerificationFilter.java
index d08354c43..043ae6811 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/MetaDataVerificationFilter.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/MetaDataVerificationFilter.java
@@ -9,7 +9,7 @@ import org.opensaml.saml2.metadata.provider.MetadataFilter;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.security.x509.BasicX509Credential;
-import at.gv.egovernment.moa.id.MOAIDException;
+import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
import at.gv.egovernment.moa.id.protocols.pvp2x.verification.EntityVerifier;
public class MetaDataVerificationFilter implements MetadataFilter {
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java
index e7e1beb45..c795e20ba 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java
@@ -1,7 +1,6 @@
package at.gv.egovernment.moa.id.configuration.filter;
import java.io.IOException;
-import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.regex.Pattern;
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 6a7087c85..1676b014d 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
@@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
@@ -20,6 +21,7 @@ import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA;
import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType;
import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS;
+import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs;
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;
@@ -119,6 +121,7 @@ ServletResponseAware {
&& !userdb.isIsMailAddressVerified()) {
log.info("Online-Applikation managemant disabled. Mail address is not verified.");
addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
+ return Constants.STRUTS_SUCCESS;
}
@@ -186,16 +189,31 @@ ServletResponseAware {
&& !userdb.isIsMailAddressVerified()) {
log.info("Online-Applikation managemant disabled. Mail address is not verified.");
addActionError(LanguageHelper.getErrorString("error.editoa.mailverification"));
+ return Constants.STRUTS_SUCCESS;
}
-
+
+ MOAIDConfiguration moaidconfig = ConfigurationDBRead.getMOAIDConfiguration();
+ if (moaidconfig != null) {
+ DefaultBKUs defaultbkus = moaidconfig.getDefaultBKUs();
+ if (defaultbkus != null) {
+ generalOA.setBkuHandyURL(defaultbkus.getHandyBKU());
+ generalOA.setBkuLocalURL(defaultbkus.getLocalBKU());
+ generalOA.setBkuOnlineURL(defaultbkus.getOnlineBKU());
+ }
+ }
+
//set UserSpezific OA Parameters
if (!authUser.isAdmin())
generateUserSpecificConfigurationOptions(userdb);
+
+
+ ConfigurationDBUtils.closeSession();
newOA = true;
formID = Random.nextRandom();
session.setAttribute(Constants.SESSION_FORMID, formID);
+
return Constants.STRUTS_OA_EDIT;
}
@@ -616,8 +634,13 @@ ServletResponseAware {
dboa.setType(Constants.MOA_CONFIG_BUSINESSSERVICE);
String num = generalOA.getIdentificationNumber().replaceAll(" ", "");
- if (num.startsWith(Constants.IDENIFICATIONTYPE_FN))
+ 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');
+ }
if (num.startsWith(Constants.IDENIFICATIONTYPE_ZVR))
num = num.substring(Constants.IDENIFICATIONTYPE_ZVR.length());
@@ -858,7 +881,12 @@ ServletResponseAware {
deaktivededBusinessService = true;
String[] split = bpk.split("\\+");
generalOA.setIdentificationType(split[1].substring(1));
- generalOA.setIdentificationNumber(split[2]);
+
+ if (bpk.startsWith(Constants.IDENIFICATIONTYPE_BASEID_FN))
+ generalOA.setIdentificationNumber(
+ at.gv.egovernment.moa.util.StringUtils.deleteLeadingZeros(split[2]));
+ else
+ generalOA.setIdentificationNumber(split[2]);
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java
index 8ef7c44cf..9903b5391 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAGeneralConfigValidation.java
@@ -54,11 +54,11 @@ public class OAGeneralConfigValidation {
//Check BKU URLs
if (isAdmin) {
check =form.getBkuHandyURL();
- if (MiscUtil.isEmpty(check)) {
- log.info("Empty Handy-BKU URL");
- errors.add(LanguageHelper.getErrorString("validation.general.bku.handy.empty"));
-
- } else {
+ if (MiscUtil.isNotEmpty(check)) {
+// log.info("Empty Handy-BKU URL");
+// errors.add(LanguageHelper.getErrorString("validation.general.bku.handy.empty"));
+//
+// } else {
if (!ValidationHelper.validateURL(check)) {
log.info("Not valid Handy-BKU URL");
errors.add(LanguageHelper.getErrorString("validation.general.bku.handy.valid"));
@@ -66,11 +66,11 @@ public class OAGeneralConfigValidation {
}
check =form.getBkuLocalURL();
- if (MiscUtil.isEmpty(check)) {
- log.info("Empty Local-BKU URL");
- errors.add(LanguageHelper.getErrorString("validation.general.bku.local.empty"));
-
- } else {
+ if (MiscUtil.isNotEmpty(check)) {
+// log.info("Empty Local-BKU URL");
+// errors.add(LanguageHelper.getErrorString("validation.general.bku.local.empty"));
+//
+// } else {
if (!ValidationHelper.validateURL(check)) {
log.info("Not valid Online-BKU URL");
errors.add(LanguageHelper.getErrorString("validation.general.bku.local.valid"));
@@ -78,11 +78,11 @@ public class OAGeneralConfigValidation {
}
check =form.getBkuOnlineURL();
- if (MiscUtil.isEmpty(check)) {
- log.info("Empty Online-BKU URL");
- errors.add(LanguageHelper.getErrorString("validation.general.bku.online.empty"));
-
- } else {
+ if (MiscUtil.isNotEmpty(check)) {
+// log.info("Empty Online-BKU URL");
+// errors.add(LanguageHelper.getErrorString("validation.general.bku.online.empty"));
+//
+// } else {
if (!ValidationHelper.validateURL(check)) {
log.info("Not valid Online-BKU URL");
errors.add(LanguageHelper.getErrorString("validation.general.bku.online.valid"));
diff --git a/id/ConfigWebTool/src/main/resources/struts.xml b/id/ConfigWebTool/src/main/resources/struts.xml
index ce4b408b4..a0bf3f468 100644
--- a/id/ConfigWebTool/src/main/resources/struts.xml
+++ b/id/ConfigWebTool/src/main/resources/struts.xml
@@ -115,6 +115,7 @@
<action name="newOA" method="newOA" class="at.gv.egovernment.moa.id.configuration.struts.action.EditOAAction">
<result name="editOA">/jsp/editOAGeneral.jsp</result>
+ <result name="success" type="chain">main</result>
<result name="error">/error.jsp</result>
<result name="reauthentication" type="redirectAction">
<param name="actionName">logout</param>
@@ -125,6 +126,7 @@
<action name="loadOA" method="inital" class="at.gv.egovernment.moa.id.configuration.struts.action.EditOAAction">
<result name="editOA">/jsp/editOAGeneral.jsp</result>
+ <result name="success" type="chain">main</result>
<result name="error">/error.jsp</result>
<result name="reauthentication" type="redirectAction">
<param name="actionName">logout</param>