| Scoping parameters

Related topics
This topic explains how to use scoped names with the parameters in the wwpro_api_parameters API package. As the portlet reference path uniquely identifies a portlet instance on a page, it provides the scoping information for the parameters in this package and can be used to target parameters to individual portlets or groups of portlets on a given page. Example: If portlets named 'a' and 'b' are displayed on a given page, and if the following parameters are passed to the portlets through the URL: deptno = 10 a.deptno = 20 - where 'a' is the reference path a.empno = 30 - where 'a' is the reference path then these results are returned for the calls to the get_value API: wwpro_api_parameter.get_value('deptno','a') returns 20 wwpro_api_parameter.get_value('deptno','b') returns 10 wwpro_api_parameter.get_value('empno','b') returns an empty list Comments: Parameter values found at a tighter scope replace values at a looser scope. A tightly scoped parameter is one that is fully specified. An example for the deptno parameter is <referencepath>.deptno. An example of a loosely scoped parameter is deptno without a reference path. If the URL contains both types of parameters and if the requester uses a reference path, the parameter at the tighter of the two bindings (i.e., <referencepath>.deptno) is returned. In the first example call, the result is '20' because in the URL the parameter is fully specified as a.deptno and the value is set to '20'. In the second example call, there is no parameter deptno specified for portlet with reference path 'b', so the parameter is checked at a looser (global) scope. The value of deptno at the looser scope is '10', so the result is '10'. In the third example call, there is no empno parameter with reference path 'b' specified for portlet . Even if a check is done one level up at a looser (global) scope, there is no such parameter, so the API returns an empty list.

Related topics
Provider parameters API packages | PDK PL/SQL API Reference - Home

Back to top
The PL/SQL API Reference is part of the Portal Developer Kit on Portal Studio