0
votes

There is a Notes view(view1).The each document in the view1 have information for ID and Name. Then, there is another view(view2) in another DB.The each document in the view2 also have information for ID and Name.

As "XPages view", I'd like to display the documents in view1 which are filtered out by view2 data.

For example, view1 in DB1 has 4 documents.

Doc1  - ID1, AAA
Doc2  - ID2, BBB
Doc3  - ID3, CCC
Doc4  - ID4, DDD

view2 in DB2 has 2 documents.

Doc1  - ID2, BBB
Doc2  - ID3, CCC

I'd like to see the data as a XPages view which filtered out by view2 data. Is this feasible?

Doc1  - ID1, AAA
Doc2  - ID4, DDD

I feel it is possible if I'd like to get the next data by 'filter by column value'option. But I'd like to get the opposite result in XPages view.

Doc1  - ID2, BBB
Doc2  - ID3, CCC
2
Two options I can think of: (1) use DQL (www-01.ibm.com/support/docview.wss?uid=ibm10729047), but that requires Domino 10 or (2) use the (open source) Domino JNA project from Karsten Lehmann ( github.com/klehmann/domino-jna). I use that in a number of projects to do view filtering.Mark Leusink

2 Answers

1
votes

If you retrieve a DocumentCollection for each view, you can use the following set operations on those NotesCollections: Intersect, Subtract and Merge. I think you need Subtract in your case. These operations can be very slow, in my experience.

See, e.g.: https://www.ibm.com/support/knowledgecenter/en/SSVRGU_8.5.3/com.ibm.designer.domino.main.doc/H_SUBTRACT_METHOD_COLLECTION.html

1
votes

You're not filtering out documents from view 2 in results from view 1. Because they're two different databases, they're not the same document. At the very least, the UNID and NoteID will be different and as these are properties of the document, they're different documents. They just have the same values for the subset of fields you've chosen to include in your question.

You will need to extract the ViewEntries into a List of Java objects using only the values you want, then filter accordingly.

The only alternative is to write an additional property to the documents in database 1 for IsInDatabaseTwo, which you can then filter on in your view's selection formula.