From: <bra...@us...> - 2007-11-28 03:08:06
|
Revision: 2087 http://archive-access.svn.sourceforge.net/archive-access/?rev=2087&view=rev Author: bradtofel Date: 2007-11-27 19:08:09 -0800 (Tue, 27 Nov 2007) Log Message: ----------- FEATURE: added closest indicator for queries, allowed missing trailing '/' on requests to base of 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 2007-11-28 02:50:25 UTC (rev 2086) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2007-11-28 03:08:09 UTC (rev 2087) @@ -137,6 +137,10 @@ } String contextPath = getContextPath(httpRequest); if (!origRequestPath.startsWith(contextPath)) { + if(contextPath.startsWith(origRequestPath)) { + // missing trailing '/', just omit: + return ""; + } return null; } return origRequestPath.substring(contextPath.length()); @@ -321,7 +325,10 @@ SearchResults results = collection.getResourceIndex().query(wbRequest); if(results.getResultsType().equals( WaybackConstants.RESULTS_TYPE_CAPTURE)) { - + CaptureSearchResults cResults = (CaptureSearchResults) results; + SearchResult closest = cResults.getClosest(wbRequest); + closest.put(WaybackConstants.RESULT_CLOSEST_INDICATOR, + WaybackConstants.RESULT_CLOSEST_VALUE); query.renderUrlResults(httpRequest,httpResponse,wbRequest, results,uriConverter); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |