Wednesday, February 4, 2015

Consuming JSR 286 Portlet from WSRP producer in a WebCenter application

In our previous blog (Deploy JSR 286 Portlet) we have created a portlet and deployed it on server. Now in this blog we will consume it on WebCenter application

Our WSDL url from deployed application is http://127.0.0.1:7101/jsr286/portlets/wsrp2?WSDL
We will follow these steps
a. Create a WSRP producer connection
b. Add portlet to a page
c. Run page and see portlet content

Step1:Create a WSRP producer connection: Open ADF application in which you want to add portlets
Navigate to Application Resources > Connection > New Connection > WSRP Producer
Provide registration name, wsdl url, security details (if any) in WSRP Production Connection wizard.
Once connection is done verify if by expanding it. We should be able to see portlets deployed on WSRP producer
You will notice following changes in your project
1. Portlet configuration settings are added in adf-config.xml file
2. If its only ADF project, jdev will add required WebCenter libraries
3. Lots of pxml files got added in <application>\mds\oracle\adf\portlet directory. These files contain information about portlets

Step2: Add portlet on a page:
Create an adf page and drag and drop portlet from connection to page.
You will see an entry in page like

Similarly we can add Employee portlet in second facet of panel splitter to see Department and Employee details side by side

We will notice that everytime we drop a portlet on a page, it creates an instance of portlet, which is referred as portletInstance in binding. Similar directory structure also get created in <application>\mds\oracle\adf\portlet\<Producer>\ap directory.

Step3: Run the page: