Package org.openntf.domino

Examples of org.openntf.domino.DocumentCollection


      View view = db.getView("allStates");
      Document state = view.getFirstDocumentByKey(selVal, true);
      state.replaceItemValue("txnTest", new Date());
      sb.append("...Updated State pending committal, value is " + state.get("txnTest").toString());
      View contacts = db.getView("AllContactsByState");
      DocumentCollection dc = contacts.getAllDocumentsByKey(selVal, true);
      for (Document doc : dc) {
        if (toggle) {
          doc.replaceItemValue("txnTest", new Date());
          count += 1;
        }
View Full Code Here


     */
    private void iterateAllDocuments(final Database db, final Set<Document> secondReference) {
      System.out.println("Thread " + Thread.currentThread().getName() + " BEGINNING ITERATION of Documents");
      Session s = db.getParent();

      DocumentCollection dc = db.getAllDocuments();
      for (Document doc : dc) {
        docCount++;
        Vector v = doc.getItemValue("$UpdatedBy");
        for (Object o : v) {
          if (o instanceof String) {
View Full Code Here

      View view = db.getView("NameMessageEventMessages");
      List<String> keys = new ArrayList<String>();
      keys.add("Mail");
      keys.add("2");
      DocumentCollection dc = view.getAllDocumentsByKey(keys, false);
      System.out.println("dc: " + dc.getCount());
      StringBuilder sbc = new StringBuilder();
      for (Document doc : dc) {
        sbc.append(doc.getNoteID());
      }

      //      System.out.println("nids: " + sbc.toString());

      DocumentCollection allViewDocs = view.getAllDocuments();
      System.out.println("all view docs: " + allViewDocs.getCount());

      long elapsed = System.nanoTime() - start;
      StringBuilder sb = new StringBuilder();
      sb.append("Thread " + Thread.currentThread().getName());
      sb.append(" *** ALL OPERATIONS COMPLETE elapsed time: ");
View Full Code Here

    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    View contactsByState = currDb.getView("AllContactsByState");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    DocumentCollection dc = contactsByState.getAllDocumentsByKey("CA", true);
    doc.put("javaDCField", dc);
    doc.save(true, false);
    DocumentCollection srcDc = doc.getItemValue("javaDCField", DocumentCollection.class);
    StringBuilder sb = new StringBuilder();
    for (Document savedDoc : srcDc) {
      sb.append(savedDoc.getNoteID());
      sb.append(", ");
    }
View Full Code Here

  public void run() {
    long testStartTime = System.nanoTime();
    try {
      Session session = this.getSession();
      Database db = session.getDatabase("", "events4.nsf");
      DocumentCollection coll = db.getAllDocuments();
      for (Document doc : coll) {
        System.out.println("nid: " + doc.getNoteID());
      }
      long endTime = System.nanoTime();
    } catch (Throwable t) {
View Full Code Here

    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CA");
    DocumentCollection dc = view.getAllDocumentsByKey(key, true);
    for (Document doc : dc) {
      sb.append(doc.get("FirstName") + " " + doc.get("LastName") + "...");
    }
    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
  }
View Full Code Here

    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CX");
    DocumentCollection dc = view.getAllDocumentsByKey(key, true);
    sb.append("Getting values...");
    for (Document doc : dc) {
      sb.append(doc.get("FirstName") + " " + doc.get("LastName") + "...");
    }
    sb.append("Done");
View Full Code Here

    syncMap.put("Name", "StateName");
    syncMap.put("@Now", "LastSync");
    DocumentSyncHelper helper = new DocumentSyncHelper(DocumentSyncHelper.Strategy.CREATE_AND_REPLACE, syncMap,
        currDb.getServer(), currDb.getFilePath(), "AllContactsByState", "Key");
    View states = currDb.getView("AllStates");
    DocumentCollection sourceCollection = states.getAllDocuments();
    helper.process(sourceCollection);
    ExtLibUtil.getViewScope().put("javaTest", "Done");
  }
View Full Code Here

    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

    private void iterateAllDocuments(final Set<Document> secondReference) {
      System.out.println("Thread " + Thread.currentThread().getName() + " BEGINNING ITERATION of Documents");
      @SuppressWarnings("unused")
      Session s = db.getParent();
      org.openntf.domino.transactions.DatabaseTransaction txn = db.startTransaction();
      DocumentCollection dc = db.getAllDocuments();
      for (Document doc : dc) {
        docCount++;

        if (docCount % 1000 == 0) {
          secondReference.add(db.getDocumentByID(doc.getNoteID()));
View Full Code Here

TOP

Related Classes of org.openntf.domino.DocumentCollection

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.