Package org.openntf.domino

Examples of org.openntf.domino.Session


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


    doc.save(true, false);
  }

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

    private static final String VIEW = "Persons";

    @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 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);
      testItem.setAuthors(true);
      testItem.setReaders(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

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

  @Override
  public void run() {
    Session session = this.getSession();
    long collectionBuildNS = 0l;
    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
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();
    Formula formula = new Formula();
    String source = "REM {Begin_Do_Not_Tag};\r\n" + "\r\n" + "SenderName := @If(SendTo = \"\";EnterSendTo;SendTo);\r\n"
        + "Send := @Subset(SenderName; 1);\r\n" + "CN1 := @Trim(@Name([CN]; Send));\r\n"
        + "CN := @If(@Contains(@Right(Send;\"@\");\">\") & CN1 = \"\";@Trim(Send); CN1);\r\n"
        + "G := @If(CN = \"\"; @Name([G]; @Subset(SenderName; 1)); \"\");\r\n"
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

  public NewHelperBean() {

  }

  public void syncDatabases() {
    Session s = Factory.getSession();
    Database currDb = s.getCurrentDatabase();
    Utils.addAllListeners(currDb);
    java.util.Map<Object, String> syncMap = new java.util.HashMap<Object, String>();
    syncMap.put("Key", "State");
    syncMap.put("Name", "StateName");
    syncMap.put("@Now", "LastSync");
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();
    long collectionBuildNS = 0l;
    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
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.