Lotus Software logo
IBM Lotus Domino Designer 8.5
  Versions 8.5 and 8.5.1






Examples: ColumnValues property

This agent gets the column values of all documents in a database, taking care to determine the data type of each value.

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("All Documents");
Vector v;
String s, tabs;
DateTime dt;
Double d;
Document doc = view.getFirstDocument();
while (doc != null) {
v = doc.getColumnValues();
tabs = "";
for (int i=0; i<v.size(); i++) {
if
(v.elementAt(i).getClass().getName().endsWith("String"))
s = (String)v.elementAt(i);
else if
(v.elementAt(i).getClass().getName().endsWith("DateTime")) {
dt = (DateTime)v.elementAt(i);
s = dt.getLocalTime(); }
else if
(v.elementAt(i).getClass().getName().endsWith("Double")) {
d = (Double)v.elementAt(i);
s = d.toString(); }
else
s = "not String, DateTime, or Double";
if (s.length() == 0) s = "*no value*";
System.out.println(tabs + s);
tabs = tabs + "\t"; }
doc = view.getNextDocument(doc); }

} catch(Exception e) {
e.printStackTrace();
}
}
}
Related topics
ColumnValues property




Library | Support | Terms of use |

Last updated: Monday, October 5, 2009