Package org.openntf.domino.helpers

Examples of org.openntf.domino.helpers.DocumentSorter


  public DocumentCollection getSortedCollection() {
    String sSearch = "FIELD Author contains \"Aline Winters\"";
    org.openntf.domino.DocumentCollection dc = Factory.getSession().getCurrentDatabase().FTSearch(sSearch, 500);
    List criteria = new ArrayList();
    criteria.add("Date");
    DocumentSorter sorter = new org.openntf.domino.helpers.DocumentSorter(dc, criteria);
    DocumentCollection results = sorter.sort();
    ExtLibUtil.getViewScope().put("javaTest", results.getCount());
    return results;
  }
View Full Code Here


    List<String> criteria = new ArrayList<String>();
    criteria.add("MainSortValue");
    criteria.add("@modifieddate");
    try {
      DocumentSorter sorter = new DocumentSorter(coll, criteria);
      //      System.out.println("SORTING...");
      long startTime = System.nanoTime();
      DocumentCollection sortedColl = sorter.sort();
      long endTime = System.nanoTime();
      System.out.println("Completed resort in " + ((endTime - startTime) / 1000000) + "ms");
      //      System.out.println("SORTED");
      for (Document doc : sortedColl) {
        System.out.println(doc.getItemValueString("MainSortValue") + " " + doc.getLastModifiedDate().getTime() + " "
            + Integer.valueOf(doc.getNoteID(), 16));
      }
      DocumentSorter.DocumentData[] dataset = sorter._debugGetDataset();
      for (DocumentSorter.DocumentData data : dataset) {
        StringBuilder sb = new StringBuilder();
        for (Serializable s : data._debugGetValues()) {
          sb.append(s);
          sb.append(',');
View Full Code Here

    List<String> criteria = new ArrayList<String>();
    //    criteria.add("@doclength");
    criteria.add("@modifieddate");
    try {
      DocumentSorter sorter = null;

      //      if (indexDoc.hasItem("DocumentSorter")) {
      //        sorter = indexDoc.getItemValue("DocumentSorter", DocumentSorter.class);
      //        sorter.setDatabase(db);
      //        System.out.println("Starting resort of " + sorter.getCount() + " documents");
      //      } else {
      DocumentCollection coll = db.getAllDocuments();
      sorter = new DocumentSorter(coll, criteria);
      System.out.println("Starting resort of " + coll.getCount() + " documents");
      //      }
      //      System.out.println("SORTING...");

      long startTime = System.nanoTime();
      DocumentCollection sortedColl = sorter.sort();
      long endTime = System.nanoTime();
      System.out.println("Completed resort of " + sortedColl.getCount() + " in " + ((endTime - startTime) / 1000000) + " ms");
      //      int count = 0;
      //      for (Document doc : sortedColl) {
      //        //        System.out.println(doc.getLastModifiedDate().getTime() + " " + doc.getNoteID());
View Full Code Here

      last = new Date(0);
    int count = db.getModifiedNoteCount(last);

    if (count > 0) {
      DocumentCollection rawColl = db.getModifiedDocuments(last);
      DocumentSorter sorter = new DocumentSorter(rawColl, MOD_SORT_LIST);
      System.out.println("Scanning database " + db.getApiPath() + " with last date of " + last.getTime() + " and found "
          + rawColl.getCount() + " updates to scan");
      scanner.processSorter(sorter);

    }
View Full Code Here

TOP

Related Classes of org.openntf.domino.helpers.DocumentSorter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.