| java.lang.Object edu.indiana.lib.twinpeaks.search.QueryBase edu.indiana.lib.twinpeaks.search.HttpTransactionQueryBase
All known Subclasses: edu.indiana.lib.twinpeaks.search.singlesearch.web2.Web2Query,
Method Summary | |
public void | clearParameters() | public Element | getBody(Document pageDocument) | public boolean | getFollowRedirects() | public Element | getFormElement(Document pageDocument, String formName) | public String | getParameter(String name) | public String | getParameterName(String value) | public Document | getQueryDocument(String consumer) | public String | getQueryMethod() | public String | getQueryUrl(String consumer) | public byte[] | getResponseBytes() | public String | getResponseCharacterSet() | public Document | getResponseDocument() | public String | getResponseHeader(String name) | public String | getResponseString() | public String | getSearchString() | public SessionContext | getSessionContext() | public String | getSessionParameter(String consumer, String name) | public Object | getSessionValue(String consumer, String name) | public String | getUrl() | public void | initialize(SessionContext session) | public URL | newFullUrl(String baseComponent, String relativeComponent) | public void | removeQueryUrl(String consumer) | public void | removeSessionParameter(String consumer, String name) | public void | setDefaultCharacterSet(String cs) | public void | setParameter(String name, String value) | public void | setParametersFromFormInputs(Document pageDocument, String formName, List nameList) | public void | setParametersFromInputNames(Document pageDocument, List nameList) | public void | setParametersFromInputValues(Document pageDocument, List nameList) | public void | setParametersFromInputs(Document pageDocument, List nameList) | public void | setParametersFromNameList(NodeList nodeList, List nameList) | public void | setParametersFromValueList(NodeList nodeList, List nameList) | public void | setPreserveBaseUrlFile(boolean state) | public void | setQueryDocument(String consumer, Document queryForm) | public void | setQueryMethod(String method) | public void | setQueryUrl(String consumer, String queryUrl) | public void | setRedirectBehavior(int behavior) Establish a mechanism for handling redirects
Parameters: behavior - Specifies the desired behavior. | public void | setSearchString(String searchString) | public void | setSessionParameter(String consumer, String name, String value) | public void | setSessionValue(String consumer, String name, Object value) | public void | setUrl(String url) | public void | setUrl(URL url) | public void | setUrlFromAnchor(Element anchor) | public void | setUrlFromForm(Document pageDocument, String formName) | public int | submit() Submit a request (POST or GET) and read the response. |
HttpTransactionQueryBase | public HttpTransactionQueryBase()(Code) | | Constructor
|
clearParameters | public void clearParameters()(Code) | | Clear the parameter list
|
getBody | public Element getBody(Document pageDocument)(Code) | | Locate the HTML BODY element in the page document
Parameters: pageDocument - An HTML page (as a DOM) The body Element |
getFollowRedirects | public boolean getFollowRedirects()(Code) | | Should URLConnection follow redirects?
true if URLConnection should handle redirects |
getFormElement | public Element getFormElement(Document pageDocument, String formName)(Code) | | Find a named FORM element
Parameters: pageDocument - The search engine query page (as a DOM Document) Parameters: formName - The name of the FORM to lookup(eg FORM name="formName" ) |
getParameter | public String getParameter(String name)(Code) | | Get a named parameter
Parameters: name - Parameter name Parameter value |
getParameterName | public String getParameterName(String value)(Code) | | Get the parameter name associated with the 1st occurance of this value
Parameters: value - Parameter value Parameter name |
getQueryDocument | public Document getQueryDocument(String consumer)(Code) | | Fetch the final query form as a DOM document
Parameters: consumer - A unique name for the "user" of this object Query form (as a DOM document) |
getQueryMethod | public String getQueryMethod()(Code) | | Fetch the current HTTP query method
The method (as text) |
getQueryUrl | public String getQueryUrl(String consumer)(Code) | | Fetch the URL for the query
Parameters: consumer - A unique name for the "user" of this object Address of the final query page |
getResponseBytes | public byte[] getResponseBytes()(Code) | | Get the server response text
The response (as a byte array) |
getResponseCharacterSet | public String getResponseCharacterSet()(Code) | | Fetch the response character set
Character set designation (as a String) |
getResponseDocument | public Document getResponseDocument() throws SearchException(Code) | | Parse the server response (override as required)
Response Document |
getResponseHeader | public String getResponseHeader(String name)(Code) | | Fetch a named HTTP response parameter
Parameters: name - Parameter name Parameter value |
getResponseString | public String getResponseString()(Code) | | Get the server response text
The response (as a String) |
getSearchString | public String getSearchString()(Code) | | Fetch the current search text
The search string |
getSessionContext | public SessionContext getSessionContext()(Code) | | Get the SessionContext object for this user
The current SessionContext |
getSessionParameter | public String getSessionParameter(String consumer, String name)(Code) | | Fetch the requested general purpose parameter
Parameters: consumer - A unique name for the "user" of this object Parameters: name - Parameter name Parameter value (null if none) |
getSessionValue | public Object getSessionValue(String consumer, String name)(Code) | | Fetch the requested general purpose parameter
Parameters: consumer - A unique name for the "user" of this object Parameters: name - Parameter name Parameter value (null if none) |
getUrl | public String getUrl()(Code) | | Fetch the current search URL
The URL (as a String) |
initialize | public void initialize(SessionContext session)(Code) | | One time initialization
Parameters: session - SessionContext object |
newFullUrl | public URL newFullUrl(String baseComponent, String relativeComponent)(Code) | | Construct a new URL from base and relative components
Parameters: baseComponent - Base URL - the relative URL is added to this Parameters: relativeComponent - A partial (or full) URL that represents our target A full URL composed of the relative URL combined with "missing"portions taken from the base |
removeQueryUrl | public void removeQueryUrl(String consumer)(Code) | | Delete a stored query URL
Parameters: consumer - A unique name for the "user" of this object |
removeSessionParameter | public void removeSessionParameter(String consumer, String name)(Code) | | Delete the requested general purpose parameter
Parameters: consumer - A unique name for the "user" of this object Parameters: name - Parameter name |
setDefaultCharacterSet | public void setDefaultCharacterSet(String cs)(Code) | | Set the default character set for this transaction
Parameters: cs - Character set (UTF-8, ISO-8859-1, etc) |
setParameter | public void setParameter(String name, String value)(Code) | | Set up a name=value pair
Parameters: name - Parameter name Parameters: value - Parameter value |
setParametersFromFormInputs | public void setParametersFromFormInputs(Document pageDocument, String formName, List nameList) throws SearchException(Code) | | Produce a target URL for this query by combining the form "action" value
with the base URL of the query page
Parameters: pageDocument - The search engine query page (as a DOM Document) Parameters: formName - The name of the FORM to lookup(eg FORM name="formName" ) Parameters: nameList - A list of the parameters we're looking for |
setParametersFromInputNames | public void setParametersFromInputNames(Document pageDocument, List nameList)(Code) | | Set query parameters based on page-wide INPUTs
Parameters: pageDocument - The search engine query page (as a DOM Document) Parameters: nameList - A list of the parameters we're looking for |
setParametersFromInputValues | public void setParametersFromInputValues(Document pageDocument, List nameList)(Code) | | Set query parameters based on page-wide INPUTs
Parameters: pageDocument - The search engine query page (as a DOM Document) Parameters: nameList - A list of the parameters we're looking for |
setParametersFromNameList | public void setParametersFromNameList(NodeList nodeList, List nameList)(Code) | | Set query parameters based on element names (save name=value pairs)
Parameters: nodeList - List of Elements to evaluate Parameters: nameList - A list of the parameters we're looking for |
setParametersFromValueList | public void setParametersFromValueList(NodeList nodeList, List nameList)(Code) | | Set query parameters based on element values (save name=value pairs)
Parameters: nodeList - List of Elements to evaluate Parameters: nameList - A list of the parameters we're looking for |
setPreserveBaseUrlFile | public void setPreserveBaseUrlFile(boolean state)(Code) | | Set the "file preservation state" for getBaseUrlSpecification()
Parameters: state - true to preserve URL file portion |
setQueryDocument | public void setQueryDocument(String consumer, Document queryForm)(Code) | | Save the final query form as a DOM document
Parameters: consumer - A unique name for the "user" of this object Parameters: queryForm - Query page as a DOM document |
setQueryMethod | public void setQueryMethod(String method)(Code) | | Set the HTTP query method (post or get)
Parameters: method - METHOD_POST or METHOD_GET |
setQueryUrl | public void setQueryUrl(String consumer, String queryUrl)(Code) | | Save the URL for the query page
Parameters: consumer - A unique name for the "user" of this object Parameters: queryUrl - Address of the final query page |
setRedirectBehavior | public void setRedirectBehavior(int behavior) throws SearchException(Code) | | Establish a mechanism for handling redirects
Parameters: behavior - Specifies the desired behavior. Use one of:- REDIRECT_AUTOMATIC -
URLConnection handlesall redirects - REDIRECT_MANAGED - The
submit() codehandles any redirects - REDIRECT_MANAGED_SINGLESTEP - The caller will handle each redirect
|
setSearchString | public void setSearchString(String searchString)(Code) | | Specify the search text
Parameters: searchString - Text to look for |
setSessionParameter | public void setSessionParameter(String consumer, String name, String value)(Code) | | Save a general purpose parameter
Parameters: consumer - A unique name for the "user" of this object Parameters: name - Parameter name Parameters: value - Parameter value |
setSessionValue | public void setSessionValue(String consumer, String name, Object value)(Code) | | Save a general purpose parameter
Parameters: consumer - A unique name for the "user" of this object Parameters: name - Parameter name Parameters: value - Parameter value |
setUrl | public void setUrl(String url)(Code) | | Set search URL
Parameters: url - URL string |
setUrl | public void setUrl(URL url)(Code) | | Set search URL
Parameters: url - URL object |
setUrlFromAnchor | public void setUrlFromAnchor(Element anchor) throws SearchException(Code) | | Produce a target URL for this query by combining an anchor "href" value
with the base URL of the query page
Parameters: anchor - Anchor element |
setUrlFromForm | public void setUrlFromForm(Document pageDocument, String formName) throws SearchException(Code) | | Produce a target URL for this query by combining the form "action" value
with the base URL of the query page
Parameters: pageDocument - The search engine query page (as a DOM Document) Parameters: formName - The name of the FORM to lookup(eg FORM name="formName" ) |
submit | public int submit() throws SearchException(Code) | | Submit a request (POST or GET) and read the response. Various aspects
of the response can be inspected using the "getXXX()" methods.
Submission status code (200 = success) |
|
|