Tuesday, March 3, 2009

JSF Portlet Bridge for dummys

Today I read an entry from the blog of Oracle Portal Principal Product Manager Peter Moskovits, dated from about 9 months ago. It talked about JSF Portlet Bridge, and showed him creating a video of his creating a an application which demonstrated JSF Portlet Bridge at work.

I am just starting to learn about Oracle Portal, unlike Peter, so I thought the world of people who are at my understanding level might like to hear my comments. All of the following are eithe quotes from Peter Moskovits, or they are my interpretations of Peter's words or actions, coupled with what I know and have read.

So in JDev 11g you can right-click on a reusable item called a Task Flow, or a jspx/jsp page and something comes up which says "Create Portlet Entry...". Doing this action will create a file called portlet.xml which is apparently the key file in portlet applications. I believe this is the equivalent of doing what is called "portletizing" an application.

In Peter's video, he is deploying his portletized JSF application to the embedded preconfigured OC4J which also had the portlet container in it. Even after this app was portletized, Peter could still run the jspx/jsp files individually. But also Peter demonstrated that you could access something called a "portlet producer". Apparently there is something called WSRP which is a portlet producer. I guess WSRP is a web service also because it has a WSDL, which you need to copy and save if you are ever going to use the portlet-ized JSF app you made.,..and also deployed.

WSDL URL's are also called "endpoint URL's".

Although it appears you get to the portletized JSF applications though the WSRP service, portlet parlance says that your application "consumes" a portlet...just like an app consumes a web service.

So when you create your application that consumes portlets (preferable, hopes oracle, a webcenter template application out of JDev 11g) it is called a portlet consumer application. In JDev 11g (and probably all IDE's) you need to register the portlet producer with your application. In 11g Jdev this is done by...
  1. clicking ViewController project
  2. New --> WebTier --> Portlets --> WSRP Producer Registration
  3. Name the portlet producer you are registering
  4. paste in that WSRP WSDL you have been saving (see above)
After a successful registration you see a WSRP producer node in the Application Resources section. This opens up to child nodes and you see your portletized JSF app.

Then in your app you can just create you JSF (or other technology that supports using WSRP), and drag and drop the portlet out from under the WSRP producer node and onto the page. This will add the portlet tag and portlet binding to the page (assuming you are using ADF, ;-). If you run it you will see your page in a portlet on the browser.

So where is the JSF Portlet Bridge coming into play here? I read that the JSF Portlet Bridge bridges JSF and Portlet technologies...but where do the implementing classes reside. I think they reside on the machine where you first deployed your portletized JSF application. I am beginning to think that this app server that you first deploy your portletized JSF app does not need to have a Portlet Container...like Oracle Portal. I think it just needs that portlet.xml in order for WSRP to talk to it. I suspect that WSRP needs to be implemented on both ends...probably the same version...but maybe not?

I know this though, because Peter said it: when you create your portlet consumer application, you can use your published portletized JSF app in any other 3rd party portal that supports WSRP (and the version of WSRP you are using).

Still trying to digest all of this. Tomorrow I have a conference call with Peter and the rest of my teammates.

Here is the video Peter made... video

Also the link for the JSR for JSF Portlet Bridge has a Spec with some great overview material in it. It helped me.

No comments: