Package org.openntf.domino

Examples of org.openntf.domino.NoteCollection


        iterateForms(db);
      }
      Set<Document> secondReference = new HashSet<Document>();
      iterateAllDocuments(db, secondReference);
      //      System.gc();
      NoteCollection nc = db.createNoteCollection(false);
      nc.buildCollection();
      iterateSecondReferences(secondReference);
      iterateThirdReferences();

      View view = db.getView("NameMessageEventMessages");
      List<String> keys = new ArrayList<String>();
View Full Code Here


    int dbDocs = 0;
    try {
      Database db = session.getDatabase("", "imdb/movies.bak");
      dbDocs = db.getAllDocuments().getCount();
      long testStartTime = System.nanoTime();
      NoteCollection nc = db.createNoteCollection(false);
      nc.selectAllDataNotes(true);
      nc.setSelectionFormula("@Begins(Title; \"B\")"); //NTF comment or uncomment this to toggle testing selection formula impact
      nc.buildCollection();
      int[] nids = nc.getNoteIDs();
      long collectionTime = System.nanoTime();
      collectionBuildNS = collectionTime - testStartTime;
      collectionSize = nids.length;
      Document[] documents = new Document[collectionSize];
      for (int i = 0; i < collectionSize; i++) {
View Full Code Here

    int dbDocs = 0;
    try {
      Database db = session.getDatabase("", "imdb/movies.bak");
      dbDocs = db.getAllDocuments().getCount();
      long testStartTime = System.nanoTime();
      NoteCollection nc = db.createNoteCollection(false);
      nc.selectAllDataNotes(true);
      nc.setSelectionFormula("@Begins(Title; \"B\")"); //NTF comment or uncomment this to toggle testing selection formula impact
      nc.buildCollection();
      int[] nids = nc.getNoteIDs();
      long collectionTime = System.nanoTime();
      collectionBuildNS = collectionTime - testStartTime;
      collectionSize = nids.length;
      Document[] documents = new Document[collectionSize];
      for (int i = 0; i < collectionSize; i++) {
View Full Code Here

    try {
      NoteList notelist = new NoteList();
      marktime = System.nanoTime();
      timelog("Beginning first notelist...");
      NoteCollection notecoll = db.createNoteCollection(false);
      notecoll.setSelectDocuments(true);
      notecoll.setSelectionFormula("@Begins(Title; \"B\")");
      notecoll.buildCollection();
      //      DocumentCollection coll = db.search("@Begins(Title; \"B\")");
      timelog("Starting note coordinates of " + notecoll.getCount() + " documents");
      //      for (Document doc : notecoll) {
      for (String nid : notecoll) {
        NoteCoordinate nc = new NoteCoordinate(notecoll, nid);
        notelist.add(nc);
      }

      //      Database eventDb = session.getDatabase("", "events4.nsf");
      //      NoteCollection eventNotecoll = eventDb.createNoteCollection(false);
      //      eventNotecoll.setSelectDocuments(true);
      //      eventNotecoll.buildCollection();
      //      timelog("Continuing note coordinates of " + eventNotecoll.getCount() + " documents");
      //      for (String nid : eventNotecoll) {
      //        NoteCoordinate nc = new NoteCoordinate(eventNotecoll, nid);
      //        notelist.add(nc);
      //      }
      //      Database xspextDb = session.getDatabase("", "openntf/xpagesext.nsf");
      //      NoteCollection xspextNotecoll = xspextDb.createNoteCollection(false);
      //      xspextNotecoll.setSelectDocuments(true);
      //      xspextNotecoll.buildCollection();
      //      timelog("Continuing note coordinates of " + xspextNotecoll.getCount() + " documents");
      //      for (String nid : xspextNotecoll) {
      //        NoteCoordinate nc = new NoteCoordinate(xspextNotecoll, nid);
      //        notelist.add(nc);
      //      }

      byte[] bytes = notelist.toByteArray();
      int byteSize = bytes.length;
      timelog("Resulting bytearray is " + bytes.length + " so we expect " + (bytes.length / (2500 * 24)) + " items");
      //      File file = File.createTempFile("foo", "bar");
      //      FileOutputStream fos = new FileOutputStream(file);
      //      fos.write(bytes);
      //      fos.close();

      storeTest.writeBinary("imdbNoteList", bytes, 2500 * 24);
      storeTest.save();
      String storeId = storeTest.getUniversalID();
      storeTest.recycle();
      storeTest = null;

      //      coll.recycle();
      //      coll = null;

      notecoll.recycle();
      notecoll = null;
      //      eventNotecoll.recycle();
      //      eventNotecoll = null;
      //      eventDb.recycle();
      //      eventDb = null;
View Full Code Here

        iterateForms(db);
      }
      Set<Document> secondReference = new HashSet<Document>();
      iterateAllDocuments(db, secondReference);
      System.gc();
      NoteCollection nc = db.createNoteCollection(false);
      nc.buildCollection();
      iterateSecondReferences(secondReference);
      iterateThirdReferences();

      long elapsed = System.nanoTime() - start;
      StringBuilder sb = new StringBuilder();
View Full Code Here

    }

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public void Count(final Database db) {
      DocumentCollection dc = db.getAllDocuments();
      NoteCollection nc = db.createNoteCollection(false);
      nc.add(dc);

      Arrays.asList(nc.getNoteIDs());
      Set setAll = new HashSet(Arrays.asList(nc.getNoteIDs()));

      View allView = db.getView("All Documents");
      ViewEntryCollection vec = allView.getAllEntries();
      ViewEntry entry = vec.getFirstEntry();
      ViewEntry next = null;
View Full Code Here

   * @deprecated RPr: This might be very slow, so I suggest not to use this
   */
  @Override
  @Deprecated
  public NoteCollection getNoteCollection() {
    NoteCollection nc = getAncestorDatabase().createNoteCollection(false);
    nc.setSelectDocuments(true);
    nc.setSelectionFormula(getSelectionFormula());
    nc.buildCollection();
    return nc;
  }
View Full Code Here

        }
      }
    } else {
      // According to Tommy Valand's research, the fastest method is to build a NoteCollection with a matching selection formula
      // http://dontpanic82.blogspot.com/2013/06/benchmark-fetching-noteids-and.html
      NoteCollection nc = getNoteCollection();

      int[] nids = nc.getNoteIDs();

      // Arrays.sort(nids);
      // for (org.openntf.domino.Document doc : result) {
      // int nid = Integer.valueOf(doc.getNoteID(), 16);
      // if (!(Arrays.binarySearch(nids, nid) >= 0)) {
View Full Code Here

   *
   * @see org.openntf.domino.types.Design#getNoteID()
   */
  @Override
  public String getNoteID() {
    NoteCollection notes = this.getParent().createNoteCollection(false);
    notes.add(this);
    return notes.getFirstNoteID();
  }
View Full Code Here

   *
   * @see org.openntf.domino.types.Design#getNoteID()
   */
  @Override
  public String getNoteID() {
    NoteCollection notes = this.getParent().createNoteCollection(false);
    notes.add(this);
    return notes.getFirstNoteID();
  }
View Full Code Here

TOP

Related Classes of org.openntf.domino.NoteCollection

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.