Sunday, July 16, 2017

PSPRSMNAVINFO - Portal Menu Navigation in SQL

Last week, I worked on a requirement where I needed to find all the components that are part of a role (or a list of roles) including the Portal Menu Navigation Path if it exists. It is easy to get the list of components that are part of a role but it is not really straight forward to qualify that information with the actual Portal Menu Navigation (if it exists).

 In the past, I used the following query to return the Portal Menu Navigation Path for a Component. The query mines through the Portal Structure and Content and presents the navigation hierarchy in the result.



As we can see, it will not be easy to re-purpose this hierarchical query and expand it for my requirement.

While poking around on this topic, I stumbled on this gem of a table PSPRSMNAVINFO that, I believe, was introduced thanks to the PeopleSoft Search Framework!

Here is what we can see in the Definition Properties of this record:
"Holds the Navigation Path to the given target crefs registered in Portal Registry. Holds only effective and non-expired target crefs.
Used by the Portal Menu SES Search.
Updated every schedule of search index file
"

From my understanding, it appears that this table is used as part of the PeopleSoft Search Framework - PTPORTALREGISTRY Search Definition. Also, the App Engine library PORTALPATHAE is responsible for populating this table with the navigation path information when the search index is built.

PeopleTools > Search Framework > Designer > Search Definition (PTPORTALREGISTRY)


PeopleTools > Search Framework > Administration > Schedule Search Index


To identify the last time the PTPORTALREGISTRY search definition index was built, we can query the table PSPRSMPATHSTAT.


If for any reason we don't have the Search Framework enabled and we still want to take advantage of the data in this table, then we can simply populate this table by directly running the PORTALPATHAE App Engine Library from App Designer. Since I was testing this on a Virtual Box installation of a PUM image (CS 9.2 - Image 4), I did not have Search enabled/configured. I ran the AE from App Designer as follows:


Now, let us see how we can use PSPRSMNAVINFO to get the Portal Menu Navigation information.



The best part about this table is that it allows us to directly retrieve the navigation path for a component without having to deal with the hierarchical structure in PSPRSMDEFN. This makes it easier to use/expand this information in other queries.

Here is how I extended this information to create a query that retrieves all components in a role along with the Portal Menu Navigation Path information (if it exists).


Github link to SQL Queries in this post:
https://github.com/SasankVemana/PS-Portal-Menu-Navigation-Queries

14 comments:

  1. Replies
    1. Yeah Jim! Now we know how the Portal Menu Search works! :)

      Delete
  2. Great stuff. Thank you for sharing.

    It was so much of paint to do Security Matrix Report and this makes it a lot easier.

    ReplyDelete
  3. @Sashank: There is also a delivered Component (Main Menu > PeopleTools > Portal > View Menu Security) that displays such information, although due to the time it takes to display, I'm assuming it uses the traditional approach of Parent/Child.

    I stumbled upon PSPRSMNAVINFO recently too and it is indeed quite useful

    ReplyDelete
    Replies
    1. Manoj - Yes. The View Menu Security is a great utility as well! But I suspect it uses some flavor of PeopleCode. And you are right, it is super slow! :)

      Delete
    2. Also, I just noticed that View Menu Security is not filtering out the expired CREFs. It is a returning a whole bunch of extra CREFs compared to my query.

      Delete
  4. Hey Sasank - was wondering if you could help me with debugging an issue.

    A component has ComponentChanged set to true, but I can't find the actual field that is causing ComponentChanged to be set to true. Have you encountered such issues before?

    I tried debugging JavaScript, but didn't help either. Fields have Set Component Changed unchecked, but still PeopleCode shows that Component data has changed.

    Thanks a ton for your help, as always...

    - Mani

    ReplyDelete
    Replies
    1. Hi Mani - That is a bit tricky. One suggestion is to set the trace on the login page (trace=Y) which provides options for component buffer tracing.

      Delete
  5. not sure if it is me. works good in 8.54. When executed in 8.56 PORTAL_NAVPATH is blank

    ReplyDelete
    Replies
    1. @Bala - Just to double check. Did you check if the PORTALPATHAE process was run in your 8.56 environment?

      Delete
    2. Sasank, running the AE fixed it. my bad. thanks

      Delete
  6. Hi Sasank
    I have a requirement to auto expand the menu in classic mode of CS 9.2 PT 8.57.
    Where do we need to make the customization in PT_NAV or PT_NAV2 application package.

    ReplyDelete
    Replies
    1. Hi Pazhanivel - Which menu are you referring to? The Fluid Navigator Menu? Or the Classic Menu Pagelet?

      Delete