|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
edu.ucsb.nceas.metacat.MetaCatServlet
A metadata catalog server implemented as a Java Servlet
Valid parameters are:
action=query -- query the values of all elements and attributes
and return a result set of nodes
action=squery -- structured query (see pathquery.dtd)
action=insert -- insert an XML document into the database store
action=update -- update an XML document that is in the database store
action=delete -- delete an XML document from the database store
action=validate -- vallidate the xml contained in valtext
action=read -- display an XML document in XML or HTML
doctype -- document type list returned by the query (publicID)
qformat=xml -- display resultset from query in XML
qformat=html -- display resultset from query in HTML
docid=34 -- display the document with the document ID number 34
doctext -- XML text of the document to load into the database
acltext -- XML access text for a document to load into the database
dtdtext -- XML DTD text for a new DTD to load into Metacat XML Catalog
query -- actual query text (to go with 'action=query' or 'action=squery')
valtext -- XML text to be validated
action=getdatadoc -- retreive a stored datadocument
action=getdoctypes -- retreive all doctypes (publicID)
action=getdataguide -- retreive a Data Guide
datadoc -- data document name (id)
The particular combination of parameters that are valid for each particular action value is quite specific. This documentation will be reorganized to reflect this information.
Constructor Summary | |
MetaCatServlet()
|
Method Summary | |
protected java.lang.String |
createResultDocument(java.util.Hashtable doclist,
java.lang.String xmlquery)
Transforms a hashtable of documents to an xml or html result. |
protected java.lang.String |
decodeMouseAction(java.util.Hashtable params)
decodes the mouse click information coming from the client. |
void |
destroy()
Close all db connections from the pool |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle "GET" method requests from HTTP clients |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handle "POST" method requests from HTTP clients |
protected void |
handleQuery(java.io.PrintWriter out,
java.util.Hashtable params,
javax.servlet.http.HttpServletResponse response,
java.lang.String user,
java.lang.String group)
Create the xml query, execute it and display the results. |
protected void |
handleSQuery(java.io.PrintWriter out,
java.util.Hashtable params,
javax.servlet.http.HttpServletResponse response,
java.lang.String user,
java.lang.String group)
Retreive the squery xml, execute it and display it |
void |
init(javax.servlet.ServletConfig config)
Initialize the servlet by creating appropriate database connections |
protected java.lang.String |
transformQuery(java.util.Hashtable params)
Removes the tag from the beginning of xmlquery so it can properly be placed in the |
protected java.lang.String |
transformQuery(java.lang.String xmlquery)
removes the tag from the beginning. |
protected void |
transformResultset(java.lang.String resultdoc,
javax.servlet.http.HttpServletResponse response,
java.io.PrintWriter out)
Transorms an xml resultset document to html and sends it to the browser |
Constructor Detail |
public MetaCatServlet()
Method Detail |
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
public void destroy()
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
protected java.lang.String decodeMouseAction(java.util.Hashtable params)
params
- the parameters from the CGIprotected void handleSQuery(java.io.PrintWriter out, java.util.Hashtable params, javax.servlet.http.HttpServletResponse response, java.lang.String user, java.lang.String group)
out
- the output stream to the clientparams
- the Hashtable of parameters that should be included
in the squery.response
- the response object linked to the clientconn
- the database connectionprotected void handleQuery(java.io.PrintWriter out, java.util.Hashtable params, javax.servlet.http.HttpServletResponse response, java.lang.String user, java.lang.String group)
out
- the output stream to the clientparams
- the Hashtable of parameters that should be included
in the squery.response
- the response object linked to the clientprotected java.lang.String transformQuery(java.util.Hashtable params)
xmlquery
- is the query to remove the tag from.protected java.lang.String transformQuery(java.lang.String xmlquery)
xmlquery
- a string representing a query.protected void transformResultset(java.lang.String resultdoc, javax.servlet.http.HttpServletResponse response, java.io.PrintWriter out)
resultdoc
- the string representation of the document that needs
to be transformed.response
- the HttpServletResponse object bound to the client.out
- the output stream to the clientprotected java.lang.String createResultDocument(java.util.Hashtable doclist, java.lang.String xmlquery)
doclist-
- the hashtable to transformxmlquery-
- the query that returned the dolist resultresultdoc-
- the document type to backtrack to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |