Thursday, May 20, 2010

WLP Content Presenter Portlet Simplified

I find the steps at Adding the Content Presenter Portlet to be a bit hard to follow as the content loops back and forth between the sample application and your application, and has frequent references to other documentation where the link goes to the start of the document rather than the specific section necessary for the task at hand. Having always liked reading and writing Quick Start guides, I am posting this one for the WebLogic Portal Content Presenter Portlet. I will later add how to incorporate the inline editing demonstrated in the sample application once I figure it out for myself.

So, first off, I will skip ahead to explain why I start the Quick Start where I do, which is that the templates we will want to add later spit compile errors in OPOE. For that reason, I am creating a separate Portal Web Application that will later be deployed as a shared library. If you don't need the templates from the sample  app,  you can just use your main application. If you don't know how to get that far on your own, see the WLP Quick Start and come back here. One other caveat is that you will need a DataSync project associated with the EAR project.

Once you have whatever portal web application that will be Content Presenter enabled chosen, you need to add the necessary facets. Unlike WebLogic Workshop for WLP, you aren't prompted to add facets when creating the project, so you need to go to the Project Properties after creating the Portal Web Application and add them.

The facet we care about is Content Presenter Framework. It does, however, have some dependencies. Fortunately, OPOE  lets you know what they are:

[caption id="attachment_435" align="aligncenter" width="450" caption="Adding Facets to WLP"][/caption]

So, rather than list them all out here, just select Content Presenter Framework under WebLogic Portal (Optional) and follow the errors for what to add. One note is that you will want Struts 1.2 instead of 1.3. Otherwise, the default version will do the trick.

To save time, I also selected the Sample Framework Components facet. You will eventually need to build your own log-in portlet, but this should do to get the Content Presenter working.

If you don't already have one, create a .portal file for your portal web application and add the Sample Login Portlet. You could add the Content Presenter portlet at this time, but unless you are only going to have one in the application you don't want to as it will be tied to the library instance. By adding it to new desktop  in the Portal Administration Tool (PAT), you will create a separate instance each time.

[caption id="attachment_445" align="aligncenter" width="450" caption="Create .portal File and Add Login"][/caption]

If you don't already have some content in your repository to display, once you deploy the portal application go create some as the Content Presenter doesn't seem to have the facility to create new content (or I haven't figured it out yet, but if you are reading this then you haven't either :) ).

With content ready, create a portal and desktop (again, if you haven't already) and add the content presenter portlet onto a page in the desktop (again, we do this here to have a specific instance):

[caption id="attachment_449" align="aligncenter" width="450" caption="Add Content Presenter Portlet to Desktop"][/caption]

You will also need to enable Disc on your desktop if you want the sample login portlet to work.

And...

[caption id="attachment_453" align="aligncenter" width="450" caption="Ta Daaaa!"][/caption]

At this point you can return to the standard documentation at Section 14.2.1, "Configuring the Content Presenter Portlet" for the rest of the steps as it seems to be back on track (for my taste) at that point.

Wednesday, May 19, 2010

WebLogic Portal (WLP) Content Presenter Portlet in 10.3.2

I hope to update this post with a vastly simplified approach to using the content presentation feature. Meanwhile, I do want to point out one thing that had me spinning my time for awhile. The URI for the templates TLDs in the sample files  cause a compile error. At first I thought it was because the URI changed from http://www.bea.com/servers/content/ui/jsp/templates to http://www.bea.com/tags/wlpapps/contentui/templates, so I changed it. Then I got run-time errors because some of the methods aren't in the new library. So I rolled back to the original values and just turned off validation for JSPs. That worked. So I am taking the approach of putting the templates into a shared library and taking the deployment hit rather than the development hit of having validations turned off for the main branch of the project. Later, I should create a build file that merges the projects at build time and drops the share library reference.

Tuesday, May 18, 2010

WebLogic Shared Library Reference

One of those items I always have to go look up the specifics for is creating the MANIFEST.MF file for WebLogic shared libraries.
Reference URL can be found here.

Thursday, May 13, 2010