Restricting public render parameter scope

JSR 286 has introduced a concept of Public Render Parameter for communication between portlets in same or different WAR.
Public render paramter declared in a portlet, are accessible for all the portlets across the portal.
But in some case you might want to restrict the scope of public render parameter.

Let's take an example to understand this...

You have got two pages on which you have each instance of Book List and Book Details portlet.
Book list portlets shows all the books available in the library and when you select any book, Book Details portlet shows all the information about the book,
like book availability, book author e.t.c.

So you have these two portlets on two different pages say Page A and Page B.

By defalut public render parameter are global, so if you select any book from Book List portlet on page A, Book details portlet on Page A and Page B will start showing same book details.

In WebSphere Portal V6.1.x, you can control this behavior by limiting the sharing scope for public parameters to a page.
To limit sharing of public render parameter to another instance of the same portlet on other page, you can limit this scope by doing following:
Go to Edit page settings for page A and set param.sharing.scope (under Advanced options - I want to set parameters) to a non-empty value such as PageAScope.

Now Book Details portlet on Page A use their own shared values for their declared render parameters, and it will not conflict with rendering data of Book Details portlet on Page B.

No comments: