From c80c2df4bc7fd6cc87156e1d38f5cc4a76d1ac1a Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 6 Aug 2013 16:03:19 +0200 Subject: HTTP Metadata provider --- .../moa/id/commons/db/ConfigurationDBRead.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (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 e815f2a69..99c47e6d3 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 @@ -21,6 +21,7 @@ public class ConfigurationDBRead { QUERIES.put("getOnlineApplicationWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.publicURLPrefix like 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("getMOAIDConfiguration", "select moaidconfiguration from MOAIDConfiguration moaidconfiguration"); QUERIES.put("getUserWithUserID", "select userdatabase from UserDatabase userdatabase where userdatabase.id = :id"); QUERIES.put("searchOnlineApplicationsWithID", "select onlineapplication from OnlineApplication onlineapplication where onlineapplication.friendlyName like :id"); @@ -134,6 +135,24 @@ public class ConfigurationDBRead { 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"); -- cgit v1.2.3