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

6 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