Hi Thomas, hi all,
...
> the new Portlet API was proposed by IBM and defined
> together with the JetSpeed OpenSource Community.
I have a portlet here that produces dynamic content (i. e. a fragment of
a text/html) which itself contains <img src="...">'s that point back
towards the portlet application. As long as those point to *static*
locations (e. g. icons), everything works fine, because the portal
server itself can serve the content.
But is there a way for a specific portlet to *dynamically* serve *any*
MIME type? And to serve that content without redisplaying the whole home
page, and without any surrounding portal markup?
Two *scenarios*:
(1) Think of a situation where a portlet outputs stock
quote information as a text/html fragment and wants
to include an href to a dynamically generated *.gif.
This href could be served best from the portlet
itself as it only knows about session/context
information.
(2) Think of a portlet popping up a
javascript:window.open(URL), i. e. a new window. It
would be nice if the text/html (or other (subsequent))
content of that window became populated by a query
against that specific portlet.
An *example*:
A portlet with portlet ID 2000 does:
StringBuffer sb = new StringBuffer("");
sb.append("<a
href=\"javascript:window.open('http://localhost/myportal/.../?PC_2000_co
mmand=displayWindowContent')\"");
// should retrieve text/html
sb.append("click here to popup new window</a>");
out.println(sb.toString());
The dynamically generated + served document in its new browser window
could contain something like this:
<html><head></head><body>
Here's the latest stock graph you requested:<br>
<img src="http://localhost/myportal/.../?PC_2000_command=getStockImage">
<!-- should retrieve image/gif or such -->
</body></html>
The current interface org.apache.jetspeed.portlet.PortletResponse does
not provide for something like this.
One mechanism I could think of is to expose the underlying
javax.servlet.ServletResponse to a portlet method and to invoke this
method during a special request against the portal. (The portal server
would have to somehow dispatch that depending on a special criteria.)
The portlet would then be able to do wild things like e. g.
ServletResponse.setContentType() and ServletResponse.getOutputStream().
Have I overlooked something, or is there currently really no way to
accomplish this goal of serving "dynamic external" content from a
portlet?
Kind regards
Klaus
--
[EMAIL PROTECTED]
mobile: +49-173-310-6491
accept-language: en-us, de
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]