com.guiseframework.demo
Class DemoApplication

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.AbstractGuiseApplication
          extended by com.guiseframework.demo.DemoApplication
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, com.globalmentor.config.ConfigurationManaged, com.globalmentor.net.Resource, GuiseApplication

public class DemoApplication
extends AbstractGuiseApplication

Demonstration Guise application. Copyright © 2005 GlobalMentor, Inc. Demonstrates custom Guise applications, setting application resource bundles, and custom authorization.

Author:
Garret Wilson

Field Summary
static com.globalmentor.net.URIPath EDIT_USER_PANEL_NAVIGATION_PATH
          The application-relative navigation path to the edit user modal panel.
static com.globalmentor.net.URIPath RESTRICTED_PANEL_NAVIGATION_PATH
          The application-relative navigation path to the restricted panel.
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Fields inherited from interface com.guiseframework.GuiseApplication
ENVIRONMENT_PROPERTY, GUISE_ASSETS_AUDIO_PATH, GUISE_ASSETS_BASE_PATH, GUISE_ASSETS_CABS_PATH, GUISE_ASSETS_DOCUMENTS_PATH, GUISE_ASSETS_DTD_PATH, GUISE_ASSETS_FLASH_PATH, GUISE_ASSETS_JAVASCRIPT_PATH, GUISE_ASSETS_TEMP_BASE_PATH, GUISE_ASSETS_THEMES_PATH, GUISE_BASIC_THEME_BASE_PATH, GUISE_BASIC_THEME_PATH, GUISE_RESERVED_BASE_PATH, GUISE_ROOT_THEME_BASE_PATH, GUISE_ROOT_THEME_CURSORS_PATH, GUISE_ROOT_THEME_PATH, LOCALES_PROPERTY, RESOURCE_BUNDLE_BASE_NAME_PROPERTY, STYLE_URI_PROPERTY, THEME_URI_PROPERTY, THEMED_PROPERTY
 
Fields inherited from interface com.globalmentor.net.Resource
URI_PROPERTY_NAME
 
Constructor Summary
DemoApplication()
          Default constructor with no identifier.
DemoApplication(java.net.URI uri)
          URI constructor.
 
Method Summary
 java.lang.String generateUserID()
           
protected  char[] getPassword(java.security.Principal principal)
          Looks up the corresponding password for the given principal.
protected  DemoUser getPrincipal(java.lang.String id)
          Looks up a principal from the given ID.
 java.util.List<DemoUser> getUsers()
          The synchronized list of application users.
protected  boolean isAuthorized(com.globalmentor.net.URIPath applicationPath, java.security.Principal principal, java.lang.String realm)
          Checks whether the given principal is authorized to access the resouce at the given application path.
 
Methods inherited from class com.guiseframework.AbstractGuiseApplication
addDestination, addDestination, checkInstalled, checkNotInstalled, createApplicationFrame, createSession, createTempAsset, getAssetURL, getBasePath, getBaseURI, getConfiguration, getContainer, getDCSID, getDepictionURI, getDepictionURI, getDestination, getDestinations, getEnvironment, getHomeDirectory, getInputStream, getInputStream, getLocaleResourcePath, getLocales, getLogDirectory, getLogWriter, getMailProperties, getMailSendQueue, getMailSession, getNavigationPath, getOutputStream, getOutputStream, getRealm, getResourceBundleBaseName, getResourceInputStream, getResourcesIO, getSession, getStyleURI, getSupportedLocales, getTempDirectory, getThemeIO, getThemeURI, getURI, hasAsset, hasDestination, hasResource, install, isInstalled, isThemed, loadProperties, loadResourceBundle, loadResourceBundle, loadResourceBundle, loadTheme, registerSession, relativizePath, relativizeURI, removeConfiguration, resolvePath, resolveURI, setBaseURI, setConfiguration, setConfiguration, setConfigurations, setDCSID, setDestinations, setEnvironment, setLocales, setLogLevel, setMailProperties, setResourceBundleBaseName, setStyleURI, setThemed, setThemeURI, uninstall, unregisterSession
 
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

EDIT_USER_PANEL_NAVIGATION_PATH

public static final com.globalmentor.net.URIPath EDIT_USER_PANEL_NAVIGATION_PATH
The application-relative navigation path to the edit user modal panel.


RESTRICTED_PANEL_NAVIGATION_PATH

public static final com.globalmentor.net.URIPath RESTRICTED_PANEL_NAVIGATION_PATH
The application-relative navigation path to the restricted panel.

Constructor Detail

DemoApplication

public DemoApplication()
Default constructor with no identifier.


DemoApplication

public DemoApplication(java.net.URI uri)
URI constructor. The URI identifier may or may not be the URI at which the application can be accessed.

Parameters:
uri - The URI for the application, or null if there is no identifier.
Method Detail

getUsers

public java.util.List<DemoUser> getUsers()
The synchronized list of application users.


generateUserID

public java.lang.String generateUserID()
Returns:
A new unique user ID.

getPrincipal

protected DemoUser getPrincipal(java.lang.String id)
Looks up a principal from the given ID. This version returns the user with the given ID.

Overrides:
getPrincipal in class AbstractGuiseApplication
Parameters:
id - The ID of the principal.
Returns:
The principal corresponding to the given ID, or null if no principal could be determined.

getPassword

protected char[] getPassword(java.security.Principal principal)
Looks up the corresponding password for the given principal. This version returns the password of the given user.

Overrides:
getPassword in class AbstractGuiseApplication
Parameters:
principal - The principal for which a password should be returned.
Returns:
The password associated with the given principal, or null if no password is associated with the given principal.

isAuthorized

protected boolean isAuthorized(com.globalmentor.net.URIPath applicationPath,
                               java.security.Principal principal,
                               java.lang.String realm)
Checks whether the given principal is authorized to access the resouce at the given application path. For the application path "restricted", this version authorized only users marked as authorized.

Overrides:
isAuthorized in class AbstractGuiseApplication
Parameters:
applicationPath - The relative path of the resource requested.
principal - The principal requesting authentication, or null if the principal is not known.
realm - The realm with which the resource is associated, or null if the realm is not known.
Returns:
true if the given principal is authorized to access the resource represented by the given application path.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.