Question

i have a view in an xpage with some entries (lets say clients). I have an acl group of persons (clients) that contains some of the clients of the view. Now i want to use the search attribute of the view to show only entries that belong to the group.

I already use search attribute to select users by name e.g:

FIELD Name Contains "Chuck Norris"

Is there any similar query? (maybe using @isMember on the field....?)

UPDATE: i will have the group entries (client names) into a text list in a document too. so can i filter the "name" field of the view based on the values of a text list?

Was it helpful?

Solution

Perhaps using a reader field is a good idea. You're talking about restricting document access to a group of Domino users - that's exactly what reader fields are for.

For example, make your text list field containing client names into a reader field like this:

var item = document1.getFirstItem("myfield");
item.setReaders(true);
document1.save();

myfield needs to contain canonical names (CN=firstname lastname/O=organisation).

Using reader fields, you don't need to do any view filtering at all, it happens automatically. If you have really many documents (say, half a million or so), it could slow down things, otherwise, it's a nice approach.

When you want to restrict displaying documents only in one certain view reader fields are no solution, though. In that case, you need to do the view filtering yourself as you tried.

If you want to filter only for ONE certain client, then using a categorized view is the way to go. You can give the view panel the name of one client as category filter then.

If you want to filter for multiple clients, you need to do it based on fulltext search, just as you already tried. In that case, make sure you're working with Domino 9. Previous Domino versions don't apply the view sorting order to a fulltext search result, which means you have to search it manually using custom javascript or so, which is complicated.

Or, as Frantisek suggested, write a scheduled agent which puts documents in folders depending on their clients - but depending on the number of clients you want to filter the view for this may lead to many folders, which may lead to other problems. Furthermore, you need to make sure to remove folders when they are not needed anymore, and you have a lag until new documents appear in a folder.

So in a nutshell, if you want to do an application wide restriction based on client names, use reader fields. If you want to restrict for one client name at a time, use categories. Otherwise, use fulltext search with Domino 9.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top