]> source.dussan.org Git - vaadin-framework.git/commitdiff
Some early modifications to the client side to allow for Portlet URLs. Don't know...
authorPetter Holmström <petter.holmstrom@itmill.com>
Fri, 30 Oct 2009 12:57:25 +0000 (12:57 +0000)
committerPetter Holmström <petter.holmstrom@itmill.com>
Fri, 30 Oct 2009 12:57:25 +0000 (12:57 +0000)
svn changeset:9509/svn branch:portlet_2.0

src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

index 1674196e9090ea60723fcd25801d9e91d4e2801b..b4ea4cafffc3c538aa44e3c9188d99d5acda7639 100644 (file)
@@ -24,12 +24,22 @@ public class ApplicationConfiguration {
     private String communicationErrorMessage;
     private String communicationErrorUrl;
     private boolean useDebugIdInDom = true;
+    private boolean usePortletURLs = false;
+    private String portletActionURLBase;
 
     private Class<? extends Paintable>[] classes = new Class[1024];
 
     private static ArrayList<ApplicationConnection> unstartedApplications = new ArrayList<ApplicationConnection>();
     private static ArrayList<ApplicationConnection> runningApplications = new ArrayList<ApplicationConnection>();
 
+    public boolean usePortletURLs() {
+        return usePortletURLs;
+    }
+    
+    public String getPortletActionURLBase() {
+        return portletActionURLBase;
+    }
+    
     public String getRootPanelId() {
         return id;
     }
@@ -101,7 +111,12 @@ public class ApplicationConfiguration {
                 this.@com.vaadin.terminal.gwt.client.ApplicationConfiguration::communicationErrorMessage = jsobj.comErrMsg.message;
                 this.@com.vaadin.terminal.gwt.client.ApplicationConfiguration::communicationErrorUrl = jsobj.comErrMsg.url;
             }
-        
+            if (jsobj.usePortletURLs) {
+                this.@com.vaadin.terminal.gwt.client.ApplicationConfiguration::usePortletURLs = jsobj.usePortletURLs;
+            }
+            if (jsobj.portletActionURLBase) {
+                this.@com.vaadin.terminal.gwt.client.ApplicationConfiguration::portletActionURLBase = jsobj.portletActionURLBase;
+            }
         } else {
             $wnd.alert("Vaadin app failed to initialize: " + this.id);
         }
index e9f2fba3d11bfc7aa8890c2fe1bc4ba3554b75f1..1b1a3ee9e97d45f8979b9cdcca5a56e32a0d785e 100755 (executable)
@@ -305,7 +305,12 @@ public class ApplicationConnection {
         final String rd = uidl_security_key + VAR_BURST_SEPARATOR + requestData;
 
         console.log("Making UIDL Request with params: " + rd);
-        String uri = getAppUri() + "UIDL" + configuration.getPathInfo();
+        String uri;
+        if (configuration.usePortletURLs()) {
+            uri = configuration.getPortletActionURLBase() + "&UIDL=true";
+        } else {
+            uri = getAppUri() + "UIDL" + configuration.getPathInfo();
+        }
         if (repaintAll) {
             // collect some client side data that will be sent to server on
             // initial uidl request
@@ -323,7 +328,12 @@ public class ApplicationConnection {
             // TODO figure out how client and view size could be used better on
             // server. screen size can be accessed via Browser object, but other
             // values currently only via transaction listener.
-            uri += "?repaintAll=1&" + "sh=" + screenHeight + "&sw="
+            if (configuration.usePortletURLs()) {
+                uri += "&";
+            } else {
+                uri += "?";
+            }
+            uri += "repaintAll=1&" + "sh=" + screenHeight + "&sw="
                     + screenWidth + "&cw=" + clientWidth + "&ch="
                     + clientHeight + "&vw=" + offsetWidth + "&vh="
                     + offsetHeight + "&fr=" + token;
@@ -332,7 +342,7 @@ public class ApplicationConnection {
             }
         }
         if (windowName != null && windowName.length() > 0) {
-            uri += (repaintAll ? "&" : "?") + "windowName=" + windowName;
+            uri += (repaintAll || configuration.usePortletURLs() ? "&" : "?") + "windowName=" + windowName;
         }
 
         if (!forceSync) {