aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/InterfederationIDPAction.java42
1 files changed, 25 insertions, 17 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/InterfederationIDPAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/InterfederationIDPAction.java
index dfb27673a..813aa1960 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/InterfederationIDPAction.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/InterfederationIDPAction.java
@@ -35,6 +35,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.OnlineApplication;
import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase;
+import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
import at.gv.egovernment.moa.id.commons.validation.ValidationHelper;
import at.gv.egovernment.moa.id.configuration.Constants;
import at.gv.egovernment.moa.id.configuration.data.FormularCustomization;
@@ -246,22 +247,29 @@ public class InterfederationIDPAction extends BasicOAAction {
session.setAttribute(Constants.SESSION_FORMID, formID);
return Constants.STRUTS_ERROR_VALIDATION;
- } else {
-
+ } else {
+ onlineapplication = postProcessSaveOnlineApplication(onlineapplication);
+
//set default Target interfederated nameID caluclation
- if (getGeneralOA().isBusinessService()) {
- IdentificationNumber businessID = onlineapplication.getAuthComponentOA().getIdentificationNumber();
- if (businessID == null) {
- businessID = new IdentificationNumber();
- onlineapplication.getAuthComponentOA().setIdentificationNumber(businessID);
- }
- businessID.setValue(Constants.PREFIX_WPBK + "MOA-IDP");
-
- } else
- onlineapplication.setTarget("MOA-IDP");
-
- postProcessSaveOnlineApplication(onlineapplication);
-
+ if (getPvp2OA() != null) {
+ if (getGeneralOA().isBusinessService()) {
+ IdentificationNumber businessID = onlineapplication.getAuthComponentOA().getIdentificationNumber();
+ if (businessID == null) {
+ businessID = new IdentificationNumber();
+ onlineapplication.getAuthComponentOA().setIdentificationNumber(businessID);
+ }
+ businessID.setValue(Constants.PREFIX_WPBK + "MOA-IDP");
+ } else
+ onlineapplication.setTarget("MOA-IDP");
+
+ try {
+ ConfigurationDBUtils.saveOrUpdate(onlineapplication);
+
+ } catch (MOADatabaseException e) {
+ log.warn("Online-Application can not be stored.", e);
+ return LanguageHelper.getErrorString("error.db.oa.store", request);
+ }
+ }
}
//remove session attributes
@@ -331,8 +339,8 @@ public class InterfederationIDPAction extends BasicOAAction {
OnlineApplication onlineapplication = ConfigurationDBRead.getOnlineApplication(oaidentifier);
try {
- if (MiscUtil.isNotEmpty(onlineapplication.getAuthComponentOA().getOAPVP2().getMetadataURL())) {
-
+ if (onlineapplication.getAuthComponentOA().getOAPVP2() != null &&
+ MiscUtil.isNotEmpty(onlineapplication.getAuthComponentOA().getOAPVP2().getMetadataURL())) {
MOAIDConfiguration moaconfig = ConfigurationDBRead.getMOAIDConfiguration();
moaconfig.setPvp2RefreshItem(new Date());
ConfigurationDBUtils.saveOrUpdate(moaconfig);