From 83773a3597dfccbf16c8265fa3ef9019706a3461 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 12 Dec 2013 12:23:55 +0100 Subject: peps list in general config --- .../id/configuration/data/GeneralStorkConfig.java | 43 ++++++++++++++++++++++ .../struts/action/EditGeneralConfigAction.java | 24 +++++++++++- 2 files changed, 66 insertions(+), 1 deletion(-) (limited to 'id/ConfigWebTool/src/main/java/at/gv') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java index d0b108e1e..51c6e8aa4 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralStorkConfig.java @@ -1,5 +1,48 @@ package at.gv.egovernment.moa.id.configuration.data; +import java.util.ArrayList; +import java.util.List; + +import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; +import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; + public class GeneralStorkConfig { + private List cpepslist; + + public void parse(MOAIDConfiguration config) { + + if (config != null) { + AuthComponentGeneral auth = config.getAuthComponentGeneral(); + + if (auth != null) { + ForeignIdentities foreign = auth.getForeignIdentities(); + + if (foreign != null) { + STORK stork = foreign.getSTORK(); + if (stork != null) { + // deep clone to foreclose lazyloading session timeouts + cpepslist = new ArrayList(); + for(CPEPS current : stork.getCPEPS()) { + cpepslist.add(current); + } + } + } + } + } + } + + public List getCpepslist() { + return cpepslist; + } + + public void setCpepslist(List cpepslist) { + this.cpepslist = cpepslist; + } + + + } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java index 61ab3cecd..b4ae27c6a 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java @@ -48,6 +48,7 @@ import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; import at.gv.egovernment.moa.id.configuration.data.GeneralMOAIDConfig; +import at.gv.egovernment.moa.id.configuration.data.GeneralStorkConfig; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; import at.gv.egovernment.moa.id.configuration.validation.moaconfig.MOAConfigValidator; import at.gv.egovernment.moa.id.util.Random; @@ -65,7 +66,8 @@ public class EditGeneralConfigAction extends ActionSupport private AuthenticatedUser authUser; private GeneralMOAIDConfig moaconfig; - + private GeneralStorkConfig storkconfig; + private String formID; public String loadConfig() { @@ -84,6 +86,8 @@ public class EditGeneralConfigAction extends ActionSupport moaconfig = new GeneralMOAIDConfig(); moaconfig.parse(dbconfig); + storkconfig = new GeneralStorkConfig(); + storkconfig.parse(dbconfig); ConfigurationDBUtils.closeSession(); @@ -531,6 +535,24 @@ public class EditGeneralConfigAction extends ActionSupport public void setMoaconfig(GeneralMOAIDConfig moaconfig) { this.moaconfig = moaconfig; } + + /** + * Gets the storkconfig. + * + * @return the storkconfig + */ + public GeneralStorkConfig getStorkconfig() { + return storkconfig; + } + + /** + * Sets the storkconfig. + * + * @param storkconfig the new storkconfig + */ + public void setStorkconfig(GeneralStorkConfig storkconfig) { + this.storkconfig = storkconfig; + } /** * @return the formID -- cgit v1.2.3