Examples of NoteCollection


Examples of lotus.domino.NoteCollection

      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      if (doc.hasItem("Form")) {
        String formName = doc.getItemValueString("Form");
        Form fm = currDb.getForm(formName);
        NoteCollection notes = currDb.createNoteCollection(false);
        notes.add(fm);
        ExtLibUtil.getViewScope().put("oldJavaTest", notes.getFirstNoteID());
      }
    } catch (NotesException e) {
      //handle Exception
    }
  }
View Full Code Here

Examples of lotus.domino.NoteCollection

        System.out.println("DOCWALK: noteid array has " + allDocs.getCount() + " entries in " + (walkEndTime - walkStartTime)
            / 1000 + "us");

        long ncStartTime = System.nanoTime();
        NoteCollection nc = db.createNoteCollection(false);
        nc.add(allDocs);
        nids = nc.getNoteIDs();
        long ncBuildTime = System.nanoTime();
        System.out
        .println("NOTECOLL: noteid array has " + nids.length + " entries in " + (ncBuildTime - ncStartTime) / 1000 + "us");
        //        for (int j = 0; j < nids.length; j++) {
        //          doc = db.getDocumentByID(Integer.toString(nids[j], 16));
        //        }
        //        long ncWalkTime = System.nanoTime();
        //        System.out.println("NOTECOLL: noteid array walked " + nids.length + " entries in " + (ncWalkTime - ncBuildTime) / 1000
        //            + "us");

        long mergeStartTime = System.nanoTime();
        DocumentCollection mergeColl = db.search("@False", db.getLastModified(), 1);
        for (int j = 0; j < nids.length; j++) {
          mergeColl.merge(nids[j]);
        }
        long mergeBuildTime = System.nanoTime();
        System.out.println("MERGECOLL: mergeColl has " + mergeColl.getCount() + " entries in " + (mergeBuildTime - mergeStartTime)
            / 1000 + "us");
        doc = mergeColl.getFirstDocument();
        while (doc != null) {
          nextDoc = mergeColl.getNextDocument(doc);
          @SuppressWarnings("unused")
          int n = Integer.valueOf(doc.getNoteID(), 16);
          doc.recycle();
          doc = nextDoc;
        }
        long mergeWalkTime = System.nanoTime();
        System.out.println("MERGECOLL: mergeColl walked " + mergeColl.getCount() + " entries in "
            + (mergeWalkTime - mergeBuildTime) / 1000 + "us");

        System.out.println("MERGECOLL: mergeColl total time " + mergeColl.getCount() + " entries in "
            + (mergeWalkTime - ncStartTime) / 1000 + "us");

        walkStartTime = System.nanoTime();
        doc = allDocs.getFirstDocument();
        i = 0;
        while (doc != null) {
          nextDoc = allDocs.getNextDocument(doc);
          nids[i++] = Integer.valueOf(doc.getNoteID(), 16);
          doc.recycle();
          doc = nextDoc;
        }
        walkEndTime = System.nanoTime();

        System.out.println("DOCWALK: noteid array has " + allDocs.getCount() + " entries in " + (walkEndTime - walkStartTime)
            / 1000 + "us");

        ncStartTime = System.nanoTime();
        nc = db.createNoteCollection(false);
        nc.add(allDocs);
        nids = nc.getNoteIDs();
        ncBuildTime = System.nanoTime();
        System.out
        .println("NOTECOLL: noteid array has " + nids.length + " entries in " + (ncBuildTime - ncStartTime) / 1000 + "us");
        //        for (int j = 0; j < nids.length; j++) {
        //          doc = db.getDocumentByID(Integer.toString(nids[j], 16));
        //        }
        //        long ncWalkTime = System.nanoTime();
        //        System.out.println("NOTECOLL: noteid array walked " + nids.length + " entries in " + (ncWalkTime - ncBuildTime) / 1000
        //            + "us");

        mergeStartTime = System.nanoTime();
        mergeColl = db.search("@False", db.getLastModified(), 1);
        for (int j = 0; j < nids.length; j++) {
          mergeColl.merge(nids[j]);
        }
        mergeBuildTime = System.nanoTime();
        System.out.println("MERGECOLL: mergeColl has " + mergeColl.getCount() + " entries in " + (mergeBuildTime - mergeStartTime)
            / 1000 + "us");
        doc = mergeColl.getFirstDocument();
        while (doc != null) {
          nextDoc = mergeColl.getNextDocument(doc);
          @SuppressWarnings("unused")
          int n = Integer.valueOf(doc.getNoteID(), 16);
          doc.recycle();
          doc = nextDoc;
        }
        mergeWalkTime = System.nanoTime();
        System.out.println("MERGECOLL: mergeColl walked " + mergeColl.getCount() + " entries in "
            + (mergeWalkTime - mergeBuildTime) / 1000 + "us");

        System.out.println("MERGECOLL: mergeColl total time " + mergeColl.getCount() + " entries in "
            + (mergeWalkTime - ncStartTime) / 1000 + "us");

        nc.recycle();
        allDocs.recycle();
        mergeColl.recycle();

      } catch (Throwable t) {
        t.printStackTrace();
View Full Code Here

Examples of lotus.domino.NoteCollection

    db.recycle();
  }

  public void run4(final Session session) throws NotesException {
    Database db = session.getDatabase("", "events4.nsf");
    NoteCollection cacheNC = db.createNoteCollection(false);
    cacheNC.setSelectDocuments(true);
    cacheNC.buildCollection();
    cacheNC.recycle();
    DocumentCollection cacheDc = db.getAllDocuments();
    Document cacheDoc = cacheDc.getFirstDocument();
    cacheDoc.recycle();
    cacheDc.recycle();
    db.recycle();

    db = session.getDatabase("", "events4.nsf");
    DocumentCollection dc = db.getAllDocuments();
    Document doc = dc.getFirstDocument();
    Document nextDoc = null;
    int dcCount = dc.getCount();
    int j = 0;
    String[] dcUnids = new String[dcCount];
    long dcStart = System.nanoTime();
    while (doc != null) {
      nextDoc = dc.getNextDocument(doc);
      dcUnids[j++] = doc.getUniversalID();
      doc.recycle();
      doc = nextDoc;
    }
    System.out.println("DocumentCollection strategy got UNIDs for " + dcCount + " docs in " + (System.nanoTime() - dcStart) / 1000
        + "us");
    dc.recycle();
    db.recycle();

    db = session.getDatabase("", "events4.nsf");
    NoteCollection nc3 = db.createNoteCollection(false);
    nc3.setSelectDocuments(true);
    nc3.buildCollection();
    int nc3Count = nc3.getCount();
    String[] nc3Unids = new String[nc3Count];
    int[] nids = nc3.getNoteIDs();
    int k = 0;
    long nc3Start = System.nanoTime();
    for (int id : nids) {
      nc3Unids[k++] = nc3.getUNID(Integer.toHexString(id));
    }
    System.out.println("NoteCollection strategy ints got UNIDs for " + nc3Count + " notes in " + (System.nanoTime() - nc3Start) / 1000
        + "us");
    nc3.recycle();
    db.recycle();

    db = session.getDatabase("", "events4.nsf");
    NoteCollection nc = db.createNoteCollection(false);
    nc.setSelectDocuments(true);
    nc.buildCollection();
    int ncCount = nc.getCount();
    String[] ncUnids = new String[ncCount];
    String nid = nc.getFirstNoteID();
    long ncStart = System.nanoTime();
    for (int i = 0; i < ncCount; i++) {
      ncUnids[i] = nc.getUNID(nid);
      nid = nc.getNextNoteID(nid);
    }
    System.out.println("NoteCollection strategy first/next got UNIDs for " + ncCount + " notes in " + (System.nanoTime() - ncStart)
        / 1000 + "us");
    nc.recycle();
    db.recycle();

    db = session.getDatabase("", "events4.nsf");
    NoteCollection nc2 = db.createNoteCollection(false);
    nc2.setSelectDocuments(true);
    nc2.buildCollection();
    int nc2Count = nc2.getCount();
    String[] nc2Unids = new String[nc2Count];
    nid = nc2.getFirstNoteID();
    long nc2Start = System.nanoTime();
    for (int i = 0; i < nc2Count; i++) {
      Document nc2doc = db.getDocumentByID(nid);
      nc2Unids[i] = nc2doc.getUniversalID();
      nc2doc.recycle();
      nid = nc2.getNextNoteID(nid);
    }
    System.out.println("NoteCollection strategy doc got UNIDs for " + nc2Count + " notes in " + (System.nanoTime() - nc2Start) / 1000
        + "us");
    nc2.recycle();
    db.recycle();

  }
View Full Code Here

Examples of lotus.domino.NoteCollection

  }

  public void run3(final Session session) throws NotesException {
    Database db = session.getDatabase("", "index.ntf");
    NoteCollection nc = db.createNoteCollection(false);
    nc.setSelectIcon(true);
    nc.setSelectAcl(true);
    nc.selectAllDesignElements(true);
    nc.buildCollection();
    DxlExporter export = session.createDxlExporter();
    export.setForceNoteFormat(true);
    export.setRichTextOption(DxlExporter.DXLRICHTEXTOPTION_RAW);
    String dxl = export.exportDxl(nc);
    nc.recycle();
    export.recycle();
    db.recycle();
    try {
      PrintWriter out = new PrintWriter("c:\\data\\index.dxl");
      out.println(dxl);
View Full Code Here

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

Examples of org.openntf.domino.NoteCollection

    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

Examples of org.openntf.domino.NoteCollection

    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

Examples of org.openntf.domino.NoteCollection

    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

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();

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

Examples of org.openntf.domino.NoteCollection

    }

    @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
TOP
Copyright © 2018 www.massapi.com. 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.