com.guiseframework.platform.web
Class HTTPServletWebPlatform

java.lang.Object
  extended by com.guiseframework.platform.AbstractPlatform
      extended by com.guiseframework.platform.web.AbstractWebPlatform
          extended by com.guiseframework.platform.web.HTTPServletWebPlatform
All Implemented Interfaces:
Platform, WebPlatform

public class HTTPServletWebPlatform
extends AbstractWebPlatform
implements WebPlatform

A web platform based upon an HTTP servlet.

Author:
Garret Wilson

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.guiseframework.platform.web.WebPlatform
WebPlatform.PollCommand
 
Field Summary
 
Fields inherited from class com.guiseframework.platform.web.AbstractWebPlatform
DEFAULT_POLL_INTERVAL, DEPICT_ID_STRING_PREFIX
 
Fields inherited from interface com.guiseframework.platform.web.WebPlatform
AJAX_JAVASCRIPT_PATH, ATTRIBUTE_ATTRIBUTE_HASH, ATTRIBUTE_CLASS_CONTENT, ATTRIBUTE_CONTENT_HASH, ATTRIBUTE_CONTENT_TYPE, ATTRIBUTE_PATCH_TYPE, ATTRIBUTE_PATCH_TYPE_NO_VALUE, ATTRIBUTE_PATCH_TYPE_NONE, ATTRIBUTE_PATCH_TYPE_TEMP, BLANK_MP3_PATH, DOM_JAVASCRIPT_PATH, ELEMENT_IMG_ATTRIBUTE_ORIGINAL_SRC, ELEMENT_IMG_ATTRIBUTE_ROLLOVER_SRC, ELEMENT_TEXTAREA_ATTRIBUTE_MULTILINE, GUISE_AJAX_REQUEST_CONTENT_TYPE, GUISE_AJAX_RESPONSE_CONTENT_TYPE, GUISE_DTD_PATH, GUISE_EMPTY_HTML_DOCUMENT_PATH, GUISE_FLASH_PATH, GUISE_JAVASCRIPT_PATH, GUISE_ML_NAMESPACE_PREFIX, GUISE_ML_NAMESPACE_URI, GUISE_SESSION_UUID_URI_QUERY_PARAMETER, GUISE_VERSION_URI_QUERY_PARAMETER, GUISE_XHTML_DTD_PUBLIC_ID, JAVASCRIPT_JAVASCRIPT_PATH
 
Constructor Summary
HTTPServletWebPlatform(GuiseApplication application, HttpSession httpSession, HttpServletRequest httpRequest)
          Application and request constructor.
 
Method Summary
 WebUserAgentProduct getClientProduct()
           
 WebDepictContext getDepictContext()
          Retrieves information and functionality related to the current depiction.
 HttpSession getHTTPSession()
           
 Product getJavaScriptProduct()
           
 void selectPlatformFiles(boolean multiple, ValueSelectListener<java.util.Collection<PlatformFile>> platformFileSelectListener)
          Selects one or more files on the platform, using the appropriate selection functionality for the platform.
 void sendResource(java.net.URI resourceURI)
          Sends a resource to the platform.
 void sendResource(java.net.URI resourceURI, Bookmark bookmark)
          Sends a resource to the platform.
 void sendResource(com.globalmentor.net.URIPath resourcePath)
          Sends a resource to the platform.
 void sendResource(com.globalmentor.net.URIPath resourcePath, Bookmark bookmark)
          Sends a resource to the platform with the specified bookmark.
 void uploadPlatformFiles(java.lang.String destinationPath, Bookmark destinationBookmark, com.globalmentor.event.ProgressListener progressListener, PlatformFile... platformFiles)
          Uploads files from the platform.
 
Methods inherited from class com.guiseframework.platform.web.AbstractWebPlatform
discontinuePollInterval, getDepictID, getDepictIDString, getEnvironment, getPollInterval, getSendMessageQueue, requestPollInterval, setPollInterval
 
Methods inherited from class com.guiseframework.platform.AbstractPlatform
generateDepictID, getApplication, getDepictedObject, getDepictLock, getDepictor, getDepictorClass, getRegisteredDepictorClass, registerDepictedObject, registerDepictorClass, unregisterDepictedObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.platform.web.WebPlatform
discontinuePollInterval, getDepictID, getDepictIDString, getPollInterval, getSendMessageQueue, requestPollInterval, setPollInterval
 
