Package org.openntf.domino

Examples of org.openntf.domino.Database


    this.database = d;
  }

  public static void main(final String[] args) {
    Session s = null;
    Database d = null;
    NotesThread.sinitThread();
    try {
      s = Factory.getSession();
      d = s.getDatabase("heracles/intec-pw", "OpenNTF\\OpenNTFDomino.nsf");
      SimpleEmailTest a = new SimpleEmailTest(s, d);
View Full Code Here


  }

  @SuppressWarnings("unused")
  public void NotesMain() {
    Session session;
    Database database;

    // Fails on checking current database!!

    try {
      Session s;
      Database db;
      if (this.session != null) {
        s = this.session;
        db = this.database;
        DominoEmail myEmail = new DominoEmail();
        myEmail.createSimpleEmail("pwithers@intec.co.uk", "", "", "OpenNTF Domino Email",
View Full Code Here

    @Override
    public void run() {

      Session s = Factory.getSession();
      Database source = s.getDatabase("", TARGET, true);
      View view = source.getView(VIEW);
      System.out.println("-- START --");
      long start = System.nanoTime();

      if (null != view) {
        view.setAutoUpdate(false);
View Full Code Here

   */
  private static final long serialVersionUID = 1L;

  public void processView() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allStates");
    for (ViewEntry currentEntry : view.getAllEntries()) {
      sb.append(currentEntry.getNoteID() + "..."); // Do whatever it is you actually want to get done
    }
    ExtLibUtil.getViewScope().put("javaTest", sb.toString());
  }
View Full Code Here

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

  public void getAllEntriesByKey() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CA");
    ViewEntryCollection ec = view.getAllEntriesByKey(key, true);
    for (ViewEntry entry : ec) {
      sb.append(entry.getColumnValues().get(7) + "...");
View Full Code Here

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

  public void getAllDocumentsByKey() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CA");
    DocumentCollection dc = view.getAllDocumentsByKey(key, true);
    for (Document doc : dc) {
      sb.append(doc.get("FirstName") + " " + doc.get("LastName") + "...");
View Full Code Here

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

  public void getAllDocumentsByKeyNoMatch() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CX");
    DocumentCollection dc = view.getAllDocumentsByKey(key, true);
    sb.append("Getting values...");
    for (Document doc : dc) {
View Full Code Here

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

  public void getAllEntriesByKeyNoMatch() {
    StringBuilder sb = new StringBuilder();
    Database db = Factory.getSession().getCurrentDatabase();
    View view = db.getView("allContactsByState");
    ArrayList<String> key = new ArrayList<String>();
    key.add("CX");
    ViewEntryCollection ec = view.getAllEntriesByKey(key, true);
    sb.append("Getting values...");
    for (ViewEntry entry : ec) {
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"));
      key.add(doc.getItemValueString("LastName"));
      if (view.checkUnique(key, doc)) {
        sb.append("No document yet exists with name Aaron Monroe");
View Full Code Here

    long documentBuildNS = 0l;
    long documentPageNS = 0l;
    int collectionSize = 0;
    int dbDocs = 0;
    try {
      Database db = session.getDatabase("", "imdb/movies.bak");
      dbDocs = db.getAllDocuments().getCount();
      long testStartTime = System.nanoTime();
      NoteCollection nc = db.createNoteCollection(false);
      nc.selectAllDataNotes(true);
      nc.setSelectionFormula("@Begins(Title; \"B\")"); //NTF comment or uncomment this to toggle testing selection formula impact
      nc.buildCollection();
      int[] nids = nc.getNoteIDs();
      long collectionTime = System.nanoTime();
      collectionBuildNS = collectionTime - testStartTime;
      collectionSize = nids.length;
      Document[] documents = new Document[collectionSize];
      for (int i = 0; i < collectionSize; i++) {
        documents[i] = db.getDocumentByID(nids[i], true/*false would mean full load of the Document*/);
      }
      long documentTime = System.nanoTime();
      documentBuildNS = documentTime - collectionTime;
      int pageSize = 100;
      int pageStart = 2014;
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.