The parameters identified for an element can be configured during portlet creation in one of the element definition windows or after portlet creation using the Portlet Builder Configure Parameter wizard. You launch the wizard by clicking the Params button on the Portlet Builder toolbar.
Web Studio allows you to identify or create portlet parameters that control the portlet content. These can be CGI script parameters for Web elements or custom @OP parameters for XML and database elements. You can specify these parameters as variables, which causes the portlet to display input fields during playback. End users can submit their own parameter values into these input fields to return personalized content.
A CGI program, or script, is a way users interact dynamically with Web pages; for example, submitting a string to a search form. When parameters are submitted to a CGI script to navigate to the Web page, the program automatically detects these parameters and their values. You can designate one or more CGI parameters as variables. Portlets with variable parameters display a window containing input fields for these parameters before portlet content is rendered. This allows portal users to submit their own parameter values to return personalized content.
When the element contains data-capable parameters, a window displays during the element creation process that displays all parameters that you can designate as variables.
In addition to specifying variables for an element, you can also select a personalization adapter to use with the parameters. You can select the username and password parameters as variables, then select the personalization username/password login adapter. The Key represents the value that a user needs to enter.
Users can use the My Info link in Portal Interface to personalize the values for these input fields so that they can always log in using their own user name and password. See “Using the user name/password adapter” for more information.
Whether you access the parameter configuration windows during portlet creation or by clicking Params, you can edit the following parameter properties.
The parameter options display in a different order and
on more than one screen when you click Params to access the Configure
Parameters window. The order shown here is how the parameter options
display during portlet creation.
Position – use the up and down arrows to organize the parameters in the order you want them to appear in the portlet.
Variable – select the parameter that you want to configure as a variable. This option is labeled “Configure” in the Configure Parameters wizard.
Name – displays the parameter name used in the CGI script.
Display Name – enter an alternate name to use as the input field label.
You can assign two or more parameters the same display
name to combine input parameters. When you are prompted to enter
input for the parameter, that input is used to fill in all the parameters
with that display name, saving retyping.
Default Value – enter a default value to automatically populate the input field. The user can override this value by typing in a different value.
(Display) Type – select the input field type: Text Field, Password, Text Area, and None. When using the username/password personalization adapter, you must select Password (rather than Text Field) for this option.
Personalize – personalization adapters retrieve values from external systems or databases and automatically submit them to the portlet. They must be registered with Web Studio before they appear in the Personalize drop-down. Once a Personalize adapter is selected, the adapter’s available methods display in the Key drop-down.
Key – select a method to specify the parameter within the personalization adapter.
Required – specify whether the parameter is required.
Enter Setup Description HTML – this option appears only in the Configure Parameters wizard.
You can insert an @OP parameter into the SQL query of a database. This dynamically modifies the query string submitted to the database.
Inserting @OP parameters
Create a new database element:
Right-click the mouse in the Portlet Manager detail view and select New Aggregated Portlet from the pop-up.
Click the down arrow beside the New icon on the Portlet Manager toolbar and select Aggregated Portlet from the drop-down menu.
When the Portlet Builder appears, right-click in either frame and select New Database Element from the pop-up. You can also click the down arrow next to the Add icon and select Database Element.
Complete the Database Element Definition:
This example uses an Adaptive Server database Enterprise.
Username – enter the user name to access the database; for example:
sa
Password – enter the password to access the database. Leave this field blank for this example.
JDBC Connect URL – enter the connection string to access the database; for example:
jdbc:sybase:Tds:<ASE_server_name>:5000
JDBC Driver – enter the JDBC driver used to access the database; for example:
com.sybase.jdbc2.jdbc.SybDriver
SQL Query String – enter the SQL statement to retrieve the requested data from the database; for example:
select * from tiles where header like '@OP["Header"="%CNN%"]'
To determine other header values, use a wildcard search ‘%’.
UI XSLT – enter the complete URL of the XSLT to be applied to the content returned by the database or click Select to select from existing XSL templates.
Select the Variable option next to the Header parameter
and enter “%CNN%
'” into
the Default Value input field.
Click Next in the upper-right corner.
Enter an element name such as “DB Search” and click Finish.
In the Portlet Builder, click Save to display the Portlet Save window.
Complete the fields and click OK.
Click Finish in the upper-right corner. You should see a pop-up that displays “Portlet saved successfully.”
Click OK to close the window, then click Close in the upper-right corner.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |