Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript to invoke portlet ? : Help please

 
Sathya Sekar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sathya Sekar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic