From 868b44cfa0b086710dcaf49e9b029a0b05bc8826 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 17 Jan 2014 15:46:22 +0100 Subject: fixing maven errors --- id/server/moa-id-commons/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 9ec756f85..3862a0d82 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -101,6 +101,7 @@ org.apache.maven.plugins maven-jar-plugin + true true false @@ -187,4 +188,4 @@ - \ No newline at end of file + -- cgit v1.2.3 From ed19c3b21b338e05efae1067216a5bbb7d60efe4 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 17 Jan 2014 16:09:46 +0100 Subject: changing chars to reflect utf8 --- id/server/moa-id-commons/moa-id-commons.iml | 63 +++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 id/server/moa-id-commons/moa-id-commons.iml (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml new file mode 100644 index 000000000..e8ef0548b --- /dev/null +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From f5c184fb20f87732030868e58653fdf68113f05a Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Mon, 27 Jan 2014 18:33:39 +0100 Subject: fix version for oa lib --- id/server/moa-id-commons/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 9dc17d7c9..3862a0d82 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -3,7 +3,7 @@ MOA.id moa-id - 1.9.96-SNAPSHOT + 1.9.97-SNAPSHOT moa-id-commons moa-id-commons -- cgit v1.2.3 From 791615f1f887f81ade19a374e2552f3cb1be89ab Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Mon, 3 Feb 2014 19:04:01 +0100 Subject: merging again --- id/server/moa-id-commons/moa-id-commons.iml | 5 ++--- id/server/moa-id-commons/pom.xml | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index 411421a90..3dfcfd427 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -29,11 +29,10 @@ + - - - + diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 6ff61a12e..9a3cf4f7c 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -3,7 +3,7 @@ MOA.id moa-id -cd id + 1.9.98-SNAPSHOT moa-id-commons moa-id-commons @@ -14,7 +14,12 @@ cd id hyberjaxb http://repository.highsource.org/maven2/releases/ true - + + + JBoss IAIK + http://nexus.iaik.tugraz.at/nexus/content/repositories/nexus/ + + -- cgit v1.2.3 From 65fb688c9323696fcc12e1c049a2b6a75d6ff1e5 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Tue, 4 Feb 2014 17:25:09 +0100 Subject: merging with other code --- id/server/moa-id-commons/moa-id-commons.iml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index 3dfcfd427..08d15d746 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -26,13 +26,14 @@ - - + + - - + + + -- cgit v1.2.3 From 42c8940c7b813744933d261e4c414f17762062cd Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 20 Feb 2014 16:57:14 +0100 Subject: ap plugins are persisted now --- .../src/main/resources/config/moaid_config_2.0.xsd | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index 33ad5c990..ea78918b6 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -49,7 +49,7 @@ - + possibility to include common austrian primary keys in human readable way, english translation not available @@ -933,6 +933,8 @@ type="xsd:boolean" /> + + @@ -1010,4 +1012,13 @@ + + + + + + + + + -- cgit v1.2.3 From caee81b311e93720d4c1fe2b3de22cdcbb0fe74d Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Wed, 26 Feb 2014 16:32:48 +0100 Subject: config --- .../moa/id/commons/db/ConfigurationDBRead.java | 706 ++++++++++----------- 1 file changed, 353 insertions(+), 353 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java index e4e4ce98a..88220cded 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java @@ -22,366 +22,366 @@ *******************************************************************************/ package at.gv.egovernment.moa.id.commons.db; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.persistence.EntityManager; - -import org.apache.commons.lang.StringEscapeUtils; - 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.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; +import org.apache.commons.lang.StringEscapeUtils; + +import javax.persistence.EntityManager; +import javax.persistence.PersistenceException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @SuppressWarnings("rawtypes") public class ConfigurationDBRead { - private static Map QUERIES = new HashMap(); - static { - QUERIES.put("getActiveOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1'"); - QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix))"); - QUERIES.put("getOnlineApplicationWithDBID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id"); - QUERIES.put("getAllOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication"); - QUERIES.put("getAllActiveOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '1'"); - QUERIES.put("getAllNewOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1'"); - QUERIES.put("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration"); - QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id"); - QUERIES.put("getNewUserWithUserTokken", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken"); - QUERIES.put("getAllNewUsers", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '1'"); - QUERIES.put("getAllOpenUsersRequests", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is not null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0'"); - QUERIES.put("getUserWithUserBPKWBPK", "select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk"); - QUERIES.put("getUserWithUserUsername", "select userdatabase from UserDatabase userdatabase where userdatabase.username = :username"); - QUERIES.put("getAllUsers", "select userdatabase from UserDatabase userdatabase"); - QUERIES.put("getUsersWithOADBID", "select userdatabase from UserDatabase userdatabase inner join userdatabase.onlineApplication oa where oa.hjid = :id"); - QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id"); } - - public static OnlineApplication getActiveOnlineApplication(String id) { - MiscUtil.assertNotNull(id, "OnlineApplictionID"); - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID")); - //query.setParameter("id", id+"%"); - query.setParameter("id", StringEscapeUtils.escapeHtml(id)); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.debug("No entries found."); - return null; - } - - if (result.size() > 1) { - Logger.warn("OAIdentifier match to more then one DB-entry!"); - return null; - } - - return (OnlineApplication) result.get(0); - } - - public static OnlineApplication getOnlineApplication(String id) { - MiscUtil.assertNotNull(id, "OnlineApplictionID"); - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID")); - //query.setParameter("id", id+"%"); - query.setParameter("id", id); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - if (result.size() > 1) { - Logger.warn("OAIdentifier match to more then one DB-entry!"); - return null; - } - - return (OnlineApplication) result.get(0); - } - - public static OnlineApplication getOnlineApplication(long dbid) { - MiscUtil.assertNotNull(dbid, "OnlineApplictionID"); - Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithDBID")); - //query.setParameter("id", id+"%"); - query.setParameter("id", dbid); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return (OnlineApplication) result.get(0); - } - - public static MOAIDConfiguration getMOAIDConfiguration() { - Logger.trace("Load MOAID Configuration from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getMOAIDConfiguration")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return (MOAIDConfiguration) result.get(0); - } - - public static List getAllOnlineApplications() { - Logger.trace("Get All OnlineApplications from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOnlineApplications")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } - - public static List getAllNewOnlineApplications() { - Logger.trace("Get All OnlineApplications from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewOnlineApplications")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } - - public static List getAllUsers() { - Logger.trace("Get All OnlineApplications from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getAllUsers")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } - - public static List getAllActiveOnlineApplications() { - Logger.trace("Get All active OnlineApplications from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getAllActiveOnlineApplications")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } - - @SuppressWarnings("rawtypes") - public static List searchOnlineApplications(String id) { - MiscUtil.assertNotNull(id, "OnlineApplictionID"); - Logger.trace("Getting OnlineApplication with ID " + id + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsWithID")); - query.setParameter("id", "%"+id+"%"); - - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - - public static UserDatabase getUserWithID(long id) { - MiscUtil.assertNotNull(id, "UserID"); - Logger.trace("Getting Userinformation with ID " + id + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserID")); - query.setParameter("id", id); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return (UserDatabase) result.get(0); - } - - public static UserDatabase getUsersWithOADBID(long id) { - MiscUtil.assertNotNull(id, "OADBID"); - Logger.trace("Getting Userinformation with OADBID " + id + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getUsersWithOADBID")); - query.setParameter("id", id); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return (UserDatabase) result.get(0); - } - - public static UserDatabase getUserWithUserName(String username) { - MiscUtil.assertNotNull(username, "UserName"); - Logger.trace("Getting Userinformation with ID " + username + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserUsername")); - query.setParameter("username", username); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return (UserDatabase) result.get(0); - } - - public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { - MiscUtil.assertNotNull(bpkwbpk, "bpk/wbpk"); - Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserBPKWBPK")); - query.setParameter("bpk", bpkwbpk); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return (UserDatabase) result.get(0); - } - - public static UserDatabase getNewUserWithTokken(String tokken) { - MiscUtil.assertNotNull(tokken, "bpk/wbpk"); - Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getNewUserWithUserTokken")); - query.setParameter("tokken", tokken); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return (UserDatabase) result.get(0); - } - - public static List getAllNewUsers() { - Logger.trace("Get all new Users from Database"); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewUsers")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } - - public static List getAllOpenUsersRequests() { - Logger.trace("Get all new Users from Database"); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOpenUsersRequests")); - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - return result; - } + private static Map QUERIES = new HashMap(); + + static { + QUERIES.put("getActiveOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix)) and onlineapplication.isActive = '1'"); + QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix = SUBSTRING(:id, 1, LENGTH(onlineapplication.publicURLPrefix))"); + QUERIES.put("getOnlineApplicationWithDBID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.hjid = :id"); + QUERIES.put("getAllOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication"); + QUERIES.put("getAllActiveOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '1'"); + QUERIES.put("getAllNewOnlineApplications", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.isActive = '0' and onlineapplication.isAdminRequired = '1'"); + QUERIES.put("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration"); + QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.hjid = :id"); + QUERIES.put("getNewUserWithUserTokken", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken = :tokken"); + QUERIES.put("getAllNewUsers", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '1'"); + QUERIES.put("getAllOpenUsersRequests", "select userdatabase from UserDatabase userdatabase where userdatabase.userRequestTokken is not null and userdatabase.isAdminRequest = '1' and userdatabase.isMailAddressVerified = '0'"); + QUERIES.put("getUserWithUserBPKWBPK", "select userdatabase from UserDatabase userdatabase where userdatabase.bpk = :bpk"); + QUERIES.put("getUserWithUserUsername", "select userdatabase from UserDatabase userdatabase where userdatabase.username = :username"); + QUERIES.put("getAllUsers", "select userdatabase from UserDatabase userdatabase"); + QUERIES.put("getUsersWithOADBID", "select userdatabase from UserDatabase userdatabase inner join userdatabase.onlineApplication oa where oa.hjid = :id"); + QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id"); + } + + public static OnlineApplication getActiveOnlineApplication(String id) { + MiscUtil.assertNotNull(id, "OnlineApplictionID"); + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getActiveOnlineApplicationWithID")); + //query.setParameter("id", id+"%"); + query.setParameter("id", StringEscapeUtils.escapeHtml(id)); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.debug("No entries found."); + return null; + } + + if (result.size() > 1) { + Logger.warn("OAIdentifier match to more then one DB-entry!"); + return null; + } + + return (OnlineApplication) result.get(0); + } + + public static OnlineApplication getOnlineApplication(String id) { + MiscUtil.assertNotNull(id, "OnlineApplictionID"); + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID")); + //query.setParameter("id", id+"%"); + query.setParameter("id", id); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + if (result.size() > 1) { + Logger.warn("OAIdentifier match to more then one DB-entry!"); + return null; + } + + return (OnlineApplication) result.get(0); + } + + public static OnlineApplication getOnlineApplication(long dbid) { + MiscUtil.assertNotNull(dbid, "OnlineApplictionID"); + Logger.trace("Getting OnlineApplication with DBID " + dbid + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithDBID")); + //query.setParameter("id", id+"%"); + query.setParameter("id", dbid); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return (OnlineApplication) result.get(0); + } + + public static MOAIDConfiguration getMOAIDConfiguration() { + Logger.trace("Load MOAID Configuration from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getMOAIDConfiguration")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return (MOAIDConfiguration) result.get(0); + } + + public static List getAllOnlineApplications() { + Logger.trace("Get All OnlineApplications from database."); + + List result = null; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOnlineApplications")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } + + public static List getAllNewOnlineApplications() { + Logger.trace("Get All OnlineApplications from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewOnlineApplications")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } + + public static List getAllUsers() { + Logger.trace("Get All OnlineApplications from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getAllUsers")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } + + public static List getAllActiveOnlineApplications() { + Logger.trace("Get All active OnlineApplications from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getAllActiveOnlineApplications")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } + + @SuppressWarnings("rawtypes") + public static List searchOnlineApplications(String id) { + MiscUtil.assertNotNull(id, "OnlineApplictionID"); + Logger.trace("Getting OnlineApplication with ID " + id + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsWithID")); + query.setParameter("id", "%" + id + "%"); + + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + + return result; + } + + public static UserDatabase getUserWithID(long id) { + MiscUtil.assertNotNull(id, "UserID"); + Logger.trace("Getting Userinformation with ID " + id + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserID")); + query.setParameter("id", id); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return (UserDatabase) result.get(0); + } + + public static UserDatabase getUsersWithOADBID(long id) { + MiscUtil.assertNotNull(id, "OADBID"); + Logger.trace("Getting Userinformation with OADBID " + id + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getUsersWithOADBID")); + query.setParameter("id", id); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return (UserDatabase) result.get(0); + } + + public static UserDatabase getUserWithUserName(String username) { + MiscUtil.assertNotNull(username, "UserName"); + Logger.trace("Getting Userinformation with ID " + username + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserUsername")); + query.setParameter("username", username); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return (UserDatabase) result.get(0); + } + + public static UserDatabase getUserWithUserBPKWBPK(String bpkwbpk) { + MiscUtil.assertNotNull(bpkwbpk, "bpk/wbpk"); + Logger.trace("Getting Userinformation with ID " + bpkwbpk + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getUserWithUserBPKWBPK")); + query.setParameter("bpk", bpkwbpk); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return (UserDatabase) result.get(0); + } + + public static UserDatabase getNewUserWithTokken(String tokken) { + MiscUtil.assertNotNull(tokken, "bpk/wbpk"); + Logger.trace("Getting Userinformation with Tokken " + tokken + " from database."); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getNewUserWithUserTokken")); + query.setParameter("tokken", tokken); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return (UserDatabase) result.get(0); + } + + public static List getAllNewUsers() { + Logger.trace("Get all new Users from Database"); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getAllNewUsers")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } + + public static List getAllOpenUsersRequests() { + Logger.trace("Get all new Users from Database"); + + List result; + EntityManager session = ConfigurationDBUtils.getCurrentSession(); + + javax.persistence.Query query = session.createQuery(QUERIES.get("getAllOpenUsersRequests")); + result = query.getResultList(); + + Logger.trace("Found entries: " + result.size()); + + if (result.size() == 0) { + Logger.trace("No entries found."); + return null; + } + return result; + } } -- cgit v1.2.3 From cd0887a43b0b4350e736433c2b513901a2151601 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Tue, 4 Mar 2014 17:51:06 +0100 Subject: after merge, having problem --- id/server/moa-id-commons/moa-id-commons.iml | 7 +- id/server/moa-id-commons/pom.xml | 491 +++++++++++++++------------- 2 files changed, 260 insertions(+), 238 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index 08d15d746..8ded8b94a 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -26,8 +26,8 @@ - - + + @@ -71,9 +71,6 @@ - - - diff --git a/id/server/moa-id-commons/pom.xml b/id/server/moa-id-commons/pom.xml index 9a3cf4f7c..055a67bf4 100644 --- a/id/server/moa-id-commons/pom.xml +++ b/id/server/moa-id-commons/pom.xml @@ -1,235 +1,260 @@ - - 4.0.0 - - MOA.id - moa-id - 1.9.98-SNAPSHOT - - moa-id-commons - moa-id-commons - MOA.id.server - - - - hyberjaxb - http://repository.highsource.org/maven2/releases/ - true - - - JBoss IAIK - http://nexus.iaik.tugraz.at/nexus/content/repositories/nexus/ - - - - - - - org.hibernate - hibernate-core - 4.2.1.Final - - - org.hibernate - hibernate-c3p0 - 4.2.1.Final - - - org.hibernate - hibernate-entitymanager - 4.2.1.Final - - - - org.apache.commons - commons-lang3 - 3.1 - - - MOA - moa-common - jar - + + 4.0.0 + + MOA.id + moa-id + 1.9.98-SNAPSHOT + + moa-id-commons + moa-id-commons + MOA.id.server - - - - org.hibernate.javax.persistence - hibernate-jpa-2.0-api - 1.0.1.Final - - - - org.jvnet.hyperjaxb3 - hyperjaxb3-ejb-runtime - 0.5.6 - - - org.jvnet.hyperjaxb3 - maven-hyperjaxb3-plugin - 0.5.6 - - - mysql - mysql-connector-java - 5.1.25 - - - - - install - - - - src/main/resources/config - - **/*.java - - - - target/generated-sources/xjc - - **/*.java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.5 - 1.5 - - - - org.apache.maven.plugins - maven-jar-plugin - - true - true - - false - - - - - - test-jar - - - - - - - org.jvnet.hyperjaxb3 - maven-hyperjaxb3-plugin - 0.5.6 - - - - generate - - - - - true - src/main/resources/config - src/main/resources/config - src/main/resources/config/persistence_template.xml - at.gv.egovernment.moa.id.commons.db.dao.config - - - - true - maven-compiler-plugin - 2.0.2 - - 1.5 - 1.5 - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.5 - - UTF-8 - UTF-8 - true - false - false - true - at.gv.egovernment.moa.spss.server.*;at.gv.egovernment.moa.spss.api.impl.*;at.gv.egovernment.moa.spss.impl.* - - - pre - a - Preconditions: - - - post - a - Postconditions: - - - - http://java.sun.com/j2se/1.4/docs/api/ - http://java.sun.com/j2se/1.5.0/docs/api/ - http://logging.apache.org/log4j/docs/api/ - - 1.5 - - - - generate-javadoc - package - - jar - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.jvnet.hyperjaxb3 - - - maven-hyperjaxb3-plugin - - - [0.5.6,) - - - generate - - - - - - - - - - - - - + + + hyberjaxb + http://repository.highsource.org/maven2/releases/ + + true + + + + JBoss IAIK + http://nexus.iaik.tugraz.at/nexus/content/repositories/nexus/ + + + + + + + org.hibernate + hibernate-core + 4.2.1.Final + + + org.hibernate + hibernate-c3p0 + 4.2.1.Final + + + org.hibernate + hibernate-entitymanager + 4.2.1.Final + + + + org.apache.commons + commons-lang3 + 3.1 + + + MOA + moa-common + jar + + + + + + org.hibernate.javax.persistence + hibernate-jpa-2.0-api + 1.0.1.Final + + + + org.jvnet.hyperjaxb3 + hyperjaxb3-ejb-runtime + 0.5.6 + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + + + org.jvnet.hyperjaxb3 + maven-hyperjaxb3-plugin + 0.5.6 + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + + + mysql + mysql-connector-java + 5.1.25 + + + + + install + + + + src/main/resources/config + + **/*.java + + + + target/generated-sources/xjc + + **/*.java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + org.apache.maven.plugins + maven-jar-plugin + + true + true + + false + + + + + + test-jar + + + + + + + org.jvnet.hyperjaxb3 + maven-hyperjaxb3-plugin + 0.5.6 + + + + generate + + + + + true + src/main/resources/config + src/main/resources/config + src/main/resources/config/persistence_template.xml + at.gv.egovernment.moa.id.commons.db.dao.config + + + + true + maven-compiler-plugin + 2.0.2 + + 1.5 + 1.5 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.5 + + UTF-8 + UTF-8 + true + false + false + true + + at.gv.egovernment.moa.spss.server.*;at.gv.egovernment.moa.spss.api.impl.*;at.gv.egovernment.moa.spss.impl.* + + + + pre + a + Preconditions: + + + post + a + Postconditions: + + + + http://java.sun.com/j2se/1.4/docs/api/ + http://java.sun.com/j2se/1.5.0/docs/api/ + http://logging.apache.org/log4j/docs/api/ + + 1.5 + + + + generate-javadoc + package + + jar + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.jvnet.hyperjaxb3 + + + maven-hyperjaxb3-plugin + + + [0.5.6,) + + + generate + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3 From 7f1c5affaa9358bef6995371dc08c8f0c981a849 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Tue, 4 Mar 2014 20:06:41 +0100 Subject: resolving problems related to commons and slf4j libraries --- id/server/moa-id-commons/moa-id-commons.iml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index 8ded8b94a..ef994abd3 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -56,6 +56,11 @@ + + + + + -- cgit v1.2.3 From eb32824288778c0fd427dbcbf826c8d9c16596b2 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Tue, 4 Mar 2014 20:26:15 +0100 Subject: after merge ap --- id/server/moa-id-commons/moa-id-commons.iml | 1 + 1 file changed, 1 insertion(+) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index ef994abd3..3bd426fc3 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -37,6 +37,7 @@ + -- cgit v1.2.3 From 458a579978fa4fd0718c754bb8b6ca41f82d8145 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Tue, 4 Mar 2014 20:33:36 +0100 Subject: after chaning --- id/server/moa-id-commons/moa-id-commons.iml | 1 - 1 file changed, 1 deletion(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index 3bd426fc3..ef994abd3 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -37,7 +37,6 @@ - -- cgit v1.2.3 From 1ba3c2042e0c4da08af39db6172ff1206dfece36 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 5 Mar 2014 10:22:46 +0100 Subject: ap plugins can be configured to listen to certain attributes --- .../moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index d20ec1c68..845e4fe1f 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -957,8 +957,9 @@ - - + + + -- cgit v1.2.3 From 58c8a91c173ce699b8014e4f81fa195bfa37d246 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Wed, 5 Mar 2014 19:28:25 +0100 Subject: land selection change --- .../moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index d20ec1c68..b2c9eb58c 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -11,14 +11,16 @@ - + + - + + -- cgit v1.2.3 From 19e164874ea92d51f9df12f56047d77db9683091 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Wed, 5 Mar 2014 20:57:05 +0100 Subject: storkid derivation pro country --- id/server/moa-id-commons/moa-id-commons.iml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index ef994abd3..aeb4ad88c 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -61,6 +61,7 @@ + @@ -75,7 +76,6 @@ - -- cgit v1.2.3 From 4ade7db6124eec07aebf087721d3d478f92bdaad Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Wed, 12 Mar 2014 09:59:19 +0100 Subject: added consent-checkbox to config ui --- .../src/main/resources/config/moaid_config_2.0.xsd | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index b7e8f6ff3..936363169 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -883,11 +883,16 @@ - - - + + + - + + + -- cgit v1.2.3 From 60ac2a89fce86eb1e8344eb22535cfdd0b9aa147 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Fri, 14 Mar 2014 18:37:56 +0100 Subject: attr --- id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index 936363169..3a2b8cc62 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -892,7 +892,7 @@ - + -- cgit v1.2.3 From 70e3ac3a5a76c430f453019eba72a1f291069913 Mon Sep 17 00:00:00 2001 From: Bojan Suzic Date: Thu, 20 Mar 2014 13:35:29 +0100 Subject: adjust bpk builder --- id/server/moa-id-commons/moa-id-commons.iml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'id/server/moa-id-commons') diff --git a/id/server/moa-id-commons/moa-id-commons.iml b/id/server/moa-id-commons/moa-id-commons.iml index aeb4ad88c..387cfa900 100644 --- a/id/server/moa-id-commons/moa-id-commons.iml +++ b/id/server/moa-id-commons/moa-id-commons.iml @@ -26,8 +26,8 @@ - - + + -- cgit v1.2.3