Project

General

Profile

« Previous | Next » 

Revision 3464

Added by Jing Tao about 17 years ago

Add a new method - query which can specify qformat.

View differences:

src/edu/ucsb/nceas/metacat/client/MetacatClient.java
276 276
    
277 277
    /**
278 278
     * Query the metacat document store with the given metacat-compatible
279
     * query document, and return the result set as a Reader.
279
     * query document and default qformat xml, and return the result set as a Reader.
280 280
     *
281 281
     * @param xmlQuery a Reader for accessing the XML version of the query
282 282
     * @return a Reader for accessing the result set
283 283
     */
284 284
    public Reader query(Reader xmlQuery) throws MetacatInaccessibleException,
285 285
            IOException {
286
        String qformat = "xml";
287
        return query(xmlQuery, qformat);
288
    }
289
    
290
    /**
291
     * Query the metacat document store with the given metacat-compatible
292
     * query document and qformat, and return the result set as a Reader.
293
     *
294
     * @param xmlQuery a Reader for accessing the XML version of the query
295
     * @param qformat the format of return doc. It can be xml, knb, lter and etal.
296
     * @return a Reader for accessing the result set
297
     */
298
    public Reader query(Reader xmlQuery, String qformat) throws MetacatInaccessibleException,
299
            IOException {
286 300
        Reader reader = null;
287 301
        String query = null;
288 302
        try {
......
294 308
        //set up properties
295 309
        Properties prop = new Properties();
296 310
        prop.put("action", "squery");
297
        prop.put("qformat", "xml");
311
        prop.put("qformat", qformat);
298 312
        prop.put("query", query);
299 313
        
300 314
        InputStream response = null;

Also available in: Unified diff