1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package de.bea.domingo.samples;
24
25 import java.util.Iterator;
26
27 import de.bea.domingo.DDatabase;
28 import de.bea.domingo.DNotesException;
29 import de.bea.domingo.DNotesFactory;
30 import de.bea.domingo.DSession;
31 import de.bea.domingo.DView;
32 import de.bea.domingo.DViewEntry;
33
34 /***
35 * A simple example accessing the local NAB.
36 *
37 * <p>The file notes.jar from the Lotus Notes client installation must be in the
38 * classpath to run this test.</p>
39 *
40 * @author <a href=mailto:kriede@users.sourceforge.net>Kurt Riede</a>
41 */
42 public final class LocalCallNAB {
43
44 /***
45 * Main method of sample.
46 *
47 * @param args arguments
48 * @throws DNotesException if the sample fails
49 */
50 public static void main(String[] args) throws DNotesException {
51
52
53 DNotesFactory factory = DNotesFactory.getInstance();
54
55
56 DSession session = factory.getSession();
57
58
59 DDatabase database = session.getDatabase("", "names.nsf");
60
61
62 DView view = database.getView("($Users)");
63 Iterator allEntries = view.getAllEntries();
64 System.out.println("Content of view ($Users)");
65 while (allEntries.hasNext()) {
66 DViewEntry entry = (DViewEntry) allEntries.next();
67 for (int i = 0; i < entry.getColumnValues().size(); i++) {
68 System.out.print(entry.getColumnValues().get(i) + ", ");
69 }
70 System.out.println();
71 }
72 }
73 }