|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.ucsb.nceas.metacat.DBQuery
public class DBQuery
A Class that searches a relational DB for elements and attributes that have free text matches a query string, or structured query matches to a path specified node in the XML hierarchy. It returns a result set consisting of the document ID for each document that satisfies the query
| Constructor Summary | |
|---|---|
DBQuery()
construct an instance of the DBQuery class |
|
DBQuery(java.util.Vector docids)
Construct an instance of DBQuery Class BUT accept a docid Vector that will supersede the query.printSQL() method If a docid Vector is passed in, the docids will be used to create a simple IN query without the multiple subselects of the printSQL() method Using this constructor, we just check for a docidOverride Vector in the findResultDoclist() method |
|
| Method Summary | |
|---|---|
static void |
clearQueryResultCache()
Method to clear the query result cache. |
static java.lang.String |
createQuery(java.lang.String value)
format a simple free-text value query as an XML document that conforms to the pathquery.dtd and is appropriate for submission to the DBQuery structured query engine |
static java.lang.String |
createQuery(java.lang.String value,
java.lang.String doctype)
format a simple free-text value query as an XML document that conforms to the pathquery.dtd and is appropriate for submission to the DBQuery structured query engine |
java.lang.StringBuffer |
createResultDocument(java.lang.String xmlquery,
QuerySpecification qspec,
java.io.PrintWriter out,
java.lang.String user,
java.lang.String[] groups,
boolean useXMLIndex)
Transforms a hashtable of documents to an xml or html result and sent the content to outputstream. |
java.lang.StringBuffer |
createResultDocument(java.lang.String xmlquery,
QuerySpecification qspec,
java.io.PrintWriter out,
java.lang.String user,
java.lang.String[] groups,
boolean useXMLIndex,
int pagesize,
int pagestart,
java.lang.String sessionid)
|
static java.lang.String |
createSQuery(java.util.Hashtable params)
format a structured query as an XML document that conforms to the pathquery.dtd and is appropriate for submission to the DBQuery structured query engine |
void |
findDocuments(javax.servlet.http.HttpServletResponse response,
java.io.PrintWriter out,
java.util.Hashtable params,
java.lang.String user,
java.lang.String[] groups,
java.lang.String sessionid)
Method put the search result set into out printerwriter |
void |
findDocuments(javax.servlet.http.HttpServletResponse response,
java.io.PrintWriter out,
java.util.Hashtable params,
java.lang.String user,
java.lang.String[] groups,
java.lang.String sessionid,
boolean useXMLIndex)
Method put the search result set into out printerwriter |
java.util.zip.ZipOutputStream |
getZippedPackage(java.lang.String docIdString,
javax.servlet.ServletOutputStream out,
java.lang.String user,
java.lang.String[] groups,
java.lang.String passWord)
put a data packadge into a zip output stream |
static void |
main(java.lang.String[] args)
the main routine used to test the DBQuery utility. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DBQuery()
Generally, one would call the findDocuments() routine after creating an instance to specify the search query
parserName - the fully qualified name of a Java class implementing
the org.xml.sax.XMLReader interfacepublic DBQuery(java.util.Vector docids)
docids - List of docids to display in the resultset| Method Detail |
|---|
public static void main(java.lang.String[] args)
Usage: java DBQuery
xmlfile - the filename of the xml file containing the query
public void findDocuments(javax.servlet.http.HttpServletResponse response,
java.io.PrintWriter out,
java.util.Hashtable params,
java.lang.String user,
java.lang.String[] groups,
java.lang.String sessionid)
resoponse - the return responseout - the output printerparams - the paratermer hashtableuser - the user name (it maybe different to the one in param)groups - the group arraysessionid - the sessionid
public void findDocuments(javax.servlet.http.HttpServletResponse response,
java.io.PrintWriter out,
java.util.Hashtable params,
java.lang.String user,
java.lang.String[] groups,
java.lang.String sessionid,
boolean useXMLIndex)
resoponse - the return responseout - the output printerparams - the paratermer hashtableuser - the user name (it maybe different to the one in param)groups - the group arraysessionid - the sessionid
public java.lang.StringBuffer createResultDocument(java.lang.String xmlquery,
QuerySpecification qspec,
java.io.PrintWriter out,
java.lang.String user,
java.lang.String[] groups,
boolean useXMLIndex)
xmlquery - qspec - out - user - groups - useXMLIndex - sessionid -
public java.lang.StringBuffer createResultDocument(java.lang.String xmlquery,
QuerySpecification qspec,
java.io.PrintWriter out,
java.lang.String user,
java.lang.String[] groups,
boolean useXMLIndex,
int pagesize,
int pagestart,
java.lang.String sessionid)
public static void clearQueryResultCache()
public static java.lang.String createSQuery(java.util.Hashtable params)
params - The list of parameters that should be included in the
query
public static java.lang.String createQuery(java.lang.String value,
java.lang.String doctype)
value - the text string to search for in the xml catalogdoctype - the type of documents to include in the result set -- use
"any" or "ANY" for unfiltered result setspublic static java.lang.String createQuery(java.lang.String value)
value - the text string to search for in the xml catalog
public java.util.zip.ZipOutputStream getZippedPackage(java.lang.String docIdString,
javax.servlet.ServletOutputStream out,
java.lang.String user,
java.lang.String[] groups,
java.lang.String passWord)
throws java.lang.ClassNotFoundException,
java.io.IOException,
java.sql.SQLException,
McdbException,
java.lang.NumberFormatException,
java.lang.Exception
docId, - which the user want to put into zip output stream,it has versionout, - a servletoutput stream which the zip output stream will be
putuser, - the username of the usergroups, - the group of the user
java.lang.ClassNotFoundException
java.io.IOException
java.sql.SQLException
McdbException
java.lang.NumberFormatException
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||