diff options
author | John Alhroos <john.ahlroos@itmill.com> | 2010-08-05 10:20:23 +0000 |
---|---|---|
committer | John Alhroos <john.ahlroos@itmill.com> | 2010-08-05 10:20:23 +0000 |
commit | 83e7ac457ec937ea89555b992de04dbd7d4fc761 (patch) | |
tree | d13e56567a80b62b5050e718087932913b08768a /src/com/vaadin/Application.java | |
parent | a0db6c4ef08f41256bcfbc19a362c06fddbfb2c0 (diff) | |
download | vaadin-framework-83e7ac457ec937ea89555b992de04dbd7d4fc761.tar.gz vaadin-framework-83e7ac457ec937ea89555b992de04dbd7d4fc761.zip |
Added authentication error checking in ApplicationConnection. Needed when using containers Form security.
svn changeset:14415/svn branch:6.4
Diffstat (limited to 'src/com/vaadin/Application.java')
-rw-r--r-- | src/com/vaadin/Application.java | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index f24d133af4..14837fa0f9 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -1329,6 +1329,11 @@ public abstract class Application implements URIHandler, protected String communicationErrorCaption = "Communication problem"; protected String communicationErrorMessage = "Take note of any unsaved data, and <u>click here</u> 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 <u>click here</u> to continue."; + protected String internalErrorURL = null; protected boolean internalErrorNotificationEnabled = true; protected String internalErrorCaption = "Internal error"; @@ -1416,6 +1421,38 @@ public abstract class Application implements URIHandler, } /** + * @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 <u>click here</u> to continue." + */ + public String getAuthenticationErrorMessage() { + return (authenticationErrorNotificationEnabled ? authenticationErrorMessage + : null); + } + + /** * @return null to reload the current URL after internal error message * has been shown. */ @@ -1617,6 +1654,52 @@ public abstract class Application implements URIHandler, } /** + * Sets the URL to go to when there is a authentication error. + * + * @param authenticationErrorURL + * the URL to go to, or null to reload current + */ + public void setAuthenticationErrorURL(String authenticationErrorURL) { + this.authenticationErrorURL = authenticationErrorURL; + } + + /** + * Enables or disables the notification. If disabled, the set URL (or + * current) is loaded directly. + * + * @param authenticationErrorNotificationEnabled + * true = enabled, false = disabled + */ + public void setAuthenticationErrorNotificationEnabled( + boolean authenticationErrorNotificationEnabled) { + this.authenticationErrorNotificationEnabled = authenticationErrorNotificationEnabled; + } + + /** + * Sets the caption of the notification. Set to null for no caption. If + * both caption and message is null, the notification is disabled; + * + * @param authenticationErrorCaption + * the caption + */ + public void setAuthenticationErrorCaption( + String authenticationErrorCaption) { + this.authenticationErrorCaption = authenticationErrorCaption; + } + + /** + * Sets the message of the notification. Set to null for no message. If + * both caption and message is null, the notification is disabled; + * + * @param authenticationErrorMessage + * the message + */ + public void setAuthenticationErrorMessage( + String authenticationErrorMessage) { + this.authenticationErrorMessage = authenticationErrorMessage; + } + + /** * Sets the URL to go to when there is a communication error. * * @param communicationErrorURL |