JAVA/CORBA クラス


例:setHSL メソッド
このフォームアクションは、文書内のアイテム [Hue]、[Saturation]、および [Luminance] を setHSL へのパラメータとして使用し、その結果得られるプロパティ値を [NotesColor]、[Red]、[Green]、[Blue]、[Hue]、[Saturation]、および [Luminance] アイテムに書き込みます。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

 public void NotesMain() {

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

     // (Your code goes here)
     ColorObject color = session.createColorObject();
     DocumentCollection dc = agentContext.getUnprocessedDocuments();
     Document doc = dc.getFirstDocument();
     while (doc != null)
     {
       int h = doc.getItemValueInteger("Hue");
       int s = doc.getItemValueInteger("Saturation");
       int l = doc.getItemValueInteger("Luminance");
       color.setHSL(h, s, l);
       Integer i = new Integer(color.getNotesColor());
       doc.replaceItemValue("NotesColor", i);
       i = new Integer(color.getRed());
       doc.replaceItemValue("Red", i);
       i = new Integer(color.getGreen());
       doc.replaceItemValue("Green", i);
       i = new Integer(color.getBlue());
       doc.replaceItemValue("Blue", i);
       i = new Integer(color.getHue());
       doc.replaceItemValue("Hue", i);
       i = new Integer(color.getSaturation());
       doc.replaceItemValue("Saturation", i);
       i = new Integer(color.getLuminance());
       doc.replaceItemValue("Luminance", i);
       doc.save(true, true);
       doc = dc.getNextDocument(doc);  
     }

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

関連項目