Package org.openntf.domino

Examples of org.openntf.domino.Document$Schema


  }

  void createAllType(Database db, int index) {
    Session session = db.getParent();
    String sIndex = Integer.toString(index);
    Document doc = db.createDocument();
    doc.put("Form", "AllTypes");

    doc.put("fldIcon", index);
    doc.put("fldText", "text_" + sIndex);
    doc.put("fldNumber", index * 100);
    doc.put("fldDate", createDate(2012, Calendar.JANUARY, index));
    doc.put("fldTime", createTime(session, 5, 1, index));
    doc.put("fldDateTime", createDateTime(2011, 2, index, 8, 9, index));
    doc.put("fldDateTimeRange", createDateTimeRange(session, 2012, 3, index, 8, 9, index));
    doc.put("fldDialogList", "dlg_" + sIndex);

    ArrayList<String> mx = new ArrayList<String>();
    mx.add("text_" + sIndex + "_1");
    mx.add("text_" + sIndex + "_2");
    mx.add("text_" + sIndex + "_3");
    doc.put("fldText2", mx);

    ArrayList<Object> mn = new ArrayList<Object>();
    mn.add(index * 100 + 1);
    mn.add(index * 100 + 2);
    mn.add(index * 100 + 3);
    doc.put("fldNumber2", mn);

    ArrayList<Date> md = new ArrayList<Date>();
    md.add(createDate(2010, Calendar.JANUARY, index));
    md.add(createDate(2010, Calendar.FEBRUARY, index));
    md.add(createDate(2010, Calendar.MARCH, index));
    doc.put("fldDate2", md);

    Vector<Date> mt = new Vector<Date>();
    mt.add(createTime(session, 6, 1, index));
    mt.add(createTime(session, 6, 2, index));
    mt.add(createTime(session, 6, 3, index));
    doc.put("fldTime2", mt);

    Vector<Date> mdt = new Vector<Date>();
    mdt.add(createDateTime(2011, 1, index, 6, 1, index));
    mdt.add(createDateTime(2011, 2, index, 6, 2, index));
    mdt.add(createDateTime(2011, 3, index, 6, 3, index));
    doc.put("fldDateTime2", mdt);

    if (false) { // DateTime range do not work with multiple values?
      Vector<DateRange> mrg = new Vector<DateRange>();
      mrg.add(createDateTimeRange(session, 2012, 2, index, 4, 1, index));
      mrg.add(createDateTimeRange(session, 2012, 3, index, 5, 1, index));
      mrg.add(createDateTimeRange(session, 2012, 4, index, 6, 1, index));
      doc.put("fldDateTimeRange2", mrg);
    }

    ArrayList<Object> mdg = new ArrayList<Object>();
    mdg.add("dlgx_" + sIndex + "_1");
    mdg.add("dlgx_" + sIndex + "_1");
    mdg.add("dlgx_" + sIndex + "_1");
    doc.put("fldDialogList2", mdg);

    doc.save();
  }
View Full Code Here


      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

TOP

Related Classes of org.openntf.domino.Document$Schema

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.