Package org.openntf.domino

Examples of org.openntf.domino.View


  }

  public void setDocumentCollectionField() {
    Session s = Factory.getSession();
    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) {
View Full Code Here


  }

  public void setMapField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    TreeMap<String, String> testMap = new TreeMap<String, String>();
    testMap.put("Per", "Denmark");
    testMap.put("John", "South Africa");
    testMap.put("Mark", "Netherlands");
    testMap.put("Paul", "UK");
View Full Code Here

        try {
          StringBuilder sb = new StringBuilder();
          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");
          }
          System.out.println(sb.toString());
View Full Code Here

  public void breakNames() {
    try {
      Session s = Factory.getSession();
      Database currDb = s.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      Item testItem = doc.replaceItemValue("muppetField", 1);
      testItem.setNames(true);
      doc.save(true, false);
    } catch (Throwable t) {
      ExtLibUtil.getViewScope().put("javaTest", t.getClass().getName() + ": " + t.getLocalizedMessage());
View Full Code Here

  public void testNamesAuthorsReaders() {
    try {
      StringBuilder sb = new StringBuilder();
      Session s = Factory.getSession();
      Database currDb = s.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      Item testItem = doc.replaceItemValue("readersAuthorsNamesField", s.getEffectiveUserName());
      sb.append("Checking if Item is Readers, Names or Authors...");
      sb.append(testItem.isReadersNamesAuthors());
      testItem.setNames(true);
      testItem.setAuthors(true);
View Full Code Here

  public void getDocAsJson() {
    try {
      Session s = Factory.getSession();
      Database currDb = s.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      ExtLibUtil.getViewScope().put("javaTest", doc.toJson(true));
    } catch (Throwable t) {

    }
  }
View Full Code Here

      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;
      while (entry != null) {
        next = vec.getNextEntry(entry);
        setAll.remove(entry.getNoteIDAsInt());
View Full Code Here

  public void dateTimeIsBeforeTest() {
    StringBuilder sb = new StringBuilder();
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View threadsByDate = currDb.getView("AllThreadsByDate");
    ViewNavigator vNav = threadsByDate.createViewNav();
    vNav.setEntryOptions(org.openntf.domino.ViewNavigator.VN_ENTRYOPT_NOCOLUMNVALUES);
    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(20);
    ViewEntry firstEnt = vNav.getNth(randomInt);
    while (!firstEnt.isDocument()) {
View Full Code Here

  public void dateTimeIsAfterTest() {
    StringBuilder sb = new StringBuilder();
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View threadsByDate = currDb.getView("AllThreadsByDate");
    ViewNavigator vNav = threadsByDate.createViewNav();
    vNav.setEntryOptions(org.openntf.domino.ViewNavigator.VN_ENTRYOPT_NOCOLUMNVALUES);
    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(20);
    ViewEntry firstEnt = vNav.getNth(randomInt);
    while (!firstEnt.isDocument()) {
View Full Code Here

  public void dateTimeEqualsTest() {
    StringBuilder sb = new StringBuilder();
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View threads = currDb.getView("AllThreads");
    Random randomGenerator = new Random();
    int randomInt = randomGenerator.nextInt(100);
    Document firstDoc = threads.getNthDocument(randomInt);
    randomInt = randomGenerator.nextInt(100);
    Document secondDoc = threads.getNthDocument(randomInt);
    String firstDt = firstDoc.getFirstItem("Date").getText();
    String secondDt = secondDoc.getFirstItem("Date").getText();
    DateTime firstDate = s.createDateTime(firstDt);
    DateTime secondDate = s.createDateTime(secondDt);
    sb.append("Comparing " + firstDt + " (" + firstDoc.getUniversalID() + ") with " + secondDt + " ("
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.