File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Portals and Portlets and the fly likes Portlet communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Portlet communication" Watch "Portlet communication" New topic
Author

Portlet communication

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Hi

I am new to portal development and maybe I am asking some very basic questions. But I would really appreciate if anyone could guide me through.

When does it become important to go with the wiring approach for portlet communication? From what I have been reading there are 3 other approaches as well that can be followed, which are as below. How do we know which one to go for:

1. The PortletSession APPLICATION_SCOPE is there. So can we not put things in the portlet session and let the other portlets read from there?

2. Also we can put in database from where all the portlets that need those parameters, can obtain them.

3. Using the wps-urlgeneration tag, we can pass parameters from one portlet to another.


So how do we know when we should use wiring and when the above three ways?

Thanks a lot
[ January 27, 2008: Message edited by: Dorothy Taylor ]
Mahendra Phatangare
Greenhorn

Joined: Jan 27, 2008
Posts: 2
Use portlet wiring when you want two portlets to communicate on certain events like click or timeout. portlets can share information using PortletSession's APPLICATION_SCOPE but target portlet will not get when source portlet has set something in session.so some event is required to trigger communication. for exa. you enter search string in one portlet and get results in another portlet.
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
So suppose that I have this scenario only like I enter a search criteria in one portlet and want to update the result is another portlet. Is wiring the only way this can be done or there is any other way as well like wps:urlgeneration etc.
Umesh Wale
Greenhorn

Joined: Sep 12, 2005
Posts: 11
Cant we try to add a Interceptor in between two portlets where in we are creating a HTTPServletRequest and put the Portlet parameter (the one which we are passing through the url generation). So as we can always retrieve the data from other portlet through the HTTPServlet Request.

but yeah always wiring will be the recommended way for the Portlet to Portle Communication.

POrtlet database can be accessible to you throught the different ways, but it can be updated in edit mode only throgh the Administrator privelages.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Dorothy",
Please check your private messages.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Abhishek Kanchan
Ranch Hand

Joined: May 10, 2007
Posts: 32
Hi Dorothy,

I need to know with what decision you really ended with.
Is Wiring the better way to go.
Please reply. :roll:


SCJP 1.5<br />SCWCD 5.0
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

For me, portlet wiring has always been sorta an "IBM TERM" for mapping together two Portlets that use C2A, or Click-2-Action, an IBM specific implementation of portlet communication.

Red flags go off for me all over the place when people start talking about wiring. Not that it is always bad, but it sometimes indicates that people aren't using the portal properly, or aren't thinking from a portal mindset.

Why do two portlets need to message each other? If they are so heavily linked together, why aren't they part of the same portlet application? If they were, they could share the APPLICATION_SCOPE setting on the session, and your problem is solved.

Furthermore, why aren't the two portlets actually just one portlet? There's nothing wrong with a single, dashboard portlet. In fact, it's often a good idea. I've seen very good dashboard applications, that would be one good portlet, ripped apart into 10 different portlets, and then wired together in the most kloogy of fashions, creating a solution that is neither maintainable or manageable.

If there is shared data, put it in a commonly accessible database table. If two portlets need to respond to each other, package them as a single, common portlet. Don't fall back on wiring with C2A. It's not a long-term solution.

-Cameron McKenzie
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Hi All

Starting this thread again after a long time, but i hope that's ok

So if I am going for co-operative JSR-168 portlets, is wiring still a not so good way of doing stuff. By wiring, I mean wiring using WSDL in Websphere POrtal server
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Personally, I avoid it.

It works, and it's cool. But it does have a learning curve, and whether there will be people around in the future to service it, work on it and understand it? That I'm not too sure of.

So, time to develop and ease of maintenance are my concerns. If those aren't big issues, well, C2A is pretty neat, and clients love it - gets them close to that Web 2.0 experience. There's value in that.

-Cameron McKenzie
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Portlet communication
 
Similar Threads
JSF Portlet navigation problem
Is there any PortletContaner API ?
how to restore initial state of JSF Portlets when we navigate back to a PORTAL Page
JSF Portlet - how to maintain initial state of portlets in navigating portal pages
how to restore initial state of JSF Portlets when we navigate back to a PORTAL Page