22.1 Understanding Parameters

Two types of objects in Oracle Portal can use parameters; pages and portlets. A page parameter stores a value for a page and a portlet parameter stores a value for a portlet.

The following sections describes page parameters and portlet parameters and how to use them in Oracle Portal:

22.1.1 Understanding Page Parameters

Page parameters accept and store values for a page. Their presence on a page means that page information can be different depending on where the page is called from, or who is viewing the page. For example, you could define a page parameter on a page that displays a stock ticker portlet so that a different portfolio is displayed depending on value of the page parameter. Page parameters can be defined for Standard, Mobile, and Search pages, custom pages that are based on these page types, and navigation pages.

In Oracle Portal, parameters and events are enabled for page groups, by default. For information on enabling/disabling parameters and events in a page group, see Chapter 4, "Working with Page Groups".

A page parameter gets its value from (in order of precedence):

  • the URL used to access the page, for example:

    http://myportal/mypage?a=1&b=2
    

    Parameters are case-sensitive, so if your parameter name is a, entering a=1 will work, but A=1 will not.

  • the personalized value of the parameter, as specified by the current user

  • the default value of the parameter, as specified by the page designer

22.1.1.1 Page Parameters in URL Pages

You can define page parameters for URL pages. The page parameters (and their values) are passed to the location that is specified by the URL page. For example, if the URL page myurlpage points to the URL http://www.yahoo.com/somepage and values are defined for page parameters a and b (a=1 and b=2), this URL is used to access the page in Oracle Portal:

http://myportal/myurlpage?a=1&b=2

The parameter values are passed to the location specified for the page and this generates the following URL:

http://www.yahoo.com/somepage?a=1&b=2

22.1.2 Understanding Portlet Parameters

Portlet parameters accept and store values for portlets. This means that information displayed in a portlet can be specific to a particular page or user. A portlet's parameters are specified in the file provider.xml.

There are two types of portlet parameter, public and private:

  • Public portlet parameters are displayed to page designers. This allows page designers to assign appropriate parameter values and make the information displayed in the portlet specific to their page. The page designer can provide a specific value (constant), a system variable (for example, USER), or a page parameter.

    To set values for portlet parameters, the page group setting Enable Parameters and Events must be enabled, see Chapter 4, "Working with Page Groups".

  • Private portlet parameters are used internally by the portlet, for example, to identify the current row displayed, or the current tab displayed. Private portlet parameters are not displayed to the page designer.

For example, a Stock Ticker portlet could have a public portlet parameter (ticker) that accepts a stock symbol as its value. When this portlet is placed on a page, the public ticker parameter is displayed on the Edit Page: Parameters tab. If the page designer sets the ticker parameter to a specific value, such as ORCL, the portlet shows stock information for this company when it is displayed.

Alternatively, the page designer could add a page parameter (for example, symbol) to the page, and pass that page parameter to the portlet parameter. If the page parameter is personalizable, users can set the stock ticker portlet to display stock information for any company they choose.

More on OTN
For information on how to add parameters to your portlets, see the Oracle Fusion Middleware Developer's Guide for Oracle Portal available on the Oracle Portal documentation page of the Oracle Technology Network at http://www.oracle.com/technology/products/ias/portal/documentation.html.