From: <bra...@us...> - 2007-08-23 23:52:52
|
Revision: 1937 http://archive-access.svn.sourceforge.net/archive-access/?rev=1937&view=rev Author: bradtofel Date: 2007-08-23 16:52:07 -0700 (Thu, 23 Aug 2007) Log Message: ----------- INITIAL-REV: .jsp which renders HTML for a timeline suitable for insertion in replayed HTML pages. Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp Added: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp 2007-08-23 23:52:07 UTC (rev 1937) @@ -0,0 +1,327 @@ +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.Date" %> +<%@ page import="java.text.ParseException" %> +<%@ page import="org.archive.wayback.WaybackConstants" %> +<%@ page import="org.archive.wayback.core.SearchResult" %> +<%@ page import="org.archive.wayback.core.Timestamp" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> +<%@ page import="org.archive.wayback.query.UIQueryResults" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsTimelinePartitionsFactory" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + + request.getServerPort() + request.getContextPath(); + +UIQueryResults results = (UIQueryResults) UIResults.getFromRequest(request); +StringFormatter fmt = results.getFormatter(); + +Timestamp searchStartTs = results.getStartTimestamp(); +Timestamp searchEndTs = results.getEndTimestamp(); +Timestamp exactTs = results.getExactRequestedTimestamp(); +String searchUrl = results.getSearchUrl(); +Date exactDate = exactTs.getDate(); + +String exactDateStr = exactTs.getDateStr(); +WaybackRequest wbRequest = results.getWbRequest(); +String resolution = wbRequest.get(WaybackConstants.REQUEST_RESOLUTION); +if(resolution == null) { + resolution = WaybackConstants.REQUEST_RESOLUTION_AUTO; +} +String metaMode = wbRequest.get(WaybackConstants.REQUEST_META_MODE); +String metaChecked = ""; +if(metaMode != null && metaMode.equals("yes")) { + metaChecked = "checked"; +} + +String searchString = results.getSearchUrl(); + +SearchResult first = null; +SearchResult prev = null; +SearchResult next = null; +SearchResult last = null; + +int resultCount = results.getResultsReturned(); +int resultIndex = 1; +Iterator it = results.resultsIterator(); +while(it.hasNext()) { + SearchResult res = (SearchResult) it.next(); + String resDateStr = res.get(WaybackConstants.RESULT_CAPTURE_DATE); + int compared = resDateStr.compareTo(exactDateStr.substring(0,resDateStr.length())); + if(compared < 0) { + resultIndex++; + prev = res; + if(first == null) { + first = res; + } + } else if(compared > 0) { + last = res; + if(next == null) { + next = res; + } + } +} +// string to indicate which select option is currently active +String yearsOptSelected = ""; +String monthsOptSelected = ""; +String daysOptSelected = ""; +String hoursOptSelected = ""; +String autoOptSelected = ""; + +String minResolution = ResultsTimelinePartitionsFactory.getMinResolution( + results.getResults()); + +String optimal = ""; +if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { + optimal = fmt.format("TimelineView.timeRange.hours"); +} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { + optimal = fmt.format("TimelineView.timeRange.days"); +} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { + optimal = fmt.format("TimelineView.timeRange.months"); +} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { + optimal = fmt.format("TimelineView.timeRange.years"); +} else { + optimal = fmt.format("TimelineView.timeRange.unknown"); +} +String autoOptString = fmt.format("TimelineView.timeRange.auto",optimal); + +ArrayList partitions; +if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { + hoursOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getHour(results.getResults(), + wbRequest); +} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { + daysOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getDay(results.getResults(), + wbRequest); +} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { + monthsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getMonth(results.getResults(), + wbRequest); +} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { + yearsOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getYear(results.getResults(), + wbRequest); +} else { + autoOptSelected = "selected"; + partitions = ResultsTimelinePartitionsFactory.getAuto(results.getResults(), + wbRequest); +} +int numPartitions = partitions.size(); +ResultsPartition firstP = (ResultsPartition) partitions.get(0); +ResultsPartition lastP = (ResultsPartition) partitions.get(numPartitions -1); + +String firstDate = firstP.getTitle(); +String lastDate = lastP.getTitle(); +String titleString = ""; +%> +<link rel="stylesheet" href="<%= contextRoot %>/css/timeline.css" type="text/css"> +<script type="text/javascript"> + function changeResolution() { + document.timeline.submit(); + } + function changeMeta() { + document.timeline.submit(); + } + +var open = true; + +function handleDragClick() { + var daDiv = document.getElementById("wm-ipp"); + var daDraggerDiv = document.getElementById("wm-dragger"); + while(daDraggerDiv.hasChildNodes()) { + daDraggerDiv.removeChild(daDraggerDiv.firstChild); + } + var newText; + if(open) { + open = false; + daDiv.style.width = "100px"; + newText = "<"; + } else { + open = true; + daDiv.style.width = "100%"; + newText = ">"; + } + daDraggerDiv.appendChild(document.createTextNode(newText)); +} + + +</script> +<!-- +overflow:hidden; border-width:1; border-style:outset; width:100%; height:80px; right:0; top:0; background-color:#dddddd; + --> +<div id="wm-ipp" style="position:relative;z-index:99999;border:1px solid;color:black;background-color:lightYellow;font-size:10px;font-family:sans-serif;padding:5px" > +<!-- +<div onclick="handleDragClick()" id="wm-dragger" style="height:25px; width:100%; border-width:1; border-style:outset; background-color:#cccccc; text-align:right;"> +< +</div> + --> +<table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td width="1" nowrap></td> + <td> + <!-- Viewing --> + <table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td> + <span class="smallboldfont"><%= fmt.format("TimelineView.viewingVersion",resultIndex,resultCount) %> </span> + </td> + </tr> + <tr> + <td nowrap><span class="title"> <%= fmt.format("TimelineView.viewingVersionDate",exactDate) %> </span> </td> + </tr> + </table> + </td> + <td width="400"> + <table> + <tr> + <td width="50%"></td> + <td> + <table cellspacing="0" border="0" cellpadding="0" width="100%"> + <tr> + <td width="48%" nowrap><span class="smallfont"><%= firstDate %></span></td> + <td align="center" valign="bottom" nowrap><img wmSpecial="1" src="<%= contextRoot %>/images/mark.jpg"></td> + <td width="48%" nowrap align="right"><span class="smallfont"><%= lastDate %></span></td> + </tr> + </table> + </td> + <td width="50%"></td> + </tr> + <tr> + <td nowrap align="right"><% + titleString = ""; + if(first != null) { + titleString = "title=\"" + + fmt.format("TimelineView.firstVersionTitle", + results.resultToDate(first)) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(first) %>"><% + } + %><img <%= titleString %> wmSpecial="1" border=0 width=19 height=20 src="<%= contextRoot %>/images/first.jpg"><% + if(first != null) { + %></a><% + } + titleString = ""; + if(prev != null) { + titleString = "title=\"" + + fmt.format("TimelineView.prevVersionTitle", + results.resultToDate(prev)) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(prev) %>"><% + } + %><img <%= titleString %> wmSpecial="1" border=0 width=13 height=20 src="<%= contextRoot %>/images/prev.jpg"><% + if(first != null) { + %></a><% + } + %></td> + <td nowrap><% + + for(int i = 0; i < numPartitions; i++) { + ResultsPartition partition = (ResultsPartition) partitions.get(i); + ArrayList partitionResults = partition.getMatches(); + int numResults = partitionResults.size(); + String imageUrl = contextRoot + "/images/line.jpg"; + String replayUrl = null; + String prettyDateTime = null; + if(numResults == 1) { + imageUrl = contextRoot + "/images/mark_one.jpg"; + SearchResult result = (SearchResult) partitionResults.get(0); + replayUrl = results.resultToReplayUrl(result); + prettyDateTime = fmt.format("TimelineView.markDateTitle",results.resultToDate(result)); + + } else if (numResults > 1) { + imageUrl = contextRoot + "/images/mark_several.jpg"; + SearchResult result = (SearchResult) partitionResults.get(numResults - 1); + replayUrl = results.resultToReplayUrl(result); + prettyDateTime = fmt.format("TimelineView.markDateTitle",results.resultToDate(result)); + + } + if((i > 0) && (i < numPartitions)) { + +%><img wmSpecial="1" border=0 width=1 height=16 src="<%= contextRoot %>/images/linemark.jpg"><% + + } + + if(replayUrl == null) { + +%><img wmSpecial="1" border=0 width=7 height=16 src="<%= imageUrl %>"><% + + } else { + +%><a wmSpecial="1" href="<%= replayUrl %>"><img wmSpecial="1" border=0 width=7 height=16 title="<%= prettyDateTime %>" src="<%= imageUrl %>"></a><% + + } + } + +%></td> + <td nowrap><% + titleString = ""; + if(next != null) { + titleString = "title=\"" + + fmt.format("TimelineView.nextVersionTitle", + results.resultToDate(next)) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(next) %>"><% + } + %><img wmSpecial="1" <%= titleString %> border=0 width=13 height=20 src="<%= contextRoot %>/images/next.jpg"><% + if(first != null) { + %></a><% + } + titleString = ""; + if(last != null) { + titleString = "title=\"" + + fmt.format("TimelineView.lastVersionTitle", + results.resultToDate(last)) + "\""; + %><a wmSpecial="1" href="<%= results.resultToReplayUrl(last) %>"><% + } + %><img wmSpecial="1" <%= titleString %> border=0 width=19 height=20 src="<%= contextRoot %>/images/last.jpg"><% + if(first != null) { + %></a><% + } + %></td> + </tr> + </table> + </td> + <td align="right"> + <!-- Resolution --> + <form wmSpecial="1" name="timeline" method="GET" target="_top" action="<%= contextRoot + "/frameset" %>"> + <input type="hidden" name="url" value="<%= searchUrl %>"> + <input type="hidden" name="exactdate" value="<%= exactDateStr %>"> + <input type="hidden" name="type" value="urlclosestquery"> + <%= fmt.format("TimelineView.timeRange") %> + <select NAME="resolution" SIZE="1" onChange="changeResolution()"> + <option <%= yearsOptSelected %> value="years"> + <%= fmt.format("TimelineView.timeRange.years") %> + </option> + <option <%= monthsOptSelected %> value="months"> + <%= fmt.format("TimelineView.timeRange.months") %> + </option> + <option <%= daysOptSelected %> value="days"> + <%= fmt.format("TimelineView.timeRange.days") %> + </option> + <option <%= hoursOptSelected %> value="hours"> + <%= fmt.format("TimelineView.timeRange.hours") %> + </option> + <option <%= autoOptSelected %> value="auto"><%= autoOptString %></option> + </select> <%= + fmt.format("TimelineView.metaDataCheck") + %><input type="checkbox" name="metamode" value="yes" <%= + metaChecked + %> onClick="changeMeta()"> <a href="help.php" target="_top"><%= + fmt.format("UIGlobal.helpLink") + %></a> + </form> + </td> + <td> + <img wmSpecial="1" alt='' height='1' src='images/1px.gif' width='5'> + </td> + </tr> +</table> +</div> +<script type="text/javascript"> + var daDiv = document.getElementById("wm-ipp"); + var daParentNode = daDiv.parentNode; + var daBody = document.body; + daParentNode.removeChild(daDiv); + daBody.insertBefore(daDiv,daBody.firstChild); +</script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2007-08-29 00:17:42
|
Revision: 1964 http://archive-access.svn.sourceforge.net/archive-access/?rev=1964&view=rev Author: bradtofel Date: 2007-08-28 17:17:41 -0700 (Tue, 28 Aug 2007) Log Message: ----------- TWEAK: 'flush="true"' on jsp:include tags Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLResults.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 2007-08-29 00:17:10 UTC (rev 1963) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp 2007-08-29 00:17:41 UTC (rev 1964) @@ -1,6 +1,6 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> -<jsp:include page="/template/UI-header.jsp" /> +<jsp:include page="/template/UI-header.jsp" flush="true" /> <% UIResults results = UIResults.getFromRequest(request); @@ -23,4 +23,4 @@ <input type="HIDDEN" name="type" value="replay"> <input type="SUBMIT" value="<%= fmt.format("AdvancedSearch.submitButton") %>"> </form> -<jsp:include page="/template/UI-footer.jsp" /> +<jsp:include page="/template/UI-footer.jsp" flush="true" /> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp 2007-08-29 00:17:10 UTC (rev 1963) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp 2007-08-29 00:17:41 UTC (rev 1964) @@ -1,10 +1,10 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> -<jsp:include page="/template/UI-header.jsp" /> +<jsp:include page="/template/UI-header.jsp" flush="true" /> <% UIResults results = UIResults.getFromRequest(request); StringFormatter fmt = results.getFormatter(); String url = "http://archive-access.sourceforge.net/projects/wayback/faq.html"; %> <%= fmt.format("UIGlobal.helpPage",url) %> -<jsp:include page="/template/UI-footer.jsp" /> +<jsp:include page="/template/UI-footer.jsp" flush="true" /> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp 2007-08-29 00:17:10 UTC (rev 1963) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp 2007-08-29 00:17:41 UTC (rev 1964) @@ -1,6 +1,6 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> -<jsp:include page="template/UI-header.jsp" /> +<jsp:include page="template/UI-header.jsp" flush="true" /> <% UIResults results = UIResults.getFromRequest(request); StringFormatter fmt = results.getFormatter(); @@ -8,4 +8,4 @@ <p> <%= fmt.format("UIGlobal.indexPage") %> </p> -<jsp:include page="template/UI-footer.jsp" /> +<jsp:include page="template/UI-footer.jsp" flush="true" /> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp 2007-08-29 00:17:10 UTC (rev 1963) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp 2007-08-29 00:17:41 UTC (rev 1964) @@ -1,7 +1,7 @@ <%@ page import="org.archive.wayback.exception.WaybackException" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> -<jsp:include page="/template/UI-header.jsp" /> +<jsp:include page="/template/UI-header.jsp" flush="true" /> <% WaybackException e = (WaybackException) request.getAttribute("exception"); @@ -13,4 +13,4 @@ <h2><%= fmt.format(e.getTitleKey()) %></h2> <p><b><%= fmt.format(e.getMessageKey()) %></b></p> -<jsp:include page="/template/UI-footer.jsp" /> +<jsp:include page="/template/UI-footer.jsp" flush="true" /> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLResults.jsp 2007-08-29 00:17:10 UTC (rev 1963) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLResults.jsp 2007-08-29 00:17:41 UTC (rev 1964) @@ -9,7 +9,7 @@ <%@ page import="org.archive.wayback.query.UIQueryResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> -<jsp:include page="/template/UI-header.jsp" /> +<jsp:include page="/template/UI-header.jsp" flush="true" /> <% UIQueryResults results = (UIQueryResults) UIResults.getFromRequest(request); @@ -190,4 +190,4 @@ } %> -<jsp:include page="/template/UI-footer.jsp" /> +<jsp:include page="/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...> - 2008-01-30 00:49:32
|
Revision: 2141 http://archive-access.svn.sourceforge.net/archive-access/?rev=2141&view=rev Author: bradtofel Date: 2008-01-29 16:49:30 -0800 (Tue, 29 Jan 2008) Log Message: ----------- MOVED: wm.js into replay/ directory Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/wm.js Removed Paths: ------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/wm.js Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/wm.js (from rev 2140, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/wm.js) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/wm.js (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/wm.js 2008-01-30 00:49:30 UTC (rev 2141) @@ -0,0 +1,62 @@ + +function xResolveUrl(url) { + var image = new Image(); + image.src = url; + return image.src; +} +function xLateUrl(aCollection, sProp) { + var i = 0; + for(i = 0; i < aCollection.length; i++) { + if(aCollection[i].getAttribute(sProp) && + (aCollection[i].getAttribute(sProp).length > 0) && + (typeof(aCollection[i][sProp]) == "string")) { + + if(aCollection[i][sProp].indexOf("mailto:") == -1 && + aCollection[i][sProp].indexOf("javascript:") == -1) { + + var wmSpecial = aCollection[i].getAttribute("wmSpecial"); + if(wmSpecial && wmSpecial.length > 0) { + } else { + if(aCollection[i][sProp].indexOf("http") == 0) { + aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp]; + } else { + aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]); + } + } + } + } + } +} + +xLateUrl(document.getElementsByTagName("IMG"),"src"); +xLateUrl(document.getElementsByTagName("A"),"href"); +xLateUrl(document.getElementsByTagName("AREA"),"href"); +xLateUrl(document.getElementsByTagName("OBJECT"),"codebase"); +xLateUrl(document.getElementsByTagName("OBJECT"),"data"); +xLateUrl(document.getElementsByTagName("APPLET"),"codebase"); +xLateUrl(document.getElementsByTagName("APPLET"),"archive"); +xLateUrl(document.getElementsByTagName("EMBED"),"src"); +xLateUrl(document.getElementsByTagName("IFRAME"),"src"); +xLateUrl(document.getElementsByTagName("BODY"),"background"); +var forms = document.getElementsByTagName("FORM"); +if (forms) { + var j = 0; + for (j = 0; j < forms.length; j++) { + f = forms[j]; + if (typeof(f.action) == "string") { + if(typeof(f.method) == "string") { + if(typeof(f.method) != "post") { + var resolved = ""; + var orig = f.action; + if(f.action.indexOf("http") == 0) { + resolved = f.action; + } else { + resolved = xResolveUrl(f.action); + } + // this does not work on firefox... + f.action = sWayBackCGI + resolved; + } + } + } + } +} Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/wm.js =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/wm.js 2008-01-15 23:21:02 UTC (rev 2140) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/wm.js 2008-01-30 00:49:30 UTC (rev 2141) @@ -1,62 +0,0 @@ - -function xResolveUrl(url) { - var image = new Image(); - image.src = url; - return image.src; -} -function xLateUrl(aCollection, sProp) { - var i = 0; - for(i = 0; i < aCollection.length; i++) { - if(aCollection[i].getAttribute(sProp) && - (aCollection[i].getAttribute(sProp).length > 0) && - (typeof(aCollection[i][sProp]) == "string")) { - - if(aCollection[i][sProp].indexOf("mailto:") == -1 && - aCollection[i][sProp].indexOf("javascript:") == -1) { - - var wmSpecial = aCollection[i].getAttribute("wmSpecial"); - if(wmSpecial && wmSpecial.length > 0) { - } else { - if(aCollection[i][sProp].indexOf("http") == 0) { - aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp]; - } else { - aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]); - } - } - } - } - } -} - -xLateUrl(document.getElementsByTagName("IMG"),"src"); -xLateUrl(document.getElementsByTagName("A"),"href"); -xLateUrl(document.getElementsByTagName("AREA"),"href"); -xLateUrl(document.getElementsByTagName("OBJECT"),"codebase"); -xLateUrl(document.getElementsByTagName("OBJECT"),"data"); -xLateUrl(document.getElementsByTagName("APPLET"),"codebase"); -xLateUrl(document.getElementsByTagName("APPLET"),"archive"); -xLateUrl(document.getElementsByTagName("EMBED"),"src"); -xLateUrl(document.getElementsByTagName("IFRAME"),"src"); -xLateUrl(document.getElementsByTagName("BODY"),"background"); -var forms = document.getElementsByTagName("FORM"); -if (forms) { - var j = 0; - for (j = 0; j < forms.length; j++) { - f = forms[j]; - if (typeof(f.action) == "string") { - if(typeof(f.method) == "string") { - if(typeof(f.method) != "post") { - var resolved = ""; - var orig = f.action; - if(f.action.indexOf("http") == 0) { - resolved = f.action; - } else { - resolved = xResolveUrl(f.action); - } - // this does not work on firefox... - f.action = sWayBackCGI + resolved; - } - } - } - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2008-07-02 00:17:28
|
Revision: 2386 http://archive-access.svn.sourceforge.net/archive-access/?rev=2386&view=rev Author: bradtofel Date: 2008-07-01 17:17:37 -0700 (Tue, 01 Jul 2008) Log Message: ----------- MOVED: exception related rendering .jsps to /exception/ Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/error_image.gif Removed Paths: ------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CSSError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/JavaScriptError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/XMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/error_image.gif Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp (from rev 2228, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CSSError.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -0,0 +1,18 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +WaybackException e = (WaybackException) request.getAttribute("exception"); +UIResults results = UIResults.getFromRequest(request); +StringFormatter fmt = results.getFormatter(); +response.setStatus(e.getStatus()); + +%> +/* CSS wayback retrieval error: + + Title: <%= fmt.format(e.getTitleKey()) %> + Message: <%= fmt.format(e.getMessageKey()) %> + + */ Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp (from rev 2228, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -0,0 +1,19 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% +WaybackException e = (WaybackException) request.getAttribute("exception"); +e.setupResponse(response); +%> +<jsp:include page="/template/UI-header.jsp" flush="true" /> +<% + +UIResults results = UIResults.getFromRequest(request); +StringFormatter fmt = results.getFormatter(); + +%> + +<h2><%= fmt.format(e.getTitleKey()) %></h2> +<p><b><%= fmt.format(e.getMessageKey(),e.getMessage()) %></b></p> +<jsp:include page="/template/UI-footer.jsp" flush="true" /> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp (from rev 2228, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/JavaScriptError.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -0,0 +1,16 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +WaybackException e = (WaybackException) request.getAttribute("exception"); +UIResults results = UIResults.getFromRequest(request); +StringFormatter fmt = results.getFormatter(); +response.setStatus(e.getStatus()); + +%> +// Javascript wayback retrieval error: +// +// Title: <%= fmt.format(e.getTitleKey()) %> +// Message: <%= fmt.format(e.getMessageKey()) %> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp (from rev 2228, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/XMLError.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<%@ page language="java" pageEncoding="utf-8" contentType="text/xml;charset=utf-8"%> +<%@ page import="org.archive.wayback.exception.WaybackException" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +WaybackException e = (WaybackException) request.getAttribute("exception"); +UIResults results = UIResults.getFromRequest(request); +StringFormatter fmt = results.getFormatter(); +//response.setStatus(e.getStatus()); + +%> +<wayback> + <error> + <title><%= UIResults.encodeXMLContent(fmt.format(e.getTitleKey())) %></title> + <message><%= UIResults.encodeXMLContent(fmt.format(e.getMessageKey())) %></message> + </error> +</wayback> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/error_image.gif (from rev 2055, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/error_image.gif) =================================================================== (Binary files differ) Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CSSError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CSSError.jsp 2008-07-02 00:16:07 UTC (rev 2385) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CSSError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -1,18 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> -<%@ page import="org.archive.wayback.exception.WaybackException" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<% - -WaybackException e = (WaybackException) request.getAttribute("exception"); -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -response.setStatus(e.getStatus()); - -%> -/* CSS wayback retrieval error: - - Title: <%= fmt.format(e.getTitleKey()) %> - Message: <%= fmt.format(e.getMessageKey()) %> - - */ Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp 2008-07-02 00:16:07 UTC (rev 2385) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/HTMLError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -1,19 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> -<%@ page import="org.archive.wayback.exception.WaybackException" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<% -WaybackException e = (WaybackException) request.getAttribute("exception"); -e.setupResponse(response); -%> -<jsp:include page="/template/UI-header.jsp" flush="true" /> -<% - -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); - -%> - -<h2><%= fmt.format(e.getTitleKey()) %></h2> -<p><b><%= fmt.format(e.getMessageKey(),e.getMessage()) %></b></p> -<jsp:include page="/template/UI-footer.jsp" flush="true" /> Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/JavaScriptError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/JavaScriptError.jsp 2008-07-02 00:16:07 UTC (rev 2385) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/JavaScriptError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -1,16 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> -<%@ page import="org.archive.wayback.exception.WaybackException" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<% - -WaybackException e = (WaybackException) request.getAttribute("exception"); -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -response.setStatus(e.getStatus()); - -%> -// Javascript wayback retrieval error: -// -// Title: <%= fmt.format(e.getTitleKey()) %> -// Message: <%= fmt.format(e.getMessageKey()) %> Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/XMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/XMLError.jsp 2008-07-02 00:16:07 UTC (rev 2385) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/XMLError.jsp 2008-07-02 00:17:37 UTC (rev 2386) @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<%@ page language="java" pageEncoding="utf-8" contentType="text/xml;charset=utf-8"%> -<%@ page import="org.archive.wayback.exception.WaybackException" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<% - -WaybackException e = (WaybackException) request.getAttribute("exception"); -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -//response.setStatus(e.getStatus()); - -%> -<wayback> - <error> - <title><%= UIResults.encodeXMLContent(fmt.format(e.getTitleKey())) %></title> - <message><%= UIResults.encodeXMLContent(fmt.format(e.getMessageKey())) %></message> - </error> -</wayback> Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/error_image.gif =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2008-07-02 00:25:07
|
Revision: 2388 http://archive-access.svn.sourceforge.net/archive-access/?rev=2388&view=rev Author: bradtofel Date: 2008-07-01 17:25:15 -0700 (Tue, 01 Jul 2008) Log Message: ----------- MOVE: moved all query related .jsps to /query/. separated URL and Capture query renderers into seprate .jsp files now use UICaptureQueryResults and UIUrlQueryResults for context. Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp Removed Paths: ------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CalendarResults.jsp Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CalendarResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CalendarResults.jsp 2008-07-02 00:22:06 UTC (rev 2387) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CalendarResults.jsp 2008-07-02 00:25:15 UTC (rev 2388) @@ -1,175 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> -<%@ page import="java.util.ArrayList" %> -<%@ page import="java.util.Date" %> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.text.ParseException" %> -<%@ page import="org.archive.wayback.WaybackConstants" %> -<%@ page import="org.archive.wayback.core.SearchResult" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.query.UIQueryResults" %> -<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartitionsFactory" %> -<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<jsp:include page="/template/UI-header.jsp" flush="true" /> -<% - -UIQueryResults results = (UIQueryResults) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -String searchString = results.getSearchUrl(); - -Date searchStartDate = results.getStartTimestamp().getDate(); -Date searchEndDate = results.getEndTimestamp().getDate(); -int firstResult = results.getFirstResult(); -int lastResult = results.getLastResult(); -int resultCount = results.getResultsMatching(); - -//Timestamp searchStartTs = results.getStartTimestamp(); -//Timestamp searchEndTs = results.getEndTimestamp(); -//String prettySearchStart = results.prettyDateFull(searchStartTs.getDate()); -//String prettySearchEnd = results.prettyDateFull(searchEndTs.getDate()); - -ArrayList<ResultsPartition> partitions = ResultsPartitionsFactory.get( - results.getResults(),results.getWbRequest()); -int numPartitions = partitions.size(); -%> -<table border="0" cellpadding="5" width="100%" class="mainSearchBanner" cellspacing="0"> - <tr> - <td> - <%= fmt.format("PathQueryClassic.searchedFor",searchString) %> - </td> - <td align="right"> - <%= fmt.format("PathQueryClassic.resultsSummary",resultCount) %> - </td> - </tr> -</table> -<br> - - -<table border="0" width="100%"> - <tr bgcolor="#CCCCCC"> - <td colspan="<%= numPartitions %>" align="center" class="mainCalendar"> - <%= fmt.format("PathQueryClassic.searchResults",searchStartDate,searchEndDate) %> - </td> - </tr> - -<!-- RESULT COLUMN HEADERS --> - <tr bgcolor="#CCCCCC"> -<% - for(int i = 0; i < numPartitions; i++) { - ResultsPartition partition = partitions.get(i); -%> - <td align="center" class="mainBigBody"> - <%= partition.getTitle() %> - </td> -<% - } -%> - </tr> -<!-- /RESULT COLUMN HEADERS --> - - - -<!-- RESULT COLUMN COUNTS --> - <tr bgcolor="#CCCCCC"> -<% - for(int i = 0; i < numPartitions; i++) { - ResultsPartition partition = (ResultsPartition) partitions.get(i); -%> - <td align="center" class="mainBigBody"> - <%= fmt.format("ResultPartition.columnSummary",partition.resultsCount()) %> - </td> -<% - } -%> - </tr> -<!-- /RESULT COLUMN COUNTS --> - - -<!-- RESULT COLUMN DATA --> - <tr bgcolor="#EBEBEB"> -<% - boolean first = false; - String lastMD5 = null; - - for(int i = 0; i < numPartitions; i++) { - ResultsPartition partition = (ResultsPartition) partitions.get(i); - ArrayList<SearchResult> partitionResults = partition.getMatches(); -%> - <td nowrap class="mainBody" valign="top"> -<% - if(partitionResults.size() == 0) { -%> - -<% - } else { - - for(int j = 0; j < partitionResults.size(); j++) { - - SearchResult result = partitionResults.get(j); - String url = result.get(WaybackConstants.RESULT_URL); - String captureDate = result.get(WaybackConstants.RESULT_CAPTURE_DATE); - Timestamp captureTS = Timestamp.parseBefore(captureDate); - String prettyDate = fmt.format("PathQuery.classicResultLinkText", - captureTS.getDate()); - String origHost = result.get(WaybackConstants.RESULT_ORIG_HOST); - String MD5 = result.get(WaybackConstants.RESULT_MD5_DIGEST); - String redirectFlag = (0 == result.get( - WaybackConstants.RESULT_REDIRECT_URL).compareTo("-")) - ? "" : fmt.format("PathPrefixQuery.redirectIndicator"); - String httpResponse = result.get(WaybackConstants.RESULT_HTTP_CODE); - String mimeType = result.get(WaybackConstants.RESULT_MIME_TYPE); - - String arcFile = result.get(WaybackConstants.RESULT_ARC_FILE); - String arcOffset = result.get(WaybackConstants.RESULT_OFFSET); - - String replayUrl = results.resultToReplayUrl(result); - - boolean updated = false; - if(lastMD5 == null) { - lastMD5 = MD5; - updated = true; - } else if(0 != lastMD5.compareTo(MD5)) { - updated = true; - lastMD5 = MD5; - } - String updateStar = updated ? "*" : ""; -%> - <a href="<%= replayUrl %>"><%= prettyDate %></a> <%= updateStar %><br></br> -<% - - } - - } -%> - </td> -<% - } - -%> - </tr> -<!-- /RESULT COLUMN DATA --> -</table> - - -<% -// show page indicators: -if(results.getNumPages() > 1) { - int curPage = results.getCurPage(); - %> - <hr></hr> - <% - for(int i = 1; i <= results.getNumPages(); i++) { - if(i == curPage) { - %> - <b><%= i %></b> - <% - } else { - %> - <a href="<%= results.urlForPage(i) %>"><%= i %></a> - <% - } - } -} -%> -<jsp:include page="/template/UI-footer.jsp" flush="true" /> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp (from rev 2228, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/CalendarResults.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp 2008-07-02 00:25:15 UTC (rev 2388) @@ -0,0 +1,174 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.ArrayList" %> +<%@ page import="java.util.Date" %> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.text.ParseException" %> +<%@ page import="org.archive.wayback.WaybackConstants" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> +<%@ page import="org.archive.wayback.core.Timestamp" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.query.UICaptureQueryResults" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartitionsFactory" %> +<%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<jsp:include page="/template/UI-header.jsp" flush="true" /> +<% + +UICaptureQueryResults results = (UICaptureQueryResults) UIResults.getFromRequest(request); +StringFormatter fmt = results.getFormatter(); +String searchString = results.getSearchUrl(); + +Date searchStartDate = results.getStartTimestamp().getDate(); +Date searchEndDate = results.getEndTimestamp().getDate(); +long firstResult = results.getFirstResult(); +long lastResult = results.getLastResult(); +long resultCount = results.getResultsMatching(); + +//Timestamp searchStartTs = results.getStartTimestamp(); +//Timestamp searchEndTs = results.getEndTimestamp(); +//String prettySearchStart = results.prettyDateFull(searchStartTs.getDate()); +//String prettySearchEnd = results.prettyDateFull(searchEndTs.getDate()); + +ArrayList<ResultsPartition> partitions = ResultsPartitionsFactory.get( + results.getResults(),results.getWbRequest()); +int numPartitions = partitions.size(); +%> +<table border="0" cellpadding="5" width="100%" class="mainSearchBanner" cellspacing="0"> + <tr> + <td> + <%= fmt.format("PathQueryClassic.searchedFor",searchString) %> + </td> + <td align="right"> + <%= fmt.format("PathQueryClassic.resultsSummary",resultCount) %> + </td> + </tr> +</table> +<br> + + +<table border="0" width="100%"> + <tr bgcolor="#CCCCCC"> + <td colspan="<%= numPartitions %>" align="center" class="mainCalendar"> + <%= fmt.format("PathQueryClassic.searchResults",searchStartDate,searchEndDate) %> + </td> + </tr> + +<!-- RESULT COLUMN HEADERS --> + <tr bgcolor="#CCCCCC"> +<% + for(int i = 0; i < numPartitions; i++) { + ResultsPartition partition = partitions.get(i); +%> + <td align="center" class="mainBigBody"> + <%= partition.getTitle() %> + </td> +<% + } +%> + </tr> +<!-- /RESULT COLUMN HEADERS --> + + + +<!-- RESULT COLUMN COUNTS --> + <tr bgcolor="#CCCCCC"> +<% + for(int i = 0; i < numPartitions; i++) { + ResultsPartition partition = (ResultsPartition) partitions.get(i); +%> + <td align="center" class="mainBigBody"> + <%= fmt.format("ResultPartition.columnSummary",partition.resultsCount()) %> + </td> +<% + } +%> + </tr> +<!-- /RESULT COLUMN COUNTS --> + + +<!-- RESULT COLUMN DATA --> + <tr bgcolor="#EBEBEB"> +<% + boolean first = false; + String lastMD5 = null; + + for(int i = 0; i < numPartitions; i++) { + ResultsPartition partition = (ResultsPartition) partitions.get(i); + ArrayList<CaptureSearchResult> partitionResults = partition.getMatches(); +%> + <td nowrap class="mainBody" valign="top"> +<% + if(partitionResults.size() == 0) { +%> + +<% + } else { + + for(int j = 0; j < partitionResults.size(); j++) { + + CaptureSearchResult result = partitionResults.get(j); + String url = result.getUrlKey(); + String captureDate = result.getCaptureTimestamp(); + Timestamp captureTS = Timestamp.parseBefore(captureDate); + String prettyDate = fmt.format("PathQuery.classicResultLinkText", + captureTS.getDate()); + String origHost = result.getOriginalHost(); + String MD5 = result.getDigest(); + String redirectFlag = (0 == result.getRedirectUrl().compareTo("-")) + ? "" : fmt.format("PathPrefixQuery.redirectIndicator"); + String httpResponse = result.getHttpCode(); + String mimeType = result.getMimeType(); + + String arcFile = result.getFile(); + String arcOffset = String.valueOf(result.getOffset()); + + String replayUrl = results.resultToReplayUrl(result); + + boolean updated = false; + if(lastMD5 == null) { + lastMD5 = MD5; + updated = true; + } else if(0 != lastMD5.compareTo(MD5)) { + updated = true; + lastMD5 = MD5; + } + String updateStar = updated ? "*" : ""; +%> + <a href="<%= replayUrl %>"><%= prettyDate %></a> <%= updateStar %><br></br> +<% + + } + + } +%> + </td> +<% + } + +%> + </tr> +<!-- /RESULT COLUMN DATA --> +</table> + + +<% +// show page indicators: +if(results.getNumPages() > 1) { + int curPage = results.getCurPage(); + %> + <hr></hr> + <% + for(int i = 1; i <= results.getNumPages(); i++) { + if(i == curPage) { + %> + <b><%= i %></b> + <% + } else { + %> + <a href="<%= results.urlForPage(i) %>"><%= i %></a> + <% + } + } +} +%> +<jsp:include page="/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...> - 2008-07-02 00:30:38
|
Revision: 2390 http://archive-access.svn.sourceforge.net/archive-access/?rev=2390&view=rev Author: bradtofel Date: 2008-07-01 17:30:47 -0700 (Tue, 01 Jul 2008) Log Message: ----------- MOVE: replay related .jsp files to /replay/ Added Paths: ----------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Redirect.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp Removed Paths: ------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Redirect.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/ResultMeta.jsp Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Redirect.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Redirect.jsp 2008-07-02 00:25:51 UTC (rev 2389) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Redirect.jsp 2008-07-02 00:30:47 UTC (rev 2390) @@ -1,14 +0,0 @@ -<%@ page import="org.archive.wayback.core.Timestamp" %> - -<% - String url = request.getParameter("url"); - String time = request.getParameter("time"); - - // Put time-mapping for this id, or if no id, the ip-addr. - String id = request.getHeader("Proxy-Id"); - if(id == null) id = request.getRemoteAddr(); - Timestamp.addTimestampForId(request.getContextPath(),id, time); - - // Now redirect to the page the user wanted. - response.sendRedirect(url); -%> Deleted: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/ResultMeta.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/ResultMeta.jsp 2008-07-02 00:25:51 UTC (rev 2389) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/ResultMeta.jsp 2008-07-02 00:30:47 UTC (rev 2390) @@ -1,125 +0,0 @@ -<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> -<%@ page import="java.util.Iterator" %> -<%@ page import="java.util.Map" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> -<%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> -<%@ page import="org.archive.wayback.util.StringFormatter" %> -<% - -UIReplayResult uiResults = (UIReplayResult) UIResults.getFromRequest(request); -StringFormatter fmt = uiResults.getFormatter(); - -String origUrl = uiResults.getOriginalUrl(); -String urlKey = uiResults.getUrlKey(); -String archiveID = uiResults.getArchiveID(); -Timestamp captureTS = uiResults.getCaptureTimestamp(); -String capturePrettyDateTime = fmt.format("MetaReplay.captureDateDisplay", - captureTS.getDate()); -String mimeType = uiResults.getMimeType(); -String digest = uiResults.getDigest(); -Map<String,String> headers = uiResults.getHttpHeaders(); - -%> -<html> - <head> - <title> - <%= fmt.format("MetaReplay.title") + urlKey +" / " + - capturePrettyDateTime %> - </title> - </head> - <body> - <h2> - <%= fmt.format("MetaReplay.title") %> - </h2> - <table> - <tr> - <td class="field-cell"> - <%= fmt.format("MetaReplay.originalURL") %> - </td> - <td class="value-cell"> - <b> - <%= origUrl %> - </b> - </td> - </tr> - <tr> - <td class="field-cell"> - <%= fmt.format("MetaReplay.URLKey") %> - </td> - <td class="value-cell"> - <b> - <%= urlKey %> - </b> - </td> - </tr> - <tr> - <td class="field-cell"> - <%= fmt.format("MetaReplay.captureDate") %> - </td> - <td class="value-cell"> - <b> - <%= capturePrettyDateTime %> - </b> - </td> - </tr> - <tr> - <td class="field-cell"> - <%= fmt.format("MetaReplay.archiveID") %> - </td> - <td class="value-cell"> - <b> - <%= archiveID %> - </b> - </td> - </tr> - <tr> - <td class="field-cell"> - <%= fmt.format("MetaReplay.MIMEType") %> - </td> - <td class="value-cell"> - <b> - <%= mimeType %> - </b> - </td> - </tr> - <tr> - <td class="field-cell"> - <%= fmt.format("MetaReplay.digest") %> - </td> - <td class="value-cell"> - <b> - <%= digest %> - </b> - </td> - </tr> - </table> - <p> - <h2> - <%= fmt.format("MetaReplay.HTTPHeaders") %> - </h2> - <table> - <% - Iterator<String> itr = headers.keySet().iterator(); - while(itr.hasNext()) { - String key = itr.next(); - String value = headers.get(key); - %> - <tr> - <td class="field-cell"> - <%= key %> - </td> - <td class="value-cell"> - <b> - <%= value %> - </b> - </td> - </tr> - <% - } - %> - </table> - - </body> -</html> - Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Redirect.jsp (from rev 2055, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/Redirect.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Redirect.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Redirect.jsp 2008-07-02 00:30:47 UTC (rev 2390) @@ -0,0 +1,14 @@ +<%@ page import="org.archive.wayback.core.Timestamp" %> + +<% + String url = request.getParameter("url"); + String time = request.getParameter("time"); + + // Put time-mapping for this id, or if no id, the ip-addr. + String id = request.getHeader("Proxy-Id"); + if(id == null) id = request.getRemoteAddr(); + Timestamp.addTimestampForId(request.getContextPath(),id, time); + + // Now redirect to the page the user wanted. + response.sendRedirect(url); +%> Copied: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp (from rev 2228, trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/jsp/ResultMeta.jsp) =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp (rev 0) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp 2008-07-02 00:30:47 UTC (rev 2390) @@ -0,0 +1,125 @@ +<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> +<%@ page import="java.util.Iterator" %> +<%@ page import="java.util.Map" %> +<%@ page import="org.archive.wayback.core.Timestamp" %> +<%@ page import="org.archive.wayback.core.UIResults" %> +<%@ page import="org.archive.wayback.replay.UIReplayResult" %> +<%@ page import="org.archive.wayback.util.StringFormatter" %> +<% + +UIReplayResult uiResults = (UIReplayResult) UIResults.getFromRequest(request); +StringFormatter fmt = uiResults.getFormatter(); + +String origUrl = uiResults.getOriginalUrl(); +String urlKey = uiResults.getUrlKey(); +String archiveID = uiResults.getArchiveID(); +Timestamp captureTS = uiResults.getCaptureTimestamp(); +String capturePrettyDateTime = fmt.format("MetaReplay.captureDateDisplay", + captureTS.getDate()); +String mimeType = uiResults.getMimeType(); +String digest = uiResults.getDigest(); +Map<String,String> headers = uiResults.getHttpHeaders(); + +%> +<html> + <head> + <title> + <%= fmt.format("MetaReplay.title") + urlKey +" / " + + capturePrettyDateTime %> + </title> + </head> + <body> + <h2> + <%= fmt.format("MetaReplay.title") %> + </h2> + <table> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.originalURL") %> + </td> + <td class="value-cell"> + <b> + <%= origUrl %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.URLKey") %> + </td> + <td class="value-cell"> + <b> + <%= urlKey %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.captureDate") %> + </td> + <td class="value-cell"> + <b> + <%= capturePrettyDateTime %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.archiveID") %> + </td> + <td class="value-cell"> + <b> + <%= archiveID %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.MIMEType") %> + </td> + <td class="value-cell"> + <b> + <%= mimeType %> + </b> + </td> + </tr> + <tr> + <td class="field-cell"> + <%= fmt.format("MetaReplay.digest") %> + </td> + <td class="value-cell"> + <b> + <%= digest %> + </b> + </td> + </tr> + </table> + <p> + <h2> + <%= fmt.format("MetaReplay.HTTPHeaders") %> + </h2> + <table> + <% + Iterator<String> itr = headers.keySet().iterator(); + while(itr.hasNext()) { + String key = itr.next(); + String value = headers.get(key); + %> + <tr> + <td class="field-cell"> + <%= key %> + </td> + <td class="value-cell"> + <b> + <%= value %> + </b> + </td> + </tr> + <% + } + %> + </table> + + </body> +</html> + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bra...@us...> - 2008-07-15 01:30:04
|
Revision: 2447 http://archive-access.svn.sourceforge.net/archive-access/?rev=2447&view=rev Author: bradtofel Date: 2008-07-14 18:30:13 -0700 (Mon, 14 Jul 2008) Log Message: ----------- REFACTOR(major) of all .jsp files to use simplified UIResults interface, instead of all the previous subclasses. Also now all .jsp files now use convenience methods on underlying objects within the UIResults. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLCaptureResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLUrlResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLCaptureResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLUrlResults.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ArchiveComment.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ClientSideJSInsert.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Disclaimer.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/JSLessTimeline.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-footer.jsp trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-header.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 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/advanced_search.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -3,7 +3,7 @@ <jsp:include page="/template/UI-header.jsp" flush="true" /> <% -UIResults results = UIResults.getFromRequest(request); +UIResults results = UIResults.getGeneric(request); StringFormatter fmt = results.getFormatter(); %> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/CSSError.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -3,10 +3,9 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% - -WaybackException e = (WaybackException) request.getAttribute("exception"); -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractException(request); +WaybackException e = results.getException(); +StringFormatter fmt = results.getWbRequest().getFormatter(); response.setStatus(e.getStatus()); %> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/HTMLError.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -3,14 +3,14 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -WaybackException e = (WaybackException) request.getAttribute("exception"); +UIResults results = UIResults.extractException(request); +WaybackException e = results.getException(); e.setupResponse(response); %> <jsp:include page="/template/UI-header.jsp" flush="true" /> <% -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +StringFormatter fmt = results.getWbRequest().getFormatter(); %> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/JavaScriptError.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -4,9 +4,9 @@ <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -WaybackException e = (WaybackException) request.getAttribute("exception"); -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractException(request); +WaybackException e = results.getException(); +StringFormatter fmt = results.getWbRequest().getFormatter(); response.setStatus(e.getStatus()); %> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/exception/XMLError.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -5,9 +5,9 @@ <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -WaybackException e = (WaybackException) request.getAttribute("exception"); -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractException(request); +WaybackException e = results.getException(); +StringFormatter fmt = results.getWbRequest().getFormatter(); //response.setStatus(e.getStatus()); %> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/help.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -2,7 +2,7 @@ <%@ page import="org.archive.wayback.util.StringFormatter" %> <jsp:include page="/template/UI-header.jsp" flush="true" /> <% -UIResults results = UIResults.getFromRequest(request); +UIResults results = UIResults.getGeneric(request); StringFormatter fmt = results.getFormatter(); String url = "http://archive-access.sourceforge.net/projects/wayback/faq.html"; %> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/index.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -3,7 +3,7 @@ <%@ page import="org.archive.wayback.util.StringFormatter" %> <jsp:include page="template/UI-header.jsp" flush="true" /> <% -UIResults results = UIResults.getFromRequest(request); +UIResults results = UIResults.getGeneric(request); StringFormatter fmt = results.getFormatter(); Object names = request.getAttribute("AccessPointNames"); if(names != null) { Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/CalendarResults.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -5,32 +5,31 @@ <%@ page import="java.text.ParseException" %> <%@ page import="org.archive.wayback.WaybackConstants" %> <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResults" %> <%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.query.UICaptureQueryResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartitionsFactory" %> <%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <jsp:include page="/template/UI-header.jsp" flush="true" /> +<jsp:include page="/template/CookieJS.jsp" flush="true" /> <% +UIResults results = UIResults.extractCaptureQuery(request); -UICaptureQueryResults results = (UICaptureQueryResults) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -String searchString = results.getSearchUrl(); +WaybackRequest wbRequest = results.getWbRequest(); +CaptureSearchResults cResults = results.getCaptureResults(); +StringFormatter fmt = wbRequest.getFormatter(); +String searchString = wbRequest.getRequestUrl(); -Date searchStartDate = results.getStartTimestamp().getDate(); -Date searchEndDate = results.getEndTimestamp().getDate(); -long firstResult = results.getFirstResult(); -long lastResult = results.getLastResult(); -long resultCount = results.getResultsMatching(); -//Timestamp searchStartTs = results.getStartTimestamp(); -//Timestamp searchEndTs = results.getEndTimestamp(); -//String prettySearchStart = results.prettyDateFull(searchStartTs.getDate()); -//String prettySearchEnd = results.prettyDateFull(searchEndTs.getDate()); +Date searchStartDate = wbRequest.getStartDate(); +Date searchEndDate = wbRequest.getEndDate(); +long firstResult = cResults.getFirstReturned(); +long lastResult = cResults.getReturnedCount() + firstResult; +long resultCount = cResults.getMatchingCount(); -ArrayList<ResultsPartition> partitions = ResultsPartitionsFactory.get( - results.getResults(),results.getWbRequest()); +ArrayList<ResultsPartition> partitions = + ResultsPartitionsFactory.get(cResults, wbRequest); int numPartitions = partitions.size(); %> <table border="0" cellpadding="5" width="100%" class="mainSearchBanner" cellspacing="0"> @@ -39,6 +38,13 @@ <%= fmt.format("PathQueryClassic.searchedFor",searchString) %> </td> <td align="right"> + <select onchange="SetAnchorWindow(this.value)"> + <option value="86400">1 day</option> + <option value="604800">1 week</option> + <option value="2592000">1 month</option> + <option value="31536000">1 year</option> + <option value="315360000">10 years</option> + </select> <%= fmt.format("PathQueryClassic.resultsSummary",resultCount) %> </td> </tr> @@ -108,10 +114,10 @@ CaptureSearchResult result = partitionResults.get(j); String url = result.getUrlKey(); - String captureDate = result.getCaptureTimestamp(); - Timestamp captureTS = Timestamp.parseBefore(captureDate); + String captureTimestamp = result.getCaptureTimestamp(); + Date captureDate = result.getCaptureDate(); String prettyDate = fmt.format("PathQuery.classicResultLinkText", - captureTS.getDate()); + captureDate); String origHost = result.getOriginalHost(); String MD5 = result.getDigest(); String redirectFlag = (0 == result.getRedirectUrl().compareTo("-")) @@ -134,7 +140,7 @@ } String updateStar = updated ? "*" : ""; %> - <a href="<%= replayUrl %>"><%= prettyDate %></a> <%= updateStar %><br></br> + <a onclick="SetAnchorDate('<%= captureTimestamp %>');" href="<%= replayUrl %>"><%= prettyDate %></a> <%= updateStar %><br></br> <% } @@ -153,12 +159,12 @@ <% // show page indicators: -if(results.getNumPages() > 1) { - int curPage = results.getCurPage(); +if(cResults.getNumPages() > 1) { + int curPage = cResults.getCurPageNum(); %> <hr></hr> <% - for(int i = 1; i <= results.getNumPages(); i++) { + for(int i = 1; i <= cResults.getNumPages(); i++) { if(i == curPage) { %> <b><%= i %></b> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLCaptureResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLCaptureResults.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLCaptureResults.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -4,27 +4,26 @@ <%@ page import="java.util.Date" %> <%@ page import="org.archive.wayback.WaybackConstants" %> <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResults" %> <%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.query.UICaptureQueryResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <jsp:include page="/template/UI-header.jsp" flush="true" /> <% -UICaptureQueryResults results = (UICaptureQueryResults) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractCaptureQuery(request); +WaybackRequest wbRequest = results.getWbRequest(); +CaptureSearchResults cResults = results.getCaptureResults(); +StringFormatter fmt = wbRequest.getFormatter(); -String searchString = results.getSearchUrl(); +String searchString = wbRequest.getRequestUrl(); -long resultCount = results.getResultsReturned(); +long resultCount = cResults.getReturnedCount(); +Date searchStartDate = wbRequest.getStartDate(); +Date searchEndDate = wbRequest.getEndDate(); - Timestamp searchStartTs = results.getStartTimestamp(); - Timestamp searchEndTs = results.getEndTimestamp(); - Date searchStartDate = searchStartTs.getDate(); - Date searchEndDate = searchEndTs.getDate(); - - Iterator<CaptureSearchResult> itr = results.resultsIterator(); - %> +Iterator<CaptureSearchResult> itr = cResults.iterator(); +%> <%= fmt.format("PathQuery.resultsSummary",resultCount,searchString) %> <br></br> <%= fmt.format("PathQuery.resultRange",searchStartDate,searchEndDate) %> @@ -87,17 +86,17 @@ } // show page indicators: -int curPage = results.getCurPage(); -if(curPage > results.getNumPages()) { +int curPage = cResults.getCurPageNum(); +if(curPage > cResults.getNumPages()) { %> <hr></hr> <a href="<%= results.urlForPage(1) %>">First results</a> <% -} else if(results.getNumPages() > 1) { +} else if(cResults.getNumPages() > 1) { %> <hr></hr> <% - for(int i = 1; i <= results.getNumPages(); i++) { + for(int i = 1; i <= cResults.getNumPages(); i++) { if(i == curPage) { %> <b><%= i %></b> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLUrlResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLUrlResults.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/HTMLUrlResults.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -2,35 +2,35 @@ <%@ page import="java.util.Iterator" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Date" %> +<%@ page import="org.archive.wayback.ResultURIConverter" %> <%@ page import="org.archive.wayback.WaybackConstants" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.UrlSearchResult" %> -<%@ page import="org.archive.wayback.query.UIUrlQueryResults" %> +<%@ page import="org.archive.wayback.core.UrlSearchResults" %> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <jsp:include page="/template/UI-header.jsp" flush="true" /> <% -UIUrlQueryResults results = (UIUrlQueryResults) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractUrlQuery(request); +WaybackRequest wbRequest = results.getWbRequest(); +UrlSearchResults uResults = results.getUrlResults(); +ResultURIConverter uriConverter = results.getURIConverter(); +StringFormatter fmt = wbRequest.getFormatter(); -String searchString = results.getSearchUrl(); +String searchString = wbRequest.getRequestUrl(); -Date searchStartDate = results.getStartTimestamp().getDate(); -Date searchEndDate = results.getEndTimestamp().getDate(); +Date searchStartDate = wbRequest.getStartDate(); +Date searchEndDate = wbRequest.getEndDate(); -//PathQuerySearchResultPartitioner partitioner = -// new PathQuerySearchResultPartitioner(results.getResults(), -// results.getURIConverter()); +long firstResult = uResults.getFirstReturned(); +long resultCount = uResults.getReturnedCount(); +long lastResult = resultCount + firstResult; -long firstResult = results.getFirstResult(); -long lastResult = results.getLastResult(); -long resultCount = results.getResultsMatching(); +long totalCaptures = uResults.getMatchingCount(); -long totalCaptures = results.getResultsMatching(); - %> <%= fmt.format("PathPrefixQuery.showingResults",firstResult,lastResult, resultCount,searchString) %> @@ -38,22 +38,23 @@ <hr></hr> <% -Iterator<UrlSearchResult> itr = results.resultsIterator(); +Iterator<UrlSearchResult> itr = uResults.iterator(); while(itr.hasNext()) { UrlSearchResult result = itr.next(); String urlKey = result.getUrlKey(); String originalUrl = result.getOriginalUrl(); - String firstDateTS = result.getFirstCaptureTimestamp(); - String lastDateTS = result.getLastCaptureTimestamp(); + String firstDateTSss = result.getFirstCaptureTimestamp(); + String lastDateTSss = result.getLastCaptureTimestamp(); long numCaptures = result.getNumCaptures(); long numVersions = result.getNumVersions(); - Date firstDate = results.timestampToDate(firstDateTS); - Date lastDate = results.timestampToDate(lastDateTS); + Date firstDate = result.getFirstCaptureDate(); + Date lastDate = result.getLastCaptureDate(); if(numCaptures == 1) { - String anchor = results.makeReplayUrl(originalUrl,firstDateTS); + String ts = result.getFirstCaptureTimestamp(); + String anchor = uriConverter.makeReplayURI(ts,originalUrl); %> <a href="<%= anchor %>"> <%= urlKey %> @@ -89,17 +90,17 @@ } // show page indicators: -int curPage = results.getCurPage(); -if(curPage > results.getNumPages()) { +int curPage = uResults.getCurPageNum(); +if(curPage > uResults.getNumPages()) { %> <hr></hr> <a href="<%= results.urlForPage(1) %>">First results</a> <% -} else if(results.getNumPages() > 1) { +} else if(uResults.getNumPages() > 1) { %> <hr></hr> <% - for(int i = 1; i <= results.getNumPages(); i++) { + for(int i = 1; i <= uResults.getNumPages(); i++) { if(i == curPage) { %> <b><%= i %></b> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLCaptureResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLCaptureResults.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLCaptureResults.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -7,14 +7,12 @@ <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> <%@ page import="org.archive.wayback.core.CaptureSearchResults" %> <%@ page import="org.archive.wayback.core.SearchResults" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.query.UICaptureQueryResults" %> <% -UICaptureQueryResults uiResults = (UICaptureQueryResults) UIResults.getFromRequest(request); +UIResults uiResults = UIResults.extractCaptureQuery(request); -CaptureSearchResults results = uiResults.getResults(); -Iterator<CaptureSearchResult> itr = uiResults.resultsIterator(); +CaptureSearchResults results = uiResults.getCaptureResults(); +Iterator<CaptureSearchResult> itr = results.iterator(); %> <wayback> <request> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLUrlResults.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLUrlResults.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/query/XMLUrlResults.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -5,16 +5,14 @@ <%@ page import="java.util.Map" %> <%@ page import="java.util.Enumeration" %> <%@ page import="org.archive.wayback.core.SearchResults" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.UrlSearchResults" %> <%@ page import="org.archive.wayback.core.UrlSearchResult" %> -<%@ page import="org.archive.wayback.query.UIUrlQueryResults" %> <% -UIUrlQueryResults uiResults = (UIUrlQueryResults) UIResults.getFromRequest(request); +UIResults uiResults = UIResults.extractUrlQuery(request); -UrlSearchResults results = uiResults.getResults(); -Iterator<UrlSearchResult> itr = uiResults.resultsIterator(); +UrlSearchResults results = uiResults.getUrlResults(); +Iterator<UrlSearchResult> itr = results.iterator(); %> <wayback> <request> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ArchiveComment.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ArchiveComment.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ArchiveComment.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -1,12 +1,10 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <%@ page import="java.util.Date" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -UIReplayResult results = (UIReplayResult) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractReplay(request); +StringFormatter fmt = results.getWbRequest().getFormatter(); Date exactDate = results.getResult().getCaptureDate(); Date now = new Date(); String prettyDateFormat = "{0,date,H:mm:ss MMM d, yyyy}"; Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ClientSideJSInsert.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ClientSideJSInsert.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ClientSideJSInsert.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -1,15 +1,13 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <%@ page import="java.util.Date" %> <%@ page import="org.archive.wayback.ResultURIConverter" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.WaybackRequest" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -UIReplayResult results = (UIReplayResult) UIResults.getFromRequest(request); +UIResults results = UIResults.extractReplay(request); String requestDate = results.getResult().getCaptureTimestamp(); -String contextPath = results.makeReplayUrl("",requestDate); +String contextPath = results.getURIConverter().makeReplayURI(requestDate,""); String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath(); Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Disclaimer.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Disclaimer.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Disclaimer.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -1,27 +1,24 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <%@ page import="java.util.Date" %> <%@ page import="org.archive.wayback.WaybackConstants" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.WaybackRequest" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -UIReplayResult results = (UIReplayResult) UIResults.getFromRequest(request); +UIResults results = UIResults.extractReplay(request); -StringFormatter fmt = results.getFormatter(); +StringFormatter fmt = results.getWbRequest().getFormatter(); CaptureSearchResult result = results.getResult(); String dupeMsg = ""; if(result != null) { if(result.isDuplicateDigest()) { - String dupeDate = result.getDuplicateDigestStoredTimestamp(); + Date dupeDate = result.getDuplicateDigestStoredDate(); String prettyDate = ""; if(dupeDate != null) { - Timestamp dupeTS = Timestamp.parseBefore(dupeDate); prettyDate = "(" + fmt.format("MetaReplay.captureDateDisplay", - dupeTS.getDate()) + ")"; + dupeDate) + ")"; } dupeMsg = " Note that this document was downloaded, and not saved because it was a duplicate of a previously captured version " + prettyDate + ". HTTP headers presented here are from the original capture."; Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/JSLessTimeline.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/JSLessTimeline.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/JSLessTimeline.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -6,10 +6,8 @@ <%@ page import="org.archive.wayback.WaybackConstants" %> <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> <%@ page import="org.archive.wayback.core.CaptureSearchResults" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.WaybackRequest" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> <%@ page import="org.archive.wayback.query.resultspartitioner.ResultsTimelinePartitionsFactory" %> <%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> @@ -18,24 +16,21 @@ String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath(); -UIReplayResult results = (UIReplayResult) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractReplay(request); WaybackRequest wbRequest = results.getWbRequest(); -CaptureSearchResults cResults = results.getResults(); +StringFormatter fmt = wbRequest.getFormatter(); +CaptureSearchResults cResults = results.getCaptureResults(); -String exactDateStr = wbRequest.get(WaybackConstants.REQUEST_DATE); -String searchUrl = wbRequest.get(WaybackConstants.REQUEST_URL); -String resolution = wbRequest.get(WaybackConstants.REQUEST_RESOLUTION); -String metaMode = wbRequest.get(WaybackConstants.REQUEST_META_MODE); +String exactDateStr = wbRequest.getReplayTimestamp(); +Date exactDate = wbRequest.getReplayDate(); +String searchUrl = wbRequest.getRequestUrl(); +String resolution = wbRequest.getTimelineResolution(); -Date exactDate = Timestamp.parseBefore(exactDateStr).getDate(); - - if(resolution == null) { - resolution = WaybackConstants.REQUEST_RESOLUTION_AUTO; + resolution = WaybackRequest.REQUEST_RESOLUTION_AUTO; } String metaChecked = ""; -if(metaMode != null && metaMode.equals("yes")) { +if(wbRequest.isMetaMode()) { metaChecked = "checked"; } @@ -49,8 +44,9 @@ Iterator<CaptureSearchResult> it = cResults.iterator(); while(it.hasNext()) { CaptureSearchResult res = it.next(); - String resDateStr = res.getCaptureTimestamp(); - int compared = resDateStr.compareTo(exactDateStr.substring(0,resDateStr.length())); + Date resDate = res.getCaptureDate(); + + int compared = resDate.compareTo(exactDate); if(compared < 0) { resultIndex++; prev = res; @@ -74,15 +70,15 @@ String minResolution = ResultsTimelinePartitionsFactory.getMinResolution(cResults); String optimal = ""; -if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { +if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { optimal = fmt.format("TimelineView.timeRange.hours"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { optimal = fmt.format("TimelineView.timeRange.days"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { optimal = fmt.format("TimelineView.timeRange.months"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_TWO_MONTHS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { optimal = fmt.format("TimelineView.timeRange.twomonths"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { optimal = fmt.format("TimelineView.timeRange.years"); } else { optimal = fmt.format("TimelineView.timeRange.unknown"); @@ -90,30 +86,24 @@ String autoOptString = fmt.format("TimelineView.timeRange.auto",optimal); ArrayList<ResultsPartition> partitions; -if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { +if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { hoursOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getHour(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { + partitions = ResultsTimelinePartitionsFactory.getHour(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { daysOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getDay(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { + partitions = ResultsTimelinePartitionsFactory.getDay(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { monthsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getMonth(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_TWO_MONTHS)) { + partitions = ResultsTimelinePartitionsFactory.getMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { monthsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getTwoMonth(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { + partitions = ResultsTimelinePartitionsFactory.getTwoMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { yearsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getYear(results.getResults(), - wbRequest); + partitions = ResultsTimelinePartitionsFactory.getYear(cResults,wbRequest); } else { autoOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getAuto(results.getResults(), - wbRequest); + partitions = ResultsTimelinePartitionsFactory.getAuto(cResults,wbRequest); } int numPartitions = partitions.size(); ResultsPartition firstP = (ResultsPartition) partitions.get(0); @@ -283,9 +273,9 @@ <option <%= autoOptSelected %> value="auto"><%= autoOptString %></option> </select> <%= fmt.format("TimelineView.metaDataCheck") - %><input type="checkbox" name="metamode" value="yes" <%= + %><input type="checkbox" name="<%= WaybackRequest.REQUEST_META_MODE%>" value="<%= WaybackRequest.REQUEST_YES %>" <%= metaChecked - %> onClick="changeMeta()">  + %> onClick="changeMeta()"> </form> --> <a wmSpecial="1" href="<%= contextRoot %>/help.jsp" target="_top"><%= Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/ResultMeta.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -1,24 +1,23 @@ <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <%@ page import="java.util.Iterator" %> <%@ page import="java.util.Map" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> +<%@ page import="org.archive.wayback.core.CaptureSearchResult" %> <%@ page import="org.archive.wayback.core.UIResults" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -UIReplayResult uiResults = (UIReplayResult) UIResults.getFromRequest(request); -StringFormatter fmt = uiResults.getFormatter(); - -String origUrl = uiResults.getOriginalUrl(); -String urlKey = uiResults.getUrlKey(); -String archiveID = uiResults.getArchiveID(); -Timestamp captureTS = uiResults.getCaptureTimestamp(); +UIResults uiResults = UIResults.extractReplay(request); +StringFormatter fmt = uiResults.getWbRequest().getFormatter(); +CaptureSearchResult result = uiResults.getResult(); +String origUrl = result.getOriginalUrl(); +String urlKey = result.getUrlKey(); +String archiveID = result.getFile() + "/" + result.getOffset(); +String captureTS = result.getCaptureTimestamp(); String capturePrettyDateTime = fmt.format("MetaReplay.captureDateDisplay", - captureTS.getDate()); -String mimeType = uiResults.getMimeType(); -String digest = uiResults.getDigest(); -Map<String,String> headers = uiResults.getHttpHeaders(); + result.getCaptureDate()); +String mimeType = result.getMimeType(); +String digest = result.getDigest(); +Map<String,String> headers = uiResults.getResource().getHttpHeaders(); %> <html> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/replay/Timeline.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -6,10 +6,8 @@ <%@ page import="org.archive.wayback.WaybackConstants" %> <%@ page import="org.archive.wayback.core.CaptureSearchResult" %> <%@ page import="org.archive.wayback.core.CaptureSearchResults" %> -<%@ page import="org.archive.wayback.core.Timestamp" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.core.WaybackRequest" %> -<%@ page import="org.archive.wayback.replay.UIReplayResult" %> <%@ page import="org.archive.wayback.query.resultspartitioner.ResultsTimelinePartitionsFactory" %> <%@ page import="org.archive.wayback.query.resultspartitioner.ResultsPartition" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> @@ -18,24 +16,22 @@ String contextRoot = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath(); -UIReplayResult results = (UIReplayResult) UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); +UIResults results = UIResults.extractReplay(request); WaybackRequest wbRequest = results.getWbRequest(); -CaptureSearchResults cResults = results.getResults(); +StringFormatter fmt = wbRequest.getFormatter(); +CaptureSearchResults cResults = results.getCaptureResults(); -String exactDateStr = wbRequest.get(WaybackConstants.REQUEST_DATE); -String searchUrl = wbRequest.get(WaybackConstants.REQUEST_URL); -String resolution = wbRequest.get(WaybackConstants.REQUEST_RESOLUTION); -String metaMode = wbRequest.get(WaybackConstants.REQUEST_META_MODE); +String exactDateStr = wbRequest.getReplayTimestamp(); +Date exactDate = wbRequest.getReplayDate(); +String searchUrl = wbRequest.getRequestUrl(); +String resolution = wbRequest.getTimelineResolution(); -Date exactDate = Timestamp.parseBefore(exactDateStr).getDate(); - if(resolution == null) { - resolution = WaybackConstants.REQUEST_RESOLUTION_AUTO; + resolution = WaybackRequest.REQUEST_RESOLUTION_AUTO; } String metaChecked = ""; -if(metaMode != null && metaMode.equals("yes")) { +if(wbRequest.isMetaMode()) { metaChecked = "checked"; } @@ -74,15 +70,15 @@ String minResolution = ResultsTimelinePartitionsFactory.getMinResolution(cResults); String optimal = ""; -if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { +if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { optimal = fmt.format("TimelineView.timeRange.hours"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { optimal = fmt.format("TimelineView.timeRange.days"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { optimal = fmt.format("TimelineView.timeRange.months"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_TWO_MONTHS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { optimal = fmt.format("TimelineView.timeRange.twomonths"); -} else if(minResolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { +} else if(minResolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { optimal = fmt.format("TimelineView.timeRange.years"); } else { optimal = fmt.format("TimelineView.timeRange.unknown"); @@ -90,30 +86,24 @@ String autoOptString = fmt.format("TimelineView.timeRange.auto",optimal); ArrayList<ResultsPartition> partitions; -if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_HOURS)) { +if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_HOURS)) { hoursOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getHour(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_DAYS)) { + partitions = ResultsTimelinePartitionsFactory.getHour(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_DAYS)) { daysOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getDay(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_MONTHS)) { + partitions = ResultsTimelinePartitionsFactory.getDay(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_MONTHS)) { monthsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getMonth(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_TWO_MONTHS)) { + partitions = ResultsTimelinePartitionsFactory.getMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_TWO_MONTHS)) { monthsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getTwoMonth(results.getResults(), - wbRequest); -} else if(resolution.equals(WaybackConstants.REQUEST_RESOLUTION_YEARS)) { + partitions = ResultsTimelinePartitionsFactory.getTwoMonth(cResults,wbRequest); +} else if(resolution.equals(WaybackRequest.REQUEST_RESOLUTION_YEARS)) { yearsOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getYear(results.getResults(), - wbRequest); + partitions = ResultsTimelinePartitionsFactory.getYear(cResults,wbRequest); } else { autoOptSelected = "selected"; - partitions = ResultsTimelinePartitionsFactory.getAuto(results.getResults(), - wbRequest); + partitions = ResultsTimelinePartitionsFactory.getAuto(cResults,wbRequest); } int numPartitions = partitions.size(); ResultsPartition firstP = (ResultsPartition) partitions.get(0); @@ -305,7 +295,7 @@ <option <%= autoOptSelected %> value="auto"><%= autoOptString %></option> </select> <%= fmt.format("TimelineView.metaDataCheck") - %><input type="checkbox" name="metamode" value="yes" <%= + %><input type="checkbox" name="<%= WaybackRequest.REQUEST_META_MODE %>" value="<%= WaybackRequest.REQUEST_YES %>" <%= metaChecked %> onClick="changeMeta()">  </form> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-footer.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-footer.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-footer.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -2,10 +2,10 @@ <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <% -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -String contextRoot = results.getContextPrefix(); -String serverRoot = results.getServerPrefix(); +UIResults results = UIResults.getGeneric(request); +StringFormatter fmt = results.getWbRequest().getFormatter(); +String contextRoot = results.getWbRequest().getContextPrefix(); +String serverRoot = results.getWbRequest().getServerPrefix(); %> <!-- FOOTER --> <div align="center"> Modified: trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-header.jsp =================================================================== --- trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-header.jsp 2008-07-15 01:27:41 UTC (rev 2446) +++ trunk/archive-access/projects/wayback/wayback-webapp/src/main/webapp/template/UI-header.jsp 2008-07-15 01:30:13 UTC (rev 2447) @@ -1,25 +1,27 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<%@ page import="org.archive.wayback.core.WaybackRequest" %> <%@ page import="org.archive.wayback.core.UIResults" %> <%@ page import="org.archive.wayback.util.StringFormatter" %> <%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8"%> <% -UIResults results = UIResults.getFromRequest(request); -StringFormatter fmt = results.getFormatter(); -String contextRoot = results.getContextPrefix(); -String serverRoot = results.getServerPrefix(); +UIResults results = UIResults.getGeneric(request); +WaybackRequest wbRequest = results.getWbRequest(); +StringFormatter fmt = wbRequest.getFormatter(); +String contextRoot = wbRequest.getContextPrefix(); +String serverRoot = wbRequest.getServerPrefix(); %> <!-- HEADER --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> - <meta http-equiv="content-type" content="text/html; charset=utf-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"> + src="<%= contextRoot %>css/styles.css" /> <title><%= fmt.format("UIGlobal.pageTitle") %></title> - <base target="_top"> + <base target="_top" /> </head> <body bgcolor="white" alink="red" vlink="#0000aa" link="blue" @@ -64,13 +66,14 @@ <font size="2" color="#FFFFFF" face="Arial, Helvetica, sans-serif"> <%= fmt.format("UIGlobal.enterWebAddress") %> </font> - <input type="hidden" name="type" value="urlquery"> - <input type="text" name="url" value="http://" size="24" maxlength="256"> + <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"> </b> - <select name="date" size="1"> + <select name="<%= WaybackRequest.REQUEST_DATE %>" size="1"> <option value="" selected><%= fmt.format("UIGlobal.selectYearAll") %></option> - <option>2007</option> + <option>2008</option> + <option>2007</option> <option>2006</option> <option>2005</option> <option>2004</option> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |