Revision 375
Added by berkley over 24 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
159 | 159 |
/** |
160 | 160 |
* Control servlet response depending on the action parameter specified |
161 | 161 |
*/ |
162 |
private void handleGetOrPost(HttpServletRequest request,
|
|
162 |
protected void handleGetOrPost(HttpServletRequest request,
|
|
163 | 163 |
HttpServletResponse response) |
164 | 164 |
throws ServletException, IOException |
165 | 165 |
{ |
... | ... | |
295 | 295 |
* @return action the action to be performed or "error" if an error was |
296 | 296 |
* generated |
297 | 297 |
*/ |
298 |
private String decodeMouseAction(Hashtable params)
|
|
298 |
protected String decodeMouseAction(Hashtable params)
|
|
299 | 299 |
{ |
300 | 300 |
// Determine what type of request the user made |
301 | 301 |
// if the action parameter is set, use it as a default |
... | ... | |
413 | 413 |
* @param response is the response object linked to the client |
414 | 414 |
* @param conn the database connection |
415 | 415 |
*/ |
416 |
private String handleSQuery(String xmlquery)
|
|
416 |
protected String handleSQuery(String xmlquery)
|
|
417 | 417 |
{ |
418 | 418 |
Hashtable doclist = runQuery(xmlquery); |
419 | 419 |
String resultdoc = createResultDocument(doclist, xmlquery); |
... | ... | |
427 | 427 |
* in the squery. |
428 | 428 |
* @param response is the response object linked to the client |
429 | 429 |
*/ |
430 |
private void handleQuery(PrintWriter out, Hashtable params,
|
|
430 |
protected void handleQuery(PrintWriter out, Hashtable params,
|
|
431 | 431 |
HttpServletResponse response) |
432 | 432 |
{ |
433 | 433 |
|
... | ... | |
457 | 457 |
* Run the query and return a hashtable of results. |
458 | 458 |
* @param xmlquery the query to run |
459 | 459 |
*/ |
460 |
private Hashtable runQuery(String xmlquery)
|
|
460 |
protected Hashtable runQuery(String xmlquery)
|
|
461 | 461 |
{ |
462 | 462 |
Hashtable doclist=null; |
463 | 463 |
Connection conn = null; |
... | ... | |
487 | 487 |
* to be transformed. |
488 | 488 |
* @param response the HttpServletResponse object bound to the client. |
489 | 489 |
* @param out the output stream to the client |
490 |
*/ |
|
491 |
private void transformResultset(String resultdoc,
|
|
490 |
*/
|
|
491 |
protected void transformResultset(String resultdoc,
|
|
492 | 492 |
HttpServletResponse response, |
493 | 493 |
PrintWriter out) |
494 | 494 |
{ |
... | ... | |
515 | 515 |
* @param doclist- the hashtable to transform |
516 | 516 |
* @param xmlquery- the query that returned the dolist result |
517 | 517 |
*/ |
518 |
private String createResultDocument(Hashtable doclist, String xmlquery)
|
|
518 |
protected String createResultDocument(Hashtable doclist, String xmlquery)
|
|
519 | 519 |
{ |
520 | 520 |
// Create a buffer to hold the xml result |
521 | 521 |
StringBuffer resultset = new StringBuffer(); |
... | ... | |
528 | 528 |
//the following should work but it doesn't because the parser doesn't |
529 | 529 |
//like the <?xml?> tag inside the <query> tag. This is supposed to be |
530 | 530 |
//the way that the query itself is sent back to the client. |
531 |
|
|
531 | 532 |
//resultset.append(" <query>" + xmlquery + "</query>"); |
533 |
|
|
532 | 534 |
Enumeration doclistkeys = doclist.keys(); |
533 | 535 |
while (doclistkeys.hasMoreElements()) |
534 | 536 |
{ |
... | ... | |
544 | 546 |
* Handle the database getdocument request and return a XML document, |
545 | 547 |
* possibly transformed from XML into HTML |
546 | 548 |
*/ |
547 |
private void handleGetDocumentAction(PrintWriter out, Hashtable params,
|
|
549 |
protected void handleGetDocumentAction(PrintWriter out, Hashtable params,
|
|
548 | 550 |
HttpServletResponse response) |
549 | 551 |
throws ClassNotFoundException, IOException, SQLException { |
550 | 552 |
String docidstr = null; |
... | ... | |
600 | 602 |
* Handle the database putdocument request and write an XML document |
601 | 603 |
* to the database connection |
602 | 604 |
*/ |
603 |
private void handleInsertOrUpdateAction(PrintWriter out, Hashtable params,
|
|
605 |
protected void handleInsertOrUpdateAction(PrintWriter out, Hashtable params,
|
|
604 | 606 |
HttpServletResponse response) { |
605 | 607 |
|
606 | 608 |
Connection conn = null; |
... | ... | |
693 | 695 |
// NOTE -- NEED TO TEST HERE |
694 | 696 |
// FOR EXISTENCE OF PARAM |
695 | 697 |
// BEFORE ACCESSING ARRAY |
696 |
try { |
|
698 |
try {
|
|
697 | 699 |
dbw.delete(docid[0]); |
698 | 700 |
response.setContentType("text/xml"); |
699 | 701 |
out.println("<?xml version=\"1.0\"?>"); |
... | ... | |
905 | 907 |
|
906 | 908 |
/** |
907 | 909 |
* '$Log$ |
910 |
* 'Revision 1.74 2000/08/17 16:04:20 berkley |
|
911 |
* 'Changed the flow of query and SQuery. SQuery now only handles a preformatted pathquery document as input (in the "query" parameter). |
|
912 |
* 'HandleQuery now handles all structured queries derived by CGI parameters. |
|
913 |
* ' |
|
908 | 914 |
* 'Revision 1.73 2000/08/16 20:08:20 berkley |
909 | 915 |
* 'fixed bug with handleSQuery() that kept DMan from access the squery functionality |
910 | 916 |
* ' |
Also available in: Unified diff
changed the prototype of overwritable functions to "protected" instead of "private".