Menu

Consuming pre-configured Portlets in WebCenter Portal

03/03/2015 - Middleware, Portal and Content Management, Web Services, XML

Oracle WebCenter Portal: Framework enables you to consume a portlet by registering its producer with an application.
Your application can consume portlets that you build and portlets that you receive from a third party.
After you register the producer, you can drag and drop the portlets on to the page in your application.

In this blog post, we will try to understand the following :

 

Starting integrated WebLogic Server (integrated WLS) from JDeveloper IDE or JDev.

If Integrated WebLogic Server is not running, start it. Select Run -> Start Server Instance.

 

Find the WSDL URL for pre-configured WSRP Portlet Producer

From the Run menu, select WebCenter Portal Deployments. The WebCenter Portal Deployments dialog appears and select the WebCenter Portal Application (wsrp-samples) to deploy to integrated WebLogic Server and click OK. You’ll see the deployment successful message under ‘Deployments – Log’ tab :

—————————————————————————-

[04:31:57 AM] Deploying WSRP Sample Portlet Producers to IntegratedWebLogicServer…

[04:32:02 AM] WSRP Sample Portlet Producers was deployed successfully.

[04:32:02 AM] URL: http://127.0.0.1:7101/portletapp

—————————————————————————-

Access the URL http://127.0.0.1:7101/portletapp mentioned in the ‘Deployments – Log’ tab and you’ll see the WSRP Test Producer page :

—————————————————————————-

WSRP Producer Test Page

Your WSRP Producer Contains the Following Portlets:

Portlet Name (Minimum WSRP Version)

* Hello World Portlet (1.0)

* CSS (1.0)

* Lottery (1.0)

* CacheTest (1.0)

* Session (1.0)

* ParameterForm (2.0)

* Upload (1.0)

* Snoop (1.0)

* FormSubmission (1.0)

* ReadOnlyParameterForm (2.0)

* HTML Portlet (1.0)

* Chart (1.0)

and many other details can be found from the same page.

—————————————————————————-

From the WSRP Producer Test Page, you can find the WSRP v2 WSDL which looks like :

http://127.0.0.1:7101/portletapp/portlets/wsrp2?WSDL

Copy the above WSDL URL (i.e.  WSRP v2 WSDL) as we need it in later stage to create a connection to WSRP Portlet Producer.

 

Registering Portlet Producers (WSRP Portlet Producer) with a WebCenter Portal: Framework Application

Try from your WebCenter Portal Framework Application -> Application Resources -> Connections -> New Connection -> WSRP Producer and you’ll get a new popup window for ‘Register WSRP Portlet Producer’ that has 5 steps :

Step 1 – Specify Producer Name : Click Next to keep default values 

Step 2 – Paste the WSDL URL ( http://127.0.0.1:7101/portletapp/portlets/wsrp2?WSDL ) and specify the proxy details (if needed) and click Next

Step 3 – Specify Additional Registration Details : Click Next to keep default values

Step 4 – Configure Security Attributes : Click Next to keep default values

Step 5 – Specify Key Store : Click Finish to complete.

 

Testing the Portlet Producer connection

Try from your WebCenter Portal Framework Application -> Application Resources -> Connections -> WSRP Producer -> WsrpPortletProducer0 and right click on it and click on Test Producer Connection opens a window prompt which confirms “Connection to WsrpPortletProducer0 is successful”. Click OK to close the window prompt.

Also click on [+] symbol associated with WsrpPortletProducer0 to drill-down or to list all the WSRP Sample Portlets like Hello World Portlet, Lottery Portlet, Snoop Portlet, etc.

 

Consuming WSRP portlets by drag and drop of portlets on to a JSPX page (i.e. JSF page) in your application.

Create a new JSF page (say testportlets.jspx) with blank template. Now drag and drop the following 3 portlets on to the testportlets.jspx page :

(1) Hello World Portlet

(2) Lottery Portlet

(3) Snoop Portlet

Go to Structures window associated with testportlets.jspx page and select root node (i.e. jsp:root). Right click on it and click on Edit Authorization will open a jazn-data.xml file.

Under Resources -> select ‘testportlets (oracle.webcenter.portletapp.pages)’ and click on [+] next to ‘Granted To’  -> Click on Add Application Role -> Enable / Select ‘test-all’ application role and click OK to close the window. Save all pages.

 

Build, run and test your Oracle WebCenter Portal: Framework application that consumes pre-configured WSRP Portlets

FYI, If the browser fails to load. Launch the browser manually and open the testportlets.jspx URL.

Now you can see the testportlets.jspx page loaded with 3 portlets – renders portlets as expected.

(1) Hello Portlet says “Hello weblogic”. Here weblogic is the name of the user used for testing.

(2) Lottery Portlet shows a specially picked random number. On each reload of the page or clicking on Settings icon -> Refresh, refreshes the Lottery portlet with a different specially picked random number.

(3) Snoop Portlet displays the list of attributes and its values associated with the Request Information.

 

REFERENCE:

For more information about deploy/undeploy of pre-configured portlets or web applications, Try the following to open the readme content in JDev :

Run JDeveloper and click Help -> WebCenter Portal – Preconfigured Server Readme

 

Nanda Kishor K N
Senior Member of Technical Staff at Oracle India Pvt. Ltd.
Co-Founder of JavaAndJava.com, A Webmaster, Java Enthusiast, Enterprise Portal Developer, Foodie, Traveller, SEO, SMO, WordPress Fan, Loves Photography, Veggie Lover, Ex-Sun Employee, Proud Dad, Bangalorean, An INDIAN.Passion for building stronger online communities and aiming to build a self-sustainable high traffic websites which is informative yet useful to as many people as possible.

Leave a Reply