All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.server.SystemMessages Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */

package com.vaadin.server;

import java.io.Serializable;

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

* Use {@link VaadinService#setSystemMessagesProvider(SystemMessagesProvider)} * to customize. *

* * The defaults defined in this class are: *
    *
  • sessionExpiredURL = null
  • *
  • sessionExpiredNotificationEnabled = true
  • *
  • sessionExpiredCaption = ""
  • *
  • sessionExpiredMessage = "Take note of any unsaved data, and * click here to continue."
  • *
  • communicationErrorURL = null
  • *
  • communicationErrorNotificationEnabled = true
  • *
  • communicationErrorCaption = "Communication problem"
  • *
  • communicationErrorMessage = "Take note of any unsaved data, and * click here to continue."
  • *
  • internalErrorURL = null
  • *
  • internalErrorNotificationEnabled = true
  • *
  • internalErrorCaption = "Internal error"
  • *
  • internalErrorMessage = "Please notify the administrator. * Take note of any unsaved data, and click here to continue."
  • *
  • cookiesDisabledURL = null
  • *
  • cookiesDisabledNotificationEnabled = true
  • *
  • cookiesDisabledCaption = "Cookies disabled"
  • *
  • cookiesDisabledMessage = "This application requires cookies to * function. Please enable cookies in your browser and click here to try * again.
  • *
* */ public class SystemMessages implements Serializable { protected String sessionExpiredURL = null; protected boolean sessionExpiredNotificationEnabled = true; protected String sessionExpiredCaption = "Session Expired"; protected String sessionExpiredMessage = "Take note of any unsaved data, and click here or press ESC key to continue."; protected String communicationErrorURL = null; protected boolean communicationErrorNotificationEnabled = true; protected String communicationErrorCaption = "Communication problem"; protected String communicationErrorMessage = "Take note of any unsaved data, and click here or press ESC to continue."; protected String authenticationErrorURL = null; protected boolean authenticationErrorNotificationEnabled = true; protected String authenticationErrorCaption = "Authentication problem"; protected String authenticationErrorMessage = "Take note of any unsaved data, and click here or press ESC to continue."; protected String internalErrorURL = null; protected boolean internalErrorNotificationEnabled = true; protected String internalErrorCaption = "Internal error"; protected String internalErrorMessage = "Please notify the administrator.
Take note of any unsaved data, and click here or press ESC to continue."; protected String cookiesDisabledURL = null; protected boolean cookiesDisabledNotificationEnabled = true; protected String cookiesDisabledCaption = "Cookies disabled"; protected String cookiesDisabledMessage = "This application requires cookies to function.
Please enable cookies in your browser and click here or press ESC to try again."; /** * Use {@link CustomizedSystemMessages} to customize */ SystemMessages() { } /** * @return null to indicate that the application will be restarted after * session expired message has been shown. */ public String getSessionExpiredURL() { return sessionExpiredURL; } /** * @return true to show session expiration message. */ public boolean isSessionExpiredNotificationEnabled() { return sessionExpiredNotificationEnabled; } /** * @return "" to show no caption. */ public String getSessionExpiredCaption() { return (sessionExpiredNotificationEnabled ? sessionExpiredCaption : null); } /** * @return "Take note of any unsaved data, and click here to * continue." */ public String getSessionExpiredMessage() { return (sessionExpiredNotificationEnabled ? sessionExpiredMessage : null); } /** * @return null to reload the application after communication error message. */ public String getCommunicationErrorURL() { return communicationErrorURL; } /** * @return true to show the communication error message. */ public boolean isCommunicationErrorNotificationEnabled() { return communicationErrorNotificationEnabled; } /** * @return "Communication problem" */ public String getCommunicationErrorCaption() { return (communicationErrorNotificationEnabled ? communicationErrorCaption : null); } /** * @return "Take note of any unsaved data, and click here to * continue." */ public String getCommunicationErrorMessage() { return (communicationErrorNotificationEnabled ? communicationErrorMessage : null); } /** * @return null to reload the application after authentication error * message. */ public String getAuthenticationErrorURL() { return authenticationErrorURL; } /** * @return true to show the authentication error message. */ public boolean isAuthenticationErrorNotificationEnabled() { return authenticationErrorNotificationEnabled; } /** * @return "Authentication problem" */ public String getAuthenticationErrorCaption() { return (authenticationErrorNotificationEnabled ? authenticationErrorCaption : null); } /** * @return "Take note of any unsaved data, and click here to * continue." */ public String getAuthenticationErrorMessage() { return (authenticationErrorNotificationEnabled ? authenticationErrorMessage : null); } /** * @return null to reload the current URL after internal error message has * been shown. */ public String getInternalErrorURL() { return internalErrorURL; } /** * @return true to enable showing of internal error message. */ public boolean isInternalErrorNotificationEnabled() { return internalErrorNotificationEnabled; } /** * @return "Internal error" */ public String getInternalErrorCaption() { return (internalErrorNotificationEnabled ? internalErrorCaption : null); } /** * @return "Please notify the administrator.
* Take note of any unsaved data, and click here to * continue." */ public String getInternalErrorMessage() { return (internalErrorNotificationEnabled ? internalErrorMessage : null); } /** * Returns the URL the user should be redirected to after dismissing the * "you have to enable your cookies" message. Typically null. * * @return A URL the user should be redirected to after dismissing the * message or null to reload the current URL. */ public String getCookiesDisabledURL() { return cookiesDisabledURL; } /** * Determines if "cookies disabled" messages should be shown to the end user * or not. If the notification is disabled the user will be immediately * redirected to the URL returned by {@link #getCookiesDisabledURL()}. * * @return true to show "cookies disabled" messages to the end user, false * to redirect to the given URL directly */ public boolean isCookiesDisabledNotificationEnabled() { return cookiesDisabledNotificationEnabled; } /** * Returns the caption of the message shown to the user when cookies are * disabled in the browser. * * @return The caption of the "cookies disabled" message */ public String getCookiesDisabledCaption() { return (cookiesDisabledNotificationEnabled ? cookiesDisabledCaption : null); } /** * Returns the message shown to the user when cookies are disabled in the * browser. * * @return The "cookies disabled" message */ public String getCookiesDisabledMessage() { return (cookiesDisabledNotificationEnabled ? cookiesDisabledMessage : null); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy