org.archive.wayback.requestparser
Class OpenSearchRequestParser

java.lang.Object
  extended by org.archive.wayback.requestparser.BaseRequestParser
      extended by org.archive.wayback.requestparser.WrappedRequestParser
          extended by org.archive.wayback.requestparser.OpenSearchRequestParser
All Implemented Interfaces:
RequestParser

public class OpenSearchRequestParser
extends WrappedRequestParser

RequestParser which attempts to extract data from an HTML form, that is, from HTTP GET request arguments containing a query, an optional count (results per page), and an optional current page argument. All other reqeust fields are expected to be encoded within the query ("q") field.

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Field Summary
static String SEARCH_QUERY
          CGI argument name for query arguments
static String SEARCH_RESULTS
          CGI argument name for number of results per page, 1 based
static String START_PAGE
          CGI argument name for page number of results, 1 based
 
Fields inherited from class org.archive.wayback.requestparser.BaseRequestParser
DEFAULT_MAX_RECORDS, QUERY_BASE, REPLAY_BASE, XQUERY_BASE
 
Constructor Summary
OpenSearchRequestParser(BaseRequestParser wrapped)
           
 
Method Summary
 WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest, AccessPoint wbContext)
          attempt to transform an incoming HttpServletRequest into a WaybackRequest object.
 
Methods inherited from class org.archive.wayback.requestparser.WrappedRequestParser
getEarliestTimestamp, getLatestTimestamp, getMaxRecords
 
Methods inherited from class org.archive.wayback.requestparser.BaseRequestParser
setEarliestTimestamp, setLatestTimestamp, setMaxRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_QUERY

public static final String SEARCH_QUERY
CGI argument name for query arguments

See Also:
Constant Field Values

SEARCH_RESULTS

public static final String SEARCH_RESULTS
CGI argument name for number of results per page, 1 based

See Also:
Constant Field Values

START_PAGE

public static final String START_PAGE
CGI argument name for page number of results, 1 based

See Also:
Constant Field Values
Constructor Detail

OpenSearchRequestParser

public OpenSearchRequestParser(BaseRequestParser wrapped)
Parameters:
wrapped - the BaseRequestParser being wrapped
Method Detail

parse

public WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest,
                            AccessPoint wbContext)
                     throws BadQueryException
Description copied from interface: RequestParser
attempt to transform an incoming HttpServletRequest into a WaybackRequest object. returns null if there is missing information.

Specified by:
parse in interface RequestParser
Specified by:
parse in class BaseRequestParser
Parameters:
httpRequest - ServletHttpRequest being handled
wbContext - AccessPoint which is attempting to parse the request
Returns:
populated WaybackRequest object if successful, null otherwise.
Throws:
BadQueryException - if the request could match this AccessPoint, but is malformed: invalid datespec, URL, or flags


Copyright © 2005-2011 Internet Archive. All Rights Reserved.