aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-10-04 09:59:02 +0000
committerVaadin Code Review <review@vaadin.com>2012-10-04 09:59:02 +0000
commitd5c8710d72a000e8e80d39079afd41eae2406111 (patch)
tree7a65e0107799d2cbf7deeb81cdda51b4d94e4205 /server
parent31d542b4bf99ae3a3805b33db94d38b3f4b33d14 (diff)
parent55841c374c2e10e92428037fcdd713acc1908c03 (diff)
downloadvaadin-framework-d5c8710d72a000e8e80d39079afd41eae2406111.tar.gz
vaadin-framework-d5c8710d72a000e8e80d39079afd41eae2406111.zip
Merge "Remove default bootstrap parameter support (#9824)"
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/BootstrapHandler.java40
-rw-r--r--server/src/com/vaadin/server/PortletCommunicationManager.java15
2 files changed, 14 insertions, 41 deletions
diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java
index 0886507caf..e10351b4ad 100644
--- a/server/src/com/vaadin/server/BootstrapHandler.java
+++ b/server/src/com/vaadin/server/BootstrapHandler.java
@@ -379,16 +379,11 @@ public abstract class BootstrapHandler implements RequestHandler {
protected void appendMainScriptTagContents(BootstrapContext context,
StringBuilder builder) throws JSONException, IOException {
- JSONObject defaults = getDefaultParameters(context);
JSONObject appConfig = getApplicationParameters(context);
boolean isDebug = !context.getSession().getConfiguration()
.isProductionMode();
- builder.append("vaadin.setDefaults(");
- appendJsonObject(builder, defaults, isDebug);
- builder.append(");\n");
-
builder.append("vaadin.initApplication(\"");
builder.append(context.getAppId());
builder.append("\",");
@@ -407,6 +402,10 @@ public abstract class BootstrapHandler implements RequestHandler {
protected JSONObject getApplicationParameters(BootstrapContext context)
throws JSONException, PaintException {
+ VaadinRequest request = context.getRequest();
+ VaadinServiceSession session = context.getSession();
+ VaadinService vaadinService = request.getService();
+
JSONObject appConfig = new JSONObject();
String themeName = context.getThemeName();
@@ -420,10 +419,10 @@ public abstract class BootstrapHandler implements RequestHandler {
appConfig.put("widgetset", context.getWidgetsetName());
- appConfig.put("initialPath", context.getRequest().getRequestPathInfo());
+ appConfig.put("initialPath", request.getRequestPathInfo());
Map<String, String[]> parameterMap = new HashMap<String, String[]>(
- context.getRequest().getParameterMap());
+ request.getParameterMap());
// Include theme as a fake initial param so that UI can know its theme
// for serving CustomLayout templates
@@ -431,17 +430,6 @@ public abstract class BootstrapHandler implements RequestHandler {
appConfig.put("initialParams", parameterMap);
- return appConfig;
- }
-
- protected JSONObject getDefaultParameters(BootstrapContext context)
- throws JSONException {
- JSONObject defaults = new JSONObject();
-
- VaadinRequest request = context.getRequest();
- VaadinServiceSession session = context.getSession();
- VaadinService vaadinService = request.getService();
-
// Get system messages
SystemMessages systemMessages = vaadinService.getSystemMessages();
if (systemMessages != null) {
@@ -453,7 +441,7 @@ public abstract class BootstrapHandler implements RequestHandler {
systemMessages.getCommunicationErrorMessage());
comErrMsg.put("url", systemMessages.getCommunicationErrorURL());
- defaults.put("comErrMsg", comErrMsg);
+ appConfig.put("comErrMsg", comErrMsg);
JSONObject authErrMsg = new JSONObject();
authErrMsg.put("caption",
@@ -462,29 +450,29 @@ public abstract class BootstrapHandler implements RequestHandler {
systemMessages.getAuthenticationErrorMessage());
authErrMsg.put("url", systemMessages.getAuthenticationErrorURL());
- defaults.put("authErrMsg", authErrMsg);
+ appConfig.put("authErrMsg", authErrMsg);
}
String staticFileLocation = vaadinService
.getStaticFileLocation(request);
String widgetsetBase = staticFileLocation + "/"
+ VaadinServlet.WIDGETSET_DIRECTORY_PATH;
- defaults.put("widgetsetBase", widgetsetBase);
+ appConfig.put("widgetsetBase", widgetsetBase);
if (!session.getConfiguration().isProductionMode()) {
- defaults.put("debug", true);
+ appConfig.put("debug", true);
}
if (vaadinService.isStandalone(request)) {
- defaults.put("standalone", true);
+ appConfig.put("standalone", true);
}
- defaults.put("heartbeatInterval", vaadinService
+ appConfig.put("heartbeatInterval", vaadinService
.getDeploymentConfiguration().getHeartbeatInterval());
- defaults.put("appUri", getAppUri(context));
+ appConfig.put("appUri", getAppUri(context));
- return defaults;
+ return appConfig;
}
protected abstract String getAppUri(BootstrapContext context);
diff --git a/server/src/com/vaadin/server/PortletCommunicationManager.java b/server/src/com/vaadin/server/PortletCommunicationManager.java
index c77c195197..8d39eee9ac 100644
--- a/server/src/com/vaadin/server/PortletCommunicationManager.java
+++ b/server/src/com/vaadin/server/PortletCommunicationManager.java
@@ -89,21 +89,6 @@ public class PortletCommunicationManager extends AbstractCommunicationManager {
}
@Override
- protected JSONObject getDefaultParameters(BootstrapContext context)
- throws JSONException {
- /*
- * We need this in order to get uploads to work. TODO this is
- * not needed for uploads anymore, check if this is needed for
- * some other things
- */
- JSONObject defaults = super.getDefaultParameters(context);
-
- defaults.put("pathInfo", "");
-
- return defaults;
- }
-
- @Override
protected void appendMainScriptTagContents(
BootstrapContext context, StringBuilder builder)
throws JSONException, IOException {