Pass in Parameters

Pass in Parameters

Pass in parameters for an Interview Portlet across WSRP

We pass in parameters for an Interview Portlet across WSRP by this using 'public render parameters' as defined in JSR268 and WSRP2; by default, the portlet is configured to receive the following parameters:

 

If the value of start_investigation_proxy is true, then the values for the other parameters are inspected and used to start an investigation. Note that this will end any investigation currently in progress.

These public render parameters can be set by another portlet located on the same portal page as the Interview Portlet.

For an example of passing parameters, see the topic Pass in parameters for an Interview Portlet across WSRP.

Notes:

Setting portlet parameters on WebCenter

On WebCenter, portlet parameters can be bound to page parameters, which in turn can be bound to portal page URL parameters and populated at runtime. This way, it is possible to launch a portal page with specific parameters for the interview portlet.

 

Additionally, portlet parameters can also be set at design time by the administrator of a page by accessing the Edit -> Parameters option for the Interview Portlet.

Note: Page query parameters will persist across restarting and closing the interview. This may cause undesirable behaviour; for example, if a session is started with a particular queryParam_preseedID specified as a page parameter, but then restarted, the subsequent session will also have the same queryParam_preseedID.

Receive additional parameters

Any custom parameters can be received by the portlet, and processed; for example, in the custom event handlers. To receive additional parameters, the portlet.xml file needs to be augmented with these additional parameters, and the parameter setting portlet needs to set them.

Pass in parameters for a local interview portlet

In some cases, users might want to launch straight into a particular rulebase, locale, goal, as well as supply user-id and locale-id parameters.

In Web Determinations, these parameters are passed as URL query string parameters; however, this does not work for the portlet out of the box, because the portlet does not have access to the URL parameters of the portal page, nor the HTTP request. Instead, we have created a servlet which acts as a proxy, receiving the parameters, storing them in the session and performing a redirect to the portal page after which the portlet extracts the parameters from the session.

Note: If a portal page has more than one instance of the interview portlet, invoking the proxy will cause each portlet's investigation to be started with the supplied parameters.

Configure the proxy

The web.xml file in the opa-interview-portlet directory configures the proxy servlet. Specifically, the following elements can be configured:

Session management

The application server needs to be configured so that the proxy servlet shares the session state with the portlet. On Tomcat-based application servers, this can be done by adding the emptySessionPath="true" attribute to the Connector element in conf\server.xml.

Supported parameters

The proxy supports the following parameters:

 

The query string format is ?param1=val1&param2=val2...

Examples

Rulebase and Case ID:

http://localhost:8080/opa-interview-portlet/StartInvestigation?rulebase_proxy=AdminSmokeTest&case_id_proxy=1-1RN26,guest,0-1,AdminSmokeTest

 

Rulebase and locale:

http://localhost:8080/opa-interview-portlet/StartInvestigation?rulebase_proxy=SuperSimple&locale_proxy=fr-FR

Rulebase, User ID, Goal ID and locale:

http://localhost:8080/opa-interview-portlet/StartInvestigation?rulebase_proxy=SocialServicesScreeningPortlet&user_id_proxy=Bob&goal_proxy=Attribute~interview_complete~global~global&locale_proxy=en-US