Examples: Form class
This agent prints the properties of all the forms in the current database.
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();
Vector forms = db.getForms();
System.out.println
("Forms in \"" + db.getTitle() + "\":");
for (int i = 0; i < forms.size(); i++) {
Form form = (Form)forms.elementAt(i);
System.out.println
("\nForm name : " + form.getName());
Vector alias = form.getAliases();
if (alias.size() != 0) {
System.out.println
("\tAlias\t: " + alias.elementAt(0));
for (int j = 1; j < alias.size(); j++)
System.out.println
("\t \" \"\t: " + alias.elementAt(j)); }
System.out.println
("\tProtect Readers\t: " + form.isProtectReaders());
System.out.println
("\tProtect Users\t: " + form.isProtectUsers());
System.out.println
("\tSub Form \t: " + form.isSubForm());
Vector users = form.getFormUsers();
if (users.size() != 0) {
System.out.println
("\tForm users\t: " + users.elementAt(0));
for (int j = 1; j < users.size();j++)
System.out.println
("\t \" \" \t: " + users.elementAt(j)); }
Vector readers = form.getReaders();
if (readers.size() != 0) {
System.out.println
("\tForm Readers\t: " + readers.elementAt(0));
for (int j = 1; j < readers.size(); j++)
System.out.println
("\t \" \" \t: " + readers.elementAt(j)); }
Vector fields = form.getFields();
if (fields.size() != 0) {
System.out.println
("\tFields \t: " + fields.elementAt(0));
for (int j = 1; j < fields.size(); j++)
System.out.println
("\t \"\" \t: " + fields.elementAt(j)); } }
} catch(Exception e) {
e.printStackTrace();
}
}
}