Repository: openmeetings
Updated Branches:
  refs/heads/master f864a8c61 -> 68e54afc4


[OPENMEETINGS-1679] added _ensureApplication method which doesn't drop the 
session


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/68e54afc
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/68e54afc
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/68e54afc

Branch: refs/heads/master
Commit: 68e54afc4ac24b7d54fb7fb6b12f00ae148608ae
Parents: f864a8c
Author: Maxim Solodovnik <solomax...@gmail.com>
Authored: Fri Aug 11 12:10:53 2017 +0700
Committer: Maxim Solodovnik <solomax...@gmail.com>
Committed: Fri Aug 11 12:12:50 2017 +0700

----------------------------------------------------------------------
 .../java/org/apache/openmeetings/db/dao/label/LabelDao.java   | 6 +++---
 .../org/apache/openmeetings/db/util/ApplicationHelper.java    | 7 ++++++-
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/68e54afc/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/label/LabelDao.java
----------------------------------------------------------------------
diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/label/LabelDao.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/label/LabelDao.java
index 64ab2b2..5bb02e4 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/label/LabelDao.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/label/LabelDao.java
@@ -18,7 +18,7 @@
  */
 package org.apache.openmeetings.db.dao.label;
 
-import static 
org.apache.openmeetings.db.util.ApplicationHelper.ensureApplication;
+import static 
org.apache.openmeetings.db.util.ApplicationHelper._ensureApplication;
 import static org.apache.openmeetings.util.OpenmeetingsVariables.webAppRootKey;
 
 import java.io.File;
@@ -103,11 +103,11 @@ public class LabelDao implements 
IDataProviderDao<StringLabel>{
        }
 
        public static String getString(long fieldValuesId, long langId) {
-               return ensureApplication(langId).getOmString(fieldValuesId, 
langId);
+               return _ensureApplication(langId).getOmString(fieldValuesId, 
langId);
        }
 
        public static String getString(String key, long langId) {
-               return ensureApplication(langId).getOmString(key, langId);
+               return _ensureApplication(langId).getOmString(key, langId);
        }
 
        private static File getLangFile() {

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/68e54afc/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
----------------------------------------------------------------------
diff --git 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
index c509be4..a4415bb 100644
--- 
a/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
+++ 
b/openmeetings-db/src/main/java/org/apache/openmeetings/db/util/ApplicationHelper.java
@@ -80,7 +80,7 @@ public class ApplicationHelper {
                return ensureApplication(-1L);
        }
 
-       public static IApplication ensureApplication(Long langId) {
+       public static IApplication _ensureApplication(Long langId) {
                IApplication a = null;
                if (Application.exists()) {
                        a = (IApplication)Application.get();
@@ -112,6 +112,11 @@ public class ApplicationHelper {
                        }
                        a = 
(IApplication)Application.get(wicketApplicationName);
                }
+               return a;
+       }
+
+       public static IApplication ensureApplication(Long langId) {
+               IApplication a = _ensureApplication(langId);
                if (ThreadContext.getRequestCycle() == null) {
                        ServletWebRequest req = new ServletWebRequest(new 
MockHttpServletRequest((Application)a, new 
MockHttpSession(a.getServletContext()), a.getServletContext()), "");
                        RequestCycleContext rctx = new RequestCycleContext(req, 
new MockWebResponse(), a.getRootRequestMapper(), 
a.getExceptionMapperProvider().get());

Reply via email to