03-17-2014 10:52 AM
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
03-21-2014 06:49 AM
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.
03-21-2014 06:49 AM
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.
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.