JAVA/CORBA クラス


例:getValueCustomDataBytes メソッド
次のエージェントは、現在の文書のカスタムデータを取得します。カスタムデータは TenBytesItem という名前のアイテムにあり、書き込まれたときに TenBytesType というデータ型名が設定されています。

import lotus.domino.*;
import java.io.*;

public class JavaAgent extends AgentBase {

 public void NotesMain() {

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

     // (Your code goes here)
     Document doc = agentContext.getDocumentContext();
     if (doc.hasItem("TenBytesItem")) {
       Item item = doc.getFirstItem("TenBytesItem");
         if (item.getType() == Item.USERDATA) {
           byte[] bytes = item.getValueCustomDataBytes(
           "TenBytesType");
           for (int i = 0; i < 10; i++)
             System.out.println( (char) bytes[i] );
       }
       else
         System.out.println("Not user data");
     }
     else
     {
       System.out.println("No item TenBytesItem in document");
     }

   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

関連項目