You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(10) |
Sep
(36) |
Oct
(339) |
Nov
(103) |
Dec
(152) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(141) |
Feb
(102) |
Mar
(125) |
Apr
(203) |
May
(57) |
Jun
(30) |
Jul
(139) |
Aug
(46) |
Sep
(64) |
Oct
(105) |
Nov
(34) |
Dec
(162) |
2007 |
Jan
(81) |
Feb
(57) |
Mar
(141) |
Apr
(72) |
May
(9) |
Jun
(1) |
Jul
(144) |
Aug
(88) |
Sep
(40) |
Oct
(43) |
Nov
(34) |
Dec
(20) |
2008 |
Jan
(44) |
Feb
(45) |
Mar
(16) |
Apr
(36) |
May
(8) |
Jun
(77) |
Jul
(177) |
Aug
(66) |
Sep
(8) |
Oct
(33) |
Nov
(13) |
Dec
(37) |
2009 |
Jan
(2) |
Feb
(5) |
Mar
(8) |
Apr
|
May
(36) |
Jun
(19) |
Jul
(46) |
Aug
(8) |
Sep
(1) |
Oct
(66) |
Nov
(61) |
Dec
(10) |
2010 |
Jan
(13) |
Feb
(16) |
Mar
(38) |
Apr
(76) |
May
(47) |
Jun
(32) |
Jul
(35) |
Aug
(45) |
Sep
(20) |
Oct
(61) |
Nov
(24) |
Dec
(16) |
2011 |
Jan
(22) |
Feb
(34) |
Mar
(11) |
Apr
(8) |
May
(24) |
Jun
(23) |
Jul
(11) |
Aug
(42) |
Sep
(81) |
Oct
(48) |
Nov
(21) |
Dec
(20) |
2012 |
Jan
(30) |
Feb
(25) |
Mar
(4) |
Apr
(6) |
May
(1) |
Jun
(5) |
Jul
(5) |
Aug
(8) |
Sep
(6) |
Oct
(6) |
Nov
|
Dec
|
From: <bra...@us...> - 2010-05-28 23:18:48
|
Revision: 3130 http://archive-access.svn.sourceforge.net/archive-access/?rev=3130&view=rev Author: bradtofel Date: 2010-05-28 23:18:42 +0000 (Fri, 28 May 2010) Log Message: ----------- HACKED out labels, made image type transparent, turned off line anti-aliasing, changes dashed stroke to 1:1 Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/Graph.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphConfiguration.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/RegionGraphElement.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/Graph.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/Graph.java 2010-05-28 03:27:24 UTC (rev 3129) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/Graph.java 2010-05-28 23:18:42 UTC (rev 3130) @@ -92,12 +92,12 @@ } // draw line below values: - int labelHeight = config.regionFontSize + (config.fontPadY * 2); - int valuesHeight = (height - labelHeight) + 1; - - g2d.setColor(config.regionBorderColor); - g2d.setStroke(config.regionBorderStroke); - g2d.drawLine(1, valuesHeight, width - 2, valuesHeight); +// int labelHeight = config.regionFontSize + (config.fontPadY * 2); +// int valuesHeight = (height - labelHeight) + 1; +// +// g2d.setColor(config.regionBorderColor); +// g2d.setStroke(config.regionBorderStroke); +// g2d.drawLine(1, valuesHeight, width - 2, valuesHeight); } static int xlateX(int w, int c, int i) { Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphConfiguration.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphConfiguration.java 2010-05-28 03:27:24 UTC (rev 3129) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphConfiguration.java 2010-05-28 23:18:42 UTC (rev 3130) @@ -31,22 +31,28 @@ import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.Stroke; +import java.awt.image.BufferedImage; /** * @author brad * */ public class GraphConfiguration { - final static float dash1[] = {3.0f}; final static BasicStroke dashed = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, - 3.0f, dash1, 0.0f); + 1.0f, new float[] {1.0f}, 0.0f); + /** + * type of BufferedImage to create, specifically the final constructor arg. + */ + public static int imageType = BufferedImage.TRANSLUCENT; + /** * Main background color for graphs */ - public Color backgroundColor = Color.white; + public Color backgroundColor = new Color(255,255,255,90); +// public Color backgroundColor = Color.white; /** * font size for Year/Month labels @@ -85,16 +91,16 @@ /** * Background color for active/selected Year/Month */ - public Color regionHighlightColor = Color.lightGray; + public Color regionHighlightColor = new Color(255,255,25,128); /** * color for non-active/selected graph values */ - public Color valueColor = Color.blue; + public Color valueColor = Color.black; /** * color for active/selected graph values */ - public Color valueHighlightColor = Color.green; + public Color valueHighlightColor = Color.red; /** * Minimum pixel height for non-zero graph values @@ -120,8 +126,10 @@ * @param g2d The Graphics2D objects on which the hints should be set. */ public void setRenderingHints(Graphics2D g2d) { +// g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, +// RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); + RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java 2010-05-28 03:27:24 UTC (rev 3129) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java 2010-05-28 23:18:42 UTC (rev 3130) @@ -93,7 +93,8 @@ public void render(OutputStream target, Graph graph) throws IOException { BufferedImage bi = - new BufferedImage(graph.width, graph.height, BufferedImage.TYPE_INT_RGB); + new BufferedImage(graph.width, graph.height, + GraphConfiguration.imageType); Graphics2D g2d = bi.createGraphics(); graph.draw(g2d); ImageIO.write(bi, "png", target); Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/RegionGraphElement.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/RegionGraphElement.java 2010-05-28 03:27:24 UTC (rev 3129) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/graph/RegionGraphElement.java 2010-05-28 23:18:42 UTC (rev 3130) @@ -52,7 +52,8 @@ // System.err.format("Created region (%d,%d)-(%d,%d)\n",x,y,width,height); this.data = data; this.config = config; - int labelHeight = config.regionFontSize + (config.fontPadY * 2); +// int labelHeight = config.regionFontSize + (config.fontPadY * 2); + int labelHeight = 0; int valuesHeight = height - labelHeight; this.values = new ValueGraphElements(x+1, y+1, width - 1, valuesHeight, data.getHighlightedValue(), data.getValues(), @@ -77,11 +78,11 @@ g2d.setStroke(config.regionBorderStroke); g2d.drawLine(x, y, x, y + height); - int fontY = (y + height) - config.fontPadY; - - g2d.setColor(config.regionLabelColor); - g2d.setFont(config.getRegionLabelFont()); - g2d.drawString(data.getLabel(), x + config.fontPadX, fontY); +// int fontY = (y + height) - config.fontPadY; +// +// g2d.setColor(config.regionLabelColor); +// g2d.setFont(config.getRegionLabelFont()); +// g2d.drawString(data.getLabel(), x + config.fontPadX, fontY); values.draw(g2d); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-28 03:27:31
|
Revision: 3129 http://archive-access.svn.sourceforge.net/archive-access/?rev=3129&view=rev Author: bradtofel Date: 2010-05-28 03:27:24 +0000 (Fri, 28 May 2010) Log Message: ----------- Now uses FastArchivalSAXRenderer by default, also added javascript mime-based selector instructions Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/ArchivalUrlReplay.xml Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/ArchivalUrlReplay.xml =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/ArchivalUrlReplay.xml 2010-05-28 03:25:28 UTC (rev 3128) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/ArchivalUrlReplay.xml 2010-05-28 03:27:24 UTC (rev 3129) @@ -73,11 +73,17 @@ </bean> <!-- - Custom rules for rewriting HTML content using a SAX parser, for fine-tuned - server-side rewriting. + ArchivalUrlSaxReplay.xml is a template for defining custom rules for + rewriting HTML content using a SAX parser, allowing fine-tuned and + flexible server-side rewriting. Defines a bean with id + "archivalSAXDelegator", which can be substituted with the + "fastArchivalSAXDelegator" below. + <import resource="ArchivalUrlSaxReplay.xml"/> --> - <import resource="ArchivalUrlSaxReplay.xml"/> - + <bean id="fastArchivalSAXDelegator" class="org.archive.wayback.archivalurl.FastArchivalUrlReplayParseEventHandler" > + <property name="jspInsertPath" value="/WEB-INF/replay/DisclaimChooser.jsp"/> + </bean> + <!-- The following bean is an example of the new SAX based rewriting renderer. It also uses a pluggable character encoding detector, which could allow clients @@ -88,7 +94,7 @@ <property name="charsetDetector"> <bean class="org.archive.wayback.replay.charset.RotatingCharsetDetector"/> </property> - <property name="delegator" ref="archivalSAXDelegator"/> + <property name="delegator" ref="fastArchivalSAXDelegator"/> </bean> <!-- @@ -111,6 +117,7 @@ </property> </bean> + <!-- The main Archival URL replay dispatcher. It uses a list of Selectors to determine which ReplayRenderer should be used for each document. @@ -126,6 +133,16 @@ </property> </bean> + <!-- WARN CLIENT ABOUT PATH REDIRECTS --> + <bean class="org.archive.wayback.replay.selector.RedirectSelector"> + <property name="renderer"> + <bean class="org.archive.wayback.replay.JSPReplayRenderer"> + <property name="targetJsp" value="/WEB-INF/replay/UrlRedirectNotice.jsp" /> + <property name="wrap" value="true" /> + </bean> + </property> + </bean> + <!-- Explicit (via "cs_" flag) CSS REPLAY --> <bean class="org.archive.wayback.replay.selector.CSSRequestSelector"> <property name="renderer" ref="archivalcssreplayrenderer"/> @@ -171,6 +188,18 @@ <property name="renderer" ref="archivalcssreplayrenderer"/> </bean> + <!-- JS REPLAY --> + <bean class="org.archive.wayback.replay.selector.MimeTypeSelector"> + <property name="mimeContains"> + <list> + <value>text/javascript</value> + <value>application/javascript</value> + <value>application/x-javascript</value> + </list> + </property> + <property name="renderer" ref="archivaljsreplayrenderer"/> + </bean> + <!-- ASX-MIME REPLAY --> <bean class="org.archive.wayback.replay.selector.MimeTypeSelector"> <property name="mimeContains"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-28 03:25:34
|
Revision: 3128 http://archive-access.svn.sourceforge.net/archive-access/?rev=3128&view=rev Author: bradtofel Date: 2010-05-28 03:25:28 +0000 (Fri, 28 May 2010) Log Message: ----------- Added config for wrapper JSP for the accesspoint Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-05-28 03:24:40 UTC (rev 3127) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-05-28 03:25:28 UTC (rev 3128) @@ -104,6 +104,8 @@ private String staticPrefix = null; private String queryPrefix = null; private String replayPrefix = null; + + private String wrapperJsp = "/WEB-INF/template/UI-wrapper.jsp"; private String refererAuth = null; @@ -123,7 +125,6 @@ private ExclusionFilterFactory exclusionFactory = null; private BooleanOperator<WaybackRequest> authentication = null; - protected boolean dispatchLocal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) @@ -544,8 +545,23 @@ public String getQueryPrefix() { return getBestPrefix(queryPrefix,staticPrefix,replayPrefix); } + /** + * @return the String url prefix to use when generating self referencing + * replay URLs + */ + public String getWrapperJsp() { + return wrapperJsp; + } /** + * @param wrapperJsp the .jsp file responsible for generating the HTML + * wrapper for content. + */ + public void setWrapperJsp(String wrapperJsp) { + this.wrapperJsp = wrapperJsp; + } + + /** * @param urlRoot explicit URL prefix to use when creating ANY self * referencing URLs * @deprecated use setQueryPrefix, setReplayPrefix, setStaticPrefix This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-28 03:24:46
|
Revision: 3127 http://archive-access.svn.sourceforge.net/archive-access/?rev=3127&view=rev Author: bradtofel Date: 2010-05-28 03:24:40 +0000 (Fri, 28 May 2010) Log Message: ----------- Now has option to forward to a UI-wrapper jsp, or to forward directly Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java 2010-05-28 03:23:46 UTC (rev 3126) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java 2010-05-28 03:24:40 UTC (rev 3127) @@ -349,15 +349,44 @@ /** * Store this UIResults object in the given HttpServletRequest, then - * forward the request to target, which should be a .jsp capable of drawing - * the information stored in this object. + * forward the request to wrapper, which *should* subsequently forward the + * request to target. + * * @param request the HttpServletRequest * @param response the HttpServletResponse * @param target the String path to the .jsp to handle drawing the data, * relative to the contextRoot (ex. "/WEB-INF/query/foo.jsp") + * @param wrapper the wrapper page which should generate the header, + * forward control to 'target' and then generate the footer. * @throws ServletException for usual reasons... * @throws IOException for usual reasons... */ + public void forwardWrapped(HttpServletRequest request, + HttpServletResponse response, final String target, String wrapper) + throws ServletException, IOException { + + this.contentJsp = target; + this.originalRequestURL = request.getRequestURL().toString(); + request.setAttribute(FERRET_NAME, this); + RequestDispatcher dispatcher = request.getRequestDispatcher(wrapper); + if(dispatcher == null) { + throw new IOException("No dispatcher for " + target); + } + dispatcher.forward(request, response); + } + + /** + * 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. Specifically, this means + * that if target is a .jsp, it must render it's own header and footer. + * @param request the HttpServletRequest + * @param response the HttpServletResponse + * @param target the String path to the .jsp to handle drawing the data, + * relative to the contextRoot (ex. "/WEB-INF/query/foo.jsp") + * @throws ServletException for usual reasons... + * @throws IOException for usual reasons... + */ public void forward(HttpServletRequest request, HttpServletResponse response, final String target) throws ServletException, IOException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-28 03:23:52
|
Revision: 3126 http://archive-access.svn.sourceforge.net/archive-access/?rev=3126&view=rev Author: bradtofel Date: 2010-05-28 03:23:46 +0000 (Fri, 28 May 2010) Log Message: ----------- BUGFIX introduce by last checkin. was not using AccessPoint wrapper Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/query/Renderer.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/query/Renderer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/query/Renderer.java 2010-05-28 03:23:17 UTC (rev 3125) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/query/Renderer.java 2010-05-28 03:23:46 UTC (rev 3126) @@ -57,12 +57,13 @@ CaptureSearchResults results, ResultURIConverter uriConverter) throws ServletException, IOException { - String jsp = captureJsp; + UIResults uiResults = new UIResults(wbRequest,uriConverter,results); if(wbRequest.isXMLMode()) { - jsp = xmlCaptureJsp; + uiResults.forward(httpRequest, httpResponse, xmlCaptureJsp); + } else { + uiResults.forwardWrapped(httpRequest, httpResponse, + captureJsp, wbRequest.getAccessPoint().getWrapperJsp()); } - UIResults uiResults = new UIResults(wbRequest,uriConverter,results); - uiResults.forward(httpRequest, httpResponse, jsp); } /* (non-Javadoc) @@ -73,12 +74,13 @@ UrlSearchResults results, ResultURIConverter uriConverter) throws ServletException, IOException { - String jsp = urlJsp; + UIResults uiResults = new UIResults(wbRequest,uriConverter,results); if(wbRequest.isXMLMode()) { - jsp = xmlUrlJsp; + uiResults.forward(httpRequest, httpResponse, xmlUrlJsp); + } else { + uiResults.forwardWrapped(httpRequest, httpResponse, + urlJsp,wbRequest.getAccessPoint().getWrapperJsp()); } - UIResults uiResults = new UIResults(wbRequest,uriConverter,results); - uiResults.forward(httpRequest, httpResponse, jsp); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-28 03:23:24
|
Revision: 3125 http://archive-access.svn.sourceforge.net/archive-access/?rev=3125&view=rev Author: bradtofel Date: 2010-05-28 03:23:17 +0000 (Fri, 28 May 2010) Log Message: ----------- added option to wrap in normal UI-wrapper or not Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java 2010-05-19 00:07:08 UTC (rev 3124) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/JSPReplayRenderer.java 2010-05-28 03:23:17 UTC (rev 3125) @@ -49,6 +49,7 @@ */ public class JSPReplayRenderer implements ReplayRenderer { private String targetJsp = null; + private boolean wrap = true; public void renderResource(HttpServletRequest httpRequest, HttpServletResponse httpResponse, WaybackRequest wbRequest, @@ -57,7 +58,13 @@ throws ServletException, IOException, WaybackException { UIResults uiResults = new UIResults(wbRequest, uriConverter, results, result, resource); - uiResults.forward(httpRequest, httpResponse, targetJsp); + if(wrap) { + uiResults.forwardWrapped(httpRequest, httpResponse, + targetJsp, wbRequest.getAccessPoint().getWrapperJsp()); + } else { + uiResults.forward(httpRequest, httpResponse, + targetJsp); + } } /** @@ -76,4 +83,22 @@ this.targetJsp = targetJsp; } + /** + * @return true if the jsp should be wrapped in the stardard UI template + * wrapper jsp for the AccessPoint. + */ + public boolean isWrap() { + return wrap; + } + + /** + * @param wrap if true then the jsp configured for this page will be + * wrapped in the standard template used for the current AccessPoint, if + * false then the jsp configured is responsible for rendering the entire + * content. + */ + public void setWrap(boolean wrap) { + this.wrap = wrap; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-19 00:07:14
|
Revision: 3124 http://archive-access.svn.sourceforge.net/archive-access/?rev=3124&view=rev Author: bradtofel Date: 2010-05-19 00:07:08 +0000 (Wed, 19 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp 2010-05-18 23:46:07 UTC (rev 3123) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp 2010-05-19 00:07:08 UTC (rev 3124) @@ -1,14 +1,21 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> <% UIResults results = UIResults.getGeneric(request); -StringFormatter fmt = results.getWbRequest().getFormatter(); +WaybackRequest wbRequest = results.getWbRequest(); +StringFormatter fmt = wbRequest.getFormatter(); +String staticPrefix = wbRequest.getAccessPoint().getStaticPrefix(); +String queryPrefix = wbRequest.getAccessPoint().getQueryPrefix(); +String replayPrefix = wbRequest.getAccessPoint().getReplayPrefix(); + + %> -<form action="query"> +<form action="<%= queryPrefix %>query"> <%= fmt.format("AdvancedSearch.searchTypeLabel") %> <select name="type"> <option value="urlquery"><%= fmt.format("AdvancedSearch.searchTypeExactOption") %></option> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:46:17
|
Revision: 3123 http://archive-access.svn.sourceforge.net/archive-access/?rev=3123&view=rev Author: bradtofel Date: 2010-05-18 23:46:07 +0000 (Tue, 18 May 2010) Log Message: ----------- INITIAL REV: jsp to redirect users to a target URL. designed to be used when users enter Wayback from a deep link Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp Added: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Interstitial.jsp 2010-05-18 23:46:07 UTC (rev 3123) @@ -0,0 +1,52 @@ +<%@ +page import="org.archive.wayback.webapp.AccessPoint" +%><%@ +page import="org.archive.wayback.util.StringFormatter" +%><% +String toUrl = request.getParameter(AccessPoint.INTERSTITIAL_TARGET); +if(toUrl == null) { + response.setStatus(400); +%> +<html> + <body> + Bad request. require argument <%= AccessPoint.INTERSTITIAL_TARGET %> + </body> +</html> +<% +} else { + String secsS = request.getParameter(AccessPoint.INTERSTITIAL_SECONDS); + int secs = 5; + try { + secs = Integer.parseInt(secsS); + } catch (NumberFormatException e) { + + } + if(secs < 1) { + secs = 5; + } + StringFormatter f = new StringFormatter(null,null); + String safeTargetUrl = f.escapeHtml(toUrl); + String safeTargetUrlJS = f.escapeJavaScript(toUrl); + %> +<jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> + <script type="text/javascript"> + function go() { + document.location.href = "<%= safeTargetUrlJS %>"; + } + window.setTimeout("go()",<%= secs * 1000 %>); + </script> + <h2>Redirecting...</h2> + <p> + Thanks for visiting the Wayback Machine. We're about to redirect you + to the page you requested: + </p> + <p><%= safeTargetUrl %></p> + <p> + in <%= secs %> seconds. + Click <a href="<%= safeTargetUrl %>">here</a> to go now. + </p> +jsp:include page="/WEB-INF/template/UI-footer.jsp" flush="true" /> +<% +} +%> +< \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:43:48
|
Revision: 3122 http://archive-access.svn.sourceforge.net/archive-access/?rev=3122&view=rev Author: bradtofel Date: 2010-05-18 23:43:42 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Added nav links to move forward/back in time with a ResourceNotAvailable Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-05-18 23:41:18 UTC (rev 3121) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-05-18 23:43:42 UTC (rev 3122) @@ -1,17 +1,30 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <%@ page import="java.util.List" %> +<%@ page import="java.util.Date" %> <%@ page import="org.archive.wayback.exception.WaybackException" %> <%@ page import="org.archive.wayback.exception.ResourceNotInArchiveException"%> +<%@ page import="org.archive.wayback.exception.ResourceNotAvailableException"%> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResults" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <%@ page import="org.archive.wayback.util.url.UrlOperations" %> +<%@ page import="org.archive.wayback.partition.PartitionsToGraph" %> + +<%@ page import="org.archive.wayback.util.partition.Partitioner" %> +<%@ page import="org.archive.wayback.util.partition.Partition" %> +<%@ page import="org.archive.wayback.util.partition.PartitionSize" %> +<%@ page import="org.archive.wayback.partition.PartitionPartitionMap" %> +<%@page import="org.archive.wayback.exception.ResourceNotAvailableException"%> <% UIResults results = UIResults.extractException(request); WaybackException e = results.getException(); WaybackRequest wbr = results.getWbRequest(); e.setupResponse(response); -String contextRoot = wbr.getContextPrefix(); +String staticPrefix = wbr.getAccessPoint().getStaticPrefix(); +String queryPrefix = wbr.getAccessPoint().getQueryPrefix(); +String replayPrefix = wbr.getAccessPoint().getReplayPrefix(); String requestUrl = wbr.getRequestUrl(); %> @@ -19,7 +32,6 @@ <% StringFormatter fmt = results.getWbRequest().getFormatter(); - %> <h2><%= fmt.format(e.getTitleKey()) %></h2> @@ -36,7 +48,7 @@ WaybackRequest tmp = wbr.clone(); for(String closeMatch : closeMatches) { tmp.setRequestUrl(closeMatch); - String link = tmp.getContextPrefix() + "query?" + + String link = queryPrefix + "query?" + tmp.getQueryArguments(); %> <a href="<%= link %>"><%= closeMatch %></a><br> @@ -48,7 +60,7 @@ WaybackRequest tmp = wbr.clone(); tmp.setRequestUrl(parentUrl); tmp.setUrlQueryRequest(); - String link = tmp.getContextPrefix() + "query?" + + String link = queryPrefix + "query?" + tmp.getQueryArguments(); String escapedLink = fmt.escapeHtml(link); String escapedParentUrl = fmt.escapeHtml(parentUrl); @@ -60,6 +72,40 @@ </p> <% } +} else if(e instanceof ResourceNotAvailableException) { +%> + <div class="wm-nav-link-div"> + <% + CaptureSearchResults cResults = results.getCaptureResults(); + Date firstDate = cResults.getFirstResultDate(); + Date lastDate = cResults.getLastResultDate(); + PartitionPartitionMap yearMap = + new PartitionPartitionMap(); + PartitionSize yearSize = Partitioner.yearSize; + Partitioner<Partition<CaptureSearchResult>> yearPartitioner = + new Partitioner<Partition<CaptureSearchResult>>(yearMap); + + List<Partition<Partition<CaptureSearchResult>>> yearPartitions = + yearPartitioner.getRange(yearSize,firstDate,lastDate); + + String navs[] = PartitionsToGraph.getNavigators(fmt,results.getResult()); + String links[] = PartitionsToGraph.getNavigatorLinks(yearPartitions,results.getURIConverter()); + String searchUrl = wbr.getRequestUrl(); + String starLink = fmt.escapeHtml(queryPrefix + "*/" + searchUrl); + links[PartitionsToGraph.NAV_CURRENT] = starLink; + for(int i = 0; i < navs.length; i++) { + if(i > 0) { + %> <% + } + if(links[i] == null) { + %><%= navs[i] %><% + } else { + %> <a href="<%= links[i] %>"><%= navs[i] %></a> <% + } + } + %> + </div> +<% } %> <jsp:include page="/WEB-INF/template/UI-footer.jsp" flush="true" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:41:25
|
Revision: 3121 http://archive-access.svn.sourceforge.net/archive-access/?rev=3121&view=rev Author: bradtofel Date: 2010-05-18 23:41:18 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/CalendarResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/HTMLCaptureResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OldCalendarResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchCaptureResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchUrlResults.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/CalendarResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/CalendarResults.jsp 2010-05-18 23:39:28 UTC (rev 3120) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/CalendarResults.jsp 2010-05-18 23:41:18 UTC (rev 3121) @@ -25,6 +25,9 @@ String searchString = fmt.escapeHtml(wbRequest.getRequestUrl()); List<String> closeMatches = cResults.getCloseMatches(); +String staticPrefix = results.getStaticPrefix(); +String queryPrefix = results.getQueryPrefix(); +String replayPrefix = results.getReplayPrefix(); Date searchStartDate = wbRequest.getStartDate(); Date searchEndDate = wbRequest.getEndDate(); @@ -174,8 +177,8 @@ <% for(String closeMatch : closeMatches) { tmp.setRequestUrl(closeMatch); - String link = fmt.escapeHtml(tmp.getContextPrefix() + "query?" + - tmp.getQueryArguments()); + String link = fmt.escapeHtml(tmp.getAccessPoint().getQueryPrefix() + + "query?" + tmp.getQueryArguments()); closeMatch = fmt.escapeHtml(closeMatch); %> <a href="<%= link %>"><%= closeMatch %></a><br> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/HTMLCaptureResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/HTMLCaptureResults.jsp 2010-05-18 23:39:28 UTC (rev 3120) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/HTMLCaptureResults.jsp 2010-05-18 23:41:18 UTC (rev 3121) @@ -33,11 +33,14 @@ <% boolean first = false; String lastMD5 = null; + String lastUrl = null; while(itr.hasNext()) { CaptureSearchResult result = (CaptureSearchResult) itr.next(); String url = result.getUrlKey(); - + if(url != lastUrl) { + lastMD5 = null; + } String prettyDate = result.getCaptureTimestamp(); String origHost = result.getOriginalHost(); String MD5 = result.getDigest(); Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OldCalendarResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OldCalendarResults.jsp 2010-05-18 23:39:28 UTC (rev 3120) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OldCalendarResults.jsp 2010-05-18 23:41:18 UTC (rev 3121) @@ -164,8 +164,8 @@ <% for(String closeMatch : closeMatches) { tmp.setRequestUrl(closeMatch); - String link = tmp.getContextPrefix() + "query?" + - tmp.getQueryArguments(); + String link = fmt.escapeHtml(tmp.getContextPrefix() + "query?" + + tmp.getQueryArguments()); %> <a href="<%= link %>"><%= closeMatch %></a><br> <% Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchCaptureResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchCaptureResults.jsp 2010-05-18 23:39:28 UTC (rev 3120) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchCaptureResults.jsp 2010-05-18 23:41:18 UTC (rev 3121) @@ -29,7 +29,11 @@ StringFormatter fmt = wbRequest.getFormatter(); CaptureSearchResults results = uiResults.getCaptureResults(); Iterator<CaptureSearchResult> itr = results.iterator(); -String contextRoot = wbRequest.getContextPrefix(); + +String staticPrefix = uiResults.getStaticPrefix(); +String queryPrefix = uiResults.getQueryPrefix(); +String replayPrefix = uiResults.getReplayPrefix(); + String searchString = wbRequest.getRequestUrl(); long firstResult = results.getFirstReturned(); long shownResultCount = results.getReturnedCount(); @@ -47,12 +51,12 @@ xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Wayback OpenSearch Results</title> - <link><%= contextRoot %>></link> + <link><%= queryPrefix %>></link> <description><%= fmt.format("PathQueryClassic.searchedFor",searchString) %></description> <opensearch:totalResults><%= resultCount %></opensearch:totalResults> <opensearch:startIndex><%= firstResult %></opensearch:startIndex> <opensearch:itemsPerPage><%= shownResultCount %></opensearch:itemsPerPage> - <atom:link rel="search" type="application/opensearchdescription+xml" href="<%= contextRoot %>/opensearchdescription.xml"/> + <atom:link rel="search" type="application/opensearchdescription+xml" href="<%= staticPrefix %>/opensearchdescription.xml"/> <opensearch:Query role="request" searchTerms="<%= UIResults.encodeXMLContent(searchTerms) %>" startPage="<%= wbRequest.getPageNum() %>" /> <% while(itr.hasNext()) { Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchUrlResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchUrlResults.jsp 2010-05-18 23:39:28 UTC (rev 3120) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/query/OpenSearchUrlResults.jsp 2010-05-18 23:41:18 UTC (rev 3121) @@ -31,7 +31,11 @@ StringFormatter fmt = wbRequest.getFormatter(); UrlSearchResults results = uiResults.getUrlResults(); Iterator<UrlSearchResult> itr = results.iterator(); -String contextRoot = wbRequest.getContextPrefix(); + +String staticPrefix = uiResults.getStaticPrefix(); +String queryPrefix = uiResults.getQueryPrefix(); +String replayPrefix = uiResults.getReplayPrefix(); + String searchString = wbRequest.getRequestUrl(); long firstResult = results.getFirstReturned(); long shownResultCount = results.getReturnedCount(); @@ -49,12 +53,12 @@ xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Wayback OpenSearch Results</title> - <link><%= contextRoot %>></link> + <link><%= queryPrefix %>></link> <description><%= fmt.format("PathQueryClassic.searchedFor",searchString) %></description> <opensearch:totalResults><%= resultCount %></opensearch:totalResults> <opensearch:startIndex><%= firstResult %></opensearch:startIndex> <opensearch:itemsPerPage><%= shownResultCount %></opensearch:itemsPerPage> - <atom:link rel="search" type="application/opensearchdescription+xml" href="<%= contextRoot %>/opensearchdescription.xml"/> + <atom:link rel="search" type="application/opensearchdescription+xml" href="<%= staticPrefix %>/opensearchdescription.xml"/> <opensearch:Query role="request" searchTerms="<%= UIResults.encodeXMLContent(searchTerms) %>" startPage="<%= wbRequest.getPageNum() %>" /> <% while(itr.hasNext()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:39:34
|
Revision: 3120 http://archive-access.svn.sourceforge.net/archive-access/?rev=3120&view=rev Author: bradtofel Date: 2010-05-18 23:39:28 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-footer.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-header.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-footer.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-footer.jsp 2010-05-18 23:38:40 UTC (rev 3119) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-footer.jsp 2010-05-18 23:39:28 UTC (rev 3120) @@ -4,18 +4,20 @@ <% UIResults results = UIResults.getGeneric(request); StringFormatter fmt = results.getWbRequest().getFormatter(); -String contextRoot = results.getWbRequest().getContextPrefix(); -String serverRoot = results.getWbRequest().getServerPrefix(); + +String staticPrefix = results.getStaticPrefix(); +String queryPrefix = results.getQueryPrefix(); +String replayPrefix = results.getReplayPrefix(); %> <!-- FOOTER --> <div align="center"> <hr noshade size="1" align="center"> <p> - <a href="<%= contextRoot %>"> + <a href="<%= staticPrefix %>"> <%= fmt.format("UIGlobal.homeLink") %> </a> | - <a href="<%= contextRoot %>help.jsp"> + <a href="<%= staticPrefix %>help.jsp"> <%= fmt.format("UIGlobal.helpLink") %> </a> </p> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-header.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-header.jsp 2010-05-18 23:38:40 UTC (rev 3119) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/template/UI-header.jsp 2010-05-18 23:39:28 UTC (rev 3120) @@ -8,8 +8,11 @@ UIResults results = UIResults.getGeneric(request); WaybackRequest wbRequest = results.getWbRequest(); StringFormatter fmt = wbRequest.getFormatter(); -String contextRoot = wbRequest.getContextPrefix(); -String serverRoot = wbRequest.getServerPrefix(); + +String staticPrefix = results.getStaticPrefix(); +String queryPrefix = results.getQueryPrefix(); +String replayPrefix = results.getReplayPrefix(); + %> <!-- HEADER --> <html xmlns="http://www.w3.org/1999/xhtml"> @@ -18,8 +21,8 @@ <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" - href="<%= contextRoot %>css/styles.css" - src="<%= contextRoot %>css/styles.css" /> + href="<%= staticPrefix %>css/styles.css" + src="<%= staticPrefix %>css/styles.css" /> <title><%= fmt.format("UIGlobal.pageTitle") %></title> <base target="_top" /> </head> @@ -33,7 +36,7 @@ <!-- WAYBACK LOGO --> - <td width="26%"><a href="<%= contextRoot %>"><img src="<%= contextRoot %>images/wayback_logo_sm.gif" width="153" height="54" border="0"></a></td> + <td width="26%"><a href="<%= staticPrefix %>"><img src="<%= staticPrefix %>images/wayback_logo_tr.gif" width="153" height="54" border="0"></a></td> <!-- /WAYBACK LOGO --> @@ -56,11 +59,11 @@ <!-- URL FORM --> - <form action="<%= contextRoot %>query" method="get"> + <form action="<%= queryPrefix %>query" method="get"> <tr> - <td nowrap align="center"><img src="<%= contextRoot %>images/shim.gif" width="1" height="20"> + <td nowrap align="center"><img src="<%= staticPrefix %>images/shim.gif" width="1" height="20"> <b class="mainBodyW"> <font size="2" color="#FFFFFF" face="Arial, Helvetica, sans-serif"> @@ -89,7 +92,7 @@ <input type="submit" name="Submit" value="<%= fmt.format("UIGlobal.urlSearchButton") %>" align="absMiddle"> - <a href="<%= contextRoot %>advanced_search.jsp" style="color:white;font-size:11px"> + <a href="<%= staticPrefix %>advanced_search.jsp" style="color:white;font-size:11px"> <%= fmt.format("UIGlobal.advancedSearchLink") %> </a> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:38:46
|
Revision: 3119 http://archive-access.svn.sourceforge.net/archive-access/?rev=3119&view=rev Author: bradtofel Date: 2010-05-18 23:38:40 +0000 (Tue, 18 May 2010) Log Message: ----------- INITIAL REV: renders a redirect resource with a page indicating the redirect and using javascript to automate the redirect after a few seconds Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/UrlRedirectNotice.jsp Added: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/UrlRedirectNotice.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/UrlRedirectNotice.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/UrlRedirectNotice.jsp 2010-05-18 23:38:40 UTC (rev 3119) @@ -0,0 +1,56 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Date" %> +<%@ page import="java.lang.StringBuffer" %> +<%@ page import="org.archive.wayback.archivalurl.ArchivalUrlDateRedirectReplayRenderer" %> +<%@ page import="org.archive.wayback.ResultURIConverter" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% +UIResults results = UIResults.extractReplay(request); + +WaybackRequest wbr = results.getWbRequest(); +StringFormatter fmt = wbr.getFormatter(); +CaptureSearchResult cResult = results.getResult(); +ResultURIConverter uric = results.getURIConverter(); + +String sourceUrl = cResult.getOriginalUrl(); +String targetUrl = cResult.getRedirectUrl(); +String captureTS = cResult.getCaptureTimestamp(); +Date captureDate = cResult.getCaptureDate(); + +String dateSpec = + ArchivalUrlDateRedirectReplayRenderer.makeFlagDateSpec(captureTS, wbr); + +String targetReplayUrl = uric.makeReplayURI(dateSpec,targetUrl); + +String safeSource = fmt.escapeHtml(sourceUrl); +String safeTarget = fmt.escapeHtml(targetUrl); +String safeTargetJS = fmt.escapeJavaScript(targetUrl); +String safeTargetReplayUrl = fmt.escapeHtml(targetReplayUrl); +String safeTargetReplayUrlJS = fmt.escapeJavaScript(targetReplayUrl); + +String prettyDate = fmt.format("MetaReplay.captureDateDisplay",captureDate); +int secs = 5; + +%> +<jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> + <script type="text/javascript"> + function go() { + document.location.href = "<%= safeTargetReplayUrlJS %>"; + } + window.setTimeout("go()",<%= secs * 1000 %>); + </script> + <h2>Redirecting...</h2> + <p>The URL you requested:</p> + <p><%= safeSource %></p> + <p>redirected to the URL:</p> + <p><%= safeTarget %></p> + <p> + when it was crawled at <%= prettyDate %>. You will be redirected + to that target in <%= secs %> seconds. + Click <a href="<%= safeTargetReplayUrl %>">here</a> to go now. + </p> +<jsp:include page="/WEB-INF/template/UI-footer.jsp" flush="true" /> + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:37:19
|
Revision: 3118 http://archive-access.svn.sourceforge.net/archive-access/?rev=3118&view=rev Author: bradtofel Date: 2010-05-18 23:37:13 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp 2010-05-18 23:36:44 UTC (rev 3117) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Timeline.jsp 2010-05-18 23:37:13 UTC (rev 3118) @@ -16,7 +16,7 @@ UIResults results = UIResults.extractReplay(request); -String contextRoot = results.getWbRequest().getContextPrefix(); +String staticPrefix = results.getStaticPrefix(); WaybackRequest wbRequest = results.getWbRequest(); StringFormatter fmt = wbRequest.getFormatter(); CaptureSearchResults cResults = results.getCaptureResults(); @@ -171,7 +171,7 @@ <table cellspacing="0" border="0" cellpadding="0" width="100%"> <tr> <td width="48%" nowrap><span><%= firstDate %></span></td> - <td align="center" valign="bottom" nowrap><img style="display: inline;" wmSpecial="1" src="<%= contextRoot %>/images/mark.jpg"></td> + <td align="center" valign="bottom" nowrap><img style="display: inline;" wmSpecial="1" src="<%= staticPrefix %>/images/mark.jpg"></td> <td width="48%" nowrap align="right"><span><%= lastDate %></span></td> </tr> </table> @@ -187,7 +187,7 @@ first.getCaptureDate()) + "\""; %><a wmSpecial="1" onclick="SetAnchorDate('<%= first.getCaptureTimestamp() %>');" href="<%= results.resultToReplayUrl(first) %>"><% } - %><img style="display: inline;" <%= titleString %> wmSpecial="1" border=0 width=19 height=20 src="<%= contextRoot %>/images/first.jpg"><% + %><img style="display: inline;" <%= titleString %> wmSpecial="1" border=0 width=19 height=20 src="<%= staticPrefix %>/images/first.jpg"><% if(first != null) { %></a><% } @@ -198,7 +198,7 @@ prev.getCaptureDate()) + "\""; %><a wmSpecial="1" onclick="SetAnchorDate('<%= prev.getCaptureTimestamp() %>');" href="<%= results.resultToReplayUrl(prev) %>"><% } - %><img style="display: inline;" <%= titleString %> wmSpecial="1" border=0 width=13 height=20 src="<%= contextRoot %>/images/prev.jpg"><% + %><img style="display: inline;" <%= titleString %> wmSpecial="1" border=0 width=13 height=20 src="<%= staticPrefix %>/images/prev.jpg"><% if(first != null) { %></a><% } @@ -209,19 +209,19 @@ ResultsPartition partition = (ResultsPartition) partitions.get(i); ArrayList partitionResults = partition.getMatches(); int numResults = partitionResults.size(); - String imageUrl = contextRoot + "/images/line.jpg"; + String imageUrl = staticPrefix + "/images/line.jpg"; String replayUrl = null; String prettyDateTime = null; String ts = null; if(numResults == 1) { - imageUrl = contextRoot + "/images/mark_one.jpg"; + imageUrl = staticPrefix + "/images/mark_one.jpg"; CaptureSearchResult result = (CaptureSearchResult) partitionResults.get(0); replayUrl = results.resultToReplayUrl(result); prettyDateTime = fmt.format("TimelineView.markDateTitle",result.getCaptureDate()); ts = result.getCaptureTimestamp(); } else if (numResults > 1) { - imageUrl = contextRoot + "/images/mark_several.jpg"; + imageUrl = staticPrefix + "/images/mark_several.jpg"; CaptureSearchResult result = (CaptureSearchResult) partitionResults.get(numResults - 1); replayUrl = results.resultToReplayUrl(result); prettyDateTime = fmt.format("TimelineView.markDateTitle",result.getCaptureDate()); @@ -230,7 +230,7 @@ } if((i > 0) && (i < numPartitions)) { -%><img style="display: inline;" wmSpecial="1" border=0 width=1 height=16 src="<%= contextRoot %>/images/linemark.jpg"><% +%><img style="display: inline;" wmSpecial="1" border=0 width=1 height=16 src="<%= staticPrefix %>/images/linemark.jpg"><% } @@ -254,7 +254,7 @@ next.getCaptureDate()) + "\""; %><a wmSpecial="1" onclick="SetAnchorDate('<%= next.getCaptureTimestamp() %>');" href="<%= results.resultToReplayUrl(next) %>"><% } - %><img style="display: inline;" wmSpecial="1" <%= titleString %> border=0 width=13 height=20 src="<%= contextRoot %>/images/next.jpg"><% + %><img style="display: inline;" wmSpecial="1" <%= titleString %> border=0 width=13 height=20 src="<%= staticPrefix %>/images/next.jpg"><% if(next != null) { %></a><% } @@ -265,7 +265,7 @@ last.getCaptureDate()) + "\""; %><a wmSpecial="1" onclick="SetAnchorDate('<%= last.getCaptureTimestamp() %>');" href="<%= results.resultToReplayUrl(last) %>"><% } - %><img style="display: inline;" wmSpecial="1" <%= titleString %> border=0 width=19 height=20 src="<%= contextRoot %>/images/last.jpg"><% + %><img style="display: inline;" wmSpecial="1" <%= titleString %> border=0 width=19 height=20 src="<%= staticPrefix %>/images/last.jpg"><% if(last != null) { %></a><% } @@ -277,7 +277,7 @@ <!-- Resolution --> <!-- need to get cookie data passing set up before this can be re-enabled: - <form wmSpecial="1" name="timeline" method="GET" target="_top" action="<%= contextRoot + "/frameset" %>"> + <form wmSpecial="1" name="timeline" method="GET" target="_top" action="<%= staticPrefix + "/frameset" %>"> <input type="hidden" name="url" value="<%= searchUrl %>"> <input type="hidden" name="exactdate" value="<%= exactDateStr %>"> <input type="hidden" name="type" value="urlclosestquery"> @@ -303,12 +303,12 @@ %> onClick="changeMeta()">  </form> --> - <a wmSpecial="1" href="<%= contextRoot %>/help.jsp" target="_top"><%= + <a wmSpecial="1" href="<%= staticPrefix %>/help.jsp" target="_top"><%= fmt.format("UIGlobal.helpLink") %></a> </td> <td> - <img style="display: inline;" wmSpecial="1" alt='' height='1' src='<%= contextRoot %>/images/1px.gif' width='5'> + <img style="display: inline;" wmSpecial="1" alt='' height='1' src='<%= staticPrefix %>/images/1px.gif' width='5'> </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:36:50
|
Revision: 3117 http://archive-access.svn.sourceforge.net/archive-access/?rev=3117&view=rev Author: bradtofel Date: 2010-05-18 23:36:44 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/LiveWebDisclaimer.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/LiveWebDisclaimer.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/LiveWebDisclaimer.jsp 2010-05-18 23:36:17 UTC (rev 3116) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/LiveWebDisclaimer.jsp 2010-05-18 23:36:44 UTC (rev 3117) @@ -13,7 +13,7 @@ CaptureSearchResult result = results.getResult(); WaybackRequest wbr = results.getWbRequest(); StringFormatter fmt = wbr.getFormatter(); -String contextRoot = wbr.getContextPrefix(); +String contextRoot = results.getStaticPrefix(); String urlString = fmt.escapeHtml(wbr.getRequestUrl()); String prettyDateTime = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:36:23
|
Revision: 3116 http://archive-access.svn.sourceforge.net/archive-access/?rev=3116&view=rev Author: bradtofel Date: 2010-05-18 23:36:17 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp 2010-05-18 23:35:52 UTC (rev 3115) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/ClientSideJSInsert.jsp 2010-05-18 23:36:17 UTC (rev 3116) @@ -8,9 +8,9 @@ UIResults results = UIResults.extractReplay(request); String requestDate = results.getResult().getCaptureTimestamp(); String contextPath = results.getURIConverter().makeReplayURI(requestDate,""); -String contextRoot = results.getWbRequest().getContextPrefix(); +String staticPrefix = results.getStaticPrefix(); %> <script type="text/javascript"> var sWayBackCGI = "<%= contextPath %>"; </script> -<script type="text/javascript" src="<%= contextRoot %>js/client-rewrite.js" ></script> +<script type="text/javascript" src="<%= staticPrefix %>js/client-rewrite.js" ></script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:35:58
|
Revision: 3115 http://archive-access.svn.sourceforge.net/archive-access/?rev=3115&view=rev Author: bradtofel Date: 2010-05-18 23:35:52 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/DebugBanner.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/DebugBanner.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/DebugBanner.jsp 2010-05-18 23:35:07 UTC (rev 3114) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/DebugBanner.jsp 2010-05-18 23:35:52 UTC (rev 3115) @@ -27,7 +27,6 @@ %><jsp:include page="/WEB-INF/template/CookieJS.jsp" flush="true" /><% UIResults results = UIResults.extractReplay(request); WaybackRequest wbr = results.getWbRequest(); -String contextRoot = wbr.getContextPrefix(); Set<String> keys = wbr.keySet(); Iterator<String> keysItr = keys.iterator(); Map<String,String> headers = results.getResource().getHttpHeaders(); @@ -145,7 +144,7 @@ </form> </div> </div> -<script type="text/javascript" src="<%= contextRoot %>js/disclaim-element.js" ></script> +<script type="text/javascript" src="<%= results.getStaticPrefix() %>js/disclaim-element.js" ></script> <script type="text/javascript"> var debugBanner = document.getElementById("wm-debug-banner"); if(debugBanner != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:35:13
|
Revision: 3114 http://archive-access.svn.sourceforge.net/archive-access/?rev=3114&view=rev Author: bradtofel Date: 2010-05-18 23:35:07 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp 2010-05-18 23:34:32 UTC (rev 3113) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/Disclaimer.jsp 2010-05-18 23:35:07 UTC (rev 3114) @@ -30,10 +30,9 @@ String wmNotice = fmt.format("ReplayView.banner", resultUrl, resultDate); String wmHideNotice = fmt.format("ReplayView.bannerHideLink"); -String contextRoot = results.getWbRequest().getContextPrefix(); %> <script type="text/javascript"> var wmNotice = "<%= wmNotice %><%= dupeMsg %>"; var wmHideNotice = "<%= wmHideNotice %>"; </script> -<script type="text/javascript" src="<%= contextRoot %>js/disclaim.js"></script> +<script type="text/javascript" src="<%= results.getStaticPrefix() %>js/disclaim.js"></script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:34:38
|
Revision: 3113 http://archive-access.svn.sourceforge.net/archive-access/?rev=3113&view=rev Author: bradtofel Date: 2010-05-18 23:34:32 +0000 (Tue, 18 May 2010) Log Message: ----------- now uses getQuery|Static|ReplayPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/GraphDisclaimer.jsp Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/GraphDisclaimer.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/GraphDisclaimer.jsp 2010-05-18 23:24:45 UTC (rev 3112) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/replay/GraphDisclaimer.jsp 2010-05-18 23:34:32 UTC (rev 3113) @@ -42,28 +42,31 @@ page import="org.archive.wayback.util.partition.PartitionSize" %><%@ page import="org.archive.wayback.util.StringFormatter" + %><%@ + page import="org.archive.wayback.util.url.UrlOperations" %><% UIResults results = UIResults.extractReplay(request); WaybackRequest wbRequest = results.getWbRequest(); ResultURIConverter uriConverter = results.getURIConverter(); -String contextRoot = wbRequest.getContextPrefix(); + +String staticPrefix = results.getStaticPrefix(); +String queryPrefix = results.getQueryPrefix(); +String replayPrefix = results.getReplayPrefix(); + StringFormatter fmt = wbRequest.getFormatter(); -String staticPrefix = results.getContextConfig("static-prefix"); -if(staticPrefix == null) { - staticPrefix = contextRoot; -} String graphJspPrefix = results.getContextConfig("graphJspPrefix"); if(graphJspPrefix == null) { - graphJspPrefix = contextRoot; + graphJspPrefix = queryPrefix; } CaptureSearchResults cResults = results.getCaptureResults(); String exactDateStr = results.getResult().getCaptureTimestamp(); Date exactDate = results.getResult().getCaptureDate(); -String searchUrl = wbRequest.getRequestUrl(); -String searchUrlSafe = fmt.escapeHtml(wbRequest.getRequestUrl()); -String searchUrlJS = fmt.escapeJavaScript(wbRequest.getRequestUrl()); +String searchUrl = + UrlOperations.stripDefaultPortFromUrl(wbRequest.getRequestUrl()); +String searchUrlSafe = fmt.escapeHtml(searchUrl); +String searchUrlJS = fmt.escapeJavaScript(searchUrl); String resolution = wbRequest.getTimelineResolution(); CaptureSearchResult first = null; @@ -71,8 +74,8 @@ CaptureSearchResult next = null; CaptureSearchResult last = null; -Date firstDate = cResults.getFirstResultDate(); -Date lastDate = cResults.getLastResultDate(); +Date firstDate = wbRequest.getStartDate(); +Date lastDate = wbRequest.getEndDate(); long resultCount = cResults.getReturnedCount(); int resultIndex = 1; @@ -92,7 +95,7 @@ List<Partition<Partition<CaptureSearchResult>>> yearPartitions = yearPartitioner.getRange(yearSize,firstDate,lastDate); -int imgWidth = 800; +int imgWidth = 500; int imgHeight = 35; Date firstYearDate = yearPartitions.get(0).getStart(); Date lastYearDate = yearPartitions.get(yearPartitions.size()-1).getEnd(); @@ -110,7 +113,8 @@ Graph graph = PartitionsToGraph.partsOfPartsToGraph(yearPartitions,fmt,yearFormatKey,imgWidth,imgHeight); String encodedGraph = GraphEncoder.encode(graph); String imgUrl = graphJspPrefix + "jsp/graph.jsp?graphdata=" + encodedGraph; -String starLink = fmt.escapeHtml(contextRoot + "*/" + searchUrl); +// TODO: this is archivalUrl specific: +String starLink = fmt.escapeHtml(queryPrefix + "*/" + searchUrl); %> <!-- BEGIN WAYBACK TIMELINE DISCLAIMER INSERT --> <style type="text/css"> @@ -162,18 +166,18 @@ text-align:center !important; } </style> -<script type="text/javascript" src="<%= contextRoot %>js/graph-calc.js" ></script> +<script type="text/javascript" src="<%= staticPrefix %>js/graph-calc.js" ></script> <script type="text/javascript"> var firstDate = <%= firstYearDate.getTime() %>; var lastDate = <%= lastYearDate.getTime() %>; -var wbPrefix = "<%= contextRoot %>"; +var wbPrefix = "<%= replayPrefix %>"; var wbCurrentUrl = "<%= searchUrlJS %>"; </script> <div id="wm-disclaim" dir="ltr" > <table width="100%" border="0" cellpadding="0" cellspacing="3"> <tr> <!-- WAYBACK LOGO --> - <td rowspan="2" valign="top" align="left"><a href="<%= contextRoot %>"><img style="padding-right:15px;" src="<%= staticPrefix %>images/wayback_logo_tr.gif" width="153" height="54" border="0"></a></td> + <td rowspan="2" valign="top" align="left"><a href="<%= queryPrefix %>"><img style="padding-right:15px;" src="<%= staticPrefix %>images/wayback_logo_tr.gif" width="153" height="54" border="0"></a></td> <!-- /WAYBACK LOGO --> <td width="99%"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -188,7 +192,7 @@ <!-- URL FORM --> <table border="0" cellpadding="0" cellspacing="0"> <tr> - <form action="<%= contextRoot %>query" method="get"> + <form action="<%= queryPrefix %>query" method="get"> <td class="wm-disclaim-label"><%= fmt.format("GraphTimeline.searchLabel") %></td> <td><input type="hidden" name="<%= WaybackRequest.REQUEST_TYPE %>" value="<%= WaybackRequest.REQUEST_CAPTURE_QUERY %>"><input type="text" name="<%= WaybackRequest.REQUEST_URL %>" value="http://" size="24" maxlength="256"></td> <td><input type="submit" name="submit" value="<%= fmt.format("GraphTimeline.searchButtonText") %>"></td> @@ -248,7 +252,7 @@ </tr> </table> </div> -<script type="text/javascript" src="<%= contextRoot %>js/disclaim-element.js" ></script> +<script type="text/javascript" src="<%= staticPrefix %>js/disclaim-element.js" ></script> <script type="text/javascript"> var wmDisclaimBanner = document.getElementById("wm-disclaim"); if(wmDisclaimBanner != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:24:51
|
Revision: 3112 http://archive-access.svn.sourceforge.net/archive-access/?rev=3112&view=rev Author: bradtofel Date: 2010-05-18 23:24:45 +0000 (Tue, 18 May 2010) Log Message: ----------- REFACTOR: AccessPoint fields: contextPrefix and serverPrefix are now replaced with staticPrefix, replayPrefix, and queryPrefix. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/WaybackRequest.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java 2010-05-18 23:19:04 UTC (rev 3111) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/UIResults.java 2010-05-18 23:24:45 UTC (rev 3112) @@ -224,7 +224,7 @@ } /** - * @return the original URL as recieved by Wayback, before forwarding to + * @return the original URL as received by Wayback, before forwarding to * a .jsp */ public String getOriginalRequestURL() { @@ -246,7 +246,7 @@ newWBR.setCaptureQueryRequest(); newWBR.setRequestUrl(url); - return newWBR.getContextPrefix() + "query?" + + return newWBR.getAccessPoint().getQueryPrefix() + "query?" + newWBR.getQueryArguments(1); } @@ -291,10 +291,46 @@ */ public String urlForPage(int pageNum) { WaybackRequest wbRequest = getWbRequest(); - return wbRequest.getContextPrefix() + "query?" + + return wbRequest.getAccessPoint().getQueryPrefix() + "query?" + wbRequest.getQueryArguments(pageNum); } + /** + * @return the defined staticPrefix for the AccessPoint + */ + public String getStaticPrefix() { + if(wbRequest != null) { + if(wbRequest.getAccessPoint() != null) { + return wbRequest.getAccessPoint().getStaticPrefix(); + } + } + return "/"; + } + + /** + * @return the defined queryPrefix for the AccessPoint + */ + public String getQueryPrefix() { + if(wbRequest != null) { + if(wbRequest.getAccessPoint() != null) { + return wbRequest.getAccessPoint().getQueryPrefix(); + } + } + return "/"; + } + + /** + * @return the defined replayPrefix for the AccessPoint + */ + public String getReplayPrefix() { + if(wbRequest != null) { + if(wbRequest.getAccessPoint() != null) { + return wbRequest.getAccessPoint().getReplayPrefix(); + } + } + return "/"; + } + /* * FORWARD TO A .JSP */ @@ -475,7 +511,6 @@ } - /* * STATIC CONVENIENCE METHODS */ Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/WaybackRequest.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/WaybackRequest.java 2010-05-18 23:19:04 UTC (rev 3111) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/core/WaybackRequest.java 2010-05-18 23:24:45 UTC (rev 3112) @@ -37,8 +37,6 @@ import org.archive.wayback.requestparser.OpenSearchRequestParser; import org.archive.wayback.resourceindex.filters.ExclusionFilter; -import org.archive.wayback.resourceindex.filters.HostMatchFilter; -import org.archive.wayback.resourceindex.filters.SchemeMatchFilter; import org.archive.wayback.util.ObjectFilter; import org.archive.wayback.util.ObjectFilterChain; import org.archive.wayback.util.StringFormatter; @@ -441,6 +439,8 @@ /** * @param prefix + * @deprecated use getAccessPoint.getStaticPrefix() or + * getAccessPoint.getReplayPrefix() */ public void setContextPrefix(String prefix) { contextPrefix = prefix; @@ -452,16 +452,18 @@ * * @return String absolute URL pointing to the Context root where the * request was received. + * @deprecated use AccessPoint.setReplayPrefix or setQueryPrefix */ public String getContextPrefix() { - if(contextPrefix == null) { + if(accessPoint == null) { return ""; } - return contextPrefix; + return accessPoint.getQueryPrefix(); } /** * @param prefix + * @deprecated use AccessPoint.set*Prefix */ public void setServerPrefix(String prefix) { serverPrefix = prefix; @@ -471,13 +473,15 @@ * @param prefix * @return an absolute String URL that will point to the root of the * server that is handling the request. + * @deprecated use AccessPoint.get*Prefix */ public String getServerPrefix() { - if(serverPrefix == null) { + if(accessPoint == null) { return ""; } - return serverPrefix; + return accessPoint.getQueryPrefix(); } + /** * @return the accessPoint */ @@ -500,25 +504,6 @@ this.exclusionFilter = exclusionFilter; } - @Deprecated - public ObjectFilter<CaptureSearchResult> getResultFilters() { - ObjectFilterChain<CaptureSearchResult> tmpFilters = - new ObjectFilterChain<CaptureSearchResult>(); - if(isExactHost()) { - tmpFilters.addFilter(new HostMatchFilter( - UrlOperations.urlToHost(getRequestUrl()))); - } - - if(isExactScheme()) { - tmpFilters.addFilter(new SchemeMatchFilter( - UrlOperations.urlToScheme(getRequestUrl()))); - } - if(resultFilters != null) { - tmpFilters.addFilters(resultFilters.getFilters()); - } - return tmpFilters; - } - public void setResultFilters(ObjectFilterChain<CaptureSearchResult> resultFilters) { this.resultFilters = resultFilters; } @@ -1008,6 +993,7 @@ wbRequest.serverPrefix = serverPrefix; wbRequest.formatter = formatter; + wbRequest.accessPoint = accessPoint; wbRequest.filters = new HashMap<String,String>(); Iterator<String> itr = filters.keySet().iterator(); Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-05-18 23:19:04 UTC (rev 3111) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-05-18 23:24:45 UTC (rev 3112) @@ -24,7 +24,10 @@ */ package org.archive.wayback.webapp; +import java.io.File; import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; import java.util.List; import java.util.Locale; import java.util.Properties; @@ -79,18 +82,31 @@ */ public class AccessPoint extends AbstractRequestHandler implements ShutdownListener { + /** webapp relative location of Interstitial.jsp */ + public final static String INTERSTITIAL_JSP = "jsp/Interstitial.jsp"; + /** argument for Interstitial.jsp target URL */ + public final static String INTERSTITIAL_TARGET = "target"; + /** argument for Interstitial.jsp seconds to delay */ + public final static String INTERSTITIAL_SECONDS = "seconds"; private static final Logger LOGGER = Logger.getLogger( AccessPoint.class.getName()); - + private boolean exactHostMatch = false; private boolean exactSchemeMatch = true; private boolean useAnchorWindow = false; private boolean useServerName = false; + private boolean serveStatic = true; + private boolean bounceToReplayPrefix = false; + private boolean bounceToQueryPrefix = false; private String liveWebPrefix = null; - private String urlRoot = null; + private String staticPrefix = null; + private String queryPrefix = null; + private String replayPrefix = null; + private String refererAuth = null; + private Locale locale = null; private Properties configs = null; @@ -112,20 +128,30 @@ protected boolean dispatchLocal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { - - String translated = "/" + translateRequestPathQuery(httpRequest); - - WaybackRequest wbRequest = new WaybackRequest(); - wbRequest.setContextPrefix(getUrlRoot()); - wbRequest.setAccessPoint(this); - wbRequest.fixup(httpRequest); - UIResults uiResults = new UIResults(wbRequest,uriConverter); - try { - uiResults.forward(httpRequest, httpResponse, translated); - return true; - } catch(IOException e) { - // TODO: figure out if we got IO because of a missing dispatcher + if(!serveStatic) { + return false; } +// String contextRelativePath = httpRequest.getServletPath(); + String translated = "/" + translateRequestPath(httpRequest); +// String absPath = getServletContext().getRealPath(contextRelativePath); + String absPath = getServletContext().getRealPath(translated); + File test = new File(absPath); + if(test.exists()) { + + String translated2 = "/" + translateRequestPathQuery(httpRequest); + + WaybackRequest wbRequest = new WaybackRequest(); +// wbRequest.setContextPrefix(getUrlRoot()); + wbRequest.setAccessPoint(this); + wbRequest.fixup(httpRequest); + UIResults uiResults = new UIResults(wbRequest,uriConverter); + try { + uiResults.forward(httpRequest, httpResponse, translated2); + return true; + } catch(IOException e) { + // TODO: figure out if we got IO because of a missing dispatcher + } + } return false; } @@ -152,7 +178,7 @@ // TODO: refactor this code into RequestParser implementations wbRequest.setAccessPoint(this); // wbRequest.setContextPrefix(getAbsoluteLocalPrefix(httpRequest)); - wbRequest.setContextPrefix(getUrlRoot()); +// wbRequest.setContextPrefix(getUrlRoot()); wbRequest.fixup(httpRequest); // end of refactor @@ -179,11 +205,26 @@ wbRequest.setExactScheme(isExactSchemeMatch()); if(wbRequest.isReplayRequest()) { - + if(bounceToReplayPrefix) { + // we don't accept replay requests on this AccessPoint + // bounce the user to the right place: + String suffix = translateRequestPathQuery(httpRequest); + String replayUrl = replayPrefix + suffix; + httpResponse.sendRedirect(replayUrl); + return true; + } handleReplay(wbRequest,httpRequest,httpResponse); } else { + if(bounceToQueryPrefix) { + // we don't accept replay requests on this AccessPoint + // bounce the user to the right place: + String suffix = translateRequestPathQuery(httpRequest); + String replayUrl = queryPrefix + suffix; + httpResponse.sendRedirect(replayUrl); + return true; + } wbRequest.setExactHost(isExactHostMatch()); handleQuery(wbRequest,httpRequest,httpResponse); } @@ -198,7 +239,9 @@ } catch(WaybackException e) { boolean drawError = true; if(e instanceof ResourceNotInArchiveException) { - if(getLiveWebPrefix() != null) { + if((getLiveWebPrefix() != null) + && (getLiveWebPrefix().length() > 0)) { + String liveUrl = getLiveWebPrefix() + wbRequest.getRequestUrl(); httpResponse.sendRedirect(liveUrl); @@ -220,18 +263,48 @@ String url = r.getRequestUrl(); StringBuilder sb = new StringBuilder(100); sb.append("NotInArchive\t"); - sb.append(getUrlRoot()).append("\t"); + sb.append(getBeanName()).append("\t"); sb.append(url); LOGGER.info(sb.toString()); } } + private void checkInterstitialRedirect(HttpServletRequest httpRequest) + throws BetterRequestException { + if(refererAuth != null) { + String referer = httpRequest.getHeader("Referer"); + if((referer == null) || (!referer.contains(refererAuth))) { + StringBuffer sb = httpRequest.getRequestURL(); + if(httpRequest.getQueryString() != null) { + sb.append("?").append(httpRequest.getQueryString()); + } + StringBuilder u = new StringBuilder(); + u.append(getQueryPrefix()); + u.append(INTERSTITIAL_JSP); + u.append("?"); + u.append(INTERSTITIAL_SECONDS).append("=").append(5); + u.append("&"); + u.append(INTERSTITIAL_TARGET).append("="); + try { + u.append(URLEncoder.encode(sb.toString(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + // not gonna happen... + u.append(sb.toString()); + } + throw new BetterRequestException(u.toString()); + } + } + } + private void handleReplay(WaybackRequest wbRequest, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException, WaybackException { Resource resource = null; try { + + checkInterstitialRedirect(httpRequest); + PerformanceLogger p = new PerformanceLogger("replay"); SearchResults results = getCollection().getResourceIndex().query(wbRequest); @@ -241,7 +314,7 @@ } CaptureSearchResults captureResults = (CaptureSearchResults) results; - + // TODO: check which versions are actually accessible right now? CaptureSearchResult closest = captureResults.getClosest(wbRequest, isUseAnchorWindow()); @@ -308,6 +381,16 @@ } } + private String getBestPrefix(String best, String next, String last) { + if(best != null) { + return best; + } + if(next != null) { + return next; + } + return last; + } + /* * ******************************************************************* * ******************************************************************* @@ -369,7 +452,7 @@ /** * @return the useServerName - * @deprecated no longer used, use urlPrefix + * @deprecated no longer used, use {replay,query,static}Prefix */ public boolean isUseServerName() { return useServerName; @@ -377,13 +460,28 @@ /** * @param useServerName the useServerName to set - * @deprecated no longer used, use urlPrefix + * @deprecated no longer used, use {replay,query,static}Prefix */ public void setUseServerName(boolean useServerName) { this.useServerName = useServerName; } /** + * @return true if this AccessPoint serves static content + */ + public boolean isServeStatic() { + return serveStatic; + } + + /** + * @param serveStatic if set to true, this AccessPoint will serve static + * content, and .jsp files + */ + public void setServeStatic(boolean serveStatic) { + this.serveStatic = serveStatic; + } + + /** * @return the liveWebPrefix String to use, or null, if this AccessPoint * does not use the Live Web to fill in documents missing from the archive */ @@ -401,21 +499,73 @@ /** * @return the String url prefix to use when generating self referencing - * URLs + * static URLs */ - public String getUrlRoot() { - return urlRoot; + public String getStaticPrefix() { + return getBestPrefix(staticPrefix,queryPrefix,replayPrefix); } /** - * @param urlRoot explicit URL prefix to use when creating self referencing - * URLs + * @param staticPrefix explicit URL prefix to use when creating self referencing + * static URLs */ + public void setStaticPrefix(String staticPrefix) { + this.staticPrefix = staticPrefix; + } + + /** + * @return the String url prefix to use when generating self referencing + * replay URLs + */ + public String getReplayPrefix() { + return getBestPrefix(replayPrefix,queryPrefix,staticPrefix); + } + + /** + * @param replayPrefix explicit URL prefix to use when creating self referencing + * replay URLs + */ + public void setReplayPrefix(String replayPrefix) { + this.replayPrefix = replayPrefix; + } + + /** + * @param queryPrefix explicit URL prefix to use when creating self referencing + * query URLs + */ + public void setQueryPrefix(String queryPrefix) { + this.queryPrefix = queryPrefix; + } + + /** + * @return the String url prefix to use when generating self referencing + * replay URLs + */ + public String getQueryPrefix() { + return getBestPrefix(queryPrefix,staticPrefix,replayPrefix); + } + + /** + * @param urlRoot explicit URL prefix to use when creating ANY self + * referencing URLs + * @deprecated use setQueryPrefix, setReplayPrefix, setStaticPrefix + */ public void setUrlRoot(String urlRoot) { - this.urlRoot = urlRoot; + this.queryPrefix = urlRoot; + this.replayPrefix = urlRoot; + this.staticPrefix = urlRoot; } /** + * @return the String url prefix used when generating self referencing + * URLs + * @deprecated use getQueryPrefix, getReplayPrefix, getStaticPrefix + */ + public String getUrlRoot() { + return getBestPrefix(queryPrefix,staticPrefix,replayPrefix); + } + + /** * @return explicit Locale to use within this AccessPoint. */ public Locale getLocale() { @@ -605,4 +755,45 @@ public void setAuthentication(BooleanOperator<WaybackRequest> auth) { this.authentication = auth; } + + /** + * @return the refererAuth + */ + public String getRefererAuth() { + return refererAuth; + } + + /** + * @param refererAuth the refererAuth to set + */ + public void setRefererAuth(String refererAuth) { + this.refererAuth = refererAuth; + } + + /** + * @return the bounceToReplayPrefix + */ + public boolean isBounceToReplayPrefix() { + return bounceToReplayPrefix; + } + + /** + * @param bounceToReplayPrefix the bounceToReplayPrefix to set + */ + public void setBounceToReplayPrefix(boolean bounceToReplayPrefix) { + this.bounceToReplayPrefix = bounceToReplayPrefix; + } + /** + * @return the bounceToQueryPrefix + */ + public boolean isBounceToQueryPrefix() { + return bounceToQueryPrefix; + } + + /** + * @param bounceToQueryPrefix the bounceToQueryPrefix to set + */ + public void setBounceToQueryPrefix(boolean bounceToQueryPrefix) { + this.bounceToQueryPrefix = bounceToQueryPrefix; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:19:10
|
Revision: 3111 http://archive-access.svn.sourceforge.net/archive-access/?rev=3111&view=rev Author: bradtofel Date: 2010-05-18 23:19:04 +0000 (Tue, 18 May 2010) Log Message: ----------- BUGFIX: needed to add 'CDATA' to legal HEAD tags. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java 2010-05-18 23:06:38 UTC (rev 3110) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/archivalurl/FastArchivalUrlReplayParseEventHandler.java 2010-05-18 23:19:04 UTC (rev 3111) @@ -64,8 +64,8 @@ private String jspInsertPath = "/WEB-INF/replay/DisclaimChooser.jsp"; - private final String[] okHeadTags = { "!DOCTYPE", "HTML", "HEAD", "BASE", - "LINK", "META", "TITLE", "STYLE", "SCRIPT", "BODY" }; + private final String[] okHeadTags = { "![CDATA[*", "!DOCTYPE", "HTML", "HEAD", "BASE", + "LINK", "META", "TITLE", "STYLE", "SCRIPT" }; private HashMap<String, Object> okHeadTagMap = null; private final static String FRAMESET_TAG = "FRAMESET"; private final static String BODY_TAG = "BODY"; Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java 2010-05-18 23:06:38 UTC (rev 3110) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/rules/AfterBodyStartTagJSPExecRule.java 2010-05-18 23:19:04 UTC (rev 3111) @@ -61,7 +61,8 @@ public class AfterBodyStartTagJSPExecRule extends JSPExecRule implements ReplayParseEventDelegatorVisitor, OpenTagHandler { private final String[] okHeadTags = { - "HTML","HEAD","BASE","LINK","META","TITLE","STYLE","SCRIPT","BODY" + "![CDATA[*", "!DOCTYPE","HTML","HEAD","BASE","LINK","META","TITLE", + "STYLE","SCRIPT" }; private final static String FRAMESET_TAG = "FRAMESET"; private final static String FERRET_DONE_KEY = This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:06:47
|
Revision: 3110 http://archive-access.svn.sourceforge.net/archive-access/?rev=3110&view=rev Author: bradtofel Date: 2010-05-18 23:06:38 +0000 (Tue, 18 May 2010) Log Message: ----------- REFACTOR: moved mailto: checking into ReplayParseContext Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/ReplayParseContext.java trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/transformer/URLStringTransformer.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/ReplayParseContext.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/ReplayParseContext.java 2010-05-18 23:05:10 UTC (rev 3109) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/ReplayParseContext.java 2010-05-18 23:06:38 UTC (rev 3110) @@ -34,6 +34,8 @@ import org.archive.wayback.util.htmllex.ParseContext; public class ReplayParseContext extends ParseContext { + private static final String MAILTO_PREFIX = "mailto:"; + private static final String JAVASCRIPT_PREFIX = "javascript:"; private ContextResultURIConverterFactory uriConverterFactory = null; private String datespec = null; private JSPExecutor jspExec = null; @@ -92,7 +94,11 @@ return contextualizeUrl(url,""); } public String contextualizeUrl(String url, String flags) { - if(url.startsWith("javascript:")) { + // if we get an empty string, just return it: + if(url.length() == 0) { + return url; + } + if(url.startsWith(JAVASCRIPT_PREFIX) || url.startsWith(MAILTO_PREFIX)) { return url; } url = super.contextualizeUrl(url); Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/transformer/URLStringTransformer.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/transformer/URLStringTransformer.java 2010-05-18 23:05:10 UTC (rev 3109) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/html/transformer/URLStringTransformer.java 2010-05-18 23:06:38 UTC (rev 3110) @@ -32,7 +32,6 @@ * */ public class URLStringTransformer implements StringTransformer { - private static final String MAILTO_PREFIX = "mailto:"; private String flags; /** Default constructor */ public URLStringTransformer() {} @@ -45,9 +44,6 @@ } public String transform(ReplayParseContext context, String url) { - if(url.startsWith(MAILTO_PREFIX)) { - return url; - } return context.contextualizeUrl(url, flags); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 3109 http://archive-access.svn.sourceforge.net/archive-access/?rev=3109&view=rev Author: bradtofel Date: 2010-05-18 23:05:10 +0000 (Tue, 18 May 2010) Log Message: ----------- INITIAL REV: ReplayRendererSelector which matches HTTP 3XX response codes Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/selector/RedirectSelector.java Added: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/selector/RedirectSelector.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/selector/RedirectSelector.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/selector/RedirectSelector.java 2010-05-18 23:05:10 UTC (rev 3109) @@ -0,0 +1,47 @@ +/* RedirectSelector + * + * $Id$: + * + * Created on May 7, 2010. + * + * Copyright (C) 2006 Internet Archive. + * + * This file is part of Wayback. + * + * Wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package org.archive.wayback.replay.selector; + +import org.archive.wayback.core.CaptureSearchResult; +import org.archive.wayback.core.Resource; +import org.archive.wayback.core.WaybackRequest; + +/** + * @author brad + * + */ +public class RedirectSelector extends BaseReplayRendererSelector { + public boolean canHandle(WaybackRequest wbRequest, + CaptureSearchResult result, Resource resource) { + if(!wbRequest.isLiveWebRequest()) { + String code = result.getHttpCode(); + if((code != null) && code.startsWith("3")) { + return true; + } + } + return false; + } +} Property changes on: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/selector/RedirectSelector.java ___________________________________________________________________ Added: svn:keywords + Author Date Revision Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 23:01:20
|
Revision: 3108 http://archive-access.svn.sourceforge.net/archive-access/?rev=3108&view=rev Author: bradtofel Date: 2010-05-18 23:01:13 +0000 (Tue, 18 May 2010) Log Message: ----------- TWEAK: removed calls to wbrequest setContextPrefix and setServerPrefix Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/LiveWebAccessPoint.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/LiveWebAccessPoint.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/LiveWebAccessPoint.java 2010-05-18 23:00:00 UTC (rev 3107) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/LiveWebAccessPoint.java 2010-05-18 23:01:13 UTC (rev 3108) @@ -70,9 +70,6 @@ WaybackRequest wbRequest = new WaybackRequest(); wbRequest.setAccessPoint(inner); - wbRequest.setContextPrefix(inner.getUrlRoot()); - wbRequest.setServerPrefix(inner.getUrlRoot()); - wbRequest.setLiveWebRequest(true); wbRequest.setRequestUrl(urlString); URL url = null; @@ -86,14 +83,14 @@ CaptureSearchResult result = new CaptureSearchResult(); result.setOriginalUrl(urlString); result.setUrlKey(urlString); - // should we check robots, first? + // check robots first, if configured if(robotFactory != null) { int ruling = robotFactory.get().filterObject(result); if(ruling == ExclusionFilter.FILTER_EXCLUDE) { throw new RobotAccessControlException(urlString + "is blocked by robots.txt"); } } - // robots says GO: + // no robots check, or robots.txt says GO: ArcResource r = (ArcResource) cache.getCachedResource(url, maxCacheMS , false); ARCRecord ar = (ARCRecord) r.getArcRecord(); int status = ar.getStatusCode(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
Revision: 3107 http://archive-access.svn.sourceforge.net/archive-access/?rev=3107&view=rev Author: bradtofel Date: 2010-05-18 23:00:00 +0000 (Tue, 18 May 2010) Log Message: ----------- REFACTOR: moved server-relative redirect code to this separate RequestHandler Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/ServerRelativeArchivalRedirect.java Added: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/ServerRelativeArchivalRedirect.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/ServerRelativeArchivalRedirect.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/ServerRelativeArchivalRedirect.java 2010-05-18 23:00:00 UTC (rev 3107) @@ -0,0 +1,204 @@ +/* ServerRelativeArchivalRedirect + * + * $Id$: + * + * Created on May 3, 2010. + * + * Copyright (C) 2006 Internet Archive. + * + * This file is part of Wayback. + * + * Wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package org.archive.wayback.webapp; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.archive.net.UURI; +import org.archive.net.UURIFactory; +import org.archive.util.ArchiveUtils; +import org.archive.wayback.util.url.UrlOperations; +import org.archive.wayback.util.webapp.AbstractRequestHandler; + +/** + * @author brad + * + */ +public class ServerRelativeArchivalRedirect extends AbstractRequestHandler { + private static final Logger LOGGER = Logger.getLogger( + ServerRelativeArchivalRedirect.class.getName()); + boolean useCollection = false; + private String matchHost = null; + private int matchPort = -1; + + private boolean handleRequestWithCollection(HttpServletRequest httpRequest, + HttpServletResponse httpResponse) throws ServletException, + IOException { + boolean handled = false; + // hope that it's a server relative request, with a valid referrer: + String referer = httpRequest.getHeader("Referer"); + if(referer != null) { + UURI uri = UURIFactory.getInstance(referer); + String path = uri.getPath(); + int secondSlash = path.indexOf('/',1); + if(secondSlash > -1) { + String collection = path.substring(0,secondSlash); + String remainder = path.substring(secondSlash+1); + int thirdSlash = remainder.indexOf('/'); + if(thirdSlash > -1) { + String datespec = remainder.substring(0,thirdSlash); + String url = ArchiveUtils.addImpliedHttpIfNecessary( + remainder.substring(thirdSlash+1)); + String thisPath = httpRequest.getRequestURI(); + String queryString = httpRequest.getQueryString(); + if (queryString != null) { + thisPath += "?" + queryString; + } + + String resolved = UrlOperations.resolveUrl(url, thisPath); + String contextPath = httpRequest.getContextPath(); + String finalUrl = uri.getScheme() + "://" + + uri.getAuthority() + contextPath + collection + "/" + + datespec + "/" + resolved; + // cross your fingers!!! + LOGGER.info("Server-Relative-Redirect:\t" + referer + "\t" + + thisPath + "\t" + finalUrl); + + // Gotta make sure this is properly cached, or + // weird things happen: + httpResponse.addHeader("Vary", "Referer"); + httpResponse.sendRedirect(finalUrl); + handled = true; + + } + } + } + + return handled; + } + + private boolean handleRequestWithoutCollection(HttpServletRequest httpRequest, + HttpServletResponse httpResponse) throws ServletException, + IOException { + boolean handled = false; + // hope that it's a server relative request, with a valid referrer: + String referer = httpRequest.getHeader("Referer"); + if(referer != null) { + LOGGER.trace("referer:" + referer); + UURI uri = UURIFactory.getInstance(referer); + String path = uri.getPath(); + + String remainder = path.substring(1); + int thirdSlash = remainder.indexOf('/'); + LOGGER.trace("referer:(" + referer + ") remain(" + remainder + ") 3rd("+thirdSlash+")"); + if(thirdSlash > -1) { + String datespec = remainder.substring(0,thirdSlash); + String url = ArchiveUtils.addImpliedHttpIfNecessary( + remainder.substring(thirdSlash+1)); + String thisPath = httpRequest.getRequestURI(); + String queryString = httpRequest.getQueryString(); + if (queryString != null) { + thisPath += "?" + queryString; + } + + String resolved = UrlOperations.resolveUrl(url, thisPath); + String contextPath = httpRequest.getContextPath(); + String finalUrl = uri.getScheme() + "://" + + uri.getAuthority() + contextPath + "/" + + datespec + "/" + resolved; + // cross your fingers!!! + LOGGER.info("Server-Relative-Redirect:\t" + referer + "\t" + + thisPath + "\t" + finalUrl); + + // Gotta make sure this is properly cached, or + // weird things happen: + httpResponse.addHeader("Vary", "Referer"); + httpResponse.sendRedirect(finalUrl); + handled = true; + + } + } + + return handled; + } + + public boolean handleRequest(HttpServletRequest httpRequest, + HttpServletResponse httpResponse) throws ServletException, + IOException { + if(matchHost != null) { + + if(!matchHost.equals(httpRequest.getServerName())) { + LOGGER.trace("Wrong host for ServerRelativeRed(" + + httpRequest.getServerName() +")"); + return false; + } + } + if(matchPort != -1) { + if(matchPort != httpRequest.getLocalPort()) { + LOGGER.trace("Wrong port for ServerRealtiveRed(" + + httpRequest.getServerName() + ")(" + + httpRequest.getLocalPort() +") :" + + httpRequest.getRequestURI()); + return false; + } + } + return useCollection ? + handleRequestWithCollection(httpRequest, httpResponse): + handleRequestWithoutCollection(httpRequest, httpResponse); + } + + /** + * @return the useCollection + */ + public boolean isUseCollection() { + return useCollection; + } + /** + * @param useCollection the useCollection to set + */ + public void setUseCollection(boolean useCollection) { + this.useCollection = useCollection; + } + /** + * @return the matchHost + */ + public String getMatchHost() { + return matchHost; + } + /** + * @param matchHost the matchHost to set + */ + public void setMatchHost(String matchHost) { + this.matchHost = matchHost; + } + /** + * @return the matchPort + */ + public int getMatchPort() { + return matchPort; + } + /** + * @param matchPort the matchPort to set + */ + public void setMatchPort(int matchPort) { + this.matchPort = matchPort; + } +} Property changes on: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/ServerRelativeArchivalRedirect.java ___________________________________________________________________ Added: svn:keywords + Author Date Revision Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-05-18 22:56:29
|
Revision: 3106 http://archive-access.svn.sourceforge.net/archive-access/?rev=3106&view=rev Author: bradtofel Date: 2010-05-18 22:56:23 +0000 (Tue, 18 May 2010) Log Message: ----------- INITIAL REV: simple class for manipulating bits within a byte array. Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/BitArray.java trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/util/BitArrayTest.java Added: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/BitArray.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/BitArray.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/BitArray.java 2010-05-18 22:56:23 UTC (rev 3106) @@ -0,0 +1,109 @@ +/* BitArray + * + * $Id$: + * + * Created on Apr 27, 2010. + * + * Copyright (C) 2006 Internet Archive. + * + * This file is part of Wayback. + * + * Wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package org.archive.wayback.util; + +/** + * @author brad + * + */ +public class BitArray { + private static final int MASKS[] = { + 0x01, + 0x02, + 0x04, + 0x08, + 0x10, + 0x20, + 0x40, + 0x80 + }; + private static final int MASKSR[] = { + ~0x01, + ~0x02, + ~0x04, + ~0x08, + ~0x10, + ~0x20, + ~0x40, + ~0x80 + }; + private byte array[] = null; + + /** + * Construct a new BitArray holding at least n bits + * @param n number of bits to hold + */ + public BitArray(int n) { + int bytes = n / 8; + int bits = n % 8; + if(bits > 0) { + bytes++; + } + this.array = new byte[bytes]; + } + /** + * Construct a new BitArray using argument as initial values. + * @param array byte array of initial values + */ + public BitArray(byte array[]) { + this.array = array; + } + /** + * @return the byte array backing this bit array. + */ + public byte[] getBytes() { + return array; + } + /** + * @param i index of bit to test + * @return true if the i'th bit is set, false otherwise + */ + public boolean get(int i) { + int idx = i / 8; + if(idx >= array.length) { + throw new IndexOutOfBoundsException(); + } + int bit = 7 - (i % 8); + return ((array[idx] & MASKS[bit]) == MASKS[bit]); + } + /** + * set the i'th bit to 1 or 0 + * @param i bit number to set + * @param value if true, the bit is set to 1, otherwise it is set to 0 + */ + public void set(int i, boolean value) { + int idx = i / 8; + if(idx >= array.length) { + throw new IndexOutOfBoundsException(); + } + int bit = 7 - (i % 8); + if(value) { + array[idx] = (byte) (array[idx] | MASKS[bit]); + } else { + array[idx] = (byte) (array[idx] & MASKSR[bit]); + } + } +} Property changes on: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/util/BitArray.java ___________________________________________________________________ Added: svn:keywords + Author Date Revision Id Added: trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/util/BitArrayTest.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/util/BitArrayTest.java (rev 0) +++ trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/util/BitArrayTest.java 2010-05-18 22:56:23 UTC (rev 3106) @@ -0,0 +1,84 @@ +/* BitArrayTest + * + * $Id$: + * + * Created on May 14, 2010. + * + * Copyright (C) 2006 Internet Archive. + * + * This file is part of Wayback. + * + * Wayback is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +package org.archive.wayback.util; + +import junit.framework.TestCase; + +/** + * @author brad + * + */ +public class BitArrayTest extends TestCase { + + /** + * Test method for {@link org.archive.wayback.util.BitArray#get(int)}. + */ + public void testGet() { + byte bytes[] = "Here is some data!".getBytes(); + byte bytes2[] = "Here is some data!".getBytes(); + int bits = bytes.length * 8; + sun.security.util.BitArray sba = + new sun.security.util.BitArray(bits, bytes); + org.archive.wayback.util.BitArray wba = + new org.archive.wayback.util.BitArray(bytes2); + for(int i = 0; i < bits; i++) { + boolean want = sba.get(i); + boolean got = wba.get(i); + if(want != got) { + got = wba.get(i); + } + assertEquals(want,got); + } + } + + /** + * Test method for {@link org.archive.wayback.util.BitArray#set(int, boolean)}. + */ + public void testSet() { + byte bytes[] = "Here is some data!".getBytes(); + byte bytes2[] = "Here is some data!".getBytes(); + int bits = bytes.length * 8; + sun.security.util.BitArray sba = + new sun.security.util.BitArray(bits, bytes); + org.archive.wayback.util.BitArray wba = + new org.archive.wayback.util.BitArray(bytes2); + for(int i = 0; i < bits; i++) { + boolean want = sba.get(i); + boolean got = wba.get(i); + boolean not = !want; + assertTrue(ByteOp.cmp(sba.toByteArray(), wba.getBytes())); + sba.set(i,not); + wba.set(i,not); + assertTrue(ByteOp.cmp(sba.toByteArray(), wba.getBytes())); + assertEquals(not,wba.get(i)); + sba.set(i,got); + wba.set(i,got); + assertEquals(sba.get(i),wba.get(i)); + assertTrue(ByteOp.cmp(sba.toByteArray(), wba.getBytes())); + } + + } +} Property changes on: trunk/archive-access/projects/wayback/wayback-core/src/test/java/org/archive/wayback/util/BitArrayTest.java ___________________________________________________________________ Added: svn:keywords + Author Date Revision Id This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |