From: <bra...@us...> - 2009-11-06 03:19:40
|
Revision: 2903 http://archive-access.svn.sourceforge.net/archive-access/?rev=2903&view=rev Author: bradtofel Date: 2009-11-06 03:19:32 +0000 (Fri, 06 Nov 2009) Log Message: ----------- FEATURE: now displays alternate URLs users can try, primarily useful with exactHostMatch AccessPoint property 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 2009-11-06 03:15:50 UTC (rev 2902) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2009-11-06 03:19:32 UTC (rev 2903) @@ -1,12 +1,18 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.List" %> <%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.exception.ResourceNotInArchiveException"%> <%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% UIResults results = UIResults.extractException(request); WaybackException e = results.getException(); e.setupResponse(response); +String contextRoot = results.getWbRequest().getContextPrefix(); + %> + <jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> <% @@ -16,4 +22,24 @@ <h2><%= fmt.format(e.getTitleKey()) %></h2> <p><b><%= fmt.format(e.getMessageKey(),e.getMessage()) %></b></p> +<% +if(e instanceof ResourceNotInArchiveException) { + ResourceNotInArchiveException niae = (ResourceNotInArchiveException) e; + List<String> closeMatches = niae.getCloseMatches(); + if(closeMatches != null && !closeMatches.isEmpty()) { +%> + Other requests to try:<br> +<% + WaybackRequest tmp = results.getWbRequest().clone(); + for(String closeMatch : closeMatches) { + tmp.setRequestUrl(closeMatch); + String link = tmp.getContextPrefix() + "query?" + + tmp.getQueryArguments(); +%> + <a href="<%= link %>"><%= closeMatch %></a><br> +<% + } + } +} +%> <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-04-14 21:50:39
|
Revision: 3046 http://archive-access.svn.sourceforge.net/archive-access/?rev=3046&view=rev Author: bradtofel Date: 2010-04-14 21:50:33 +0000 (Wed, 14 Apr 2010) Log Message: ----------- FEATURE: NotInArchive error page now may provide link to url prefix search in parent directory of missing resource 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-04-14 21:44:57 UTC (rev 3045) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-04-14 21:50:33 UTC (rev 3046) @@ -5,12 +5,14 @@ <%@ 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" %> <% UIResults results = UIResults.extractException(request); WaybackException e = results.getException(); +WaybackRequest wbr = results.getWbRequest(); e.setupResponse(response); -String contextRoot = results.getWbRequest().getContextPrefix(); - +String contextRoot = wbr.getContextPrefix(); +String requestUrl = wbr.getRequestUrl(); %> <jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> @@ -28,9 +30,10 @@ List<String> closeMatches = niae.getCloseMatches(); if(closeMatches != null && !closeMatches.isEmpty()) { %> - Other requests to try:<br> + <p> + Other possible close matches to try:<br></br> <% - WaybackRequest tmp = results.getWbRequest().clone(); + WaybackRequest tmp = wbr.clone(); for(String closeMatch : closeMatches) { tmp.setRequestUrl(closeMatch); String link = tmp.getContextPrefix() + "query?" + @@ -40,6 +43,23 @@ <% } } + String parentUrl = UrlOperations.getUrlParentDir(requestUrl); + if(parentUrl != null) { + WaybackRequest tmp = wbr.clone(); + tmp.setRequestUrl(parentUrl); + tmp.setUrlQueryRequest(); + String link = tmp.getContextPrefix() + "query?" + + tmp.getQueryArguments(); + String escapedLink = fmt.escapeHtml(link); + String escapedParentUrl = fmt.escapeHtml(parentUrl); + %> + </p> + <p> + More options:<br></br> + Try Searching all pages under <a href="<%= escapedLink %>"><%= escapedParentUrl %></a> + </p> + <% + } } %> <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: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-06-01 19:37:58
|
Revision: 3135 http://archive-access.svn.sourceforge.net/archive-access/?rev=3135&view=rev Author: bradtofel Date: 2010-06-01 19:37:52 +0000 (Tue, 01 Jun 2010) Log Message: ----------- Removed header/footer includes, now uses the UI-wrapper.jsp 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-06-01 19:37:08 UTC (rev 3134) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-06-01 19:37:52 UTC (rev 3135) @@ -26,11 +26,7 @@ String queryPrefix = wbr.getAccessPoint().getQueryPrefix(); String replayPrefix = wbr.getAccessPoint().getReplayPrefix(); String requestUrl = wbr.getRequestUrl(); -%> -<jsp:include page="/WEB-INF/template/UI-header.jsp" flush="true" /> -<% - StringFormatter fmt = results.getWbRequest().getFormatter(); %> @@ -108,4 +104,3 @@ <% } %> -<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-07-06 22:23:38
|
Revision: 3166 http://archive-access.svn.sourceforge.net/archive-access/?rev=3166&view=rev Author: bradtofel Date: 2010-07-06 22:23:32 +0000 (Tue, 06 Jul 2010) Log Message: ----------- 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-07-06 22:22:12 UTC (rev 3165) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-07-06 22:23:32 UTC (rev 3166) @@ -1,7 +1,9 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <%@ page import="java.util.List" %> <%@ page import="java.util.Date" %> +<%@ page import="java.util.Iterator" %> <%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.ResultURIConverter" %> <%@ page import="org.archive.wayback.exception.ResourceNotInArchiveException"%> <%@ page import="org.archive.wayback.exception.ResourceNotAvailableException"%> <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> @@ -29,17 +31,39 @@ StringFormatter fmt = results.getWbRequest().getFormatter(); %> +<jsp:include page="/WEB-INF/global-template/UI-header.jsp" flush="true" /> -<h2><%= fmt.format(e.getTitleKey()) %></h2> -<p><b><%= fmt.format(e.getMessageKey(),e.getMessage()) %></b></p> + <div id="positionHome"> + <section> + <div id="logoHome"> + <h1><span>Internet Archive's Wayback Machine</span></h1> + </div> + </section> + <section> + <div id="searchHome"> + <form name="form1" method="get" action="<%= queryPrefix %>query"> + <input type="hidden" name="<%= WaybackRequest.REQUEST_TYPE %>" value="<%= WaybackRequest.REQUEST_CAPTURE_QUERY %>"> + <input type="text" name="<%= WaybackRequest.REQUEST_URL %>" value="http://" size="40"> + <button type="submit" name="Submit">Go Wayback!</button> + </form> + <div id="searchAdvHome"> + <a href="[ADVANCED SEARCH]">Advanced Search</a> + </div> + </div> + </section> + <section> + <div id="error"> + + <h2><%= fmt.format(e.getTitleKey()) %></h2> + <p><%= fmt.format(e.getMessageKey(),e.getMessage()) %></p> <% if(e instanceof ResourceNotInArchiveException) { ResourceNotInArchiveException niae = (ResourceNotInArchiveException) e; List<String> closeMatches = niae.getCloseMatches(); if(closeMatches != null && !closeMatches.isEmpty()) { %> - <p> - Other possible close matches to try:<br></br> + <p>Other possible close matches to try:</p> + <p> <% WaybackRequest tmp = wbr.clone(); for(String closeMatch : closeMatches) { @@ -47,7 +71,7 @@ String link = queryPrefix + "query?" + tmp.getQueryArguments(); %> - <a href="<%= link %>"><%= closeMatch %></a><br> + <a href="<%= link %>"><%= closeMatch %></a><br/> <% } } @@ -61,46 +85,58 @@ String escapedLink = fmt.escapeHtml(link); String escapedParentUrl = fmt.escapeHtml(parentUrl); %> - </p> - <p> - More options:<br></br> - Try Searching all pages under <a href="<%= escapedLink %>"><%= escapedParentUrl %></a> - </p> + </p> + <p>More options:</p> + <p>Try Searching all pages under <a href="<%= escapedLink %>"><%= escapedParentUrl %></a></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> <% - } + ResourceNotAvailableException rnae = (ResourceNotAvailableException) e; + + CaptureSearchResults cResults = rnae.getCaptureSearchResults(); + Iterator<CaptureSearchResult> itr = cResults.iterator(); + CaptureSearchResult prev = null; + CaptureSearchResult next = null; + while(itr.hasNext()) { + CaptureSearchResult cur = itr.next(); + if(cur.isClosest()) { + break; } + prev = cur; + } + if(itr.hasNext()) { + next = itr.next(); + } + if((prev != null) || (next != null)) { + String dateFormat = "{0,date,MMMM dd, yyyy HH:mm:ss}"; + ResultURIConverter conv = wbr.getAccessPoint().getUriConverter(); + %> + <div>Or try another close version:</div> + <% + if(prev != null) { + String safePrevReplay = fmt.escapeHtml(conv.makeReplayURI(prev.getCaptureTimestamp(),prev.getOriginalUrl())); + %> + <div>Previous:<a href="<%= safePrevReplay %>"><%= fmt.format(dateFormat,prev.getCaptureDate())%></a></div> + <% + } + if(next != null) { + String safeNextReplay = fmt.escapeHtml(conv.makeReplayURI(next.getCaptureTimestamp(),next.getOriginalUrl())); + %> + <div>Next:<a href="<%= safeNextReplay %>"><%= fmt.format(dateFormat,next.getCaptureDate())%></a></div> + <% + } + } %> </div> <% } %> + + </div> + </section> + <div id="errorBorder"></div> + +<jsp:include page="/WEB-INF/global-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-07-20 23:50:17
|
Revision: 3177 http://archive-access.svn.sourceforge.net/archive-access/?rev=3177&view=rev Author: bradtofel Date: 2010-07-20 23:50:10 +0000 (Tue, 20 Jul 2010) Log Message: ----------- 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-07-20 23:49:44 UTC (rev 3176) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-07-20 23:50:10 UTC (rev 3177) @@ -36,7 +36,7 @@ <div id="positionHome"> <section> <div id="logoHome"> - <h1><span>Internet Archive's Wayback Machine</span></h1> + <a href="/index.jsp"><h1><span>Internet Archive's Wayback Machine</span></h1></a> </div> </section> <section> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2010-08-10 23:26:36
|
Revision: 3227 http://archive-access.svn.sourceforge.net/archive-access/?rev=3227&view=rev Author: bradtofel Date: 2010-08-10 23:26:30 +0000 (Tue, 10 Aug 2010) Log Message: ----------- backed out to something closer to the original 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-08-10 23:15:22 UTC (rev 3226) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/WEB-INF/exception/HTMLError.jsp 2010-08-10 23:26:30 UTC (rev 3227) @@ -35,23 +35,6 @@ <div id="positionHome"> <section> - <div id="logoHome"> - <a href="/index.jsp"><h1><span>Internet Archive's Wayback Machine</span></h1></a> - </div> - </section> - <section> - <div id="searchHome"> - <form name="form1" method="get" action="<%= queryPrefix %>query"> - <input type="hidden" name="<%= WaybackRequest.REQUEST_TYPE %>" value="<%= WaybackRequest.REQUEST_CAPTURE_QUERY %>"> - <input type="text" name="<%= WaybackRequest.REQUEST_URL %>" value="http://" size="40"> - <button type="submit" name="Submit">Go Wayback!</button> - </form> - <div id="searchAdvHome"> - <a href="[ADVANCED SEARCH]">Advanced Search</a> - </div> - </div> - </section> - <section> <div id="error"> <h2><%= fmt.format(e.getTitleKey()) %></h2> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |