Package org.openntf.domino

Examples of org.openntf.domino.Database


  }

  @Override
  public void run() {
    Session session = this.getSession();
    Database db = session.getDatabase("", "log.nsf");
    try {
      DatabaseSchema schema = new DatabaseSchema();
      DocumentDefinition eventDef = new DocumentDefinition();
      eventDef.setName("Events");
View Full Code Here


  }

  @Override
  public void run() {
    Session session = this.getSession();
    Database db = session.getDatabase("", "CollTest.nsf");
    DocumentCollection coll = db.getAllDocuments();
    //    System.out.println("UNSORTED");
    for (Document doc : coll) {
      //      System.out.println(doc.getItemValueString("MainSortValue") + " " + doc.getLastModifiedDate().getTime());
    }
View Full Code Here

  @Override
  public void run() {
    long testStartTime = System.nanoTime();
    Session session = this.getSession();
    //    Database db = session.getDatabase("", "events4.nsf");
    Database db = session.getDatabase("", "events4.nsf");
    //    System.out.println("Starting build of byMod view");
    //    long vStartTime = System.nanoTime();
    //    View newView = db.createView("ModTest", "SELECT @All");
    //    ViewColumn modCol = newView.createColumn(1, "Modified", "@Modified");
    //    modCol.setSorted(true);
    //    newView.refresh();
    //    long vEndTime = System.nanoTime();
    //    System.out.println("Completed building byModView in " + ((vEndTime - vStartTime) / 1000000) + "ms");
    //    IndexDatabase index = new IndexDatabase(session.getDatabase("", "redpill/index.nsf"));
    //    Document indexDoc = index.getDbDocument(db.getReplicaID());

    //    System.out.println("UNSORTED");

    List<String> criteria = new ArrayList<String>();
    //    criteria.add("@doclength");
    criteria.add("@modifieddate");
    try {
      DocumentSorter sorter = null;

      //      if (indexDoc.hasItem("DocumentSorter")) {
      //        sorter = indexDoc.getItemValue("DocumentSorter", DocumentSorter.class);
      //        sorter.setDatabase(db);
      //        System.out.println("Starting resort of " + sorter.getCount() + " documents");
      //      } else {
      DocumentCollection coll = db.getAllDocuments();
      sorter = new DocumentSorter(coll, criteria);
      System.out.println("Starting resort of " + coll.getCount() + " documents");
      //      }
      //      System.out.println("SORTING...");
View Full Code Here

      RunContext rc = Factory.getRunContext();
      System.out.println("RunContext: " + rc.toString());
      Name sname = s.getUserNameObject();
      DateFormat df = new SimpleDateFormat("yyyyMMddhhmmss");
      System.out.println(df.format(new Date()) + " Name: " + sname.getCanonical());
      Database db = s.getDatabase("", "OneMillion.nsf");
      if (INCLUDE_FORMS) {
        iterateForms(db);
      }
      Set<Document> secondReference = new HashSet<Document>();
      iterateAllDocuments(db, secondReference);
      System.gc();
      NoteCollection nc = db.createNoteCollection(false);
      nc.buildCollection();
      iterateSecondReferences(secondReference);
      iterateThirdReferences();

      long elapsed = System.nanoTime() - start;
View Full Code Here

    public void run() {
      Document doc = null;
      System.out.println("START Creation of Documents:" + new Date().toString());
      Session s = Factory.getSession();
      Set<Document> docset = new HashSet<Document>();
      Database db = s.getDatabase("", "OneMillion.nsf", true);
      if (!db.isOpen()) {
        Database db2 = s.getDatabase("", "billing.ntf", true);
        db = db2.createCopy("", "OneMillion.nsf");
        if (!db.isOpen())
          db.open();
      }

      for (int i = 1; i < 200000; i++) {
View Full Code Here

    @Override
    public void run() {

      Session s = Factory.getSession();
      Database source = s.getDatabase("", TARGET, true);

      System.out.println("-- START --");
      long start = System.nanoTime();
      for (Document doc : source.getAllDocuments()) {
        doc.removePermanently(true);
      }
      long elapsed = System.nanoTime() - start;
      System.out.println("-- STOP --");
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

    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");
      ViewCheckUniqueTest a = new ViewCheckUniqueTest(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;
        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"));
          key.add(doc.getItemValueString("LastName"));
          if (view.checkUnique(key, doc)) {
            sb.append("No document yet exists with name Aaron Monroe");
View Full Code Here

    public void run() {
      Document doc = null;
      System.out.println("START Creation of Documents");
      Session s = Factory.getSession();
      Set<Document> docset = new HashSet<Document>();
      Database db = s.getDatabase("", "OneMillion.nsf", true);
      if (!db.isOpen()) {
        Database db2 = s.getDatabase("", "billing.ntf", true);
        db = db2.createCopy("", "OneMillion.nsf");
        if (!db.isOpen())
          db.open();
      }

      for (int i = 1; i < 1000000; i++) {
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.