Package org.openntf.domino

Examples of org.openntf.domino.Database.createDocument()


  public void createNathan() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    Document contact = currDb.createDocument("Form", "Contact", "FirstName", "Nathan", "LastName", "Freeman",
        "Email", "godOfAwesome@worldOfAweso.me", "City", "Washington", "State", "WA");
    contact.save();
    ExtLibUtil.getViewScope().put("javaTest", contact.getNoteID());
  }
View Full Code Here


    fieldsMap.put("FirstName", "Paul");
    fieldsMap.put("LastName", "Withers");
    fieldsMap.put("Email", "lordOfPrettyGood@worldOfAweso.me");
    fieldsMap.put("City", "Washington");
    fieldsMap.put("State", "WA");
    Document contact = currDb.createDocument(fieldsMap);
    contact.save();
    ExtLibUtil.getViewScope().put("javaTest", contact.getNoteID());
  }

  public void setDateField() {
View Full Code Here

  public void checkIsUnique() {
    try {
      StringBuilder sb = new StringBuilder();
      Database db = Factory.getSession().getCurrentDatabase();
      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"));
View Full Code Here

  public void run1() {
    long testStartTime = System.nanoTime();
    Session session = this.getSession();
    Database log = session.getDatabase("", "log.nsf");
    Document storeTest = log.createDocument();
    storeTest.replaceItemValue("form", "BinaryTest");
    Database db = session.getDatabase("", "imdb/movies.nsf");

    try {
      NoteList notelist = new NoteList();
View Full Code Here

      if (this.session != null) {
        s = this.session;
        db = this.database;
        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"));
View Full Code Here

    Session session = this.getSession();
    Database db = session.getDatabase("", "log.nsf");
    int i = 0;
    try {
      for (i = 0; i < 5; i++) {
        Document doc = db.createDocument();
        System.out
            .println("doc " + i + " " + doc.getUniversalID() + ": " + doc.getNoteID() + " " + String.valueOf(doc.isNewNote()));
        //        doc.replaceItemValue("form", "junk");
        doc.save();
        System.out
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");
View Full Code Here

    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

    for (String key : remap.keySet()) {
      System.out.println(key + ":" + remap.get(key));
    }
    session.setConvertMIME(true);
    doc = null;
    docJunk = db.createDocument();
    doc = db.getDocumentByUNID(unid);
    Vector<Item> items = doc.getItems();
    for (Item item : items) {
      if (item.getName().equalsIgnoreCase("map")) {
        System.out.println("map: " + item.getType());
View Full Code Here

    doc.replaceItemValue("foo", "bar");
    doc.save();
    session.setConvertMIME(false);
    o = null;
    doc = null;
    docJunk = db.createDocument();
    doc = db.getDocumentByUNID(unid);
    o = doc.getItemValue("map", Map.class);
    System.out.println(o.getClass().getName());
    remap = (Map<String, String>) o;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.