Package org.openntf.domino

Examples of org.openntf.domino.Document


      Database currDb = currSess.getCurrentDatabase();
      Utils.addAllListeners(currDb);
      View contactsView = currDb.getView("AllContacts");
      for (ViewEntry ent : contactsView.getAllEntries()) {
        DateTime dt = currSess.createDateTime(new Date());
        Document doc = ent.getDocument();
        doc.replaceItemValue("testDate", dt);
        doc.save(true, false);
      }
      date = new Date();
      retVal += "<br/>Finished OpenNTF version..." + date.toString();
      ExtLibUtil.getViewScope().put("SSJSTest", retVal);
    } catch (Exception e) {
View Full Code Here


  }

  public static void openLogUtilTest() {
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allStates");
    Document doc = view.getFirstDocument();
    XspOpenLogUtil.getXspOpenLogItem().logEvent(null, "Test message", Level.FINE, doc);
  }
View Full Code Here

        ExtLibUtil.getViewScope().put("javaTest", "First select a value");
        return;
      }
      sb.append("Starting update with " + selVal);
      View view = db.getView("allStates");
      Document state = view.getFirstDocumentByKey(selVal, true);
      state.replaceItemValue("txnTest", new Date());
      sb.append("...Updated State pending committal, value is " + state.get("txnTest").toString());
      View contacts = db.getView("AllContactsByState");
      DocumentCollection dc = contacts.getAllDocumentsByKey(selVal, true);
      for (Document doc : dc) {
        if (toggle) {
          doc.replaceItemValue("txnTest", new Date());
View Full Code Here

  public static void addAllListeners(Database currDb) {
    currDb.addListener(new TestDocumentListener());
  }

  public static void XSPUtilsTest(DominoDocument doc) {
    Document beDoc = XspUtils.getBEDoc(doc);
    String unid = beDoc.getUniversalID();
    ExtLibUtil.getViewScope().put("javaTest", "Document UNID is " + unid);
  }
View Full Code Here

    private void iterateForms(final Database db) {
      System.out.println("Thread " + Thread.currentThread().getName() + " BEGINNING ITERATION of Forms");
      Vector<Form> forms = db.getForms();
      for (Form form : forms) {
        // System.out.println("Form : " + form.getName() + " (" + DominoUtils.getUnidFromNotesUrl(form.getNotesURL()) + ")");
        Document d = form.getDocument();
        Vector v = d.getItemValue("$UpdatedBy");

        Name n = db.getParent().createName((String) v.get(0));
        String cn = n.getCommon();
        nameCount++;
        docCount++;
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);
    }
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("documentToggle"));
  }
View Full Code Here

        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");
    }
    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
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()));
    sb.append("....");
    sb.append("Last modified: " + format.format(doc.getLastModifiedDate()));
    sb.append("....");
    sb.append("Last accessed: " + format.format(doc.getLastAccessedDate()));
    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
  }
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.