Customizing Events and Public Render Parameters of JSR-286 Portlets¶
Note
Publishing views as widgets is a deprecated feature and it may be removed in future major versions of the Denodo Platform.
The section Features Deprecated in Denodo Platform 8.0 lists all the features that are deprecated.
This appendix explains how to change the name of the events and public render parameters (from now on, PRP) that a Denodo portlet can publish and process. This only applies to JSR-286 portlets.
A Denodo portlet processes and publishes an event for each field of the view that publishes. It also reads the value of a PRP and sets the value of another PRP, for each field of the view.
For example, if a Denodo portlet publishes a view that has a field
called account_name
, the portlet processes the event
Input_account_name
and publishes the event
Selected_account_name
. It also reads the value of the PRP
Input_account_name
and set the value of the PRP
Selected_account_name
.
When the portlet receives the event Input_account_name
, it adds a
condition to the WHERE
clause of the query executed by the portlet
to retrieve the data. I.e. “SELECT ... FROM ... WHERE account_name =
<value received from the event>”.
If the user clicks on the link of the portlet to select a row, the
portlet publishes one event for each field of the view. Each event has
the value of the field in the selected cell. The name of these events is
Selected_<field name>
.
The name of the events and parameters can be customized so their name matches the name of an event/PRP of another portlet. This is necessary if you want to deploy a Denodo portlet in a portal that does not support event wiring.
We will explain how to customize these names with an example:
Let us say that we want to deploy two widgets:
A widget that publishes the view internet_inc, which has a field called iinc_id.
And a widget that publishes the view phone_inc, which has a field called pinc_id.
We will explain how to map the event “Selected_iinc_id” published by the portlet “internet_inc” with the event “Input_PINC_ID” that the portlet “phone_inc” can process.
Follow these steps:
Publish the views “internet_inc” and “phone_inc” as widgets. You will find the generated war files in the URL
https://<host name of the Denodo server>:9090/export/
.Edit the
portlet.xml
file ofphone_inc.war
(located in the directory/WEB-INF/
of the war file).Note that “phone_inc” is the portlet that will receive the events sent by “internet_inc”.
Do the following changes:
Search for the
<preference>
with<name>IPC_NAME_PINC_ID</name>
and replaceInput_PINC_ID
withSelected_iinc_id
, which is the name of the event sent by the portletinternet_inc
and that we wantphone_inc
to process it. That is, you have to replace this:<preference> <name>IPC_NAME_PINC_ID</name> <value>Input_PINC_ID</value> <value>Selected_PINC_ID</value> <read-only>true</read-only> </preference>
with this:
<preference> <name>IPC_NAME_PINC_ID</name> <value>Selected_iinc_id</value> <value>Selected_PINC_ID</value> <read-only>true</read-only> </preference>
The first
<value>
of the preferences that start withIPC_NAME
maps the name of a processing event and a PRP, with the name of a field. The default value isInput_PINC_ID
, which means that when the portlet receives an event calledInput_PINC_ID
, it will add a condition to the query executed by the portlet (i.e. “PINC_ID=
<value sent by the event>”).The second
<value>
of these preferences is the name of the event and PRP that will be published, which will include the value of the fieldPINC_ID
in the selected row.Search the element
<supported-processing-event>
with the<qname> Input_PINC_ID
. ReplaceInput_PINC_ID
withSelected_iinc_id
.Search the element
<supported-public-render-parameter>Input_PINC_ID</supported-public-render-parameter>
Replace
Input_PINC_ID
withSelected_iinc_id
.Search the element
<event-definition>
with the<qname> Input_PINC_ID
. ReplaceInput_PINC_ID
withSelected_iinc_id
.Search the element
<public-render-parameter>
with the<identifier> Input_PINC_ID
. In the<qname>
and the<identifier>
elements, replaceInput_PINC_ID
withSelected_iinc_id
.
Replace the
portlet.xml
ofphone_inc.war
with the new one.Deploy the war files of the two portlets as usual.