JAVA/CORBA CLASSES


Examples: ContentType property
This agent displays the type and sub-type of a MIME entity.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

 public void NotesMain() {

   try {
     Session session = getSession();
     AgentContext agentContext = session.getAgentContext();

     // (Your code goes here)
     Stream stream = session.createStream();
     // Do not convert MIME to rich text
     session.setConvertMIME(false);
     DocumentCollection dc = agentContext.getUnprocessedDocuments();
     Document doc = dc.getFirstDocument();
     while (doc != null) {
       MIMEEntity mime = doc.getMIMEEntity();
       if (mime != null) {
         System.out.println(doc.getItemValueString("Subject"));
         System.out.println("Content-Type = " +
           mime.getContentType() + "/" + mime.getContentSubType());
       }
       else
       {
         System.out.println("Not MIME - " +
           doc.getItemValueString("Subject"));
       }
       doc = dc.getNextDocument(doc);
     }
     // Restore conversion
     session.setConvertMIME(true);
   
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also