public class ArchivalUrlJSReplayRenderer extends TextReplayRenderer
TextReplayRenderer
that rewrites URLs in JavaScript resource for
replay in ArchivalURL mode, and inserts jspInserts
at the top of the
document.
This class looks up URLs in JavaScript by single regular expression set to
its regex
property, and rewrite them with ResultURIConverter
passed to updatePage
method (does not use the one set to TextDocument
.)
Regular expression shall match single URL. Be sure to enclose URL in capture group
(i.e. (
...)
), or no rewrite will happen. Regular expression can have
optional capture group before URL capture group, which may be necessary for doing
more complicated match. Text captured in the first group will be copied to the
output.
There's an alternative implementation
ArchivalURLJSStringTransformerReplayRenderer
, which supports
multiple rewrite patterns through StringTransformer
.
ResultURIConverter
,
ArchivalURLJSStringTransformerReplayRenderer
GUESSED_CHARSET_HEADER, ORIG_ENCODING
Constructor and Description |
---|
ArchivalUrlJSReplayRenderer(HttpHeaderProcessor httpHeaderProcessor) |
Modifier and Type | Method and Description |
---|---|
String |
getRegex() |
void |
setRegex(String regex)
regular expression for matching URLs.
|
protected void |
updatePage(TextDocument page,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse,
WaybackRequest wbRequest,
CaptureSearchResult result,
Resource resource,
ResultURIConverter uriConverter,
CaptureSearchResults results) |
buildInsertText, decodeResource, decodeResource, getCharsetDetector, getGuessedCharsetHeader, getJspInserts, renderResource, renderResource, setCharsetDetector, setGuessedCharsetHeader, setJspInserts, setPageURIConverterFactory
public ArchivalUrlJSReplayRenderer(HttpHeaderProcessor httpHeaderProcessor)
httpHeaderProcessor
- which should process HTTP headerspublic void setRegex(String regex)
regex
- public String getRegex()
protected void updatePage(TextDocument page, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, WaybackRequest wbRequest, CaptureSearchResult result, Resource resource, ResultURIConverter uriConverter, CaptureSearchResults results) throws javax.servlet.ServletException, IOException
updatePage
in class TextReplayRenderer
javax.servlet.ServletException
IOException
Copyright © 2005–2015 IIPC. All rights reserved.