Site Administration Page 4 - Connect Lotus Domino Server through Standalone Application with CORBA |
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:
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.
*) 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") 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 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(); 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.
blog comments powered by Disqus |