From: <bra...@us...> - 2008-08-11 23:53:23
|
Revision: 2535 http://archive-access.svn.sourceforge.net/archive-access/?rev=2535&view=rev Author: bradtofel Date: 2008-08-11 23:53:31 +0000 (Mon, 11 Aug 2008) Log Message: ----------- TWEAK: now ferrets away original beanName, which can be accessed through the new getter 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 2008-08-11 23:25:34 UTC (rev 2534) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2008-08-11 23:53:31 UTC (rev 2535) @@ -81,6 +81,7 @@ private boolean useServerName = false; private int contextPort = 0; private String contextName = null; + private String beanName = null; private WaybackCollection collection = null; private ReplayDispatcher replay = null; private ExceptionRenderer exception = new BaseExceptionRenderer(); @@ -112,7 +113,7 @@ * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String) */ public void setBeanName(String beanName) { - // TODO Auto-generated method stub + this.beanName = beanName; this.contextName = ""; int idx = beanName.indexOf(":"); if(idx > -1) { @@ -126,6 +127,9 @@ } } } + public String getBeanName() { + return beanName; + } /** * @param httpRequest * @return the prefix of paths recieved by this server that are handled by This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2008-11-06 22:54:10
|
Revision: 2632 http://archive-access.svn.sourceforge.net/archive-access/?rev=2632&view=rev Author: bradtofel Date: 2008-11-06 22:54:01 +0000 (Thu, 06 Nov 2008) Log Message: ----------- BUGFIX(ACC-46): anchorDate adherence is now configured on AccessPoint, and is disabled by default. 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 2008-11-06 22:53:25 UTC (rev 2631) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2008-11-06 22:54:01 UTC (rev 2632) @@ -79,6 +79,8 @@ AccessPoint.class.getName()); private boolean useServerName = false; + private boolean useAnchorWindow = false; + private int contextPort = 0; private String contextName = null; private String beanName = null; @@ -343,7 +345,7 @@ // TODO: check which versions are actually accessible right now? CaptureSearchResult closest = captureResults.getClosest(wbRequest, - true); + useAnchorWindow); resource = collection.getResourceStore().retrieveResource(closest); ReplayRenderer renderer = replay.getRenderer(wbRequest, closest, resource); renderer.renderResource(httpRequest, httpResponse, wbRequest, @@ -473,6 +475,20 @@ this.useServerName = useServerName; } + /** + * @return the useAnchorWindow + */ + public boolean isUseAnchorWindow() { + return useAnchorWindow; + } + + /** + * @param useAnchorWindow the useAnchorWindow to set + */ + public void setUseAnchorWindow(boolean useAnchorWindow) { + this.useAnchorWindow = useAnchorWindow; + } + public ExclusionFilterFactory getExclusionFactory() { return exclusionFactory; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2008-11-07 22:31:45
|
Revision: 2636 http://archive-access.svn.sourceforge.net/archive-access/?rev=2636&view=rev Author: bradtofel Date: 2008-11-07 22:31:42 +0000 (Fri, 07 Nov 2008) Log Message: ----------- FEATURE: added exactSchemeMatch configuration, which for now is set on all requests within this AccessPoint. TWEAK: removed some code that had been commented out and is no longer used/needed. 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 2008-11-07 22:29:45 UTC (rev 2635) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2008-11-07 22:31:42 UTC (rev 2636) @@ -80,6 +80,7 @@ private boolean useServerName = false; private boolean useAnchorWindow = false; + private boolean exactSchemeMatch = true; private int contextPort = 0; private String contextName = null; @@ -217,11 +218,6 @@ prefix.append(":").append(waybackPort); } String contextPath = getContextPath(httpRequest); -// if(contextPath.length() > 1) { -// prefix.append(contextPath); -// } else { -// prefix.append(contextPath); -// } prefix.append(contextPath); return prefix.toString(); } @@ -264,19 +260,6 @@ } catch(IOException e) { // TODO: figure out if we got IO because of a missing dispatcher } -// uiResults.storeInRequest(httpRequest,translated); -// RequestDispatcher dispatcher = null; -// // special case for the front '/' page: -// if(translated.length() == 0) { -// translated = "/"; -// } else { -// translated = "/" + translated; -// } -// dispatcher = httpRequest.getRequestDispatcher(translated); -// if(dispatcher != null) { -// dispatcher.forward(httpRequest, httpResponse); -// return true; -// } return false; } @@ -299,9 +282,13 @@ if(wbRequest != null) { handled = true; + + // TODO: refactor this code into RequestParser implementations wbRequest.setAccessPoint(this); wbRequest.setContextPrefix(getAbsoluteLocalPrefix(httpRequest)); wbRequest.fixup(httpRequest); + // end of refactor + if(authentication != null) { if(!authentication.isTrue(wbRequest)) { throw new AuthenticationControlException("Not authorized"); @@ -311,6 +298,12 @@ if(exclusionFactory != null) { wbRequest.setExclusionFilter(exclusionFactory.get()); } + // TODO: refactor this into RequestParser implementations, so a + // user could alter requests to change the behavior within a + // single AccessPoint. For now, this is a simple way to expose + // the feature to configuration. + wbRequest.setExactScheme(exactSchemeMatch); + if(wbRequest.isReplayRequest()) { handleReplay(wbRequest,httpRequest,httpResponse); @@ -488,7 +481,21 @@ public void setUseAnchorWindow(boolean useAnchorWindow) { this.useAnchorWindow = useAnchorWindow; } + + /** + * @return the exactSchemeMatch + */ + public boolean isExactSchemeMatch() { + return exactSchemeMatch; + } + /** + * @param exactSchemeMatch the exactSchemeMatch to set + */ + public void setExactSchemeMatch(boolean exactSchemeMatch) { + this.exactSchemeMatch = exactSchemeMatch; + } + public ExclusionFilterFactory getExclusionFactory() { return exclusionFactory; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2009-05-20 02:53:10
|
Revision: 2729 http://archive-access.svn.sourceforge.net/archive-access/?rev=2729&view=rev Author: bradtofel Date: 2009-05-20 02:53:02 +0000 (Wed, 20 May 2009) Log Message: ----------- FEATURE: now adheres to a BetterRequestException. 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 2009-05-20 02:51:34 UTC (rev 2728) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2009-05-20 02:53:02 UTC (rev 2729) @@ -50,6 +50,7 @@ import org.archive.wayback.core.WaybackRequest; import org.archive.wayback.exception.AuthenticationControlException; import org.archive.wayback.exception.BaseExceptionRenderer; +import org.archive.wayback.exception.BetterRequestException; import org.archive.wayback.exception.ResourceNotAvailableException; import org.archive.wayback.exception.ResourceNotInArchiveException; import org.archive.wayback.exception.WaybackException; @@ -97,6 +98,41 @@ private String urlRoot = null; private Locale locale = null; + /** + * @return the contextName + */ + public String getContextName() { + return contextName; + } + + /** + * @return the replay + */ + public ReplayDispatcher getReplay() { + return replay; + } + + /** + * @return the query + */ + public QueryRenderer getQuery() { + return query; + } + + /** + * @return the parser + */ + public RequestParser getParser() { + return parser; + } + + /** + * @return the uriConverter + */ + public ResultURIConverter getUriConverter() { + return uriConverter; + } + public Locale getLocale() { return locale; } @@ -316,6 +352,10 @@ handled = dispatchLocal(httpRequest,httpResponse); } + } catch(BetterRequestException e) { + httpResponse.sendRedirect(e.getBetterURI()); + handled = true; + } catch(WaybackException e) { logNotInArchive(e,wbRequest); exception.renderException(httpRequest, httpResponse, wbRequest, e, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2009-10-28 03:40:28
|
Revision: 2859 http://archive-access.svn.sourceforge.net/archive-access/?rev=2859&view=rev Author: bradtofel Date: 2009-10-28 03:40:14 +0000 (Wed, 28 Oct 2009) Log Message: ----------- FEATURE: added exactHostMatch boolean member, which causes only results matching the exact host request to be returned. 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 2009-10-28 03:38:26 UTC (rev 2858) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2009-10-28 03:40:14 UTC (rev 2859) @@ -25,6 +25,7 @@ package org.archive.wayback.webapp; import java.io.IOException; +import java.util.List; import java.util.Locale; import java.util.Properties; import java.util.logging.Logger; @@ -82,6 +83,7 @@ private boolean useServerName = false; private boolean useAnchorWindow = false; private boolean exactSchemeMatch = true; + private boolean exactHostMatch = false; private int contextPort = 0; private String contextName = null; @@ -97,7 +99,25 @@ private BooleanOperator<WaybackRequest> authentication = null; private String urlRoot = null; private Locale locale = null; + private List<String> filePatterns = null; + private List<String> filePrefixes = null; + + public List<String> getFilePatterns() { + return filePatterns; + } + public void setFilePatterns(List<String> filePatterns) { + this.filePatterns = filePatterns; + } + + public List<String> getFilePrefixes() { + return filePrefixes; + } + + public void setFilePrefixes(List<String> filePrefixes) { + this.filePrefixes = filePrefixes; + } + /** * @return the contextName */ @@ -346,6 +366,7 @@ } else { + wbRequest.setExactHost(exactHostMatch); handleQuery(wbRequest,httpRequest,httpResponse); } } else { @@ -575,4 +596,18 @@ public void setUrlRoot(String urlRoot) { this.urlRoot = urlRoot; } + + /** + * @return the exactHostMatch + */ + public boolean isExactHostMatch() { + return exactHostMatch; + } + + /** + * @param exactHostMatch the exactHostMatch to set + */ + public void setExactHostMatch(boolean exactHostMatch) { + this.exactHostMatch = exactHostMatch; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2009-11-10 00:50:40
|
Revision: 2921 http://archive-access.svn.sourceforge.net/archive-access/?rev=2921&view=rev Author: bradtofel Date: 2009-11-10 00:50:27 +0000 (Tue, 10 Nov 2009) Log Message: ----------- JAVADOC: updated javadoc for public methods 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 2009-11-10 00:10:23 UTC (rev 2920) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2009-11-10 00:50:27 UTC (rev 2921) @@ -1,4 +1,4 @@ -/* WaybackContext +/* AccessPoint * * $Id$ * @@ -102,18 +102,36 @@ private List<String> filePatterns = null; private List<String> filePrefixes = null; + /** + * @return List of file patterns that will be matched when querying the + * ResourceIndex + */ public List<String> getFilePatterns() { return filePatterns; } + /** + * @param filePatterns List of file Patterns (regular expressions) that + * will be matched when querying the ResourceIndex - only SearchResults + * matching one of these patterns will be returned. + */ public void setFilePatterns(List<String> filePatterns) { this.filePatterns = filePatterns; } + /** + * @return List of file String prefixes that will be matched when querying + * the ResourceIndex + */ public List<String> getFilePrefixes() { return filePrefixes; } + /** + * @param filePrefixes List of String file prefixes that will be matched + * when querying the ResourceIndex - only SearchResults from files + * with a prefix matching one of those in this List will be returned. + */ public void setFilePrefixes(List<String> filePrefixes) { this.filePrefixes = filePrefixes; } @@ -153,10 +171,18 @@ return uriConverter; } + /** + * @return explicit Locale to use within this AccessPoint. + */ public Locale getLocale() { return locale; } + /** + * @param locale explicit Locale to use for requests within this + * AccessPoint. If not set, will attempt to use the one specified by + * each requests User Agent via HTTP headers + */ public void setLocale(Locale locale) { this.locale = locale; } @@ -186,18 +212,19 @@ } } } + /** + * @return the name of the bean in the Spring configuration which defined + * this AccessPoint. + */ public String getBeanName() { return beanName; } /** - * @param httpRequest - * @return the prefix of paths recieved by this server that are handled by + * @param httpRequest HttpServletRequest which is being handled + * @return the prefix of paths received by this server that are handled by * this WaybackContext, including the trailing '/' */ public String getContextPath(HttpServletRequest httpRequest) { -// if(contextPort != 0) { -// return httpRequest.getContextPath(); -// } String httpContextPath = httpRequest.getContextPath(); if(contextName.length() == 0) { return httpContextPath + "/"; @@ -206,8 +233,11 @@ } /** - * @param httpRequest - * @param includeQuery + * Remove any leading ServletContext and AccessPoint name path elements + * from the incoming request path, returning the result as a String + * + * @param httpRequest HttpServletRequest which is being handled + * @param includeQuery if true, include any query arguments * @return the portion of the request following the path to this context * without leading '/' */ @@ -233,7 +263,10 @@ } /** - * @param httpRequest + * Remove any leading ServletContext and AccessPoint name path elements + * from the incoming request path, returning the result as a String + + * @param httpRequest HttpServletRequest which is being handled * @return the portion of the request following the path to this context, * including any query information,without leading '/' */ @@ -242,7 +275,7 @@ } /** - * @param httpRequest + * @param httpRequest HttpServletRequest which is being handled * @return the portion of the request following the path to this context, * excluding any query information, without leading '/' */ @@ -252,10 +285,10 @@ /** * Construct an absolute URL that points to the root of the context that - * recieved the request, including a trailing "/". + * received the request, including a trailing "/". * * @return String absolute URL pointing to the Context root where the - * request was revieved. + * request was received. */ private String getAbsoluteContextPrefix(HttpServletRequest httpRequest, boolean useRequestServer) { @@ -279,7 +312,7 @@ } /** - * @param httpRequest + * @param httpRequest HttpServletRequest which is being handled * @return absolute URL pointing to the base of this WaybackContext, using * Server and port information from the HttpServletRequest argument. */ @@ -288,7 +321,7 @@ } /** - * @param httpRequest + * @param httpRequest HttpServletRequest which is being handled * @return absolute URL pointing to the base of this WaybackContext, using * Canonical server and port information. */ @@ -320,11 +353,11 @@ } /** - * @param httpRequest - * @param httpResponse + * @param httpRequest HttpServletRequest which is being handled + * @param httpResponse HttpServletResponse which is being handled * @return true if the request was actually handled - * @throws ServletException - * @throws IOException + * @throws ServletException per usual + * @throws IOException per usual */ public boolean handleRequest(HttpServletRequest httpRequest, HttpServletResponse httpResponse) @@ -431,6 +464,12 @@ } } + /** + * Release any resources associated with this AccessPoint, including + * stopping any background processing threads + * + * @throws IOException per usual + */ public void shutdown() throws IOException { if(collection != null) { collection.shutdown(); @@ -557,42 +596,77 @@ this.exactSchemeMatch = exactSchemeMatch; } + /** + * @return the ExclusionFilterFactory in use with this AccessPoint + */ public ExclusionFilterFactory getExclusionFactory() { return exclusionFactory; } + /** + * @param exclusionFactory all requests to this AccessPoint will create an + * exclusionFilter from this factory when handling requests + */ public void setExclusionFactory(ExclusionFilterFactory exclusionFactory) { this.exclusionFactory = exclusionFactory; } + /** + * @return the configured AuthenticationControl operator in use with this + * AccessPoint. + */ public BooleanOperator<WaybackRequest> getAuthentication() { return authentication; } + /** + * @param authentication the BooleanOperator which determines if incoming + * requests are allowed to connect to this AccessPoint. + */ public void setAuthentication(BooleanOperator<WaybackRequest> authentication) { this.authentication = authentication; } + /** + * @return the WaybackCollection used by this AccessPoint + */ public WaybackCollection getCollection() { return collection; } + /** + * @param collection the WaybackCollection to use with this AccessPoint + */ public void setCollection(WaybackCollection collection) { this.collection = collection; } + /** + * @return the ExceptionRenderer in use with this AccessPoint + */ public ExceptionRenderer getException() { return exception; } + /** + * @param exception the ExceptionRender to use with this AccessPoint + */ public void setException(ExceptionRenderer exception) { this.exception = exception; } + /** + * @return the String url prefix to use when generating self referencing + * URLs + */ public String getUrlRoot() { return urlRoot; } + /** + * @param urlRoot explicit URL prefix to use when creating self referencing + * URLs + */ public void setUrlRoot(String urlRoot) { this.urlRoot = urlRoot; } @@ -605,7 +679,10 @@ } /** - * @param exactHostMatch the exactHostMatch to set + * @param exactHostMatch if true, then only SearchResults exactly matching + * the requested hostname will be returned from this AccessPoint. If + * false, then hosts which canonicalize to the same host as requested + * hostname will be returned (www.) */ public void setExactHostMatch(boolean exactHostMatch) { this.exactHostMatch = exactHostMatch; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-04-02 03:30:38
|
Revision: 3021 http://archive-access.svn.sourceforge.net/archive-access/?rev=3021&view=rev Author: bradtofel Date: 2010-04-02 03:30:31 +0000 (Fri, 02 Apr 2010) Log Message: ----------- BUGFIX(unreported) now definitely throws an AdministrativeExclusionException if the ExclusionFilterFactory returns null, and also attents to shutdown() the ExclusionFilterFactory, if configured. 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-04-02 03:28:28 UTC (rev 3020) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-04-02 03:30:31 UTC (rev 3021) @@ -49,12 +49,14 @@ import org.archive.wayback.core.UIResults; import org.archive.wayback.core.UrlSearchResults; import org.archive.wayback.core.WaybackRequest; +import org.archive.wayback.exception.AdministrativeAccessControlException; import org.archive.wayback.exception.AuthenticationControlException; import org.archive.wayback.exception.BaseExceptionRenderer; import org.archive.wayback.exception.BetterRequestException; import org.archive.wayback.exception.ResourceNotAvailableException; import org.archive.wayback.exception.ResourceNotInArchiveException; import org.archive.wayback.exception.WaybackException; +import org.archive.wayback.resourceindex.filters.ExclusionFilter; import org.archive.wayback.util.operator.BooleanOperator; import org.springframework.beans.factory.BeanNameAware; @@ -385,7 +387,12 @@ } if(exclusionFactory != null) { - wbRequest.setExclusionFilter(exclusionFactory.get()); + ExclusionFilter exclusionFilter = exclusionFactory.get(); + if(exclusionFilter == null) { + throw new AdministrativeAccessControlException( + "AccessControl list unavailable"); + } + wbRequest.setExclusionFilter(exclusionFilter); } // TODO: refactor this into RequestParser implementations, so a // user could alter requests to change the behavior within a @@ -483,6 +490,9 @@ if(collection != null) { collection.shutdown(); } + if(exclusionFactory != null) { + exclusionFactory.shutdown(); + } } private void logNotInArchive(WaybackException e, WaybackRequest r) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-04-05 23:43:22
|
Revision: 3029 http://archive-access.svn.sourceforge.net/archive-access/?rev=3029&view=rev Author: bradtofel Date: 2010-04-05 23:43:16 +0000 (Mon, 05 Apr 2010) Log Message: ----------- FEATURE: added configuration of a liveWebPrefix. If configured, a NotInArchiveException is redirected to: PREFIX+MISSING_URL which is assumed to be handled by another AccessPoint that can replay content from the live web. 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-04-05 23:36:47 UTC (rev 3028) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-04-05 23:43:16 UTC (rev 3029) @@ -82,6 +82,8 @@ private static final Logger LOGGER = Logger.getLogger( AccessPoint.class.getName()); + private String liveWebPrefix = null; + private boolean useServerName = false; private boolean useAnchorWindow = false; private boolean exactSchemeMatch = true; @@ -243,7 +245,7 @@ * @return the portion of the request following the path to this context * without leading '/' */ - private String translateRequest(HttpServletRequest httpRequest, + protected String translateRequest(HttpServletRequest httpRequest, boolean includeQuery) { String origRequestPath = httpRequest.getRequestURI(); @@ -334,7 +336,7 @@ return getAbsoluteContextPrefix(httpRequest, useServerName); } - private boolean dispatchLocal(HttpServletRequest httpRequest, + protected boolean dispatchLocal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { @@ -418,11 +420,20 @@ handled = true; } catch(WaybackException e) { - logNotInArchive(e,wbRequest); - exception.renderException(httpRequest, httpResponse, wbRequest, e, - uriConverter); + boolean drawError = true; + if(e instanceof ResourceNotInArchiveException) { + if(liveWebPrefix != null) { + String liveUrl = liveWebPrefix + wbRequest.getRequestUrl(); + httpResponse.sendRedirect(liveUrl); + drawError = false; + } + } + if(drawError) { + logNotInArchive(e,wbRequest); + exception.renderException(httpRequest, httpResponse, wbRequest, e, + uriConverter); + } } - return handled; } @@ -706,4 +717,18 @@ public void setExactHostMatch(boolean exactHostMatch) { this.exactHostMatch = exactHostMatch; } + + /** + * @return the liveWebPrefix + */ + public String getLiveWebPrefix() { + return liveWebPrefix; + } + + /** + * @param liveWebPrefix the liveWebPrefix to set + */ + public void setLiveWebPrefix(String liveWebPrefix) { + this.liveWebPrefix = liveWebPrefix; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-04-14 21:37:38
|
Revision: 3043 http://archive-access.svn.sourceforge.net/archive-access/?rev=3043&view=rev Author: bradtofel Date: 2010-04-14 21:37:21 +0000 (Wed, 14 Apr 2010) Log Message: ----------- FEATURE: Now calls setClosest() on closest result in Replay mode 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-04-14 21:33:02 UTC (rev 3042) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-04-14 21:37:21 UTC (rev 3043) @@ -453,6 +453,7 @@ // TODO: check which versions are actually accessible right now? CaptureSearchResult closest = captureResults.getClosest(wbRequest, useAnchorWindow); + closest.setClosest(true); resource = collection.getResourceStore().retrieveResource(closest); p.retrieved(); ReplayRenderer renderer = replay.getRenderer(wbRequest, closest, resource); 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-06-05 01:23:15
|
Revision: 3152 http://archive-access.svn.sourceforge.net/archive-access/?rev=3152&view=rev Author: bradtofel Date: 2010-06-05 01:23:08 +0000 (Sat, 05 Jun 2010) Log Message: ----------- allowed configuration of the Interstitial jsp page. changed behavior of the interstitial page to only fire if a Referer header is sent, but not from our allowed host now static files which end in "-wrap.jsp" get the UI wrapper applied to them. 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-06-05 01:20:16 UTC (rev 3151) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-06-05 01:23:08 UTC (rev 3152) @@ -83,7 +83,7 @@ public class AccessPoint extends AbstractRequestHandler implements ShutdownListener { /** webapp relative location of Interstitial.jsp */ - public final static String INTERSTITIAL_JSP = "jsp/Interstitial.jsp"; + public final static String INTERSTITIAL_JSP = "jsp/Interstitial-wrap.jsp"; /** argument for Interstitial.jsp target URL */ public final static String INTERSTITIAL_TARGET = "target"; /** argument for Interstitial.jsp seconds to delay */ @@ -106,6 +106,7 @@ private String replayPrefix = null; private String wrapperJsp = "/WEB-INF/template/UI-wrapper.jsp"; + private String interstitialJsp = INTERSTITIAL_JSP; private String refererAuth = null; @@ -133,13 +134,13 @@ return false; } // String contextRelativePath = httpRequest.getServletPath(); - String translated = "/" + translateRequestPath(httpRequest); + String translatedNoQuery = "/" + translateRequestPath(httpRequest); // String absPath = getServletContext().getRealPath(contextRelativePath); - String absPath = getServletContext().getRealPath(translated); + String absPath = getServletContext().getRealPath(translatedNoQuery); File test = new File(absPath); if(test.exists()) { - String translated2 = "/" + translateRequestPathQuery(httpRequest); + String translatedQ = "/" + translateRequestPathQuery(httpRequest); WaybackRequest wbRequest = new WaybackRequest(); // wbRequest.setContextPrefix(getUrlRoot()); @@ -147,7 +148,12 @@ wbRequest.fixup(httpRequest); UIResults uiResults = new UIResults(wbRequest,uriConverter); try { - uiResults.forward(httpRequest, httpResponse, translated2); + if(translatedNoQuery.endsWith("-wrap.jsp")) { + uiResults.forwardWrapped(httpRequest, httpResponse, + translatedQ, wrapperJsp); + } else { + uiResults.forward(httpRequest, httpResponse, translatedQ); + } return true; } catch(IOException e) { // TODO: figure out if we got IO because of a missing dispatcher @@ -273,16 +279,16 @@ private void checkInterstitialRedirect(HttpServletRequest httpRequest) throws BetterRequestException { - if(refererAuth != null) { + if((refererAuth != null) && (refererAuth.length() > 0)) { String referer = httpRequest.getHeader("Referer"); - if((referer == null) || (!referer.contains(refererAuth))) { + if((referer != null) && (referer.length() > 0) && (!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(interstitialJsp); u.append("?"); u.append(INTERSTITIAL_SECONDS).append("=").append(5); u.append("&"); @@ -562,6 +568,20 @@ } /** + * @param interstitialJsp the interstitialJsp to set + */ + public void setInterstitialJsp(String interstitialJsp) { + this.interstitialJsp = interstitialJsp; + } + + /** + * @return the interstitialJsp + */ + public String getInterstitialJsp() { + return interstitialJsp; + } + + /** * @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-06-18 00:39:02
|
Revision: 3156 http://archive-access.svn.sourceforge.net/archive-access/?rev=3156&view=rev Author: bradtofel Date: 2010-06-18 00:38:56 +0000 (Fri, 18 Jun 2010) Log Message: ----------- made wrapperJsp optional... duh. 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-06-14 19:17:21 UTC (rev 3155) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-06-18 00:38:56 UTC (rev 3156) @@ -105,7 +105,8 @@ private String queryPrefix = null; private String replayPrefix = null; - private String wrapperJsp = "/WEB-INF/template/UI-wrapper.jsp"; +// private String wrapperJsp = "/WEB-INF/template/UI-wrapper.jsp"; + private String wrapperJsp = null; private String interstitialJsp = INTERSTITIAL_JSP; private String refererAuth = null; @@ -148,7 +149,9 @@ wbRequest.fixup(httpRequest); UIResults uiResults = new UIResults(wbRequest,uriConverter); try { - if(translatedNoQuery.endsWith("-wrap.jsp")) { + if(wrapperJsp != null && + translatedNoQuery.endsWith("-wrap.jsp")) { + uiResults.forwardWrapped(httpRequest, httpResponse, translatedQ, wrapperJsp); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-07-20 23:49:02
|
Revision: 3175 http://archive-access.svn.sourceforge.net/archive-access/?rev=3175&view=rev Author: bradtofel Date: 2010-07-20 23:48:56 +0000 (Tue, 20 Jul 2010) Log Message: ----------- FEATURE: add CaptureSearchResults to the exception if the problem is ResourceNotAvailable, allowing jsp to offer alternate versions. 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-07-20 19:17:09 UTC (rev 3174) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-07-20 23:48:56 UTC (rev 3175) @@ -329,8 +329,13 @@ CaptureSearchResult closest = captureResults.getClosest(wbRequest, isUseAnchorWindow()); closest.setClosest(true); - resource = - getCollection().getResourceStore().retrieveResource(closest); + try { + resource = + getCollection().getResourceStore().retrieveResource(closest); + } catch (ResourceNotAvailableException rnae) { + rnae.setCaptureSearchResults((CaptureSearchResults)results); + throw rnae; + } p.retrieved(); ReplayRenderer renderer = getReplay().getRenderer(wbRequest, closest, resource); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-08-03 00:33:22
|
Revision: 3203 http://archive-access.svn.sourceforge.net/archive-access/?rev=3203&view=rev Author: bradtofel Date: 2010-08-03 00:33:16 +0000 (Tue, 03 Aug 2010) Log Message: ----------- about to remove all "wrap" references.. 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-08-03 00:31:10 UTC (rev 3202) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2010-08-03 00:33:16 UTC (rev 3203) @@ -83,7 +83,7 @@ public class AccessPoint extends AbstractRequestHandler implements ShutdownListener { /** webapp relative location of Interstitial.jsp */ - public final static String INTERSTITIAL_JSP = "jsp/Interstitial-wrap.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 */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2011-02-06 14:32:39
|
Revision: 3389 http://archive-access.svn.sourceforge.net/archive-access/?rev=3389&view=rev Author: bradtofel Date: 2011-02-06 14:32:33 +0000 (Sun, 06 Feb 2011) Log Message: ----------- added embargo MS field, and now pass extra arguments to interstitial redirect page 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 2011-02-06 14:31:46 UTC (rev 3388) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2011-02-06 14:32:33 UTC (rev 3389) @@ -86,6 +86,11 @@ /** argument for Interstitial.jsp seconds to delay */ public final static String INTERSTITIAL_SECONDS = "seconds"; + /** argument for Interstitial.jsp msse for replay date */ + public final static String INTERSTITIAL_DATE = "date"; + /** argument for Interstitial.jsp URL being loaded */ + public final static String INTERSTITIAL_URL = "url"; + private static final Logger LOGGER = Logger.getLogger( AccessPoint.class.getName()); @@ -111,7 +116,8 @@ private Properties configs = null; private List<String> filePatterns = null; - private List<String> filePrefixes = null; + private List<String> fileIncludePrefixes = null; + private List<String> fileExcludePrefixes = null; private WaybackCollection collection = null; private ExceptionRenderer exception = new BaseExceptionRenderer(); @@ -122,6 +128,7 @@ private ExclusionFilterFactory exclusionFactory = null; private BooleanOperator<WaybackRequest> authentication = null; + private long embargoMS = 0; protected boolean dispatchLocal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) @@ -271,7 +278,8 @@ } } - private void checkInterstitialRedirect(HttpServletRequest httpRequest) + private void checkInterstitialRedirect(HttpServletRequest httpRequest, + WaybackRequest wbRequest) throws BetterRequestException { if((refererAuth != null) && (refererAuth.length() > 0)) { String referer = httpRequest.getHeader("Referer"); @@ -286,6 +294,16 @@ u.append("?"); u.append(INTERSTITIAL_SECONDS).append("=").append(5); u.append("&"); + u.append(INTERSTITIAL_DATE).append("=").append(wbRequest.getReplayDate().getTime()); + u.append("&"); + u.append(INTERSTITIAL_URL).append("="); + try { + u.append(URLEncoder.encode(wbRequest.getRequestUrl(), "UTF-8")); + } catch (UnsupportedEncodingException e) { + // not gonna happen... + u.append(wbRequest.getRequestUrl()); + } + u.append("&"); u.append(INTERSTITIAL_TARGET).append("="); try { u.append(URLEncoder.encode(sb.toString(), "UTF-8")); @@ -293,6 +311,7 @@ // not gonna happen... u.append(sb.toString()); } + throw new BetterRequestException(u.toString()); } } @@ -304,7 +323,7 @@ Resource resource = null; try { - checkInterstitialRedirect(httpRequest); + checkInterstitialRedirect(httpRequest,wbRequest); PerformanceLogger p = new PerformanceLogger("replay"); SearchResults results = @@ -676,8 +695,8 @@ * @return List of file String prefixes that will be matched when querying * the ResourceIndex */ - public List<String> getFilePrefixes() { - return filePrefixes; + public List<String> getFileIncludePrefixes() { + return fileIncludePrefixes; } /** @@ -685,11 +704,28 @@ * when querying the ResourceIndex - only SearchResults from files * with a prefix matching one of those in this List will be returned. */ - public void setFilePrefixes(List<String> filePrefixes) { - this.filePrefixes = filePrefixes; + public void setFileIncludePrefixes(List<String> fileIncludePrefixes) { + this.fileIncludePrefixes = fileIncludePrefixes; } + /** + * @return List of file String prefixes that will be matched when querying + * the ResourceIndex + */ + public List<String> getFileExcludePrefixes() { + return fileExcludePrefixes; + } + /** + * @param filePrefixes List of String file prefixes that will be matched + * when querying the ResourceIndex - only SearchResults from files + * with a prefix matching one of those in this List will be returned. + */ + public void setFileExcludePrefixes(List<String> fileExcludePrefixes) { + this.fileExcludePrefixes = fileExcludePrefixes; + } + + /** * @return the WaybackCollection used by this AccessPoint @@ -854,4 +890,11 @@ public void setBounceToQueryPrefix(boolean bounceToQueryPrefix) { this.bounceToQueryPrefix = bounceToQueryPrefix; } + + public long getEmbargoMS() { + return embargoMS; + } + public void setEmbargoMS(long ms) { + this.embargoMS = ms; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2011-02-09 22:04:54
|
Revision: 3416 http://archive-access.svn.sourceforge.net/archive-access/?rev=3416&view=rev Author: bradtofel Date: 2011-02-09 22:04:47 +0000 (Wed, 09 Feb 2011) Log Message: ----------- BUGFIX(WWM-36): now only bounces to live web handling for Replay requests 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 2011-02-09 07:03:26 UTC (rev 3415) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2011-02-09 22:04:47 UTC (rev 3416) @@ -245,18 +245,15 @@ handled = true; } catch(WaybackException e) { - boolean drawError = true; - if(e instanceof ResourceNotInArchiveException) { - if((getLiveWebPrefix() != null) - && (getLiveWebPrefix().length() > 0)) { + if((e instanceof ResourceNotInArchiveException) + && wbRequest.isReplayRequest() + && (getLiveWebPrefix() != null) + && (getLiveWebPrefix().length() > 0)) { - String liveUrl = - getLiveWebPrefix() + wbRequest.getRequestUrl(); - httpResponse.sendRedirect(liveUrl); - drawError = false; - } - } - if(drawError) { + String liveUrl = + getLiveWebPrefix() + wbRequest.getRequestUrl(); + httpResponse.sendRedirect(liveUrl); + } else { logNotInArchive(e,wbRequest); getException().renderException(httpRequest, httpResponse, wbRequest, e, getUriConverter()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2011-05-25 01:03:23
|
Revision: 3440 http://archive-access.svn.sourceforge.net/archive-access/?rev=3440&view=rev Author: bradtofel Date: 2011-05-25 01:03:17 +0000 (Wed, 25 May 2011) Log Message: ----------- JAVADOC 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 2011-05-25 01:02:18 UTC (rev 3439) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2011-05-25 01:03:17 UTC (rev 3440) @@ -702,7 +702,7 @@ } /** - * @param filePrefixes List of String file prefixes that will be matched + * @param fileIncludePrefixes List of String file prefixes that will be matched * when querying the ResourceIndex - only SearchResults from files * with a prefix matching one of those in this List will be returned. */ @@ -719,7 +719,7 @@ } /** - * @param filePrefixes List of String file prefixes that will be matched + * @param fileExcludePrefixes List of String file prefixes that will be matched * when querying the ResourceIndex - only SearchResults from files * with a prefix matching one of those in this List will be returned. */ @@ -893,9 +893,15 @@ this.bounceToQueryPrefix = bounceToQueryPrefix; } + /** + * @return the configured number of MS for min age to return from the index + */ public long getEmbargoMS() { return embargoMS; } + /** + * @param ms minimum number of MS age for content to be served from the index + */ public void setEmbargoMS(long ms) { this.embargoMS = ms; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2011-06-16 17:19:39
|
Revision: 3475 http://archive-access.svn.sourceforge.net/archive-access/?rev=3475&view=rev Author: bradtofel Date: 2011-06-16 17:19:34 +0000 (Thu, 16 Jun 2011) Log Message: ----------- LOGGING 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 2011-06-16 17:18:09 UTC (rev 3474) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2011-06-16 17:19:34 UTC (rev 3475) @@ -26,6 +26,7 @@ import java.util.List; import java.util.Locale; import java.util.Properties; +import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; @@ -133,6 +134,9 @@ protected boolean dispatchLocal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { + if(LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Local dispatch /" + translateRequestPath(httpRequest)); + } if(!serveStatic) { return false; } @@ -179,7 +183,7 @@ Thread.currentThread().setName("Thread " + Thread.currentThread().getId() + " " + getBeanName() + " handling: " + inputPath); - + LOGGER.fine("Handling translated: " + inputPath); wbRequest = getParser().parse(httpRequest, this); if(wbRequest != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2011-09-06 03:46:50
|
Revision: 3513 http://archive-access.svn.sourceforge.net/archive-access/?rev=3513&view=rev Author: bradtofel Date: 2011-09-06 03:46:44 +0000 (Tue, 06 Sep 2011) Log Message: ----------- FEATURE: - added configuration to force clean queries, rather than forcing it to be active - added configuration of additional AccessPoint specific filter factories for search results - implemented AccessPointAware configuration of collaborating components 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 2011-09-06 03:43:17 UTC (rev 3512) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2011-09-06 03:46:44 UTC (rev 3513) @@ -102,6 +102,7 @@ private boolean serveStatic = true; private boolean bounceToReplayPrefix = false; private boolean bounceToQueryPrefix = false; + private boolean forceCleanQueries = false; private String liveWebPrefix = null; private String staticPrefix = null; @@ -130,7 +131,13 @@ private ExclusionFilterFactory exclusionFactory = null; private BooleanOperator<WaybackRequest> authentication = null; private long embargoMS = 0; + private CustomResultFilterFactory filterFactory = null; + public void init() { + checkAccessPointAware(collection,exception,query,parser,replay, + uriConverter,exclusionFactory, authentication, filterFactory); + } + protected boolean dispatchLocal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException { @@ -284,6 +291,17 @@ } } + protected void checkAccessPointAware(Object...os) { + if(os != null) { + for(Object o : os) { + if(o instanceof AccessPointAware) { + AccessPointAware apa = (AccessPointAware) o; + apa.setAccessPoint(this); + } + } + } + } + private void checkInterstitialRedirect(HttpServletRequest httpRequest, WaybackRequest wbRequest) throws BetterRequestException { @@ -323,7 +341,7 @@ } } - private void handleReplay(WaybackRequest wbRequest, + protected void handleReplay(WaybackRequest wbRequest, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException, ServletException, WaybackException { Resource resource = null; @@ -399,7 +417,7 @@ } } - private void handleQuery(WaybackRequest wbRequest, + protected void handleQuery(WaybackRequest wbRequest, HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws ServletException, IOException, WaybackException { @@ -909,4 +927,32 @@ public void setEmbargoMS(long ms) { this.embargoMS = ms; } + + /** + * @return the forceCleanQueries + */ + public boolean isForceCleanQueries() { + return forceCleanQueries; + } + + /** + * @param forceCleanQueries the forceCleanQueries to set + */ + public void setForceCleanQueries(boolean forceCleanQueries) { + this.forceCleanQueries = forceCleanQueries; + } + + /** + * @param filterFactory the filterFactory to set + */ + public void setFilterFactory(CustomResultFilterFactory filterFactory) { + this.filterFactory = filterFactory; + } + + /** + * @return the filterFactory + */ + public CustomResultFilterFactory getFilterFactory() { + return filterFactory; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2011-10-25 01:13:11
|
Revision: 3550 http://archive-access.svn.sourceforge.net/archive-access/?rev=3550&view=rev Author: bradtofel Date: 2011-10-25 01:13:05 +0000 (Tue, 25 Oct 2011) Log Message: ----------- FEATURE: Now delegates response generation to the BetterRequestException 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 2011-10-25 01:04:13 UTC (rev 3549) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/webapp/AccessPoint.java 2011-10-25 01:13:05 UTC (rev 3550) @@ -254,10 +254,7 @@ } } catch(BetterRequestException e) { - - httpResponse.setStatus(e.getStatus()); - httpResponse.setHeader("Location", e.getBetterURI()); -// httpResponse.sendRedirect(e.getBetterURI()); + e.generateResponse(httpResponse); handled = true; } catch(WaybackException e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |