From: Brad <bra...@us...> - 2005-10-19 01:22:46
|
Update of /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/simplequeryui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv901/src/java/org/archive/wayback/simplequeryui Modified Files: SimpleQueryUI.java UIResults.java Log Message: lots of javadoc comments Index: UIResults.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/simplequeryui/UIResults.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIResults.java 18 Oct 2005 02:30:49 -0000 1.1 --- UIResults.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,24 ---- + /* UIResults + * + * Created on 2005/10/18 14:00:00 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (crawler.archive.org). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ package org.archive.wayback.simplequeryui; *************** *** 11,14 **** --- 33,42 ---- import org.archive.wayback.core.WMRequest; + /** + * Provides easy access to data required in dispatched QueryUI JSPs. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public class UIResults { *************** *** 31,37 **** private HttpServletRequest httpServletRequest; ! // private String nextPageUrl; ! // private String serverBaseUrl; ! public UIResults(WMRequest wmRequest, ResourceResults results, HttpServletRequest request, ReplayUI replayUI) { --- 59,68 ---- private HttpServletRequest httpServletRequest; ! /** ! * @param wmRequest ! * @param results ! * @param request ! * @param replayUI ! */ public UIResults(WMRequest wmRequest, ResourceResults results, HttpServletRequest request, ReplayUI replayUI) { *************** *** 47,78 **** --- 78,134 ---- } + /** + * @return Timestamp end cutoff requested by user + */ public Timestamp getEndTimestamp() { return endTimestamp; } + /** + * @return first Timestamp in returned ResourceResults + */ public Timestamp getFirstResultTimestamp() { return firstResultTimestamp; } + /** + * @return last Timestamp in returned ResourceResults + */ public Timestamp getLastResultTimestamp() { return lastResultTimestamp; } + /** + * @return number of ResourceResult objects in response + */ public int getNumResults() { return numResults; } + /** + * @return URL or URL prefix requested by user + */ public String getSearchUrl() { return searchUrl; } + /** + * @return Timestamp start cutoff requested by user + */ public Timestamp getStartTimestamp() { return startTimestamp; } + /** + * @return Iterator of ResourceResults + */ public Iterator resultsIterator() { return results.iterator(); } + /** + * @param result + * @return URL string that will replay the specified Resource Result. + */ public String resultToReplayUrl(ResourceResult result) { return replayUI.makeReplayURI(httpServletRequest, result); Index: SimpleQueryUI.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/simplequeryui/SimpleQueryUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleQueryUI.java 18 Oct 2005 02:30:49 -0000 1.1 --- SimpleQueryUI.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,24 ---- + /* SimpleQueryUI + * + * Created on 2005/10/18 14:00:00 + * + * Copyright (C) 2005 Internet Archive. + * + * This file is part of the Wayback Machine (crawler.archive.org). + * + * Wayback Machine is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * any later version. + * + * Wayback Machine is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser Public License for more details. + * + * You should have received a copy of the GNU Lesser Public License + * along with Wayback Machine; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ package org.archive.wayback.simplequeryui; *************** *** 25,28 **** --- 47,57 ---- import org.archive.wayback.exception.WaybackException; + /** + * Trivial QueryUI HTTP implementation. Basic error types are reported, and very + * non-scalable HTML UI using dispatched JSP pages. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public class SimpleQueryUI implements QueryUI, RequestParser { private final static String JSP_PATH = "queryui.jsppath"; *************** *** 36,42 **** private String jspPath = null; public SimpleQueryUI() { super(); - // TODO Auto-generated constructor stub } --- 65,73 ---- private String jspPath = null; + /** + * Constructor + */ public SimpleQueryUI() { super(); } *************** *** 49,53 **** public WMRequest parseRequest(HttpServletRequest request) { - // TODO Auto-generated method stub WMRequest wmRequest = null; Matcher matcher = null; --- 80,83 ---- *************** *** 71,75 **** wmRequest.setEndTimestamp(Timestamp.parseAfter(dateStr)); } catch (ParseException e1) { - // TODO Auto-generated catch block e1.printStackTrace(); return null; --- 101,104 ---- *************** *** 97,101 **** wmRequest.setEndTimestamp(Timestamp.parseAfter(dateStr)); } catch (ParseException e1) { - // TODO Auto-generated catch block e1.printStackTrace(); return null; --- 126,129 ---- *************** *** 183,186 **** --- 211,224 ---- } + /** + * Display a WaybackException message + * + * @param wmRequest + * @param request + * @param response + * @param message + * @throws IOException + * @throws ServletException + */ public void showWaybackException(WMRequest wmRequest, HttpServletRequest request, HttpServletResponse response, *************** *** 192,196 **** public void showNoMatches(WMRequest wmRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! // TODO Auto-generated method stub request.setAttribute("results", wmRequest); String url = wmRequest.getRequestURI().getEscapedURI(); --- 230,234 ---- public void showNoMatches(WMRequest wmRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! request.setAttribute("results", wmRequest); String url = wmRequest.getRequestURI().getEscapedURI(); *************** *** 203,209 **** } public void showError(String message, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! // TODO Auto-generated method stub request.setAttribute("message", message); --- 241,256 ---- } + /** + * Display a generic error message with simple template header+footer + * + * @param message + * @param request + * @param response + * @throws IOException + * @throws ServletException + */ public void showError(String message, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! request.setAttribute("message", message); *************** *** 211,214 **** --- 258,268 ---- } + /** + * @param request + * @param response + * @param jspName + * @throws ServletException + * @throws IOException + */ private void proxyRequest(HttpServletRequest request, HttpServletResponse response, final String jspName) *************** *** 226,230 **** */ public static void main(String[] args) { - // TODO Auto-generated method stub } --- 280,283 ---- |