Question : Get document object or view that does not contain all values

Hello,

I am experiencing a problem with Lotus Notes / Domino programming. With the Java object API for Lotus Domino (NCSO.jar) I am able to get views and documents from my mail file.
Is there a possibilibty to get the documents with just a minimal set of information?

If I have a folder with mails and this folder contains e.g. 1000 mails and all mails are greater than 3 MB. But I only need to get e.g. the following values:
subject, sender, creation/receive date, last modified date, item id

When I am trying to get the mails from the folder with calling view.getAllEntries() method and getting the document object it downloads the whole message. How can I give a filter or get the document with only the minimal set of information? Is this possible?

Thank you.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
// opening session
// opening database
// getting inbox view
 
// getting all entries from the current view
// how to get only a view with a minimal set of information?
ViewEntryCollection viewCollection = view.getAllEntries();
if (null != viewCollection) {
    int viewCount = viewCollection.getCount();
    int count = 0;
    while (count <= viewCount) {
        ViewEntry viewEntry = viewCollection.getNthEntry(count);
        if (null != viewEntry) {
            Document document = viewEntry.getDocument();
            if (null != document ) {
                System.out.println("printing infos for folder -> " + view.getName());
                System.out.println("Created -> " + document.getCreated());
                System.out.println("Last modified -> " + document.getLastModified());
            }
        } else {
            System.out.println("viewEntry is null,...");
        }
        viewEntry = viewCollection.getNextEntry();
        count++;
    }
} else {
    System.out.println("viewCollection is null...");
}

Answer : Get document object or view that does not contain all values

RE: "How can I give a filter or get the document with only the minimal set of information? Is this possible?"

Unfortunately, no.  When you retrieve a NotesDocument you get the whole thing.

The most expensive call in your code above is probably this one:
    Document document = viewEntry.getDocument();

If the values that you need are actually displayed as columns in the view (or folder), then you don't need to retrieve the entire document.  Instead, you can use the ColumnValues property of the ViewEntry class.  That would eliminate having to retreive the entire document, but you would have to change the design of the view (or folder) to support the columns that your code expects.
Random Solutions  
 
programming4us programming4us