|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.archive.wayback.core.UIResults
public class UIResults
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.
| Constructor Summary | |
|---|---|
UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter)
Constructor for a "generic" UIResults, where little/no context is available. |
|
UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
CaptureSearchResults captureResults)
Constructor for "Url Query" UIResults, where the request successfully matched something from the index. |
|
UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
CaptureSearchResults captureResults,
CaptureSearchResult result,
Resource resource)
Constructor for "Replay" UIResults, where the request successfully matched something from the index, the document was retrieved from the ResourceStore, and is going to be shown to the user. |
|
UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
UrlSearchResults urlResults)
Constructor for "Url Prefix Query" UIResults, where the request successfully matched something from the index. |
|
UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
WaybackException exception)
Constructor for a "exception" UIResults, where little/no context is available. |
|
| Method Summary | |
|---|---|
static String |
encodeXMLContent(String content)
Deprecated. use getFormatter().escapeHtml(String) |
static String |
encodeXMLEntity(String tagName)
Deprecated. use getFormatter().escapeHtml(String) |
static String |
encodeXMLEntityQuote(String content)
Deprecated. use getFormatter().escapeHtml(String) |
static UIResults |
extractCaptureQuery(javax.servlet.http.HttpServletRequest httpRequest)
Extract a CaptureQuery UIResults from the HttpServletRequest. |
static UIResults |
extractException(javax.servlet.http.HttpServletRequest httpRequest)
Extract an Exception UIResults from the HttpServletRequest. |
static UIResults |
extractReplay(javax.servlet.http.HttpServletRequest httpRequest)
Extract a Replay UIResults from the HttpServletRequest. |
static UIResults |
extractUrlQuery(javax.servlet.http.HttpServletRequest httpRequest)
Extract a UrlQuery UIResults from the HttpServletRequest. |
void |
forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String target)
Store this UIResults object in the given HttpServletRequest, then forward the request to target, in this case, an image, html file, .jsp, any file which can return a complete document. |
CaptureSearchResults |
getCaptureResults()
|
String |
getContentJsp()
|
String |
getContextConfig(String configName)
Get a String generic AccessPoint config (ala AccessPoint.configs Spring config) |
String |
getContextPrefix()
Deprecated. use getWbRequest().getContextPrefix() |
WaybackException |
getException()
|
StringFormatter |
getFormatter()
Deprecated. use getWbRequest().getFormatter() |
static UIResults |
getGeneric(javax.servlet.http.HttpServletRequest httpRequest)
Extract a generic UIResults from the HttpServletRequest. |
String |
getOriginalRequestURL()
|
String |
getQueryPrefix()
|
String |
getReplayPrefix()
|
Resource |
getResource()
|
CaptureSearchResult |
getResult()
|
String |
getServerPrefix()
Deprecated. use getWbRequest().getServerPrefix() |
String |
getStaticPrefix()
|
ResultURIConverter |
getUriConverter()
Deprecated. use getURIConverter() |
ResultURIConverter |
getURIConverter()
|
UrlSearchResults |
getUrlResults()
|
WaybackRequest |
getWbRequest()
|
String |
makeCaptureQueryUrl(String url)
Create a self-referencing URL that will perform a query for all copies of the given URL. |
String |
makeReplayUrl(String url,
String timestamp)
Deprecated. use resultToReplayUrl(CaptureSearchResult) or getURIConverter.makeReplayURI() |
String |
resultToReplayUrl(CaptureSearchResult result)
Create a replay URL for the given CaptureSearchResult |
void |
setContentJsp(String contentJsp)
Deprecated. use forward() |
String |
urlForPage(int pageNum)
Create a self-referencing URL that will drive to the given page, simplifying rendering pagination |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter)
wbRequest - WaybackRequest with some or no informationuriConverter - the ResultURIConveter to use with the AccessPoint
handling the request.
public UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
WaybackException exception)
wbRequest - WaybackRequest with some or no information, but at
least the AccessPoint that handled the request.uriConverter - the ResultURIConveter to use with the AccessPoint
handling the request.exception - WaybackException to be rendered.
public UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
CaptureSearchResults captureResults)
wbRequest - WaybackRequest with a valid requesturiConverter - the ResultURIConveter to use with the AccessPoint
handling the request.captureResults - CaptureSearchResults object with matching data.
public UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
UrlSearchResults urlResults)
wbRequest - WaybackRequest with a valid requesturiConverter - the ResultURIConveter to use with the AccessPointurlResults - UrlSearchResults object with matching data.
public UIResults(WaybackRequest wbRequest,
ResultURIConverter uriConverter,
CaptureSearchResults captureResults,
CaptureSearchResult result,
Resource resource)
wbRequest - WaybackRequest with some or no informationuriConverter - the ResultURIConveter to use with the AccessPointcaptureResults - CaptureSearchResults object with matching data.result - the specific CaptureSearchResult being replayedresource - the actual Resource being replayed| Method Detail |
|---|
public WaybackRequest getWbRequest()
public ResultURIConverter getURIConverter()
public CaptureSearchResults getCaptureResults()
public UrlSearchResults getUrlResults()
public CaptureSearchResult getResult()
public Resource getResource()
public WaybackException getException()
public String getContentJsp()
public String getOriginalRequestURL()
public String makeCaptureQueryUrl(String url)
url - to search for copies of
public String getContextConfig(String configName)
configName - key for configuration property
public String resultToReplayUrl(CaptureSearchResult result)
result - CaptureSearchResult to replay
public String urlForPage(int pageNum)
pageNum - page number of results to link to.
public String getStaticPrefix()
public String getQueryPrefix()
public String getReplayPrefix()
public void forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String target)
throws javax.servlet.ServletException,
IOException
request - the HttpServletRequestresponse - the HttpServletResponsetarget - the String path to the .jsp to handle drawing the data,
relative to the contextRoot (ex. "/WEB-INF/query/foo.jsp")
javax.servlet.ServletException - for usual reasons...
IOException - for usual reasons...public static UIResults getGeneric(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest - the HttpServletRequest where the UIResults was
ferreted away
public static UIResults extractException(javax.servlet.http.HttpServletRequest httpRequest)
throws javax.servlet.ServletException
httpRequest - the HttpServletRequest where the UIResults was
ferreted away
javax.servlet.ServletException - if expected information is not available. Likely
means a programming bug, or a configuration problem.
public static UIResults extractCaptureQuery(javax.servlet.http.HttpServletRequest httpRequest)
throws javax.servlet.ServletException
httpRequest - the HttpServletRequest where the UIResults was
ferreted away
javax.servlet.ServletException - if expected information is not available. Likely
means a programming bug, or a configuration problem.
public static UIResults extractUrlQuery(javax.servlet.http.HttpServletRequest httpRequest)
throws javax.servlet.ServletException
httpRequest - the HttpServletRequest where the UIResults was
ferreted away
javax.servlet.ServletException - if expected information is not available. Likely
means a programming bug, or a configuration problem.
public static UIResults extractReplay(javax.servlet.http.HttpServletRequest httpRequest)
throws javax.servlet.ServletException
httpRequest - the HttpServletRequest where the UIResults was
ferreted away
javax.servlet.ServletException - if expected information is not available. Likely
means a programming bug, or a configuration problem.public ResultURIConverter getUriConverter()
public static String encodeXMLEntity(String tagName)
tagName - raw string to be encoded
public static String encodeXMLContent(String content)
content - to escape
public static String encodeXMLEntityQuote(String content)
content - to encode
public String getContextPrefix()
public StringFormatter getFormatter()
public String getServerPrefix()
public void setContentJsp(String contentJsp)
contentJsp - the contentJsp to set
public String makeReplayUrl(String url,
String timestamp)
url - to replaytimestamp - to replay
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||