Project

General

Profile

« Previous | Next » 

Revision 2091

Added by Jing Tao about 20 years ago

Clean up some code.

View differences:

src/edu/ucsb/nceas/metacat/DBQuery.java
345 345
                                      DBConnection dbconn, boolean useXMLIndex )
346 346
                                      throws Exception
347 347
    {
348
      int offset = 800;
348
      int offset = 1;
349
      // this is a hack for offset
350
      if (out == null)
351
      {
352
        // for html page, we put everything into one page
353
        offset = 500000;
354
      }
355
      else
356
      {
357
          offset =
358
              (new Integer(MetaCatUtil.getOption("resultsetsize"))).intValue();
359
      }
349 360
      int count = 0;
350 361
      int index = 0;
351 362
      Hashtable docListResult = new Hashtable();
......
396 407
        // if there are returndocs to match, backtracking can be performed
397 408
        // otherwise, just return the document that was hit
398 409
        Vector returndocVec = qspec.getReturnDocList();
399
        if (returndocVec.size() != 0 && !returndocVec.contains(doctype)
410
         if (returndocVec.size() != 0 && !returndocVec.contains(doctype)
400 411
                        && !qspec.isPercentageSearch())
401 412
        {
402 413
           MetaCatUtil.debugMessage("Back tracing now...", 20);
......
458 469
                if (docid_org == null)
459 470
                {
460 471
                   MetaCatUtil.debugMessage("Docid_org was null.", 40);
461
                   continue;
472
                   //continue;
462 473
                }
463 474
                docid = docid_org.trim();
464 475
                docname = xmldoc.getDocname();
......
492 503
                // Store the document id and the root node id
493 504
                docListResult.put(docid, (String) document.toString());
494 505
                count++;
495
                index++;
496 506

  
507

  
497 508
                // Get the next package document linked to our hit
498 509
                hasBtRows = btrs.next();
499 510
              }//while
......
528 539
              // Store the document id and the root node id
529 540
              docListResult.put(docid, (String) document.toString());
530 541
              count++;
531
              index++;
532 542

  
543

  
533 544
        }//else
534 545
        // when doclist reached the offset number, send out doc list and empty
535 546
        // the hash table
......
557 568
     double docListTime = System.currentTimeMillis() / 1000;
558 569
     MetaCatUtil.debugMessage("prepare docid list time: "
559 570
                    + (docListTime - queryExecuteTime), 30);
560
     MetaCatUtil.debugMessage("total docid is ===== "+index, 30);
571

  
561 572
     return resultsetBuffer;
562 573
    }//findReturnDoclist
563 574

  
......
573 584
                                       DBConnection dbconn, boolean useXMLIndex)
574 585
                                       throws Exception
575 586
   {
576

  
577
     int index =0;
578 587
     //add return field
579 588
     partOfDoclist = addRetrunfield(partOfDoclist, qspec, user, groups,
580 589
                                        dbconn, useXMLIndex );
......
594 603
           if (out != null)
595 604
           {
596 605
             out.println(xmlElement);
597
             index++;
598 606
           }
599
           else
600
           {
601
             index++;
602
           }
603 607
           resultset.append(xmlElement);
604 608
      }//while
605
      MetaCatUtil.debugMessage("total package number is ======= = "+ index, 20);
609

  
606 610
      return resultset;
607 611
   }
608 612

  
......
1043 1047
        Object nextelement;
1044 1048
        //add the xml headers
1045 1049
        query.append("<?xml version=\"1.0\"?>\n");
1046
        query.append("<pathquery version=\"1.0\">\n");
1050
        query.append("<pathquery version=\"1.2\">\n");
1047 1051

  
1052

  
1053

  
1048 1054
        if (params.containsKey("meta_file_id")) {
1049 1055
            query.append("<meta_file_id>");
1050 1056
            query.append(((String[]) params.get("meta_file_id"))[0]);
......
1155 1161
            ignoredParams.add("owner");
1156 1162
            ignoredParams.add("site");
1157 1163
            ignoredParams.add("operator");
1164
            ignoredParams.add("sessionid");
1158 1165

  
1159 1166
            // Also ignore parameters listed in the properties file
1160 1167
            // so that they can be passed through to stylesheets

Also available in: Unified diff