Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
Last time, we talked about that a relatively new feature, navigation cache, and how it helps improve the performance of the portal's navigation service (see blog Changes in the Navigation Cache). An unrelated feature, the PCD filter, can help provide different content for different users without the need to create many different roles and structures.   Just be careful when using them together.  There is a small issue when using both the navigation cache and a PCD filter that may not occur often, but it is a good idea to be aware of the possibility.  Before describing the issue, let's first take a look at what a PCD filter is.

PCD Filter

In case you haven't heard, the PCD includes a feature that enables you to deploy a filter in the PCD. Whenever anyone does a lookup in the PCD, the results are filtered based on the criteria in your filter. The criteria are coded in Java within a portal component.  The typical example of a PCD filter is one that checks the current user's language and only returns content tagged for that language. The benefit of using the filter is that it avoids the need for creating separate role structures for each language. Besides, you may not know what language a user is ahead of time, so you would not be able to assign the user to the right role based on language.  To implement a PCD filter, you have to do the following:
  • Create a portal application (holds all the filter components).
  • Create a factory class (defines the logic for the filter).
  • Create a portal service (registers the filter with PCD).
  • Create a jndi.properties file (defines your factory class as a factory in the PCD).
  • Specify the folder(s) or role(s) for which this filter applies.
The following shows three worksets, whose contents are filtered based on either the user's country, department or  position.   The top part shows a part of the Portal Catalog, with the boxes indicating properties for each object in order to make the PCD filter work. The bottom simulates what different users would see in their navigation. I don't want to go into any more detail about PCD filters, since several colleagues have written good guides to create them, including the following:

How Does All This Affect Navigation Cache?

There can be times when there is a conflict between the navigation cache and a PCD filter.   Let's say there is RoleA, which has iViewEnglish and iViewGerman. And let's say there is a PCD filter that returns iViewEnglish to users with language English and iViewGerman to users with language German. First, userEN enters the portal and navigates to RoleA --> iViewEnglish. The entry point RoleA is added to the cache, and its children are listed as iViewEnglish. Then, userDE enters and RoleA --> iViewGerman should be returned, but instead the cache is used, which has the iViewEnglish iView instead. There is no way for the navigation cache to know that a PCD filter is in use, and can't differentiate between the two users.  You can use both the navigation cache and PCD filter, but you must ensure that there is no conflict.
4 Comments