Tuesday, October 8, 2013

Extending WebCenter Portal Made Easy

If you had a chance to extend WebCenter Spaces previous to Portal release, you perhaps would agree - it was not that easy. Good news - with the latest WebCenter Portal release, extending WebCenter Portal process became simpler and more stable. There is special JDeveloper application template provided, designed to extend WebCenter Portal with custom ADF Task Flows and Java code. You can read more about it in WebCenter Developer guide here. Check how complicated it was to extend WebCenter Spaces before - What Else Can Go Wrong when Extending WebCenter Spaces.

Application template name to extend WebCenter Portal - WebCenter Portal Server Extension:

Based on this template, you can create new JDeveloper application, with two projects included - PortalExtension and PortalSharedLibrary. PortalExtension project could include any custom code you deploy. However, most of the time you will attach your custom ADF Libraries to the PortalSharedLibrary project. Simply you would need to add your custom library name into weblogic.xml file:

PortalSharedLibrary project deploys extend.spaces.webapp shared library to the WebCenter Portal server. WebCenter Portal itself is referencing extend.spaces.webapp shared library. This library acts as proxy, it is empty, there is just weblogic.xml file with a list of our custom libraries to be referenced. You should deploy extend.spaces.webapp library to the WebCenter server as a shared library (don't forget to restart it afterwards):

Make sure to increase extend.spaces.webapp library version, before deploying - it must be greater than currently deployed one:

Your custom library should be deployed separately on the server, this library is referenced from proxy extend.spaces.webapp library weblogic.xml. I was deploying custom library as shared library, using sample application from my previous blog post - Deploying ADF Applications as Shared Libraries on WLS:

New version of extend.spaces.webapp library is deployed, referencing redsamurai.shared.lib:

To test newly added custom ADF Task Flow, you need to make sure ADF Security permission is set first, otherwise ADF Task Flow will not be visible. Login to EM and grant security permission, in this example ADF Task Flow for employees is granted with authenticated role:

Once security permission is assigned, custom ADF Task Flow for employees becomes visible from the library catalog and can be added to WebCenter Portal resource catalog:

It can be consumed in the WebCenter Portal page editor (formely - Composer):

Employees data is rendered inside WebCenter Portal through custom ADF Task Flow:

Here you can download - webcenter_extend_ps7.zip example with WebCenter Portal Server Extension application, including custom library reference. Shared library deployment application is packaged into sample application as well, this one is taken from my previous blog post mentioned above.


Onkar Shoker said...

Very useful Andrejus, thank you.

One question:

If the taskflow contains custom BPM worklist and then we import task flow into webcenter application, will the bpm worklist appear within Webcenter?


Andrejus Baranovskis said...

I think, it should appear.


Anonymous said...

Very useful thank you!

I have problem when my custom taskflow is consuming a portlet. Everything works fine when running the taskflow on the integrated wls. But when i att the taskflow to a page using portalbuilder the portlet failes.

If i add the portlet directly to the page using portal builder everything works fine. Any idea where i should start looking to fix it?
The error in the log is "the metadata for portlet binding was not found in mds".

Jdev version
WCP version