Package org.openntf.domino

Examples of org.openntf.domino.View


    @Override
    public void run() {

      Session s = Factory.getSession();
      Database source = s.getDatabase("", TARGET, true);
      View view = source.getView(VIEW);
      System.out.println("-- START --");
      long start = System.nanoTime();

      if (null != view) {
        view.setAutoUpdate(false);

        System.out.println(view.getEntryCount());

        ViewNavigator nav = view.createViewNav();
        nav.setCacheSize(400);
        System.out.println("CacheSize: " + nav.getCacheSize());

        view.setAutoUpdate(true);
        ViewEntry entry = null;
        entry = nav.getFirst();
        while (null != entry) {
          entry = nav.getNext(entry);
        }
View Full Code Here


  public void doGetPut() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    View threads = currDb.getView("AllContacts");
    Document doc = threads.getFirstDocument();
    if (!doc.hasItem("documentToggle")) {
      doc.put("documentToggle", true);
    } else {
      doc.put("documentToggle", null);
    }
View Full Code Here

  private static final long serialVersionUID = 1L;

  public void processView() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allStates");
    for (ViewEntry currentEntry : view.getAllEntries()) {
      sb.append(currentEntry.getNoteID() + "..."); // Do whatever it is you actually want to get done
    }
    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
  }
View Full Code Here

  }

  public void getAllEntriesByKey() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CA");
    ViewEntryCollection ec = view.getAllEntriesByKey(key, true);
    for (ViewEntry entry : ec) {
      sb.append(entry.getColumnValues().get(7) + "...");
    }
    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
  }
View Full Code Here

  }

  public void getAllDocumentsByKey() {
    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

  }

  public void getAllDocumentsByKeyNoMatch() {
    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

  }

  public void getAllEntriesByKeyNoMatch() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CX");
    ViewEntryCollection ec = view.getAllEntriesByKey(key, true);
    sb.append("Getting values...");
    for (ViewEntry entry : ec) {
      sb.append(entry.getColumnValues().get(7) + "...");
    }
    sb.append("Done");
View Full Code Here

      StringBuilder sb = new StringBuilder();
      Database db = Factory.getSession().getCurrentDatabase();
      Document doc = db.createDocument();
      doc.put("FirstName", "Aaron");
      doc.put("LastName", "Monroe");
      View view = db.getView("AllContacts");
      ArrayList<String> key = new ArrayList<String>();
      key.add(doc.getItemValueString("FirstName"));
      key.add(doc.getItemValueString("LastName"));
      if (view.checkUnique(key, doc)) {
        sb.append("No document yet exists with name Aaron Monroe");
      } else {
        sb.append("Document already exists with name Aaron Monroe");
      }
      ExtLibUtil.getViewScope().put("javaTest", sb.toString());
View Full Code Here

    syncMap.put("Key", "State");
    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

    try {
      Database db = session.getDatabase("", "imdb/movies.nsf");
      //      db.setDelayUpdates(true);
      marktime = System.nanoTime();
      timelog("Beginning view build...");
      View byLength = db.getView("byLength");
      View btitles = db.createView("BTitles", "@Begins(Title; \"B\")", byLength);
      //      View btitles = db.createView("BTitles", "@Begins(Title; \"B\")");
      ViewColumn length = btitles.createColumn(1, "Title", "Title");
      length.setSorted(true);
      timelog("View defined.");
      btitles.refresh();
      timelog("Completed view build.");
      ViewEntryCollection vec = btitles.getAllEntries();
      int count = vec.getCount();
      timelog("Found " + count + " documents in the view");
      btitles.remove();
      timelog("Removed view.");
      btitles.recycle();
      db.recycle();
    } catch (Throwable t) {
      t.printStackTrace();
    } finally {
      long testEndTime = System.nanoTime();
View Full Code Here

TOP

Related Classes of org.openntf.domino.View

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.