Package org.openntf.domino

Examples of org.openntf.domino.Session


      createAllType(db, i);
    }
  }

  void createAllType(Database db, int index) {
    Session session = db.getParent();
    String sIndex = Integer.toString(index);
    Document doc = db.createDocument();
    doc.put("Form", "AllTypes");

    doc.put("fldIcon", index);
View Full Code Here


      }
      date = new Date();
      retVal += "<br/>Finished standard version..." + date.toString();
      date = new Date();
      retVal += "<br/>Starting OpenNTF version..." + date.toString();
      Session currSess = Factory.getSession();
      Database currDb = currSess.getCurrentDatabase();
      Utils.addAllListeners(currDb);
      View contactsView = currDb.getView("AllContacts");
      for (ViewEntry ent : contactsView.getAllEntries()) {
        DateTime dt = currSess.createDateTime(new Date());
        Document doc = ent.getDocument();
        doc.replaceItemValue("testDate", dt);
        doc.save(true, false);
      }
      date = new Date();
View Full Code Here

  public static String getVersion() {
    return "";
  }

  public static void demoJavadoc() {
    Session s = Factory.getSession();
    RichTextStyle rts = s.createRichTextStyle();
    rts.setBold(BoldStyle.ISBN_9780133258936);
  }
View Full Code Here

     * @param secondReference
     *            the second reference
     */
    private void iterateAllDocuments(final Database db, final Set<Document> secondReference) {
      System.out.println("Thread " + Thread.currentThread().getName() + " BEGINNING ITERATION of Documents");
      Session s = db.getParent();

      DocumentCollection dc = db.getAllDocuments();
      for (Document doc : dc) {
        docCount++;
        Vector v = doc.getItemValue("$UpdatedBy");
        for (Object o : v) {
          if (o instanceof String) {
            Name n = s.createName((String) o);
            String cn = n.getCommon();
            nameCount++;
          }
        }
        if (docCount % 1000 == 0) {
          secondReference.add(db.getDocumentByID(doc.getNoteID()));
        }
        if (docCount % 2000 == 0) {
          thirdReference.add(doc);
        }

        DateTime toxic = doc.getLastModified();
        String busyWork = toxic.getGMTTime();
        DateTime toxic2 = doc.getLastModified();
        String busyWork2 = toxic2.getDateOnly();
        // System.out.println("LastMod: " + toxic.getGMTTime());
        dateCount++;
      }
      System.out.println("REPEATING ITERATION of Documents");
      for (Document doc : dc) {
        docCount++;
        Vector v = doc.getItemValue("$UpdatedBy");
        for (Object o : v) {
          if (o instanceof String) {
            Name n = s.createName((String) o);
            String cn = n.getCommon();
            nameCount++;
          }
        }
        if (docCount % 1000 == 0) {
View Full Code Here

      // System.out.println("com class is loaded = " + String.valueOf(com.isLoaded()));

      // if (false) {
      long start = System.nanoTime();

      Session s = Factory.getSessionFullAccess();
      //      this.setup(s);
      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(server, dbPath);

      if (INCLUDE_FORMS) {
        iterateForms(db);
      }
      Set<Document> secondReference = new HashSet<Document>();
View Full Code Here

    }
  }

  @Override
  public void run() {
    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);
View Full Code Here

  static class Doer implements Runnable {

    @Override
    public void run() {
      long start = System.nanoTime();
      Session s = Factory.getSession();
      if (s == null) {
        try {
          s = Factory.fromLotus(lotus.domino.NotesFactory.createTrustedSession(), Session.class, null);
        } catch (Throwable t) {
          t.printStackTrace();
        }
      }
      String server = s.getServerName();
      DbDirectory dbDirectory = s.getDbDirectory(server);

      int dateCount = 0;
      int nameCount = 0;
      int docCount = 0;
View Full Code Here

    return null;
  }

  protected Session getSession() {
    try {
      Session session = Factory.fromLotus(NotesFactory.createSession(), Session.class, null);
      return session;
    } catch (Throwable t) {
      DominoUtils.handleException(t);
      return null;
    }
View Full Code Here

    // whatever you might want to do in your constructor, but stay away from Domino objects
  }

  @Override
  public void run() {
    Session session = this.getSession();
    List<String> hexes = new ArrayList<String>();
    hexes.add("DEAD");
    hexes.add("85255D220072624");
    hexes.add("85255D220072624285255BA400761D6C");
View Full Code Here

    }
  }

  protected Session getSession() {
    try {
      Session session = Factory.fromLotus(NotesFactory.createSession(), Session.class, null);
      return session;
    } catch (Throwable t) {
      DominoUtils.handleException(t);
      return null;
    }
View Full Code Here

TOP

Related Classes of org.openntf.domino.Session

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.