Home arrow Site Administration arrow Page 4 - Connect Lotus Domino Server through Standalone Application with CORBA

Working with Received Mails - Administration

This article discusses Lotus Domino Notes, especially how to access to the documents stored in it with CORBA. This feature allow developers to write standalone applications that will use documents of Lotus. Moreover, the developer won't have to learn CORBA because the Lotus Domino Server has already mapped all interfaces, so we are pure users of an API. This article assumes you already have installed a Lotus Domino Server, configured the IIOP properly, and that you know how to create nsf database files.

TABLE OF CONTENTS:
  1. Connect Lotus Domino Server through Standalone Application with CORBA
  2. Start Working with Documents
  3. Looking for Documents
  4. Working with Received Mails
  5. Deleting Attachments
  6. Conclusion
By: Alex Soto Bueno
Rating: starstarstarstarstar / 17
September 14, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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 Site Administration Articles          >>> More By Alex Soto Bueno
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: