Sunday, December 20, 2009

Producing JSR 168 Portlets Directly From ADF Task Flows with Oracle WebCenter 11g

While working with different customers, I'm getting questions about how to expose ADF Task Flows to third party Portals. Its especially important for those companies who are developing their own products based on Oracle Fusion Middleware 11g. You need to ensure that your product will be pluggable and compatible with different environment. Just imagine, in Oracle ADF 11g with WebCenter 11g you can expose your ADF Task Flows through portlet bridge as standard JSR 168 portlets and plug them into different Portals.

I continue series of posts related to integration area with new sample application - ADFIntegration7.zip. I will describe how you can expose ADF Task Flow as portlet, and then how to consume this portlet from WebCenter 11g application. Developed sample contains one ADF Task Flow with region:



I will define portlet bridge for this ADF Task Flow, and will expose available fragment:



First Part: Exposing ADF Task Flow as portlet

Its enough to right click ADF Task Flow and select Create Portlet Entry option:



Complete wizard steps, and you are done - portlet bridge is defined. Now define WAR deployment profile, we will use it to deploy portlet to WebLogic server:



For test purpose, I will use JDeveloper 11g embedded WebLogic server instance, you can start it directly from JDeveloper 11g:



Right click ViewController project and select - Deploy:



While deployment process running, you will be asked to proceed with JSR 168 portlet deployment:



From deployment log you will see application URL:



Open this URL in your browser, you can test WSDL URL from there:



Second Part: Consuming portlet in WebCenter 11g application

In Resource Palette define new WSRP Producer Connection:



You will need to specify portlet WSDL URL:



Portlet should become visible in Resource Palette, you can drag and drop it from there directly on your page, same as any other component:



Let's drag and drop it on JSPX page available in another application:



On runtime, Employees Editing portlet will be loaded, and user will see it same as it would be usual ADF application. In this case both - Query Criteria and results table are coming through consumed portlet:


24 comments:

Edwin Biemond said...

Hi Andrejus,

with Webcenter 11g there is no need to expose these task flows as portlets. just use the task flows in webcenter and if you still want to do this , keep your task flow parameters simple , don't use complex or arrays.

Andrejus Baranovskis said...

Hi Edwin,

Yes thats true, but my main idea was if you want to include ADF Task Flow into third party Portal, without WebCenter 11g.

Consuming in WebCenter 11g was just an example ;)

Thanks,
Andrejus

Amr Gawish said...

How about security, to make it read-only in view mode and editable in customizable mode.

I only can do that while using WSRP or Oracle PDK Producer!

Is there a way it can be done to a third party using ADF and JSF Bridge

Andrei said...

Hello Andrejus.
You said main idea was if you want to include ADF Task Flow into third party Portal.
What's about Oracle Portal 11g. As far as i know it doesn't support WSRP 2.0. I'd tested that. Therefore, Oracle Portal cannot consume such portlet. Correct me if i'm not right.

Andrew

Andrejus Baranovskis said...

Hi Andrei,

When its deployed, you can subscribe through both - WSRP 1.0 or WSRP 2.0. It should work.

Regards,
Andrejus

Anonymous said...

Are there any plans to include the ADF JSF/Portlet bridge under the ADF Faces license?

