Package org.openntf.domino

Examples of org.openntf.domino.Database


    ExtLibUtil.getViewScope().put("javaTest", formatted);
  }

  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


    ExtLibUtil.getViewScope().put("javaTest", formatted);
  }

  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("....");
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
  }

  public void getFormName() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    ExtLibUtil.getViewScope().put("javaTest", doc.getFormName());
  }
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", doc.getFormName());
  }

  public void getForm() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Document doc = contacts.getFirstDocument();
    ExtLibUtil.getViewScope().put("javaTest", doc.getForm().getNoteID());
  }
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", doc.getForm().getNoteID());
  }

  public void replaceItemValueSummary() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    StringBuilder sb = new StringBuilder();
    sb.append("Here is a value");
    Item itm = doc.replaceItemValue("summaryField", sb, true);
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", doc.get("summaryField") + " " + Boolean.toString(itm.isSummary()));
  }

  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

    ExtLibUtil.getViewScope().put("javaTest", contact.getNoteID());
  }

  public void createPaul() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    HashMap<String, Object> fieldsMap = new HashMap<String, Object>();
    fieldsMap.put("Form", "Contact");
    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());
  }
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", contact.getNoteID());
  }

  public void setDateField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    doc.put("javaDateField", new Date());
    doc.save(true, false);
    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaDateField"));
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaDateField"));
  }

  public void setFormulaField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    Formula fm = new Formula("@DocumentUniqueID");
    doc.put("javaFormulaField", "Document UNID is " + fm.getValue(doc));
    doc.save(true, false);
View Full Code Here

    ExtLibUtil.getViewScope().put("javaTest", doc.get("javaFormulaField"));
  }

  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);
View Full Code Here

TOP

Related Classes of org.openntf.domino.Database

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.