Pages

Tuesday, August 09, 2005

Updating Multiple Discoverer Portlets Using Portal Page Parameters

One of the new features of Discoverer 10.1.2 (the 'Drake' release), and a very useful one at that, is the ability to tie portal page parameters to Discoverer worksheet parameters. So if you have a portal page with many Discoverer worksheets, and if some or many of them have parameters, you can define portal page parameters that update multiple Discoverer portlets in one go. Rather than click the 'customize' link and then select the new parameter value, this is obviously a much easier way to go.

The way to do this is two step (well, more than just two steps, but conceptually speaking, there are two steps involved). The first one is to map your Discoverer worksheet parameters to generic Discoverer portlet parmeters. The second is to map these to portal page parameters. In between these two steps you would need to add a simple parameter form portlet to your portal page.

Assuming that you have Discoverer worksheets with paramters that you want to publish, while adding a Discoverer worksheet to your portal page, be sure to map your worksheet parameters to generic Discoverer portlet parameters. This is the first step towards tying Discoverer parameters to portal page parameters.
When configuring your Discoverer portlet, you need to map your worksheet parameters to generic Discoverer page parameters


This (below) is the page I have constructed: it's simple portal page, with four Discoverer portlets. Each worksheet has one or more parameters: Year, Region, and Department.



Click the 'Edit' link on your portal page, and then click the 'Parameters' tab. Here you will define portal page parameters. You need to define as many page parameters as you have Discoverer worksheet parameters that you want to be able to update through one click.

What I have done here is to add three parameters, and given them descriptive, but brief names, that will allow me to know which portal page parameter maps to which Discoverer portlet parameter - YearPP for Year parameter, RegionPP for Region, and DeptPP for Department.
Create new portal  page parameters


The next step is to click each Discoverer portlet link below in the page and each Discoverer portlet parameter to the portal page parameter that I have just defined. You will have to remember in each case which Discoverer worksheet parameters map to which DiscoParameter1. In this case, I made sure that the Year parameter in every worksheet mapped to DiscoParameter1, and the Reion worksheet parameter maps to DiscoParameter2.
Map portal page parameters to Discoverer generic page parameters.

As I mentioned above, the second step is to actually add a parameter form portlet. This is easily done by selecting the 'Simple Parameter Form' portlet from the Portlet Builders portlet repository.
The Simple Parameter Form portlet that you need to add to your portal page

Once you have added this parameter form portlet to your page, click the 'Edit defaults' link and click the 'Layout' tab. What you need to do here is give a label to each parameter field that will appear: Year, Region, and Department in this case. The other two fields I don't need, so I keep their 'Display As' option set to 'Hidden' so that they don't appear in the portal page. In the 'List of Values' field I need to enter the values that the Discoverer parameter can take. Note that this list of values option will mean that I can only pass one value to a parameter. If I need to pass in multiple parameters I would need to use a text field as the 'Display As' option.



Now I need just one more step. I have mapped my Discoverer worksheet parameters to generic portlet parameters. Then I mapped these generic portlet parameters to portal page parameters. And I now have a parameter form portlet. All I need to do is to tie the parameters in this portlet to my portal page parameters. To do that, click the 'Page Properties' link on the portal page, and then click the 'Events' tab.


Here, locate the parameter portlet that you have defined, and click the 'Submit' link. From the right side text that is displayed, you need to say that the portal page where your Discoverer portlets are present, should be refreshed. Under the 'When this event is raised' section you need to also specify which portal page parameters should get the values from the parameter form portlet. Sine I have already done my mapping of portal page parameters to Discoverer generic portlet parameters, this is really the final step!
Set the event properties for the parameters portlet. It refreshes the portal page, and the parameters that should be passed to the refreshed page are specified below

Now the time has come to test this thing out. This is the same portal page that I had when I started out, except that the parameter portlet has been added to the top left section of the page.

You can probably figure this out even without the need for color-coded arrows and connectors, but what I have shown is which parameter portlet field maps to which Discoverer parameter.

I select '1999' as the year value, 'West' as the region value, and leave the department value unchanged. And click 'Refresh Reports'.



All four portlets are refreshing here.



And all four portlets have refreshed with the parameter values selected: the tables, the crosstabs, the graph - all of them.



You do not have to have all portlets refresh every single time. In this case, I have only one portlet with the 'Department' parameter. And in my parameter form portlet, I change the value from 'Video Rental' to 'Video Sale' and click the 'Refresh Reports' button. As you can see, none of the other three portlets are refreshed - which is a good thing for your middle-tier resources.



If you define the parameter form field to be a text field, you can enter multiple values instead of just one.



The portal page here has refreshed with data now displaying for three years: 1998, 1999, & 2000.



Comments, suggestions, enhancements?

website statistics