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

Deleting Attachments - 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

Deleting attachments from a file isn't as easy as we think because the attachments could go with body text, and an email could have more than one body. Because of that, we need to retrieve all Body fields, save them to a buffer, (only text), remove it, and then recreate only with the buffer information.

String bod = new String();
RichTextItem body = (RichTextItem)oDocument.getFirstItem("Body");
while(body!=null)
{
    bod +=new String(body.getFormattedText(false, 0, 0));
    body.remove();
    body = (RichTextItem)oDocument.getFirstItem("Body");
}
RichTextItem body2 = oDocument.createRichTextItem("Body");
body2.appendText(bod);

oDocument.save();

As you can see in the first part of the algorithm, what we do is save all text information into a String object and we remove the body section. It would be better use StringBuffer. Then we create a new body, and we append all the text previously kept. 

Linking Documents

Linking documents to other documents is a very important feature because you can divide one document in multiple documents, with all documents linked, so when you consult, you can navigate through documents.

RichTextItem body = oDocument.createRichTextItem("Body");
body.appendText("Link to Other Document");
body.addNewLine();
body.appendDocLink((Document)oOtherDocument);

oDocument.save();

The code is so simple; we create a RichTextItem object, first we append a text, and then we append a document. What we would see is a document icon, and when we push it, we will jump to the document we have already appended. 



 
 
>>> 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: