JAVA/CORBA クラス
例:ViewColumn クラス
1. 次のエージェントは、現在のデータベースの [By Category] ビューにある各列のタイトル (または「タイトルなし」) と位置を出力します。
import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
View view = db.getView("By Category");
System.out.println("By Category view");
Vector columns = view.getColumns();
if (columns.size() != 0) {
for (int i=0; i<columns.size(); i++) {
ViewColumn column =
(ViewColumn)columns.elementAt(i);
String vtitle = column.getTitle();
if (vtitle.equals("")) vtitle = "No title";
System.out.println("\t" +
column.getPosition() + " " + vtitle); } }
} catch(Exception e) {
e.printStackTrace();
}
}
}
2. 次のエージェントは、現在のデータベースの [By Category] ビューにある最初のソート済みの列のタイトル (または「タイトルなし」) と位置を出力します。
import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext =
session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
View view = db.getView("By Category");
System.out.println("By Category view");
Vector columns = view.getColumns();
ViewColumn column = null;
boolean gotIt = false;
if (columns.size() != 0) {
for (int i=0; i<columns.size(); i++) {
column = (ViewColumn)columns.elementAt(i);
if (column.isSorted()) {
gotIt = true; break; } }
if (gotIt) {
String vtitle = column.getTitle();
if (vtitle.equals("")) vtitle = "No title";
System.out.println("First sorted column is \"" +
vtitle + "\" in position " +
column.getPosition()); }
else
System.out.println("No sorted columns"); }
} catch(Exception e) {
e.printStackTrace();
}
}
}
関連項目
ViewColumn クラス
用語集
フィードバック
ヘルプ
または
プロダクトユーザビリティ
ヘルプの使い方
すべてのヘルプ項目
用語集