This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes Can I make a call to another portlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Can I make a call to another portlet?" Watch "Can I make a call to another portlet?" New topic
Author

Can I make a call to another portlet?

Srikanth Ganji
Greenhorn

Joined: Apr 03, 2008
Posts: 24
Hi All,
Iam new to portlets can any one answer the below query.
I need to call some other portlets depending upon the successfull login.
Is it possible using JSR 168 portlets?

Thanks in Advance
Srikanth
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

You can package multiple portlets within a common, single, portlet applicatio war file. These portlets can share information through the Application Scope of the PortletSession. Check out my signature links for some free tutorials on the subject.

However, JSR168 portlets don't really call each other. There's no mechanism to do that, and it's not really how portlets are intended to work. Portlets are supposed to be independent creatures sharing space on a portal page.

What you might need is a JSF portlet that allows a wizard like experience through a portlet. It's a very proven pattern.

Also, IBM provides things like C2A, click-2-action, to provide inter-portlet communication. They also provide a PortletService framework to perhaps facilitate sharing information. IBM specific though, so don't bet the interoperabiliy of your portlets on it.

Keep asking questions - we'll get you thinking like a portlet developer in no time!

-Cameron McKenzie
Srikanth Ganji
Greenhorn

Joined: Apr 03, 2008
Posts: 24
Hi Cameron McKenzie,

My req is to show the other features like policy's the user is having other Info about the policy's in seperate portlets after successfull login of the user.
Hence I want to call one portlet from the other things to retrive the user related all other Info depending upon successfull login in different portlets.
Just want to know the info that there is a login for each and every portlet site is that validated against the user's created in the Application server i.e somthing like IDMS which is having the user details or we can store the info about loginid and password in the database.

can you throw some light on it.

Thanks & regards
Srikanth
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

The PortalAPI allows you to obtain a User object that allows you to obtain all sorts of information about the user, and the RenderRequest defines a variable called USER_INFO.

RenderRequest API

Any portlet can grab this information. If the portlets are on the page, you can have them display. The portal page aggregation mechanism will call the view mode of any portlet placed on a page, and perhaps those portlets could grab this information and display the information you're interested in.

-Cameron McKenzie
Jonas X. Yuan
author
Ranch Hand

Joined: May 18, 2008
Posts: 108
The Answer is YES.

There is a simple way to do it: by page's parameter.

Here is an example,

1) navigation portlet (games navigation), input keyword "test" and and press GO;

2) in the same page, browse portlet takes this keyword "test" and do keyword-search for games, and then display search results.

Here is real example (Liferay Portal):


Thanks

Jonas Yuan
http://liferay.cignex.com
[ June 14, 2008: Message edited by: Jonas X. Yuan ]

Books: Liferay Portal 6.1 Systems Development
 
GeeCON Prague 2014
 
subject: Can I make a call to another portlet?