]> source.dussan.org Git - vaadin-framework.git/commitdiff
#3113 load portal default theme before any others
authorHenri Sara <henri.sara@itmill.com>
Thu, 9 Jul 2009 13:02:36 +0000 (13:02 +0000)
committerHenri Sara <henri.sara@itmill.com>
Thu, 9 Jul 2009 13:02:36 +0000 (13:02 +0000)
svn changeset:8360/svn branch:6.0

src/com/vaadin/terminal/gwt/server/ApplicationPortlet.java

index 23547297c4268a3eb8fda8fa7d58ac2d825ec756..10bc3932dc89edd171780450dc5766908c2a1287 100644 (file)
@@ -148,31 +148,6 @@ public class ApplicationPortlet implements Portlet, Serializable {
 \r
                 dispatcher.include(request, response);\r
 \r
-                if (isLifeRay) {\r
-                    /*\r
-                     * Temporary support to heartbeat Liferay session when using\r
-                     * Vaadin based portlet. We hit an extra xhr to liferay\r
-                     * servlet to extend the session lifetime after each Vaadin\r
-                     * request. This hack can be removed when supporting portlet\r
-                     * 2.0 and resourceRequests.\r
-                     * \r
-                     * TODO make this configurable, this is not necessary with\r
-                     * some custom session configurations.\r
-                     */\r
-                    OutputStream out = response.getPortletOutputStream();\r
-\r
-                    String lifeRaySessionHearbeatHack = ("<script type=\"text/javascript\">"\r
-                            + "if(!vaadin.postRequestHooks) {"\r
-                            + "    vaadin.postRequestHooks = {};"\r
-                            + "}"\r
-                            + "vaadin.postRequestHooks.liferaySessionHeartBeat = function() {"\r
-                            + "    if (Liferay && Liferay.Session) {"\r
-                            + "        Liferay.Session.extend();"\r
-                            + "    }"\r
-                            + "};" + "</script>");\r
-                    out.write(lifeRaySessionHearbeatHack.getBytes());\r
-                }\r
-\r
                 /*\r
                  * Make sure portal default Vaadin theme is included exactly\r
                  * once in DOM.\r
@@ -182,6 +157,9 @@ public class ApplicationPortlet implements Portlet, Serializable {
 \r
                     // Using portal-wide theme\r
                     String loadDefaultTheme = ("<script type=\"text/javascript\">\n"\r
+                            + "if(!vaadin) { var vaadin = {} } \n"\r
+                            + "if(!vaadin.vaadinConfigurations) { vaadin.vaadinConfigurations = {} } \n"\r
+                            + "if(!vaadin.themesLoaded) { vaadin.themesLoaded = {} } \n"\r
                             + "if(!vaadin.themesLoaded['"\r
                             + portalTheme\r
                             + "']) {\n"\r
@@ -198,6 +176,31 @@ public class ApplicationPortlet implements Portlet, Serializable {
                     out.write(loadDefaultTheme.getBytes());\r
                 }\r
 \r
+                if (isLifeRay) {\r
+                    /*\r
+                     * Temporary support to heartbeat Liferay session when using\r
+                     * Vaadin based portlet. We hit an extra xhr to liferay\r
+                     * servlet to extend the session lifetime after each Vaadin\r
+                     * request. This hack can be removed when supporting portlet\r
+                     * 2.0 and resourceRequests.\r
+                     * \r
+                     * TODO make this configurable, this is not necessary with\r
+                     * some custom session configurations.\r
+                     */\r
+                    OutputStream out = response.getPortletOutputStream();\r
+\r
+                    String lifeRaySessionHearbeatHack = ("<script type=\"text/javascript\">"\r
+                            + "if(!vaadin.postRequestHooks) {"\r
+                            + "    vaadin.postRequestHooks = {};"\r
+                            + "}"\r
+                            + "vaadin.postRequestHooks.liferaySessionHeartBeat = function() {"\r
+                            + "    if (Liferay && Liferay.Session) {"\r
+                            + "        Liferay.Session.extend();"\r
+                            + "    }"\r
+                            + "};" + "</script>");\r
+                    out.write(lifeRaySessionHearbeatHack.getBytes());\r
+                }\r
+\r
             } catch (PortletException e) {\r
                 PrintWriter out = response.getWriter();\r
                 out.print("<h1>Servlet include failed!</h1>");\r