com.vaadin.client
Class ApplicationConfiguration

java.lang.Object
  extended by com.vaadin.client.ApplicationConfiguration

public class ApplicationConfiguration
extends java.lang.Object


Nested Class Summary
static class ApplicationConfiguration.ErrorMessage
          Wraps a native javascript object containing fields for an error message
 
Constructor Summary
ApplicationConfiguration()
           
 
Method Summary
 void addComponentInheritanceInfo(ValueMap valueMap)
           
 void addComponentMappings(ValueMap valueMap, WidgetSet widgetSet)
           
 java.lang.String getAtmosphereJSVersion()
          Return Atmosphere JS version.
 java.lang.String getAtmosphereVersion()
          Return Atmosphere version.
 ApplicationConfiguration.ErrorMessage getAuthorizationError()
           
 ApplicationConfiguration.ErrorMessage getCommunicationError()
           
static ApplicationConfiguration getConfigFromDOM(java.lang.String appId)
           
 java.lang.Class<? extends ServerConnector> getConnectorClassByEncodedTag(int tag)
           
 int getHeartbeatInterval()
           
 java.lang.Integer getParentTag(int tag)
           
 java.lang.String getRootPanelId()
           
static java.util.List<ApplicationConnection> getRunningApplications()
           
 java.lang.String getServerSideClassNameForTag(java.lang.Integer tag)
           
 java.lang.String getServiceUrl()
          Gets the URL to the server-side VaadinService.
 java.lang.String getServiceUrlParameterName()
          Return the name of the parameter used to to send data to the service url.
 java.lang.String getServletVersion()
           
 ApplicationConfiguration.ErrorMessage getSessionExpiredError()
           
 java.lang.Integer[] getTagsForServerSideClassName(java.lang.String classname)
          Returns all tags for given class.
 java.lang.String getThemeName()
          Deprecated. as of 7.3. Use UIConnector.getActiveTheme() to get the theme currently in use
 java.lang.String getUIDL()
          Gets the initial UIDL from the DOM, if it was provided during the init process.
 int getUIId()
          Gets the UI id of the server-side UI associated with this client-side instance.
 java.lang.String getVaadinDirUrl()
          Gets the URL of the VAADIN directory on the server.
 JavaScriptObject getVersionInfoJSObject()
           
static boolean isDebugMode()
          Checks if client side is in debug mode.
static boolean isProductionMode()
          Checks if production mode is enabled.
static boolean isQuietDebugMode()
          Checks whether debug logging should be quiet
 boolean isStandalone()
           
 boolean isWidgetsetVersionSent()
          Checks whether the widget set version has been sent to the server.
 void onModuleLoad()
           
static void registerCallback(java.lang.String widgetsetName)
          Registers that callback that the bootstrap javascript uses to start applications once the widgetset is loaded and all required information is available
static void runWhenDependenciesLoaded(Command c)
           
 void setAppId(java.lang.String appId)
           
 void setWidgetsetVersionSent()
          Registers that the widget set version has been sent to the server.
static void startApplication(java.lang.String applicationId)
          Starts the application with a given id by reading the configuration options stored by the bootstrap javascript.
 boolean useServiceUrlPathParam()
          Checks whether path info in requests to the server-side service should be in a request parameter (named v-resourcePath) or appended to the end of the service URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationConfiguration

public ApplicationConfiguration()
Method Detail

useServiceUrlPathParam

public boolean useServiceUrlPathParam()
Checks whether path info in requests to the server-side service should be in a request parameter (named v-resourcePath) or appended to the end of the service URL.

Returns:
true if path info should be a request parameter; false if the path info goes after the service URL
See Also:
getServiceUrl()

getServiceUrlParameterName

public java.lang.String getServiceUrlParameterName()
Return the name of the parameter used to to send data to the service url. This method should only be called if useServiceUrlPathParam() is true.

Returns:
The parameter name, by default v-resourcePath
Since:
7.1.6

getRootPanelId

public java.lang.String getRootPanelId()

getServiceUrl

public java.lang.String getServiceUrl()
Gets the URL to the server-side VaadinService. If useServiceUrlPathParam() return true, the requested path info should be in the v-resourcePath query parameter; else the path info should be appended to the end of the URL.

Returns:
the URL to the server-side service as a string
See Also:
useServiceUrlPathParam()

getThemeName

@Deprecated
public java.lang.String getThemeName()
Deprecated. as of 7.3. Use UIConnector.getActiveTheme() to get the theme currently in use

