Revision 745
Added by Matt Jones almost 23 years ago
MetaCatServlet.java | ||
---|---|---|
480 | 480 |
String xmlquery = ((String[])params.get("query"))[0]; |
481 | 481 |
String qformat = ((String[])params.get("qformat"))[0]; |
482 | 482 |
String resultdoc = null; |
483 |
String[] returndoc = null; |
|
484 |
if(params.contains("returndoctype")) |
|
485 |
{ |
|
486 |
returndoc = (String[])params.get("returndoctype"); |
|
487 |
} |
|
488 | 483 |
|
489 |
Hashtable doclist = runQuery(xmlquery, user, group, returndoc);
|
|
484 |
Hashtable doclist = runQuery(xmlquery, user, group); |
|
490 | 485 |
|
491 | 486 |
resultdoc = createResultDocument(doclist, transformQuery(xmlquery)); |
492 | 487 |
|
... | ... | |
513 | 508 |
HttpServletResponse response, String user, String group) |
514 | 509 |
{ |
515 | 510 |
//create the query and run it |
516 |
String[] returndoc = null; |
|
517 |
if(params.containsKey("returndoctype")) |
|
518 |
{ |
|
519 |
returndoc = (String[])params.get("returndoctype"); |
|
520 |
if (((String)returndoc[0]).equals("any") || |
|
521 |
((String)returndoc[0]).equals("ANY") || |
|
522 |
((String)returndoc[0]).equals("")) { |
|
523 |
returndoc = null; |
|
524 |
} |
|
525 |
} |
|
526 | 511 |
String xmlquery = DBQuery.createSQuery(params); |
527 |
Hashtable doclist = runQuery(xmlquery, user, group, returndoc);
|
|
512 |
Hashtable doclist = runQuery(xmlquery, user, group); |
|
528 | 513 |
String qformat = ((String[])params.get("qformat"))[0]; |
529 | 514 |
String resultdoc = null; |
530 | 515 |
|
... | ... | |
579 | 564 |
* |
580 | 565 |
* @param xmlquery the query to run |
581 | 566 |
*/ |
582 |
private Hashtable runQuery(String xmlquery, String user, String group, |
|
583 |
String[] returndoc) |
|
567 |
private Hashtable runQuery(String xmlquery, String user, String group) |
|
584 | 568 |
{ |
585 | 569 |
Hashtable doclist=null; |
586 | 570 |
Connection conn = null; |
... | ... | |
588 | 572 |
{ |
589 | 573 |
conn = util.getConnection(); |
590 | 574 |
DBQuery queryobj = new DBQuery(conn, saxparser); |
591 |
doclist = queryobj.findDocuments(new StringReader(xmlquery),user,group, |
|
592 |
returndoc); |
|
575 |
doclist = queryobj.findDocuments(new StringReader(xmlquery),user,group); |
|
593 | 576 |
util.returnConnection(conn); |
594 | 577 |
return doclist; |
595 | 578 |
} |
Also available in: Unified diff
Fixed bug in metacat where return doctypes were not being properly
back traced. Changed DBQuery.findDocuments() so that it no longer
takes a returndoc array, but instead retrieves the returndoc array
fromthe QUERYSpecification. The QuerySpecification was augmented
with a whole bunch of get/set accessor methods.