public class UIResults extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FERRET_NAME |
static String |
UI_RESOURCE_BUNDLE_NAME |
static String |
UIRESULTS_ATTRIBUTE
name of request scope attribute holding
UIResults instance. |
Constructor and Description |
---|
UIResults()
constructor for JSP.
|
UIResults(javax.servlet.http.HttpServletRequest httpRequest)
construct bare minimum UIResults.
|
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.
|
Modifier and Type | Method and Description |
---|---|
String |
enableAnalytics()
Deprecated.
1.8.1, use
getServerName() .
this method is nothing more than that. |
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()
return StringFormatter set-up for locale of request being
processed.
|
static UIResults |
getGeneric(javax.servlet.http.HttpServletRequest httpRequest)
Extract a generic UIResults from the HttpServletRequest.
|
Locale |
getLocale()
return
Locale for request being processed. |
static String |
getLocalHostName() |
String |
getOriginalRequestURL() |
String |
getQueryPrefix() |
String |
getReplayPrefix() |
Resource |
getResource() |
CaptureSearchResult |
getResult() |
String |
getServerName()
return hostname of this server.
|
String |
getServerPrefix()
Deprecated.
use getWbRequest().getServerPrefix()
|
String |
getStaticPrefix() |
String |
getTargetSite()
return hostname portion of request URL.
|
static long |
getTotalCount()
Deprecated.
1.8.1, use
PerfStats.getTotal("Total") . |
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 |
makePlainCaptureQueryUrl(String url)
Build a self-referencing URL that will perform a query for all copies
of the given URL (plain, clean URL version).
|
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()
|
void |
setPerfResponse(PerfWritingHttpServletResponse perfResponse)
Deprecated.
1.8.1, no replacement. this method has no real effect.
|
void |
setRequest(javax.servlet.http.HttpServletRequest request)
initializes WaybackRequest from HttpServletRequest.
|
String |
urlForPage(int pageNum)
Create a self-referencing URL that will drive to the given page,
simplifying rendering pagination
|
public static final String FERRET_NAME
public static String UI_RESOURCE_BUNDLE_NAME
public static final String UIRESULTS_ATTRIBUTE
UIResults
instance.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 replayedpublic UIResults(javax.servlet.http.HttpServletRequest httpRequest)
httpRequest
- public UIResults()
be sure to set required objects through setter.
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)
This method builds URL that passes target URL in CGI parameter,
along with other parameters unnecessary for making simple capture
query request. It is not suitable for simple links.
makePlainCaptureQueryUrl(String)
generates clean and
plain URL.
url
- to search for copies ofpublic String makePlainCaptureQueryUrl(String url)
url
- URL to search for copies ofpublic String getContextConfig(String configName)
configName
- key for configuration propertypublic String resultToReplayUrl(CaptureSearchResult result)
result
- CaptureSearchResult to replaypublic 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 awaypublic void setRequest(javax.servlet.http.HttpServletRequest request)
for rendering top page only.
request
- public static UIResults extractException(javax.servlet.http.HttpServletRequest httpRequest) throws javax.servlet.ServletException
httpRequest
- the HttpServletRequest where the UIResults was
ferreted awayjavax.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 awayjavax.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 awayjavax.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 awayjavax.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 encodedpublic static String encodeXMLContent(String content)
content
- to escapepublic static String encodeXMLEntityQuote(String content)
content
- to encodepublic String getContextPrefix()
public Locale getLocale()
Locale
for request being processed.null
WaybackRequest.getLocale()
,
AccessPoint.getLocale()
public StringFormatter getFormatter()
deprecation recalled 2014-05-06.
public String getServerPrefix()
public void setContentJsp(String contentJsp)
contentJsp
- the contentJsp to setpublic String makeReplayUrl(String url, String timestamp)
url
- to replaytimestamp
- to replaypublic String getServerName()
public static String getLocalHostName()
public String getTargetSite()
public String enableAnalytics()
getServerName()
.
this method is nothing more than that.public static long getTotalCount()
PerfStats.getTotal("Total")
.Total
.public void setPerfResponse(PerfWritingHttpServletResponse perfResponse)
perfResponse
- Copyright © 2005–2015 IIPC. All rights reserved.