Everybody who works with WebCenter knows about the Resource Catalog. It allows you to provide the users with a catalog of components so they can customize the page by adding these components.
The resource catalog can take taskflows, portlets, folders, documents and much more. Most of us will know how to manage the resource catalog by adding these components and arranging them in folders.
There is one nice feature that is not that well know but can provide powerful functionality. It often happens that a taskflow or portlet has to be reused in different pages with the exact same set of input parameters. Most of the time people put these taskflows on the page and provide the parameters for each instance.
The resource catalog provides us with functionality to preset certain parameters of the taskflow or portlet. These are called URL Parameters and are provided in the bottom section of the component as shown in the screenshot:

In the example project I have added the Content Presenter to the resource catalog. You can download it here
When you press the Add button you can provide the input parameter of the taskflow. This is not a dropdown list or automated list so you will have to look-up the exact name of the parameter.
In my example I will add the dataSourceType and datasource parameter to automatically populate the content presenter with those values:

When we run the project and go to edit mode to open the resource catalog we see the content presenter as a normal component:

When I add the About Us component, the content presenter will automatically use those parameters and I don't have to configure it anymore.
When you edit the content presenter instance that we just added to the page, you will notice that the parameters are preset with the ones we have defined in the resource catalog:

As you can see this improves the reusability of components.
This example has been done with an OOTB taskflow from WebCenter but this can also be done with your own taskflows. As long as they take input parameters.
The cool thing about this is that you can provide an EL value. The EL will not be parsed to provide the input parameter but instead that EL will be used as input parameter which means that you don't have to hard code the value.
If for example you have a taskflow that displays a list of employees based upon an input parameter for the department. This would allow you to add the taskflow to the resource catalog and provide an EL for the department.
It's a small feature but when used correctly is provides nice features and flexibility.
Apparently there is also a bug in JDeveloper that doesn't display the URL Parameters for the OOTB taskflows when you try to add them. You will notice that when you try to add the first parameter "datasourceType" and you set focus to the value field, it will disappear. However when you take a look at the source, you notice that parameter is there.
So for these parameters I recommend using the source view for the resource catalog because it just doesn't work in JDeveloper...
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer
Add new comment