Package org.openntf.domino

Examples of org.openntf.domino.View


  public void containsCheckItems() {
    StringBuilder sb = new StringBuilder();
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    ArrayList<String> items = new ArrayList<String>();
    items.add("FirstName");
    items.add("LastName");
    items.add("City");
    int count = 0;
    for (ViewEntry ent : contacts.getAllEntries()) {
      if (ent.getDocument().containsValue("Aurora", items)) {
        count += 1;
      }
    }
    sb.append(Integer.toString(count) + " documents contained a value 'Aurora'");
    sb.append("..............");
    Document testDoc = contacts.getFirstDocument();
    if (testDoc.containsKey("Form")) {
      sb.append("First doc contains key Form");
    } else {
      sb.append("First doc does not contain key Form");
    }
View Full Code Here


  }

  public void getCreated() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
    String formatted = format.format(doc.getCreatedDate());
    ExtLibUtil.getViewScope().put("javaTest", formatted);
  }
View Full Code Here

  }

  public void getCreatedOld() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    DateTime created = doc.getCreated();
    SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
    String formatted = format.format(created.toJavaDate());
    ExtLibUtil.getViewScope().put("javaTest", formatted);
  }
View Full Code Here

  }

  public void getOtherDates() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    StringBuilder sb = new StringBuilder();
    SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy hh:mm");
    sb.append("Created: " + format.format(doc.getCreatedDate()));
    sb.append("....");
    sb.append("First modified: " + format.format(doc.getInitiallyModifiedDate()));
View Full Code Here

  }

  public void getFormName() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    ExtLibUtil.getViewScope().put("javaTest", doc.getFormName());
  }
View Full Code Here

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

        for (ViewEntry entry : view.getAllEntries()) {

        }
        /* */
        view.setAutoUpdate(true);
      }

      long elapsed = System.nanoTime() - start;
      System.out.println("-- STOP --");
      System.out.println("Thread " + Thread.currentThread().getName() + " elapsed time: " + elapsed / 1000000 + "ms");
View Full Code Here

  }

  public void getForm() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    ExtLibUtil.getViewScope().put("javaTest", doc.getForm().getNoteID());
  }
View Full Code Here

  }

  public void replaceItemValueSummary() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    StringBuilder sb = new StringBuilder();
    sb.append("Here is a value");
    Item itm = doc.replaceItemValue("summaryField", sb, true);
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("summaryField") + " " + Boolean.toString(itm.isSummary()));
View Full Code Here

  }

  public void setDateField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    doc.put("javaDateField", new Date());
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaDateField"));
  }
View Full Code Here

  }

  public void setFormulaField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    Formula fm = new Formula("@DocumentUniqueID");
    doc.put("javaFormulaField", "Document UNID is " + fm.getValue(doc));
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaFormulaField"));
  }
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.