SunQuest
 
       Administration
  Home arrow Administration arrow Page 4 - Connect Lotus Domino Server through St...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Connect Lotus Domino Server through Standalone Application with CORBA
By: Alex Soto Bueno
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2004-09-14

    Table of Contents:
  • Connect Lotus Domino Server through Standalone Application with CORBA
  • Start Working with Documents
  • Looking for Documents
  • Working with Received Mails
  • Deleting Attachments
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Connect Lotus Domino Server through Standalone Application with CORBA - Working with Received Mails


    (Page 4 of 6 )

    As you know, Lotus Notes is a document management tool, but also is an email client. An email document is treated like any other document in Lotus, but they have a special fields to consult:

    • Posted Date
    • Delivered Date
    • From
    • Send To
    • Subject
    • Body
    • Attachments

    And a lot of more information. To view this values, you only have to make the connection to your email repository. After that, you can retrieve a document collection object. With every document , using getItemValue() and getItemValueString() depends of what attribute you want, you will retrieve all information. With attachments, it's a bit different, but with the next simple example, all will be understood.

    Attribute NameAttributeReturn Type
    SubjectSubjectjava.lang.String
    SendToSend To (cc too)java.util.Vector
    PostedDatePosted Datejava.lang.String
    DeliveredDateDelivered Datejava.lang.String
    BodyBodyjava.lang.String(*)
    FromFromjava.lang.String

    *) the body of an email, it's save in a multiple RichTextItem, so you must use a StringBuffer to catching all information. Because we use this method in the theme Deleting Attachments, please refer to this section the see an example.

    doc.getItemValueString("From")
    doc.getItemValue("SendTo")
    doc.getItemValueString("PostedDate")
    doc.getItemValueString("DeliveredDate")
    doc.getItemValueString("Subject")

    Also note that with dates, you can also retrieve an object of lotus.domino.DateTime with method getItemValueDateTimeArray("..."). This method will return a vector of DateTime objects, and then you will loop through the vector.

    Retrieving Attachments
    Vector list = new Vector();
    if (pDocument.hasEmbedded())
    {
         Enumeration e = pDocument.getItems().elements();
         while (e.hasMoreElements())
         {
             Item it = (Item)e.nextElement();
             if (it.getType()==Item.ATTACHMENT)
            {
                list.addElement(pDocument.getAttachment(it.getValueString()));
            }
         }
         return list;
    }

    What you can see in the previous code is that, firstly you look if the document has embedded information, if it has you return an enumeration of all Items that are into the document. Then you filter all documents, only allowing attachments, and then you save it into a vector object. What you save into the vector is an EmbeddedObject.

    Once fact this, with EmbeddedObject you can save it to disk using:

    String Filename = oEmbeddedObject.getSource();
    oEmbeddedObject.extractFile(Path + Filename);

    With extractFile method will copy the attachment where you pass with parameter.

    Like all Lotus documents, you can delete fields, modify, copy, extract attachments, delete attachments. This is a very important feature, because you could filter all e-mails. 

    More Administration Articles
    More By Alex Soto Bueno


       · i recently completed an web app that hooks into domino, a few things i learned is...
       · Hi,I am writing a program in java which will read a (Domino)NSF file stored...
     

       

    ADMINISTRATION ARTICLES

    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway