Revision 2067
Added by Matt Jones about 20 years ago
MetaCatServlet.java | ||
---|---|---|
431 | 431 |
PrintWriter out = response.getWriter(); |
432 | 432 |
handleGetDTDSchemaAction(out, params, response); |
433 | 433 |
out.close(); |
434 |
} else if (action.equals("getdataguide")) { |
|
435 |
PrintWriter out = response.getWriter(); |
|
436 |
handleGetDataGuideAction(out, params, response); |
|
437 |
out.close(); |
|
438 | 434 |
} else if (action.equals("getlastdocid")) { |
439 | 435 |
PrintWriter out = response.getWriter(); |
440 | 436 |
handleGetMaxDocidAction(out, params, response); |
... | ... | |
2221 | 2217 |
} |
2222 | 2218 |
|
2223 | 2219 |
/** |
2224 |
* Handle the "getdataguide" action. |
|
2225 |
* Read Data Guide for a given doctype from db connection in XML format |
|
2226 |
*/ |
|
2227 |
private void handleGetDataGuideAction(PrintWriter out, Hashtable params, |
|
2228 |
HttpServletResponse response) { |
|
2229 |
|
|
2230 |
|
|
2231 |
String doctype = null; |
|
2232 |
String[] doctypeArr = (String[])params.get("doctype"); |
|
2233 |
|
|
2234 |
// get only the first doctype specified in the list of doctypes |
|
2235 |
// it could be done for all doctypes in that list |
|
2236 |
if (doctypeArr != null) { |
|
2237 |
doctype = ((String[])params.get("doctype"))[0]; |
|
2238 |
} |
|
2239 |
|
|
2240 |
try { |
|
2241 |
|
|
2242 |
|
|
2243 |
DBUtil dbutil = new DBUtil(); |
|
2244 |
String dataguide = dbutil.readDataGuide(doctype); |
|
2245 |
out.println(dataguide); |
|
2246 |
|
|
2247 |
} catch (Exception e) { |
|
2248 |
out.println("<?xml version=\"1.0\"?>"); |
|
2249 |
out.println("<error>"); |
|
2250 |
out.println(e.getMessage()); |
|
2251 |
out.println("</error>"); |
|
2252 |
} |
|
2253 |
|
|
2254 |
} |
|
2255 |
|
|
2256 |
/** |
|
2257 | 2220 |
* Handle the "getlastdocid" action. |
2258 | 2221 |
* Get the latest docid with rev number from db connection in XML format |
2259 | 2222 |
*/ |
Also available in: Unified diff
Removed the "getdataguide" action as it was always experimental and is no longer used in metacat or morpho.