From: Brad <bra...@us...> - 2005-10-19 01:22:47
|
Update of /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/rawreplayui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv901/src/java/org/archive/wayback/rawreplayui Modified Files: RawReplayUI.java Log Message: lots of javadoc comments Index: RawReplayUI.java =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wayback/src/java/org/archive/wayback/rawreplayui/RawReplayUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RawReplayUI.java 18 Oct 2005 02:30:50 -0000 1.1 --- RawReplayUI.java 19 Oct 2005 01:22:37 -0000 1.2 *************** *** 1,2 **** --- 1,25 ---- + /* RawReplayUI + * + * 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.rawreplayui; *************** *** 31,34 **** --- 54,64 ---- import org.archive.wayback.exception.WaybackException; + /** + * Simple implementation of ReplayUI, providing basic error messages, redirect + * to closest match, and unmodified HTTP access to ARC Records. + * + * @author Brad Tofel + * @version $Date$, $Revision$ + */ public class RawReplayUI implements ReplayUI, RequestParser { private final static String JSP_PATH = "replayui.jsppath"; *************** *** 39,45 **** private String jspPath = null; public RawReplayUI() { super(); - // TODO Auto-generated constructor stub } --- 69,77 ---- private String jspPath = null; + /** + * Constructor + */ public RawReplayUI() { super(); } *************** *** 96,100 **** return wmRequest; } catch (URIException e) { ! // TODO Auto-generated catch block e.printStackTrace(); } --- 128,132 ---- return wmRequest; } catch (URIException e) { ! e.printStackTrace(); } *************** *** 129,133 **** HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! // TODO Auto-generated method stub ResourceResults results; ResourceIndex idx = wayback.getResourceIndex(); --- 161,165 ---- HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! ResourceResults results; ResourceIndex idx = wayback.getResourceIndex(); *************** *** 173,181 **** } } ! // redirect to actual date if diff than request: if (!wmRequest.getExactDateRequest().equals( closest.getTimestamp().getDateStr())) { ! String newUrl = makeReplayURI(request,closest); response.sendRedirect(response.encodeRedirectURL(newUrl)); return; --- 205,213 ---- } } ! // redirect to actual date if diff than request: if (!wmRequest.getExactDateRequest().equals( closest.getTimestamp().getDateStr())) { ! String newUrl = makeReplayURI(request, closest); response.sendRedirect(response.encodeRedirectURL(newUrl)); return; *************** *** 254,265 **** } else { ! // String message = wmRequest.getRequestURI().getURI() + " on " ! // + wmRequest.getExactTimestamp().prettyDateTime() ! // + " is Not in the Archive"; String message = wmRequest.getRequestURI().getURI() + " is not in the Archive"; ! ! showError(message, request, response); } --- 286,296 ---- } else { ! // String message = wmRequest.getRequestURI().getURI() + " on " ! // + wmRequest.getExactTimestamp().prettyDateTime() ! // + " is Not in the Archive"; String message = wmRequest.getRequestURI().getURI() + " is not in the Archive"; ! showError(message, request, response); } *************** *** 282,285 **** --- 313,327 ---- } + /** + * Display page to user indicating that an exception happenned while + * processing their request + * + * @param wmRequest + * @param request + * @param response + * @param message + * @throws IOException + * @throws ServletException + */ public void showWaybackException(final WMRequest wmRequest, HttpServletRequest request, HttpServletResponse response, *************** *** 289,295 **** } public void showError(String message, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ! // TODO Auto-generated method stub request.setAttribute("message", message); --- 331,347 ---- } + /** + * Show a generic error message to the user, dispatching to a JSP to + * actually render the template page. + * + * @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); *************** *** 312,316 **** */ public static void main(String[] args) { - // TODO Auto-generated method stub } --- 364,367 ---- |