Methods inherited from interface com.guiseframework.platform.Platform
generateDepictID, getApplication, getDepictedObject, getDepictLock, getDepictor, getEnvironment, registerDepictedObject, unregisterDepictedObject
 

Constructor Detail

HTTPServletWebPlatform

public HTTPServletWebPlatform(GuiseApplication application,
                              HttpSession httpSession,
                              HttpServletRequest httpRequest)
Application and request constructor. This implementation updates the environment from the initial request cookies

Parameters:
application - The Guise application running on this platform.
httpSession - The HTTP servlet session with which this platform is associated.
httpRequest - The HTTP servlet request.
Throws:
java.lang.NullPointerException - if the given application, HTTP session, and/or HTTP request is null.
Method Detail

getHTTPSession

public HttpSession getHTTPSession()
Returns:
The HTTP servlet session with which this platform is associated.

getClientProduct

public WebUserAgentProduct getClientProduct()
Specified by:
getClientProduct in interface Platform
Specified by:
getClientProduct in interface WebPlatform
Returns:
The user agent client, such as a browser, used to access Guise on this platform.

getJavaScriptProduct

public Product getJavaScriptProduct()
Returns:
The JavaScript supported on this platform, or null if JavaScript is not supported or the JavaScript support is not yet known.

getDepictContext

public WebDepictContext getDepictContext()
Retrieves information and functionality related to the current depiction.

Specified by:
getDepictContext in interface Platform
Specified by:
getDepictContext in interface WebPlatform
Returns:
A context for the current depiction.
Throws:
java.lang.IllegalStateException - if no depict context can be returned in the current depiction state.

selectPlatformFiles

public void selectPlatformFiles(boolean multiple,
                                ValueSelectListener<java.util.Collection<PlatformFile>> platformFileSelectListener)
Selects one or more files on the platform, using the appropriate selection functionality for the platform.

Specified by:
selectPlatformFiles in interface Platform
Parameters:
multiple - Whether multiple files should be allowed to be selected.
platformFileSelectListener - The listener that will be notified when platform files are selected.
Throws:
java.lang.NullPointerException - if the given listener is null.

uploadPlatformFiles

public void uploadPlatformFiles(java.lang.String destinationPath,
                                Bookmark destinationBookmark,
                                com.globalmentor.event.ProgressListener progressListener,
                                PlatformFile... platformFiles)
Uploads files from the platform.

Parameters:
destinationPath - The path representing the destination of the platform files, relative to the application.
destinationBookmark - The bookmark to be used in uploading the platform files to the destination path, or null if no bookmark should be used.
progressListener - The listener that will be notified when progress is made for a particular platform file upload.
platformFiles - Thet platform files to upload.
Throws:
java.lang.NullPointerException - if the given destination path and/or listener is null.
java.lang.IllegalArgumentException - if the provided path specifies a URI scheme (i.e. the URI is absolute) and/or authority.
java.lang.IllegalArgumentException - if the provided path is absolute.
java.lang.IllegalStateException - if one or more of the specified platform files can no longer be uploaded because, for example, other platform files have since been selected.

sendResource

public void sendResource(com.globalmentor.net.URIPath resourcePath)
Sends a resource to the platform.

Specified by:
sendResource in interface Platform
Parameters:
resourcePath - The path of the resource to send, relative to the application.
Throws:
java.lang.NullPointerException - if the given path is null.
java.lang.IllegalArgumentException - if the given string is not a path.

sendResource

public void sendResource(java.net.URI resourceURI)
Sends a resource to the platform.

Specified by:
sendResource in interface Platform
Parameters:
resourceURI - The URI of the resource to send, relative to the application.
Throws:
java.lang.NullPointerException - if the given URI is null.

sendResource

public void sendResource(com.globalmentor.net.URIPath resourcePath,
                         Bookmark bookmark)
Sends a resource to the platform with the specified bookmark.

Specified by:
sendResource in interface Platform
Parameters:
resourcePath - The path of the resource to send, relative to the application.
bookmark - The bookmark at the given path, or null if there is no bookmark.
Throws:
java.lang.NullPointerException - if the given path is null.

sendResource

public void sendResource(java.net.URI resourceURI,
                         Bookmark bookmark)
Sends a resource to the platform.

Specified by:
sendResource in interface Platform
Parameters:
resourceURI - The URI of the resource to send, relative to the application.
bookmark - The bookmark at the given path, or null if there is no bookmark.
Throws:
java.lang.NullPointerException - if the given URI is null.


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