Package lotus.domino

Examples of lotus.domino.DocumentCollection


  private boolean linkAlreadyExists(String sNID, String sNTitle, String sNLink1) {
    boolean bCheck = false;
    String sNLink;
    View newsByLink = null;
    DocumentCollection docs = null;
    try{
      int hashIndex = sNLink1.indexOf("#");
      if(hashIndex > 0) {
        sNLink = sNLink1.substring(0, hashIndex);
      } else {
        sNLink = sNLink1;
      }

      Database db = ExtLibUtil.getCurrentDatabase();
      newsByLink = db.getView("NewsAllbyLink");
      newsByLink.setAutoUpdate(false);
      docs = newsByLink.getAllDocumentsByKey(sNLink, true);

      Document doc = docs.getFirstDocument();
      while(doc != null) {
        if(!doc.getItemValueString("NID").equals(sNID)){
          //the document is not the current document
          bCheck = true;
          DuplicateEntry dup = new DuplicateEntry();
          dup.setNid(doc.getItemValueString("NID"));
          dup.setNLink(doc.getItemValueString("NLink"));
          dup.setNTitle(doc.getItemValueString("NTitle"));

          duplicatesList.add(dup);
        }

        Document tempDoc = doc;
        doc = docs.getNextDocument(doc);
        tempDoc.recycle();
      }

    } catch(Exception e) {
      MiscUtils.logException(e);
View Full Code Here


    return bCheck;
  }

  private boolean doFuzzySearch(String sNID, String sNTitle, String sNLink) {
    boolean bCheck = false;
    DocumentCollection docs = null;
    try {
      Database db = ExtLibUtil.getCurrentDatabase();
      docs = db.FTSearch(sNTitle, 30, Database.FT_SCORES, Database.FT_FUZZY);
      Document doc = docs.getFirstDocument();
      while(doc != null) {
        if(!doc.getItemValueString("NID").equals(sNID)){
          // the document is not the current document
          bCheck = true;
          DuplicateEntry dup = new DuplicateEntry();
          dup.setNid(doc.getItemValueString("NID"));
          dup.setNLink(doc.getItemValueString("NLink"));
          dup.setNTitle(doc.getItemValueString("NTitle"));

          duplicatesList.add(dup);
        }

        Document tempDoc = doc;
        doc = docs.getNextDocument(doc);
        tempDoc.recycle();
      }

    } catch(Exception e) {
      MiscUtils.logException(e);
View Full Code Here

     
            // 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
            Document document = documentCollection.getFirstDocument();
     
            // Start to write to cells at this row.
            int intRowToStart = 0;
     
            // The current row.
            int intRow = intRowToStart;
     
            // The current column.
            int intColumn = 0;
     
            // Process all documents
            while ( document != null ) {
                // Getting the name of the stock.
                String stringName = document.getItemValueString("Name");
               
                // Inserting the name to a specified cell.
                insertIntoCell(intColumn, intRow, stringName, xSpreadsheet, "");
               
                // Getting the number of stocks.
                double intNumber = document.getItemValueInteger( "Number" );
       
                // Inserting the number of stocks to a specified cell.
                insertIntoCell( intColumn + 1, intRow, String.valueOf(intNumber),
                                xSpreadsheet, "V" );
       
                // Getting current share price.
                double doubleSharePrice = document.getItemValueDouble("SharePrice");
       
                // Inserting the current share price to a specified cell.
                insertIntoCell(intColumn + 2, intRow,
                               String.valueOf(doubleSharePrice),
                               xSpreadsheet, "V");
       
                // Inserting the total value.
                insertIntoCell(intColumn + 3, intRow, "=B"
                               + String.valueOf( intRow + 1 )
                               + "*C" + String.valueOf(intRow + 1),
                               xSpreadsheet, "");
       
                // Increasing the current row.
                intRow++;
               
                // Getting the next document from the collection.
                document = documentCollection.getNextDocument();
            }
     
            // Summing all specific amounts.
            insertIntoCell(intColumn + 3, intRow, "=sum(D"
                           + String.valueOf( intRowToStart + 1 ) + ":D"
View Full Code Here

     
      // 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
      Document document = documentcollection.getFirstDocument();
     
      // Start to write to cells at this row.
      int intRowToStart = 0;
     
      // The current row.
      int intRow = intRowToStart;
     
      // The current column.
      int intColumn = 0;
     
      // Process all documents
      while ( document != null ) {
        // Getting the name of the stock.
        String stringName = document.getItemValueString( "Name" );
       
        // Inserting the name to a specified cell.
        insertIntoCell( intColumn, intRow, stringName, xspreadsheet, "" );
       
        // Getting the number of stocks.
        double intNumber = document.getItemValueInteger( "Number" );
       
        // Inserting the number of stocks to a specified cell.
        insertIntoCell( intColumn + 1, intRow, String.valueOf( intNumber ),
        xspreadsheet, "V" );
       
        // Getting current share price.
        double doubleSharePrice = document.getItemValueDouble( "SharePrice" );
       
        // Inserting the current share price to a specified cell.
        insertIntoCell( intColumn + 2, intRow, String.valueOf( doubleSharePrice ),
        xspreadsheet, "V" );
       
        // Inserting the total value.
        insertIntoCell( intColumn + 3, intRow, "=B"
        + String.valueOf( intRow + 1 ) + "*C" + String.valueOf( intRow + 1 ),
        xspreadsheet, "" );
       
        // Increasing the current row.
        intRow++;
       
        // Getting the next document from the collection.
        document = documentcollection.getNextDocument();
      }
     
      // Summing all specific amounts.
      insertIntoCell( intColumn + 3, intRow, "=sum(D"
      + String.valueOf( intRowToStart + 1 ) + ":D"
View Full Code Here

TOP

Related Classes of lotus.domino.DocumentCollection

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.