aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Koskinen <anna@vaadin.com>2012-11-30 12:58:05 +0200
committerAnna Koskinen <anna@vaadin.com>2012-11-30 13:00:07 +0200
commitfaf6b3861d26571ffefd3dc60c2ff7d5685576d0 (patch)
treed7f8109ed0c03396f49895cf806499ccd670196b
parent93f932e52558dd933aaa7a8c8b60c8306b0cc189 (diff)
downloadvaadin-framework-faf6b3861d26571ffefd3dc60c2ff7d5685576d0.tar.gz
vaadin-framework-faf6b3861d26571ffefd3dc60c2ff7d5685576d0.zip
Added prefix "v-" to internal parameters (#10156)
Change-Id: I79ac824bc19fa42b976954148e69d54fb91b77ab
-rw-r--r--WebContent/VAADIN/vaadinBootstrap.js38
-rw-r--r--client/src/com/vaadin/client/ApplicationConnection.java2
-rw-r--r--server/src/com/vaadin/server/AbstractCommunicationManager.java6
-rw-r--r--server/src/com/vaadin/server/Page.java6
-rw-r--r--server/src/com/vaadin/server/PortletCommunicationManager.java2
-rw-r--r--server/src/com/vaadin/server/VaadinPortlet.java2
-rw-r--r--server/src/com/vaadin/server/VaadinRequest.java4
-rw-r--r--server/src/com/vaadin/server/VaadinServlet.java2
-rw-r--r--server/src/com/vaadin/server/WebBrowser.java16
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIConstants.java2
-rw-r--r--uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java2
-rw-r--r--uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java24
12 files changed, 55 insertions, 51 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js
index 60f1b02452..64a1a00111 100644
--- a/WebContent/VAADIN/vaadinBootstrap.js
+++ b/WebContent/VAADIN/vaadinBootstrap.js
@@ -84,10 +84,10 @@
// No special url defined, use the same URL that loaded this page (without the fragment)
url = window.location.href.replace(/#.*/,'');
}
- url += ((/\?/).test(url) ? "&" : "?") + "browserDetails=1";
- var rootId = getConfig("rootId");
+ url += ((/\?/).test(url) ? "&" : "?") + "v-browserDetails=1";
+ var rootId = getConfig("v-rootId");
if (rootId !== undefined) {
- url += "&rootId=" + rootId;
+ url += "&v-rootId=" + rootId;
}
// Tell the UI what theme it is configured to use
@@ -99,7 +99,7 @@
url += '&' + vaadin.getBrowserDetailsParameters(appId);
// Timestamp to avoid caching
- url += '&' + (new Date()).getTime();
+ url += '&v-' + (new Date()).getTime();
var r;
try {
@@ -155,7 +155,7 @@
var bootstrapApp = function(mayDefer) {
var vaadinDir = getConfig('vaadinDir');
- var themeUri = vaadinDir + 'themes/' + getConfig('theme')
+ var themeUri = vaadinDir + 'themes/' + getConfig('theme');
loadTheme(themeUri);
var widgetset = getConfig('widgetset');
@@ -204,8 +204,8 @@
},
getBrowserDetailsParameters: function(parentElementId) {
// Screen height and width
- var url = 'sh=' + window.screen.height;
- url += '&sw=' + window.screen.width;
+ var url = 'v-sh=' + window.screen.height;
+ url += '&v-sw=' + window.screen.width;
// Window height and width
var cw = 0;
@@ -219,12 +219,12 @@
cw = document.documentElement.clientWidth;
ch = document.documentElement.clientHeight;
}
- url += '&cw=' + cw + '&ch=' + ch;
+ url += '&v-cw=' + cw + '&v-ch=' + ch;
var d = new Date();
- url += '&curdate=' + d.getTime();
+ url += '&v-curdate=' + d.getTime();
var tzo1 = d.getTimezoneOffset(); // current offset
var dstDiff = 0;
@@ -241,37 +241,37 @@
}
// Time zone offset
- url += '&tzo=' + tzo1;
+ url += '&v-tzo=' + tzo1;
// DST difference
- url += '&dstd=' + dstDiff;
+ url += '&v-dstd=' + dstDiff;
// Raw time zone offset
- url += '&rtzo=' + rtzo;
+ url += '&v-rtzo=' + rtzo;
// DST in effect?
- url += '&dston=' + (tzo1 != rtzo);
+ url += '&v-dston=' + (tzo1 != rtzo);
var pe = document.getElementById(parentElementId);
if (pe) {
- url += '&vw=' + pe.offsetWidth;
- url += '&vh=' + pe.offsetHeight;
+ url += '&v-vw=' + pe.offsetWidth;
+ url += '&v-vh=' + pe.offsetHeight;
}
// Location
- url += '&loc=' + encodeURIComponent(location.href);
+ url += '&v-loc=' + encodeURIComponent(location.href);
// Window name
if (window.name) {
- url += '&wn=' + encodeURIComponent(window.name);
+ url += '&v-wn=' + encodeURIComponent(window.name);
}
// Detect touch device support
- try { document.createEvent("TouchEvent"); url += "&td=1";} catch(e){};
+ try { document.createEvent("TouchEvent"); url += "&v-td=1";} catch(e){};
return url;
}
};
log('Vaadin bootstrap loaded');
-})(); \ No newline at end of file
+})();
diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java
index 0f417130f7..86ef6b0542 100644
--- a/client/src/com/vaadin/client/ApplicationConnection.java
+++ b/client/src/com/vaadin/client/ApplicationConnection.java
@@ -2343,7 +2343,7 @@ public class ApplicationConnection {
extraParams += "&";
}
String widgetsetVersion = Version.getFullVersion();
- extraParams += "wsver=" + widgetsetVersion;
+ extraParams += "v-wsver=" + widgetsetVersion;
getConfiguration().setWidgetsetVersionSent();
}
diff --git a/server/src/com/vaadin/server/AbstractCommunicationManager.java b/server/src/com/vaadin/server/AbstractCommunicationManager.java
index 19b0ac2aee..0a3dff8120 100644
--- a/server/src/com/vaadin/server/AbstractCommunicationManager.java
+++ b/server/src/com/vaadin/server/AbstractCommunicationManager.java
@@ -618,7 +618,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
* @param request
*/
private void checkWidgetsetVersion(VaadinRequest request) {
- String widgetsetVersion = request.getParameter("wsver");
+ String widgetsetVersion = request.getParameter("v-wsver");
if (widgetsetVersion == null) {
// Only check when the widgetset version is reported. It is reported
// in the first UIDL request (not the initial request as it is a
@@ -2443,7 +2443,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
// Check for an existing UI based on window.name
// Special parameter sent by vaadinBootstrap.js
- String windowName = request.getParameter("wn");
+ String windowName = request.getParameter("v-wn");
Map<String, Integer> retainOnRefreshUIs = session
.getPreserveOnRefreshUIs();
@@ -2515,7 +2515,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
UI.setCurrent(ui);
// Fire fragment change if the fragment has changed
- String location = request.getParameter("loc");
+ String location = request.getParameter("v-loc");
if (location != null) {
ui.getPage().updateLocation(location);
}
diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java
index f2b5498fd1..157b91cdcd 100644
--- a/server/src/com/vaadin/server/Page.java
+++ b/server/src/com/vaadin/server/Page.java
@@ -436,9 +436,9 @@ public class Page implements Serializable {
public void init(VaadinRequest request) {
// Extract special parameter sent by vaadinBootstrap.js
- String location = request.getParameter("loc");
- String clientWidth = request.getParameter("cw");
- String clientHeight = request.getParameter("ch");
+ String location = request.getParameter("v-loc");
+ String clientWidth = request.getParameter("v-cw");
+ String clientHeight = request.getParameter("v-ch");
if (location != null) {
try {
diff --git a/server/src/com/vaadin/server/PortletCommunicationManager.java b/server/src/com/vaadin/server/PortletCommunicationManager.java
index 3e0af96bf7..6a1c02b1e4 100644
--- a/server/src/com/vaadin/server/PortletCommunicationManager.java
+++ b/server/src/com/vaadin/server/PortletCommunicationManager.java
@@ -118,7 +118,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager {
MimeResponse portletResponse = (MimeResponse) response
.getPortletResponse();
ResourceURL resourceURL = portletResponse.createResourceURL();
- resourceURL.setResourceID("browserDetails");
+ resourceURL.setResourceID("v-browserDetails");
parameters.put("browserDetailsUrl", resourceURL.toString());
// Always send path info as a query parameter
diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java
index 58f7da0401..507f563289 100644
--- a/server/src/com/vaadin/server/VaadinPortlet.java
+++ b/server/src/com/vaadin/server/VaadinPortlet.java
@@ -349,7 +349,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants {
private boolean isBrowserDetailsRequest(ResourceRequest request) {
return request.getResourceID() != null
- && request.getResourceID().equals("browserDetails");
+ && request.getResourceID().equals("v-browserDetails");
}
private boolean isDummyRequest(ResourceRequest request) {
diff --git a/server/src/com/vaadin/server/VaadinRequest.java b/server/src/com/vaadin/server/VaadinRequest.java
index ebf405d4f3..58cbfdd18d 100644
--- a/server/src/com/vaadin/server/VaadinRequest.java
+++ b/server/src/com/vaadin/server/VaadinRequest.java
@@ -56,7 +56,9 @@ public interface VaadinRequest extends Serializable {
public String getParameter(String parameter);
/**
- * Gets all the parameters of the request.
+ * Gets all the parameters of the request. Framework's internal init
+ * parameters have prefix "v-" (does not include such parameters as "theme"
+ * and "debug").
*
* @see #getParameter(String)
*
diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java
index 0ad4dea37d..b099767b4f 100644
--- a/server/src/com/vaadin/server/VaadinServlet.java
+++ b/server/src/com/vaadin/server/VaadinServlet.java
@@ -1124,7 +1124,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
private static boolean isBrowserDetailsRequest(HttpServletRequest request) {
return "POST".equals(request.getMethod())
- && request.getParameter("browserDetails") != null;
+ && request.getParameter("v-browserDetails") != null;
}
private boolean isStaticResourceRequest(HttpServletRequest request) {
diff --git a/server/src/com/vaadin/server/WebBrowser.java b/server/src/com/vaadin/server/WebBrowser.java
index 468b36921c..f69956e267 100644
--- a/server/src/com/vaadin/server/WebBrowser.java
+++ b/server/src/com/vaadin/server/WebBrowser.java
@@ -424,13 +424,15 @@ public class WebBrowser implements Serializable {
browserDetails = new VBrowserDetails(agent);
}
- if (request.getParameter("sw") != null) {
- updateClientSideDetails(request.getParameter("sw"),
- request.getParameter("sh"), request.getParameter("tzo"),
- request.getParameter("rtzo"), request.getParameter("dstd"),
- request.getParameter("dston"),
- request.getParameter("curdate"),
- request.getParameter("td") != null);
+ if (request.getParameter("v-sw") != null) {
+ updateClientSideDetails(request.getParameter("v-sw"),
+ request.getParameter("v-sh"),
+ request.getParameter("v-tzo"),
+ request.getParameter("v-rtzo"),
+ request.getParameter("v-dstd"),
+ request.getParameter("v-dston"),
+ request.getParameter("v-curdate"),
+ request.getParameter("v-td") != null);
}
}
diff --git a/shared/src/com/vaadin/shared/ui/ui/UIConstants.java b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
index 06a4afae98..15f56b6ce2 100644
--- a/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
@@ -44,6 +44,6 @@ public class UIConstants {
/**
* Name of the parameter used to transmit UI ids back and forth
*/
- public static final String UI_ID_PARAMETER = "uiId";
+ public static final String UI_ID_PARAMETER = "v-uiId";
}
diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
index 8988fe764a..6e31862f24 100644
--- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
+++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -16,7 +16,7 @@ public class RefreshStatePreserve extends AbstractTestUI {
@Override
protected void setup(VaadinRequest request) {
// Internal parameter sent by vaadinBootstrap.js,
- addComponent(new Label("window.name: " + request.getParameter("wn")));
+ addComponent(new Label("window.name: " + request.getParameter("v-wn")));
addComponent(new Label("UI id: " + getUIId()));
addComponent(log);
diff --git a/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java b/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java
index 587c9f0f9b..df537145cf 100644
--- a/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java
+++ b/uitest/src/com/vaadin/tests/components/ui/UIInitBrowserDetails.java
@@ -25,18 +25,18 @@ public class UIInitBrowserDetails extends AbstractTestUI {
Page p = getPage();
WebBrowser wb = p.getWebBrowser();
- addDetail("location", "loc", p.getLocation());
-
- addDetail("browser window width", "cw", p.getBrowserWindowWidth());
- addDetail("browser window height", "ch", p.getBrowserWindowHeight());
- addDetail("screen width", "sw", wb.getScreenWidth());
- addDetail("screen height", "sh", wb.getScreenHeight());
-
- addDetail("timezone offset", "tzo", wb.getTimezoneOffset());
- addDetail("raw timezone offset", "rtzo", wb.getRawTimezoneOffset());
- addDetail("dst saving", "dstd", wb.getDSTSavings());
- addDetail("dst in effect", "dston", wb.isDSTInEffect());
- addDetail("current date", "curdate", wb.getCurrentDate());
+ addDetail("location", "v-loc", p.getLocation());
+
+ addDetail("browser window width", "v-cw", p.getBrowserWindowWidth());
+ addDetail("browser window height", "v-ch", p.getBrowserWindowHeight());
+ addDetail("screen width", "v-sw", wb.getScreenWidth());
+ addDetail("screen height", "v-sh", wb.getScreenHeight());
+
+ addDetail("timezone offset", "v-tzo", wb.getTimezoneOffset());
+ addDetail("raw timezone offset", "v-rtzo", wb.getRawTimezoneOffset());
+ addDetail("dst saving", "v-dstd", wb.getDSTSavings());
+ addDetail("dst in effect", "v-dston", wb.isDSTInEffect());
+ addDetail("current date", "v-curdate", wb.getCurrentDate());
}
@Override