cancel
Showing results for 
Search instead for 
Did you mean: 

Add multiple navigation trees with filters based on user property (5.6)

ganie_
Champ on-the-rise
Champ on-the-rise

Hi,

My goal is to add 3 navigations trees with exactly the same features as the default one, but with an advanced filtering specific to each one. The filter has to accept document only if the currentUser property 'p1' is equals to the document property 'p2'.

I know it is possible to add a post-query filter on the treeManagerPlugin extension, but how could I retrieve the current user in that filter ? Maybe the way of thiking is incorrect, but the only way I see is to create my own TreeActions implementation (where I can get the current principal) and my own DocumentTreeNode. Doing that way, I am able to do the filtering directly in the DocumentTreeNode implementation, but it seems a bad way to me.

Is there an other way of doing that filtering that would stay closer to the Nuxeo "philosophy" ?

Thank you

1 ACCEPTED ANSWER

ganie_
Champ on-the-rise
Champ on-the-rise

Got it ! I had forgotten that it was possible to retrieve the CoreSession directly from the DocumentModel using doc.getCoreSession() method. Then I was able to get the current principal using session.getPrincipal(). So in the end I was able to use the Filter class property in the treeManagerPlugin extension.

View answer in original post

1 REPLY 1

ganie_
Champ on-the-rise
Champ on-the-rise

Got it ! I had forgotten that it was possible to retrieve the CoreSession directly from the DocumentModel using doc.getCoreSession() method. Then I was able to get the current principal using session.getPrincipal(). So in the end I was able to use the Filter class property in the treeManagerPlugin extension.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.