Package lotus.domino

Examples of lotus.domino.Session


  }
 
  public void importDocuments(Database database) throws IOException {
    source.startImport();
    try {
      Session session = database.getParent();
      for( Entry e=source.next(); e!=null; e=source.next() ) {
        Document doc = database.createDocument();
        try {
          doc.setUniversalID(e.getUnid());
          importDocument(session,doc,e.getJsonObject());
View Full Code Here


 
  public static int findHttpsPort() {
    if(httpsPort==null) {
      synchronized(HttpUtil.class) {
        try {
          Session session = ExtLibUtil.getCurrentSessionAsSigner();
          String server = session.getServerName();
          String nabCandidates = session.getEnvironmentString("names",true); // There is a possibility that the variable is names=names.nsf,somotherdb.nsf
          String nab = StringUtil.isNotEmpty(nabCandidates) ? StringUtil.splitString(nabCandidates,',')[0] : "names.nsf";
          String formula = "@DbLookup(\"Notes\":\"Cache\";\""+server+"\":\""+nab+"\";\"($Servers)\";\""+server+"\";\"HTTP_SSLPort\";[FAILSILENT])";
          Vector<?> result = session.evaluate(formula);
          if(result.size()==1) {
            Object port = result.get(0);
            if(port instanceof Number) {
              httpsPort = ((Number)port).intValue();
            } else if(port instanceof Number) {
View Full Code Here

     
      // Getting the first spreadsheet.
      XSpreadsheet xspreadsheet = ( XSpreadsheet ) UnoRuntime.queryInterface(
          XSpreadsheet.class, xindexaccess.getByIndex( 0 ));
     
      Session session;
      if ( !stringHost.equals( "" ) ) {
        // Creating a Notes session for remote calls to the Domino classes.
        session = NotesFactory.createSession( stringHost, stringUser,
        stringPassword );
      }
      else {
        // Creating a Notes session for only local calls to the Domino classes.
        session = NotesFactory.createSession();
      }
     
      // Getting the specified Notes database.
      Database database = session.getDatabase( "", stringDatabase );
     
      // Getting a collection of all documents from the database.
      DocumentCollection documentcollection = database.getAllDocuments();
     
      // Getting the first document from the database
View Full Code Here

     
            // Getting the first spreadsheet.
            XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
                XSpreadsheet.class, xIndexAccess.getByIndex(0));
     
            Session session;
            if ( !stringHost.equals( "" ) ) {
                // Creating a Notes session for remote calls to the Domino classes.
                session = NotesFactory.createSession(stringHost, stringUser,
                                                     stringPassword);
            }
            else {
                // Creating a Notes session for only local calls to the
                // Domino classes.
                session = NotesFactory.createSession();
            }
     
            // Getting the specified Notes database.
            Database database = session.getDatabase( "", stringDatabase );
           
            // Getting a collection of all documents from the database.
            DocumentCollection documentCollection = database.getAllDocuments();
     
            // Getting the first document from the database
View Full Code Here

     
            // Getting the first spreadsheet.
            XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
                XSpreadsheet.class, xIndexAccess.getByIndex(0));
     
            Session session;
            if ( !stringHost.equals( "" ) ) {
                // Creating a Notes session for remote calls to the Domino classes.
                session = NotesFactory.createSession(stringHost, stringUser,
                                                     stringPassword);
            }
            else {
                // Creating a Notes session for only local calls to the
                // Domino classes.
                session = NotesFactory.createSession();
            }
     
            // Getting the specified Notes database.
            Database database = session.getDatabase( "", stringDatabase );
           
            // Getting a collection of all documents from the database.
            DocumentCollection documentCollection = database.getAllDocuments();
     
            // Getting the first document from the database
View Full Code Here

     
      // Getting the first spreadsheet.
      XSpreadsheet xspreadsheet = ( XSpreadsheet ) UnoRuntime.queryInterface(
          XSpreadsheet.class, xindexaccess.getByIndex( 0 ));
     
      Session session;
      if ( !stringHost.equals( "" ) ) {
        // Creating a Notes session for remote calls to the Domino classes.
        session = NotesFactory.createSession( stringHost, stringUser,
        stringPassword );
      }
      else {
        // Creating a Notes session for only local calls to the Domino classes.
        session = NotesFactory.createSession();
      }
     
      // Getting the specified Notes database.
      Database database = session.getDatabase( "", stringDatabase );
     
      // Getting a collection of all documents from the database.
      DocumentCollection documentcollection = database.getAllDocuments();
     
      // Getting the first document from the database
View Full Code Here

    try {
      Database database = (Database) resolveVariable("database");
      Document profile = database.getDocumentByUNID(mypicProfileUNID);
     
      if (null != profile) {
        Session session = (Session) resolveVariable("sessionAsSigner");
        Database nab = session.getDatabase(this.NabServer, this.NabFilePath);
       
        if (null != nab) {
          String userAbbrev = session.createName(profile.getItemValueString("User")).getAbbreviated();
          View VIMPeople = nab.getView("($VIMPeople)");
         
          Document nabEntry = VIMPeople.getDocumentByKey(userAbbrev, true);
          if (null != nabEntry) {
            XSPContext context = (XSPContext) resolveVariable("context");

            profile.replaceItemValue("PhotoURL",
                context.getUrl().getScheme() + "://" + context.getUrl().getHost() + '/' + database.getFilePath() +
                "/api.xsp?method=getmypic&id=" +
                UNIDEncoder.encode(session.createName(profile.getItemValueString("User")).getCanonical()) + "&size=" +
                this.DefaultSize + "&format=" + this.DefaultFormat);
           
            if (this.StoreProfilesInNab == "Yes") {
              // If we're synching w/ the NAB, Email Address should not be pushed to nab -- it should only get pulled
              profile.replaceItemValue("InternetAddress", nabEntry.getItemValueString("InternetAddress"));
View Full Code Here

     
            // Getting the first spreadsheet.
            XSpreadsheet xSpreadsheet = (XSpreadsheet) UnoRuntime.queryInterface(
                XSpreadsheet.class, xIndexAccess.getByIndex(0));
     
            Session session;
            if ( !stringHost.equals( "" ) ) {
                // Creating a Notes session for remote calls to the Domino classes.
                session = NotesFactory.createSession(stringHost, stringUser,
                                                     stringPassword);
            }
            else {
                // Creating a Notes session for only local calls to the
                // Domino classes.
                session = NotesFactory.createSession();
            }
     
            // Getting the specified Notes database.
            Database database = session.getDatabase( "", stringDatabase );
           
            // Getting a collection of all documents from the database.
            DocumentCollection documentCollection = database.getAllDocuments();
     
            // Getting the first document from the database
View Full Code Here

      createAllType(db, i);
    }
  }

  void createAllType(Database db, int index) throws NotesException {
    Session session = db.getParent();
    String sIndex = Integer.toString(index);
    Document doc = db.createDocument();
    try {
      doc.replaceItemValue("Form", "AllTypes");
View Full Code Here

  @Override
  public void run() {
    try {
      System.out.println("Starting NotesRunner");
      Session session = NotesFactory.createSession();
      Long sessId = getLotusId(session);
      sessionid.set(sessId);
      Database db = session.getDatabase("", "names.nsf");
      System.out.println("Db id:" + getLotusId(db));
      int i = 0;
      try {
        lotus.domino.DocumentCollection allDocs = db.getAllDocuments();
        System.out.println("All Collection has " + allDocs.getCount() + " documents");
        int[] nids = new int[allDocs.getCount()];
        lotus.domino.Document doc = allDocs.getFirstDocument();
        lotus.domino.Document nextDoc = null;
        while (doc != null) {
          nextDoc = allDocs.getNextDocument(doc);
          nids[i++] = Integer.valueOf(doc.getNoteID(), 16);
          doc.recycle();
          doc = nextDoc;
        }
        System.out.println("noteid array has " + nids.length + " entries");
        allDocs.recycle();

        //        lotus.domino.DocumentCollection newColl = db.getModifiedDocuments(session.createDateTime(new java.util.Date()));
        lotus.domino.DocumentCollection newColl = db.getAllUnreadDocuments();

        System.out.println("New Coll has " + newColl.getCount() + " documents");

        //        lotus.domino.DocumentCollection emptyColl = db.createDocumentCollection();
        newColl.intersect(nids[0]);
        System.out.println("New Coll has " + newColl.getCount() + " documents");

        for (int nid : nids) {
          newColl.merge(nid);
        }
        System.out.println("Merged Collection has " + newColl.getCount() + " documents");
        newColl.recycle();
      } catch (Throwable t) {
        t.printStackTrace();
        System.out.println("Exception at loop point " + i);
      }
      session.recycle();
    } catch (Throwable t) {
      t.printStackTrace();
    }
    System.out.println("FINI!");
  }
View Full Code Here

TOP

Related Classes of lotus.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.