241 |
241 |
private void handleQueryAction(PrintWriter out, Hashtable params,
|
242 |
242 |
HttpServletResponse response) {
|
243 |
243 |
// Run the query
|
244 |
|
Hashtable nodelist = null;
|
|
244 |
Hashtable doclist = null;
|
245 |
245 |
String query = ((String[])params.get("query"))[0];
|
246 |
246 |
String[] doctypeArr = (String[])params.get("doctype");
|
247 |
247 |
String doctype = null;
|
... | ... | |
250 |
250 |
}
|
251 |
251 |
if (queryobj != null) {
|
252 |
252 |
if (doctype != null) {
|
253 |
|
nodelist = queryobj.findDocuments(query,doctype);
|
|
253 |
doclist = queryobj.findDocuments(query,doctype);
|
254 |
254 |
} else {
|
255 |
|
nodelist = queryobj.findDocuments(query);
|
|
255 |
doclist = queryobj.findDocuments(query);
|
256 |
256 |
}
|
257 |
257 |
} else {
|
258 |
258 |
out.println("Query Object Init failed.");
|
... | ... | |
268 |
268 |
StringBuffer resultset = new StringBuffer();
|
269 |
269 |
|
270 |
270 |
// Print the resulting root nodes
|
271 |
|
Long nodeid;
|
|
271 |
String docid;
|
272 |
272 |
String document = null;
|
273 |
273 |
resultset.append("<?xml version=\"1.0\"?>\n");
|
274 |
274 |
//resultset.append("<!DOCTYPE resultset PUBLIC " +
|
275 |
275 |
// "\"-//NCEAS//resultset//EN\" \"resultset.dtd\">\n");
|
276 |
276 |
resultset.append("<resultset>\n");
|
277 |
277 |
resultset.append(" <query>" + query + "</query>");
|
278 |
|
Enumeration rootlist = nodelist.keys();
|
279 |
|
while (rootlist.hasMoreElements()) {
|
280 |
|
nodeid = (Long)rootlist.nextElement();
|
281 |
|
document = (String)nodelist.get(nodeid);
|
|
278 |
Enumeration doclistkeys = doclist.keys();
|
|
279 |
while (doclistkeys.hasMoreElements()) {
|
|
280 |
docid = (String)doclistkeys.nextElement();
|
|
281 |
document = (String)doclist.get(docid);
|
282 |
282 |
resultset.append(" <document>" + document + "</document>");
|
283 |
283 |
}
|
284 |
284 |
resultset.append("</resultset>");
|
minor modifications to fix problems introduced with AccessionNumber module