Package org.openntf.domino

Examples of org.openntf.domino.Database


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

  public void setMapField() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    View contacts = currDb.getView("AllContacts");
    Utils.addAllListeners(currDb);
    Document doc = contacts.getFirstDocument();
    TreeMap<String, String> testMap = new TreeMap<String, String>();
    testMap.put("Per", "Denmark");
    testMap.put("John", "South Africa");
View Full Code Here


  }

  public void breakNames() {
    try {
      Session s = Factory.getSession();
      Database currDb = s.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      Item testItem = doc.replaceItemValue("muppetField", 1);
      testItem.setNames(true);
      doc.save(true, false);
    } catch (Throwable t) {
View Full Code Here

  public void testNamesAuthorsReaders() {
    try {
      StringBuilder sb = new StringBuilder();
      Session s = Factory.getSession();
      Database currDb = s.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      Item testItem = doc.replaceItemValue("readersAuthorsNamesField", s.getEffectiveUserName());
      sb.append("Checking if Item is Readers, Names or Authors...");
      sb.append(testItem.isReadersNamesAuthors());
      testItem.setNames(true);
View Full Code Here

  }

  public void getDocAsJson() {
    try {
      Session s = Factory.getSession();
      Database currDb = s.getCurrentDatabase();
      View contacts = currDb.getView("AllContacts");
      Document doc = contacts.getFirstDocument();
      ExtLibUtil.getViewScope().put("javaTest", doc.toJson(true));
    } catch (Throwable t) {

    }
View Full Code Here

                int tabPos = curLine.indexOf('\t');
                curActor = curLine.substring(0, tabPos).trim();
                if (actorCount % 1000 == 0) {
                  System.out.println("Processing actor " + actorCount + ": " + curActor + " (" + lineCount + " lines)");
                }
                Database db = null; //TODO obviously not...
                @SuppressWarnings("null")
                Document doc = db.getDocumentWithKey(curActor, false);
                if (doc != null) {
                  doc.replaceItemValue("Genres", genres);
                  doc.save();
                } else {
                  exceptionCount++;
View Full Code Here

    Session session = this.getSession();
    session.setFixEnable(Fixes.REPLACE_ITEM_NULL, true);
    session.setFixEnable(Fixes.REMOVE_ITEM, true);
    session.setFixEnable(Fixes.CREATE_DB, true);
    DbDirectory dir = session.getDbDirectory("");
    Database moviesDb = dir.createDatabase("imdb/movies.nsf", true);
    //    importMovies(moviesDb);
    //    importPlots(moviesDb);
    importGenres(moviesDb);
    //    Database actorsDb = dir.createDatabase("imdb/actors.nsf", true);
    //    Database directorsDb = dir.createDatabase("imdb/directors.nsf", true);
View Full Code Here

     */
    @Override
    public void run() {
      Session s = Factory.getSession();

      Database db = s.getDatabase("", TARGET, true);

      if (!db.isOpen()) {
        Database db2 = s.getDatabase("", TEMPLATE, true);
        db = db2.createCopy("", TARGET);
        if (!db.isOpen())
          db.open();
      }

      Document doc = null;
View Full Code Here

    @Override
    public void run() {

      long start = System.nanoTime();
      Session s = Factory.getSession();
      Database source = s.getDatabase("", SOURCE, true);
      Database target = s.getDatabase("", TARGET, true);

      System.out.println("-- START --");

      for (Document doc : source.getAllDocuments()) {
        doc.copyToDatabase(target);
View Full Code Here

  @Override
  public void run() {
    long testStartTime = System.nanoTime();
    try {
      Session session = this.getSession();
      Database db = session.getDatabase("", "events4.nsf");
      DocumentCollection coll = db.getAllDocuments();
      for (Document doc : coll) {
        System.out.println("nid: " + doc.getNoteID());
      }
      long endTime = System.nanoTime();
    } catch (Throwable t) {
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

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.