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.proxy;
24
25 import java.util.Iterator;
26
27 import lotus.domino.DocumentCollection;
28 import lotus.domino.NotesException;
29 import de.bea.domingo.DBase;
30 import de.bea.domingo.DDocumentCollection;
31 import de.bea.domingo.DNotesMonitor;
32
33 /***
34 * Represents the Domino-Class <code>DocumentCollection</code>.
35 */
36 public final class DocumentCollectionProxy extends BaseCollectionProxy implements DDocumentCollection {
37
38 /*** serial version ID for serialization. */
39 private static final long serialVersionUID = 3977580290371827769L;
40
41 /***
42 * Constructor.
43 *
44 * @param theFactory the controlling factory
45 * @param parent the parent object
46 * @param documentCollection the Notes DocumentCollection
47 * @param monitor the monitor
48 *
49 * @see DocumentCollection
50 */
51 public DocumentCollectionProxy(final NotesProxyFactory theFactory, final DBase parent,
52 final DocumentCollection documentCollection, final DNotesMonitor monitor) {
53 super(theFactory, parent, documentCollection, monitor);
54 getFactory().preprocessMethod();
55 }
56
57 /***
58 * Returns the associated notes document collection object.
59 *
60 * @return notes database object
61 */
62 private DocumentCollection getDocumentCollection() {
63 return (DocumentCollection) getNotesObject();
64 }
65
66 /***
67 * @see de.bea.domingo.proxy.BaseProxy#toString()
68 * @return "DocumentCollection"
69 */
70 public String toString() {
71 return "DocumentCollection";
72 }
73
74 /***
75 * {@inheritDoc}
76 * @see de.bea.domingo.DDocumentCollection#getAllDocuments()
77 */
78 public Iterator getAllDocuments() {
79 return new DocumentCollectionIterator(getFactory(), getParent(), getDocumentCollection(), getMonitor());
80 }
81
82 /***
83 * {@inheritDoc}
84 * @see de.bea.domingo.DDocumentCollection#fullTextSearch(java.lang.String)
85 */
86 public void fullTextSearch(final String query) {
87 getFactory().preprocessMethod();
88 try {
89 getDocumentCollection().FTSearch(query);
90 } catch (NotesException e) {
91 throw newRuntimeException("Cannot search documents in collection", e);
92 }
93 }
94
95 /***
96 * {@inheritDoc}
97 * @see de.bea.domingo.DDocumentCollection#fullTextSearch(java.lang.String, int)
98 */
99 public void fullTextSearch(final String query, final int maxdocs) {
100 getFactory().preprocessMethod();
101 try {
102 getDocumentCollection().FTSearch(query, maxdocs);
103 } catch (NotesException e) {
104 throw newRuntimeException("Cannot search documents in collection", e);
105 }
106 }
107 }