Since this is currently part WebCenter, the license cost for doing what you describe here is huge :(

Mark said...

Hi Andrejus,

All the examples and documentation from Oracle seem to use both WSRP and the portlet bridge when converting an ADF application to a portlet. Is it possible to convert an ADF application to a portlet and deploy it to Oracle weblogic portal just using just the portlet bridge? This would mean the ADF application would run as a local portlet in the Oracle Weblogic Portal and would avoid the performance implications of using WSRP.

Anonymous said...

Hi Andrejus ( good work all the time ).

Quick question regarding the WAR file deployment, what about the Model components, how are they then linked back to the Viewcontroller files, if they are not packaged up also.

In the middle of trying this example.

Anonymous said...

Hi Andrejus ( good work )

I am in the middle of trying this example, but with regard to the WAR file deployment described from the Viewcontroller, how then is the Model code linked back up to the main code, i.e. there is no mention of also deploying the Model jar, etc...

Just wanted to understand this.

Thanks.

Andrejus Baranovskis said...

Hi,

Model project is linked with ViewController through Dependency. When you deploy WAR, Model code will be included automatically.

Regards,
Andrejus

Jp said...

Hi Andrejus,
It's a wonderful post. I have an adf application secured using ADF security and wanted to expose the taskflow as portlet. Could you please let me know how to setup security for the portlet to work?

Thanks
JP

SrinivasRao said...

Hi Andrejus,

This is srinivasrao annapareddy.

I have created one application with ADF customized skins, and afterwards , i have convert the taskflow to portlet as you said here , ( right click and create portlet entry ).

Portlet point of view it is working superb , but my customized skins are not working once you convert taskflows into portlet.

i believe those 2 files , portlet.xml and oracle-portlets.xml is creating some kind of disturbance to skins file ( trinidad-config.xml and trinidad-skins.xml)

can you help me in this.

Anonymous said...

Hi Andrejus,

In our project we have different independant applications. We want them to consume as portlets into a main webcentre application.

Another alterantive is exposing these applications as ADF Library.

Can you please let me know what would be the best approach.

Thanks,
Morgan.

Andrejus Baranovskis said...

Hi Morgan,

I personally recommend to go with ADF Library. Performance is much better, less bugs with data validation during transactions.

Oracle also implementing their applications with ADF Libraries.

Portlets are good only in specific cases, when you want to share task flow as a service to remote subscriber system.

Regards,
Andrejus

Sanjay said...

Hi Andrejus,
I created a portlet outof ADF taskflow and added the same on a jsf page. But I want this portlet to display data when a user clicks on a link on the jsf page. Do you have an idea on this. I followed the procedure given in the link :
http://sqltech.cl/doc/oas11gR1/webcenter.1111/e10148/jpsdg_bridge.htm#CACHFJDJ

But setDepartNumber() in EmployeeBean is called everytime even without passing and event

Also, I want to hide/show the portlet if the number of portlets are more in my jsf application.
Regards,
Sanjay

Anonymous said...

Hi Andrejus,

How to do with the pages/taskflow which is protected by the ADF security model? What's the steps to consume? how to do authentication and authorization in the portlet. Thx

Andrejus Baranovskis said...

Hi,

Portlets are out of scope for ADF Security, its why I prefer to use ADF Task Flows.

Regards,
Andrejus

Hongfu said...

Hi Andrejus,

Really s a wonderful post. I have follow your guide to do a demo(Without using ADF security). And it is ok. But when I add adf security to the producer, and wanted to expose the page as portlet. It does not work, Could you please let me know how to setup security for the portlet to work?

Andrejus Baranovskis said...

Hi,

ADF Security can be defined for pages and Task Flows, not for portlets.

Andrejus

Khad said...

Hi Andrejus

I have deployed a UCM Search portlet on the Webcenter Spaces. But it is only able to search the documents of SecurityGroup of type "Public" in UCM and user is coming as "anonymous" in the UCM logs.
I want the Porlet to be able to search all the documents for "weblogic" user. Same user creadentials used across all the the webcenter/ucm etc ...

In order for the Webcenter login page to propagate user credentials to these Portlet pages so that portlet can all the documents in UCM, I want to configure ADF security.
Does anyone have the detailed steps to configure the ADF security specific to WebCenter Portlet application ?

But when we load the portlet from WebCenter, I am not sure how the identity propagation happens to portlet (I mean, how the webcenter login credentials are propagated to Portlets)? I believe, this is through ADF security. Do I have to do anything "specific" to configure ADF security to Portlets?

Thanks
Khad

Anonymous said...

Hi Andrejus,

We are using WebCenter 11g. Is it possible to have user preferences feature enabled on a portletized taskflow ? Is it a good idea to portletize a taskflow to have the personalization benefit of a portlet ?

Best Regards,

Anonymous said...

Hi Andrejus,
Thanks for sharing wonderful post.

I followed the steps given here and have created a WSRP producer which is consumed on Webshphere portal. I am facing one error in consuming WSRP over Websphere. Below is detail of my application:


I am working on consuming a WSRP over Webshpere portal. Weblogic server (10.3.5) is the producer for the WSRP which is being consumed on Websphere portal(6.1). Application is developed with Jdeveloper 11.1.1.6 using ADF template and then converted to Portlet using "Create Portlet Entry" option at taskflow. WAR file is deployed to Weblogic server.

http://localhost:7101/dashboard/portlets/wsrp2?WSDL

Above URL used for creating a producer on Websphere portal. After consuming the portlet, I am dropping it on a page. Once portlet is dropped on page, page is giving following error: This portlet is temporarily disabled.

On server log, I see an error message : "EJPWC1103E: Consumer supplies a registrationHandle/ registrationState pair that is not recognized by the Producer. "
When I checked the Websphere portal producer configration, I found that "Registration handle" is empty.

How to update producer registration handle on Weblogic Server so that this gets propagated to Websphere server?

Thanks in advance,
Randhir

Anonymous said...

Hi Andrejus,
Thanks for sharing wonderful post.

I followed the steps given here and have created a WSRP producer which is consumed on Webshphere portal.


I am working on consuming a WSRP over Webshpere portal. Weblogic server (10.3.5)-JdeveloperIntegratedServer is the producer for the WSRP which is being consumed on Websphere portal(6.1). Application is developed with Jdeveloper 11.1.1.6 using ADF taskflow and then converted to Portlet using "Create Portlet Entry" option at taskflow. WAR file is deployed to Weblogic server.
http://localhost:7101/Test-ViewController-context-root

Above URL used for creating a producer,register a WSRP Portlet Producer by using Resource Palette->new connection->WSRP Producer->In The WSDL Url I given this URL http://localhost:7101/Test-ViewController-context-rootportlets/wsrp2?WSDL

it throwing Exception.(url contains html tags).
Please assist me how to resolve.


Thanks in advance,
Venakat

Anonymous said...

Hi Andrejus,

We are trying to consume this in Websphere Portal but I we are getting some wrapper mismacth exceptions. We are able to render the page (JSR 286) but actions on the page not working.
Can you please let me know will this work in non-ADF platform?
In such case, Do we need to change any settings on Webpshere?
Thanks for the blog.

Regards,
Chava