org.archive.wayback.core
Class UIResults

java.lang.Object
  extended by org.archive.wayback.core.UIResults

public class UIResults
extends java.lang.Object

Simple class which acts as the go-between between Java request handling code and .jsp files which actually draw various forms of results for end user consumption. Designed to be flexible enough to handle forward various types of data to the eventual .jsp files, and provides a handful of convenience method to simplify .jsp code. 5 main "forms" of this object: 1) Generic: has WaybackRequest, uriConverter 2) Exception: has WaybackRequest, uriConverter, WaybackException 3) CaptureQuery: has WaybackRequest, uriConverter, CaptureSearchResults 4) UrlQuery: has WaybackRequest, uriConverter, UrlSearchResults 5) Replay: has WaybackRequest, uriConverter, CaptureSearchResult, CaptureSearchResults, Resource There are constructors to create each of these forms from the appropriate component objects. There is also a common method "forward()" which will store the UIResults object into an HttpServletRequest, for later retrieval by .jsp files. There are static methods to extract each of these from an HttpServletRequest, which will also verify that the appropriate internal objects are present. These methods are intended to be used by the target .jsp files.

Version:
$Date$, $Revision$
Author:
brad

Constructor Summary
UIResults(WaybackRequest wbRequest, ResultURIConverter uriConverter)
           
UIResults(WaybackRequest wbRequest, ResultURIConverter uriConverter, CaptureSearchResults captureResults)
           
UIResults(WaybackRequest wbRequest, ResultURIConverter uriConverter, CaptureSearchResults captureResults, CaptureSearchResult result, Resource resource)
           
UIResults(WaybackRequest wbRequest, ResultURIConverter uriConverter, UrlSearchResults urlResults)
           
UIResults(WaybackRequest wbRequest, ResultURIConverter uriConverter, WaybackException exception)
           
 
Method Summary
static java.lang.String encodeXMLContent(java.lang.String content)
          return a string appropriate for inclusion as an XML tag
static java.lang.String encodeXMLEntity(java.lang.String tagName)
          return a string appropriate for inclusion as an XML tag
static java.lang.String encodeXMLEntityQuote(java.lang.String content)
          return a string appropriate for inclusion as an XML tag
static UIResults extractCaptureQuery(javax.servlet.http.HttpServletRequest httpRequest)
           
static UIResults extractException(javax.servlet.http.HttpServletRequest httpRequest)
           
static UIResults extractReplay(javax.servlet.http.HttpServletRequest httpRequest)
           
static UIResults extractUrlQuery(javax.servlet.http.HttpServletRequest httpRequest)
           
 void forward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String target)
           
 CaptureSearchResults getCaptureResults()
           
 java.lang.String getContentJsp()
           
 java.lang.String getContextConfig(java.lang.String configName)
           
 java.lang.String getContextPrefix()
          Deprecated.  
 WaybackException getException()
           
 StringFormatter getFormatter()
          Deprecated.  
