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 Javascript to invoke portlet ? : Help please Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "Javascript to invoke portlet ? : Help please" Watch "Javascript to invoke portlet ? : Help please" New topic
Author

Javascript to invoke portlet ? : Help please

Sathya Sekar
Greenhorn

Joined: Dec 17, 2003
Posts: 15
Hi,
We have a number of small web applications (mostly all good ol servlet-jsp based) and now, I am thinking of creating a portal app which acts like an interface over the existing apps while also providing typical user-friendly portlets like news, weather etc. When the user logs in, say a news, weather and customer search portlets would be displayed. The user can search for customers in the portlet.

Now here is the tricky thing.
A link/button would be provided which should first send an action message to the portlet to make a log entry (this is required) - somehow skip the doView (am I crazy or what ? ) and then make a request to an existing web app to launch itself.

I thought of two options -
i) have a redirect happening from the processAction() method of the portlet.
ii) a javascript to trigger off the processAction() call and then make a new request to the web app.

- Is this flow do-able at all?
- Can we simulate a call from a javascript to the portlet?
- Should I forget about portlets completely for this requirement?

Thanks for your time.
- Sathya
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

I think what you're describing would look something like this:

Rube Portlet Solution

It really sounds like you're trying to get the portal to do something you want it to do, rather than using it to do the things it is intended to do.

There's got to be an easier solution.

Which portal server are you using?

-Cameron McKenzie


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
Sathya Sekar
Greenhorn

Joined: Dec 17, 2003
Posts: 15
I agree with you Cameron in that portlets may not be the right components for this. But I wanted to explore the possibility before ruling it out altogether because of the the usefulness it would provide with multi-windows in a page, customizable content etc.

I am using Websphere for my development.

At the core of my perhaps muddled problem description are the two below queries :
- is it possible to invoke the "action" of a portlet through Javascript ?
- if so, how can we make the container not invoke the "view" after that ? (I believe that the action-view cycle is dictated by the PortletServlet
implementation of the container ?)
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4967

- is it possible to invoke the "action" of a portlet through Javascript ?


I've got to tell you, I've never seen it done. But beyond that, I really don't even know how you would go about doing it.

Doesn't mean it can't be done, or that nobody's ever done it. But whoever may have done it would have been much more intellingent, and infintely more handsome than me.



Good luck!

-Cameron McKenzie
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Javascript to invoke portlet ? : Help please
 
Similar Threads
Basics Help need for Portlet development
Websphere Portal - Test 399
Simple Weblogic Portlet Question
Show details of story on a different page of portlet
Test 399: IBM WebSphere Portal V5.1, Application Development