com.vaadin
Class Application.CustomizedSystemMessages

java.lang.Object
  extended by com.vaadin.Application.SystemMessages
      extended by com.vaadin.Application.CustomizedSystemMessages
All Implemented Interfaces:
Serializable
Enclosing class:
Application

public static class Application.CustomizedSystemMessages
extends Application.SystemMessages
implements Serializable

Contains the system messages used to notify the user about various critical situations that can occur.

Vaadin gets the SystemMessages from your application by calling a static getSystemMessages() method. By default the Application.getSystemMessages() is used. You can customize this by defining a static MyApplication.getSystemMessages() and returning CustomizedSystemMessages. Note that getSystemMessages() is static - changing the system messages will by default change the message for all users of the application.

The default behavior is to show a notification, and restart the application the the user clicks the message.
Instead of restarting the application, you can set a specific URL that the user is taken to.
Setting both caption and message to null will restart the application (or go to the specified URL) without displaying a notification. set*NotificationEnabled(false) will achieve the same thing.

The situations are:

  • Session expired: the user session has expired, usually due to inactivity.
  • Communication error: the client failed to contact the server, or the server returned and invalid response.
  • Internal error: unhandled critical server error (e.g out of memory, database crash)
  • Out of sync: the client is not in sync with the server. E.g the user opens two windows showing the same application, but the application does not support this and uses the same Window instance. When the user makes changes in one of the windows - the other window is no longer in sync, and (for instance) pressing a button that is no longer present in the UI will cause a out-of-sync -situation.

    See Also:
    Serialized Form

    Field Summary
     
    Fields inherited from class com.vaadin.Application.SystemMessages
    authenticationErrorCaption, authenticationErrorMessage, authenticationErrorNotificationEnabled, authenticationErrorURL, communicationErrorCaption, communicationErrorMessage, communicationErrorNotificationEnabled, communicationErrorURL, cookiesDisabledCaption, cookiesDisabledMessage, cookiesDisabledNotificationEnabled, cookiesDisabledURL, internalErrorCaption, internalErrorMessage, internalErrorNotificationEnabled, internalErrorURL, outOfSyncCaption, outOfSyncMessage, outOfSyncNotificationEnabled, outOfSyncURL, sessionExpiredCaption, sessionExpiredMessage, sessionExpiredNotificationEnabled, sessionExpiredURL
     
    Constructor Summary
    Application.CustomizedSystemMessages()
               
     
    Method Summary
     void setAuthenticationErrorCaption(String authenticationErrorCaption)
              Sets the caption of the notification.
     void setAuthenticationErrorMessage(String authenticationErrorMessage)
              Sets the message of the notification.
     void setAuthenticationErrorNotificationEnabled(boolean authenticationErrorNotificationEnabled)
              Enables or disables the notification.
     void setAuthenticationErrorURL(String authenticationErrorURL)
              Sets the URL to go to when there is a authentication error.
     void setCommunicationErrorCaption(String communicationErrorCaption)
              Sets the caption of the notification.
     void setCommunicationErrorMessage(String communicationErrorMessage)
              Sets the message of the notification.
     void setCommunicationErrorNotificationEnabled(boolean communicationErrorNotificationEnabled)
              Enables or disables the notification.
     void setCommunicationErrorURL(String communicationErrorURL)
              Sets the URL to go to when there is a communication error.
     void setCookiesDisabledCaption(String cookiesDisabledCaption)
              Sets the caption of the "cookies disabled" notification.
     void setCookiesDisabledMessage(String cookiesDisabledMessage)
              Sets the message of the "cookies disabled" notification.
     void setCookiesDisabledNotificationEnabled(boolean cookiesDisabledNotificationEnabled)
              Enables or disables the notification for "cookies disabled" messages.
     void setCookiesDisabledURL(String cookiesDisabledURL)
              Sets the URL to redirect to when the browser has cookies disabled.
     void setInternalErrorCaption(String internalErrorCaption)
              Sets the caption of the notification.
     void setInternalErrorMessage(String internalErrorMessage)
              Sets the message of the notification.
     void setInternalErrorNotificationEnabled(boolean internalErrorNotificationEnabled)
              Enables or disables the notification.
     void setInternalErrorURL(String internalErrorURL)
              Sets the URL to go to when an internal error occurs.
     void setOutOfSyncCaption(String outOfSyncCaption)
              Sets the caption of the notification.
     void setOutOfSyncMessage(String outOfSyncMessage)
              Sets the message of the notification.
     void setOutOfSyncNotificationEnabled(boolean outOfSyncNotificationEnabled)
              Enables or disables the notification.
     void setOutOfSyncURL(String outOfSyncURL)
              Sets the URL to go to when the client is out-of-sync.
     void setSessionExpiredCaption(String sessionExpiredCaption)
              Sets the caption of the notification.
     void setSessionExpiredMessage(String sessionExpiredMessage)
              Sets the message of the notification.
     void setSessionExpiredNotificationEnabled(boolean sessionExpiredNotificationEnabled)
              Enables or disables the notification.
     void setSessionExpiredURL(String sessionExpiredURL)
              Sets the URL to go to when the session has expired.
     
    Methods inherited from class com.vaadin.Application.SystemMessages
    getAuthenticationErrorCaption, getAuthenticationErrorMessage, getAuthenticationErrorURL, getCommunicationErrorCaption, getCommunicationErrorMessage, getCommunicationErrorURL, getCookiesDisabledCaption, getCookiesDisabledMessage, getCookiesDisabledURL, getInternalErrorCaption, getInternalErrorMessage, getInternalErrorURL, getOutOfSyncCaption, getOutOfSyncMessage, getOutOfSyncURL, getSessionExpiredCaption, getSessionExpiredMessage, getSessionExpiredURL, isAuthenticationErrorNotificationEnabled, isCommunicationErrorNotificationEnabled, isCookiesDisabledNotificationEnabled, isInternalErrorNotificationEnabled, isOutOfSyncNotificationEnabled, isSessionExpiredNotificationEnabled
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    Application.CustomizedSystemMessages

    public Application.CustomizedSystemMessages()
    Method Detail

    setSessionExpiredURL

    public void setSessionExpiredURL(String sessionExpiredURL)
    Sets the URL to go to when the session has expired.

    Parameters:
    sessionExpiredURL - the URL to go to, or null to reload current

    setSessionExpiredNotificationEnabled

    public void setSessionExpiredNotificationEnabled(boolean sessionExpiredNotificationEnabled)
    Enables or disables the notification. If disabled, the set URL (or current) is loaded directly when next transaction between server and client happens.

    Parameters:
    sessionExpiredNotificationEnabled - true = enabled, false = disabled

    setSessionExpiredCaption

    public void setSessionExpiredCaption(String sessionExpiredCaption)
    Sets the caption of the notification. Set to null for no caption. If both caption and message are null, client automatically forwards to sessionExpiredUrl after timeout timer expires. Timer uses value read from HTTPSession.getMaxInactiveInterval()

    Parameters:
    sessionExpiredCaption - the caption

    setSessionExpiredMessage

    public void setSessionExpiredMessage(String sessionExpiredMessage)
    Sets the message of the notification. Set to null for no message. If both caption and message are null, client automatically forwards to sessionExpiredUrl after timeout timer expires. Timer uses value read from HTTPSession.getMaxInactiveInterval()

    Parameters:
    sessionExpiredMessage - the message

    setAuthenticationErrorURL

    public void setAuthenticationErrorURL(String authenticationErrorURL)
    Sets the URL to go to when there is a authentication error.

    Parameters:
    authenticationErrorURL - the URL to go to, or null to reload current

    setAuthenticationErrorNotificationEnabled

    public void setAuthenticationErrorNotificationEnabled(boolean authenticationErrorNotificationEnabled)
    Enables or disables the notification. If disabled, the set URL (or current) is loaded directly.

    Parameters:
    authenticationErrorNotificationEnabled - true = enabled, false = disabled

    setAuthenticationErrorCaption

    public void setAuthenticationErrorCaption(String authenticationErrorCaption)
    Sets the caption of the notification. Set to null for no caption. If both caption and message is null, the notification is disabled;

    Parameters:
    authenticationErrorCaption - the caption

    setAuthenticationErrorMessage

    public void setAuthenticationErrorMessage(String authenticationErrorMessage)
    Sets the message of the notification. Set to null for no message. If both caption and message is null, the notification is disabled;

    Parameters:
    authenticationErrorMessage - the message

    setCommunicationErrorURL

    public void setCommunicationErrorURL(String communicationErrorURL)
    Sets the URL to go to when there is a communication error.

    Parameters:
    communicationErrorURL - the URL to go to, or null to reload current

    setCommunicationErrorNotificationEnabled

    public void setCommunicationErrorNotificationEnabled(boolean communicationErrorNotificationEnabled)
    Enables or disables the notification. If disabled, the set URL (or current) is loaded directly.

    Parameters:
    communicationErrorNotificationEnabled - true = enabled, false = disabled

    setCommunicationErrorCaption

    public void setCommunicationErrorCaption(String communicationErrorCaption)
    Sets the caption of the notification. Set to null for no caption. If both caption and message is null, the notification is disabled;

    Parameters:
    communicationErrorCaption - the caption

    setCommunicationErrorMessage

    public void setCommunicationErrorMessage(String communicationErrorMessage)
    Sets the message of the notification. Set to null for no message. If both caption and message is null, the notification is disabled;

    Parameters:
    communicationErrorMessage - the message

    setInternalErrorURL

    public void setInternalErrorURL(String internalErrorURL)
    Sets the URL to go to when an internal error occurs.

    Parameters:
    internalErrorURL - the URL to go to, or null to reload current

    setInternalErrorNotificationEnabled

    public void setInternalErrorNotificationEnabled(boolean internalErrorNotificationEnabled)
    Enables or disables the notification. If disabled, the set URL (or current) is loaded directly.

    Parameters:
    internalErrorNotificationEnabled - true = enabled, false = disabled

    setInternalErrorCaption

    public void setInternalErrorCaption(String internalErrorCaption)
    Sets the caption of the notification. Set to null for no caption. If both caption and message is null, the notification is disabled;

    Parameters:
    internalErrorCaption - the caption

    setInternalErrorMessage

    public void setInternalErrorMessage(String internalErrorMessage)
    Sets the message of the notification. Set to null for no message. If both caption and message is null, the notification is disabled;

    Parameters:
    internalErrorMessage - the message

    setOutOfSyncURL

    public void setOutOfSyncURL(String outOfSyncURL)
    Sets the URL to go to when the client is out-of-sync.

    Parameters:
    outOfSyncURL - the URL to go to, or null to reload current

    setOutOfSyncNotificationEnabled

    public void setOutOfSyncNotificationEnabled(boolean outOfSyncNotificationEnabled)
    Enables or disables the notification. If disabled, the set URL (or current) is loaded directly.

    Parameters:
    outOfSyncNotificationEnabled - true = enabled, false = disabled

    setOutOfSyncCaption

    public void setOutOfSyncCaption(String outOfSyncCaption)
    Sets the caption of the notification. Set to null for no caption. If both caption and message is null, the notification is disabled;

    Parameters:
    outOfSyncCaption - the caption

    setOutOfSyncMessage

    public void setOutOfSyncMessage(String outOfSyncMessage)
    Sets the message of the notification. Set to null for no message. If both caption and message is null, the notification is disabled;

    Parameters:
    outOfSyncMessage - the message

    setCookiesDisabledURL

    public void setCookiesDisabledURL(String cookiesDisabledURL)
    Sets the URL to redirect to when the browser has cookies disabled.

    Parameters:
    cookiesDisabledURL - the URL to redirect to, or null to reload the current URL

    setCookiesDisabledNotificationEnabled

    public void setCookiesDisabledNotificationEnabled(boolean cookiesDisabledNotificationEnabled)
    Enables or disables the notification for "cookies disabled" messages. If disabled, the URL returned by Application.SystemMessages.getCookiesDisabledURL() is loaded directly.

    Parameters:
    cookiesDisabledNotificationEnabled - true to enable "cookies disabled" messages, false otherwise

    setCookiesDisabledCaption

    public void setCookiesDisabledCaption(String cookiesDisabledCaption)
    Sets the caption of the "cookies disabled" notification. Set to null for no caption. If both caption and message is null, the notification is disabled.

    Parameters:
    cookiesDisabledCaption - the caption for the "cookies disabled" notification

    setCookiesDisabledMessage

    public void setCookiesDisabledMessage(String cookiesDisabledMessage)
    Sets the message of the "cookies disabled" notification. Set to null for no message. If both caption and message is null, the notification is disabled.

    Parameters:
    cookiesDisabledMessage - the message for the "cookies disabled" notification


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