static UIResults getGeneric(javax.servlet.http.HttpServletRequest httpRequest)
           
 java.lang.String getOriginalRequestURL()
           
 Resource getResource()
           
 CaptureSearchResult getResult()
           
 java.lang.String getServerPrefix()
          Deprecated.  
 ResultURIConverter getURIConverter()
           
 UrlSearchResults getUrlResults()
           
 WaybackRequest getWbRequest()
           
 java.lang.String makeCaptureQueryUrl(java.lang.String url)
           
 java.lang.String makeReplayUrl(java.lang.String url, java.lang.String timestamp)
          Deprecated.  
 java.lang.String resultToReplayUrl(CaptureSearchResult result)
           
 void setContentJsp(java.lang.String contentJsp)
          Deprecated.  
 void storeInRequest(javax.servlet.http.HttpServletRequest httpRequest, java.lang.String contentJsp)
          Store this UIResults in the HttpServletRequest argument.
 java.lang.String urlForPage(int pageNum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIResults

public UIResults(WaybackRequest wbRequest,
                 ResultURIConverter uriConverter)

UIResults

public UIResults(WaybackRequest wbRequest,
                 ResultURIConverter uriConverter,
                 WaybackException exception)

UIResults

public UIResults(WaybackRequest wbRequest,
                 ResultURIConverter uriConverter,
                 CaptureSearchResults captureResults)

UIResults

public UIResults(WaybackRequest wbRequest,
                 ResultURIConverter uriConverter,
                 UrlSearchResults urlResults)

UIResults

public UIResults(WaybackRequest wbRequest,
                 ResultURIConverter uriConverter,
                 CaptureSearchResults captureResults,
                 CaptureSearchResult result,
                 Resource resource)
Method Detail

getWbRequest

public WaybackRequest getWbRequest()
Returns:
Returns the wbRequest.

getURIConverter

public ResultURIConverter getURIConverter()
Returns:
the ResultURIConverter

getCaptureResults

public CaptureSearchResults getCaptureResults()
Returns:
the captureResults

getUrlResults

public UrlSearchResults getUrlResults()
Returns:
the urlResults

getResult

public CaptureSearchResult getResult()
Returns:
the result

getResource

public Resource getResource()
Returns:
the resource

getException

public WaybackException getException()
Returns:
the exception

getContentJsp

public java.lang.String getContentJsp()
Returns:
the contentJsp

getOriginalRequestURL

public java.lang.String getOriginalRequestURL()

makeCaptureQueryUrl

public java.lang.String makeCaptureQueryUrl(java.lang.String url)
Parameters:
url -
Returns:
String url that will make a query for all captures of an URL.

getContextConfig

public java.lang.String getContextConfig(java.lang.String configName)
Parameters:
configName -
Returns:
String configuration for the context, if present, otherwise null

resultToReplayUrl

public java.lang.String resultToReplayUrl(CaptureSearchResult result)
Parameters:
result -
Returns:
URL string that will replay the specified Resource Result.

urlForPage

public java.lang.String urlForPage(int pageNum)
Parameters:
pageNum -
Returns:
String URL which will drive browser to search results for a different page of results for the same query

storeInRequest

public void storeInRequest(javax.servlet.http.HttpServletRequest httpRequest,
                           java.lang.String contentJsp)
Store this UIResults in the HttpServletRequest argument.

Parameters:
httpRequest -
contentJsp -

forward

public void forward(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    java.lang.String target)
             throws javax.servlet.ServletException,
                    java.io.IOException
Parameters:
request -
response -
targt -
Throws:
javax.servlet.ServletException
java.io.IOException

getGeneric

public static UIResults getGeneric(javax.servlet.http.HttpServletRequest httpRequest)
Parameters:
httpRequest -
Returns:
generic UIResult with info from httpRequest applied.

extractException

public static UIResults extractException(javax.servlet.http.HttpServletRequest httpRequest)
                                  throws javax.servlet.ServletException
Parameters:
httpRequest -
Returns:
UIResults from httpRequest
Throws:
javax.servlet.ServletException

extractCaptureQuery

public static UIResults extractCaptureQuery(javax.servlet.http.HttpServletRequest httpRequest)
                                     throws javax.servlet.ServletException
Parameters:
httpRequest -
Returns:
UIResults from httpRequest
Throws:
javax.servlet.ServletException

extractUrlQuery

public static UIResults extractUrlQuery(javax.servlet.http.HttpServletRequest httpRequest)
                                 throws javax.servlet.ServletException
Parameters:
httpRequest -
Returns:
UIResults from httpRequest
Throws:
javax.servlet.ServletException

extractReplay

public static UIResults extractReplay(javax.servlet.http.HttpServletRequest httpRequest)
                               throws javax.servlet.ServletException
Parameters:
httpRequest -
Returns:
UIResults from httpRequest
Throws:
javax.servlet.ServletException

encodeXMLEntity

public static java.lang.String encodeXMLEntity(java.lang.String tagName)
return a string appropriate for inclusion as an XML tag

Parameters:
tagName -
Returns:
encoded tagName

encodeXMLContent

public static java.lang.String encodeXMLContent(java.lang.String content)
return a string appropriate for inclusion as an XML tag

Parameters:
content -
Returns:
encoded content

encodeXMLEntityQuote

public static java.lang.String encodeXMLEntityQuote(java.lang.String content)
return a string appropriate for inclusion as an XML tag

Parameters:
content -
Returns:
encoded content

getContextPrefix

public java.lang.String getContextPrefix()
Deprecated. 

Returns:
URL that points to the root of the current WaybackContext

getFormatter

public StringFormatter getFormatter()
Deprecated. 

Returns:
StringFormatter localized to user request

getServerPrefix

public java.lang.String getServerPrefix()
Deprecated. 

Returns:
URL that points to the root of the Server

setContentJsp

public void setContentJsp(java.lang.String contentJsp)
Deprecated. 

Parameters:
contentJsp - the contentJsp to set

makeReplayUrl

public java.lang.String makeReplayUrl(java.lang.String url,
                                      java.lang.String timestamp)
Deprecated. 

Parameters:
url -
timestamp -
Returns:
String url that will replay the url at timestamp


Copyright © 2005-2009 Internet Archive. All Rights Reserved.