Package org.openntf.domino

Examples of org.openntf.domino.Document


    randomInt = randomGenerator.nextInt(20);
    ViewEntry secondEnt = vNav.getNth(randomInt);
    while (!secondEnt.isDocument()) {
      secondEnt = vNav.getNext();
    }
    Document firstDoc = firstEnt.getDocument();
    Document secondDoc = secondEnt.getDocument();
    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.isBefore(secondDate)) {
      sb.append("first before second");
    } else {
      sb.append("first NOT before second");
    }
    sb.append("..........................................................................................");
    sb.append("Comparing " + secondDt + " (" + secondDoc.getUniversalID() + ") with " + firstDt + " ("
        + firstDoc.getUniversalID() + ")...");
    if (secondDate.isBefore(firstDate)) {
      sb.append("second before first");
    } else {
      sb.append("second NOT before first");
View Full Code Here


    randomInt = randomGenerator.nextInt(20);
    ViewEntry secondEnt = vNav.getNth(randomInt);
    while (!secondEnt.isDocument()) {
      secondEnt = vNav.getNext();
    }
    Document firstDoc = firstEnt.getDocument();
    Document secondDoc = secondEnt.getDocument();
    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.isAfter(secondDate)) {
      sb.append("first after second");
    } else {
      sb.append("first NOT after second");
    }
    sb.append("..........................................................................................");
    sb.append("Comparing " + secondDt + " (" + secondDoc.getUniversalID() + ") with " + firstDt + " ("
        + firstDoc.getUniversalID() + ")...");
    if (secondDate.isAfter(firstDate)) {
      sb.append("second after first");
    } else {
      sb.append("second NOT after first");
View Full Code Here

    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.equals(secondDate)) {
      sb.append("first is the same date/time as second");
    } else {
      sb.append("first is NOT the same date/time as second");
    }
View Full Code Here

    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.equalsIgnoreDate(secondDate)) {
      sb.append("first is the same time as second");
    } else {
      sb.append("first is NOT the same time as second");
    }
View Full Code Here

    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 + " ("
        + secondDoc.getUniversalID() + ")...");
    if (firstDate.equalsIgnoreTime(secondDate)) {
      sb.append("first is the same date as second");
    } else {
      sb.append("first is NOT the same date as second");
    }
View Full Code Here

  public void getProcessedDate() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    View threads = currDb.getView("AllContacts");
    Document doc = threads.getFirstDocument();
    DateTime dt = s.createDateTime(new Date());
    doc.put("testDate", dt);
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("testDate").toString());
  }
View Full Code Here

    session.setConvertMIME(false);
    session.setFixEnable(Fixes.APPEND_ITEM_VALUE, true);
    session.setFixEnable(Fixes.FORCE_JAVA_DATES, true);
    session.setFixEnable(Fixes.CREATE_DB, true);
    Database db = session.getDatabase("", "log.nsf");
    Document doc = db.createDocument();
    doc.replaceItemValue("form", "Events");
    doc.replaceItemValue("Server", "Test");
    Map<String, String> map = new HashMap<String, String>();
    map.put("me", "us");
    map.put("myself", "ourselves");
    map.put("I", "we");
    doc.replaceItemValue("map", map);
    doc.save();
    String unid = doc.getUniversalID();
    doc = null;
    Document docJunk = db.createDocument();
    doc = db.getDocumentByUNID(unid);
    System.out.println(doc.getNoteID());
    Object o = doc.getItemValue("map", Map.class);
    System.out.println(o.getClass().getName());
    Map<String, String> remap = (Map<String, String>) o;
View Full Code Here

      ids.add(doc.getNoteID());
    }
    //System.out.println("IDS.size " + ids.size());
    for (int i = 1; i < 100; i++) {
      System.out.println(i + ": " + Factory.dumpCounters(false));
      Document doc1 = null;
      Document doc2 = null;
      Document doc3 = null;
      for (String id : ids) {
        d = s.getDatabase("", "names.nsf");
        doc1 = d.getDocumentByID(id);
        doc1 = null;
        doc2 = d.getDocumentByID(id);
View Full Code Here

    return ret.toString();
  }

  @SuppressWarnings("unchecked")
  protected List<Object> lotus() throws NotesException {
    Document lotusDoc = db.createDocument();
    fillDemoDoc(lotusDoc);
    lotus.domino.Session rawSession = Factory.toLotus(Factory.getSession());
    lotus.domino.Document rawDocument = Factory.toLotus(lotusDoc);
    return rawSession.evaluate(formula, rawDocument);
View Full Code Here

  @SuppressWarnings("unchecked")
  //@Test(expected = NotesException.class)
  public void testLotusFail() throws NotesException {

    Document lotusDoc = db.createDocument();
    lotus.domino.Session rawSession = Factory.toLotus(Factory.getSession());
    lotus.domino.Document rawDocument = Factory.toLotus(lotusDoc);
    try {
      rawSession.evaluate(formula, rawDocument);
      fail("Expected " + NotesException.class);
View Full Code Here

TOP

Related Classes of org.openntf.domino.Document

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.