Project

General

Profile

« Previous | Next » 

Revision 167

Added by Matt Jones over 24 years ago

minor modifications to fix problems introduced with AccessionNumber module

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
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>");
src/edu/ucsb/nceas/metacat/DBSimpleQuery.java
144 144
      String docname = null;
145 145
      String doctype = null;
146 146
      String doctitle = null;
147
      StringBuffer document = null; 
147
      //StringBuffer document = null; 
148 148

  
149 149
      try {
150 150
        if (requestedDoctype == null || 
......
182 182
          doctype = rs.getString(3);
183 183
          doctitle = rs.getString(4);
184 184

  
185
          document = new StringBuffer();
185
          StringBuffer document = new StringBuffer();
186 186
          document.append("<docid>").append(docid).append("</docid>");
187

  
187 188
          if (docname != null) {
188 189
            document.append("<docname>" + docname + "</docname>");
189 190
          }

Also available in: Unified diff