Returns:
the theme name used when initializing the application

getVaadinDirUrl

public java.lang.String getVaadinDirUrl()
Gets the URL of the VAADIN directory on the server.

Returns:
the URL of the VAADIN directory

setAppId

public void setAppId(java.lang.String appId)

getUIDL

public java.lang.String getUIDL()
Gets the initial UIDL from the DOM, if it was provided during the init process.

Returns:

isStandalone

public boolean isStandalone()
Returns:
true if the application is served by std. Vaadin servlet and is considered to be the only or main content of the host page.

getUIId

public int getUIId()
Gets the UI id of the server-side UI associated with this client-side instance. The UI id should be included in every request originating from this instance in order to associate the request with the right UI instance on the server.

Returns:
the UI id

getHeartbeatInterval

public int getHeartbeatInterval()
Returns:
The interval in seconds between heartbeat requests, or a non-positive number if heartbeat is disabled.

getVersionInfoJSObject

public JavaScriptObject getVersionInfoJSObject()

getCommunicationError

public ApplicationConfiguration.ErrorMessage getCommunicationError()

getAuthorizationError

public ApplicationConfiguration.ErrorMessage getAuthorizationError()

getSessionExpiredError

public ApplicationConfiguration.ErrorMessage getSessionExpiredError()

startApplication

public static void startApplication(java.lang.String applicationId)
Starts the application with a given id by reading the configuration options stored by the bootstrap javascript.

Parameters:
applicationId - id of the application to load, this is also the id of the html element into which the application should be rendered.

getRunningApplications

public static java.util.List<ApplicationConnection> getRunningApplications()

getConfigFromDOM

public static ApplicationConfiguration getConfigFromDOM(java.lang.String appId)

getServletVersion

public java.lang.String getServletVersion()

getAtmosphereVersion

public java.lang.String getAtmosphereVersion()
Return Atmosphere version.

Returns:
Atmosphere version.
Since:
7.4

getAtmosphereJSVersion

public java.lang.String getAtmosphereJSVersion()
Return Atmosphere JS version.

Returns:
Atmosphere JS version.
Since:
7.4

getConnectorClassByEncodedTag

public java.lang.Class<? extends ServerConnector> getConnectorClassByEncodedTag(int tag)

addComponentInheritanceInfo

public void addComponentInheritanceInfo(ValueMap valueMap)

addComponentMappings

public void addComponentMappings(ValueMap valueMap,
                                 WidgetSet widgetSet)

getTagsForServerSideClassName

public java.lang.Integer[] getTagsForServerSideClassName(java.lang.String classname)
Returns all tags for given class. Tags are used in ApplicationConfiguration to keep track of different classes and their hierarchy

Parameters:
classname - name of class which tags we want
Returns:
Integer array of tags pointing to this classname
Since:
7.2

getParentTag

public java.lang.Integer getParentTag(int tag)

getServerSideClassNameForTag

public java.lang.String getServerSideClassNameForTag(java.lang.Integer tag)

runWhenDependenciesLoaded

public static void runWhenDependenciesLoaded(Command c)
Parameters:
c -
Since:
7.6

onModuleLoad

public void onModuleLoad()

registerCallback

public static void registerCallback(java.lang.String widgetsetName)
Registers that callback that the bootstrap javascript uses to start applications once the widgetset is loaded and all required information is available

Parameters:
widgetsetName - the name of this widgetset

isDebugMode

public static boolean isDebugMode()
Checks if client side is in debug mode. Practically this is invoked by adding ?debug parameter to URI. Please note that debug mode is always disabled if production mode is enabled, but disabling production mode does not automatically enable debug mode.

Returns:
true if client side is currently been debugged
See Also:
isProductionMode()

isProductionMode

public static boolean isProductionMode()
Checks if production mode is enabled. When production mode is enabled, client-side logging is disabled. There may also be other performance optimizations.

Returns:
true if production mode is enabled; otherwise false.
Since:
7.1.2

isQuietDebugMode

public static boolean isQuietDebugMode()
Checks whether debug logging should be quiet

Returns:
true if debug logging should be quiet

isWidgetsetVersionSent

public boolean isWidgetsetVersionSent()
Checks whether the widget set version has been sent to the server. It is sent in the first UIDL request.

Returns:
true if browser information has already been sent

setWidgetsetVersionSent

public void setWidgetsetVersionSent()
Registers that the widget set version has been sent to the server.



Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.