Re: don't show portlet upon error

2005-03-30 Thread Yohanes Santoso
"Roel van Dijk" <[EMAIL PROTECTED]> writes:

> is called. As I now understand it, by this time it is too late? (What data
> has been sent?) Any data that is fetched in this function can't stop the
> rendering?

I am not sure about JSP since I use Velocity, but I strongly think the
mechanism is similar. In the case of Velocity, at least top.vm has
been rendered and sent, and also, any preceeding portlet before your
portlet (from the HTML point of view).

> How can an Action that fetches the data stop the rendering of a Portlet, as
> you describe?

In Action, you can remove the portlet from the PSML if you encounter
any error in fetching so that the portlet won't be rendered. You can
also change the template to be rendered: the standard template (i
think the name is screen.vm which will in turn rendere top.vm,
portlets, bottom.vm) or some other templates.

YS.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: don't show portlet upon error

2005-03-30 Thread Roel van Dijk

> > Is it possible to stop the rendering of a portlet when an error
> occurs in
> > the buildNormalContext method? For example, if the portlet uses
> a URL and
> > the URL can't be reached, the portlet doesn't need to be displayed. Any
> > ideas?
>
> Short answer: you can't. Basically, as soon as a portlet is rendered
> the data is sent to server and for all practical purposes can't be
> undone.

Ah..


> So, what you want is to do the resource fetching _before_ any of the
> portlet is rendered. One way to do this is to create an Action that
> does the fetching, and upon a submit from your portlet, go to this
> Action.

In my current setup I extend the JspPortletAction, and pass all necessary
attributes to the JSP by setting them in the HttpServletRequest. My Portlet
definition uses 'JSP' as a parent. So, when the portlet is displayed for the
first time, the buildNormalContext of the extended JspPortletAction function
is called. As I now understand it, by this time it is too late? (What data
has been sent?) Any data that is fetched in this function can't stop the
rendering?

How can an Action that fetches the data stop the rendering of a Portlet, as
you describe?

Thanks for the tips,

Roel




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: don't show portlet upon error

2005-03-29 Thread Yohanes Santoso
"Roel van Dijk" <[EMAIL PROTECTED]> writes:

> I'm using Jetspeed 1.6-dev.
>
> Is it possible to stop the rendering of a portlet when an error occurs in
> the buildNormalContext method? For example, if the portlet uses a URL and
> the URL can't be reached, the portlet doesn't need to be displayed. Any
> ideas?

Short answer: you can't. Basically, as soon as a portlet is rendered
the data is sent to server and for all practical purposes can't be
undone.

So, what you want is to do the resource fetching _before_ any of the
portlet is rendered. One way to do this is to create an Action that
does the fetching, and upon a submit from your portlet, go to this
Action.

YS.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



don't show portlet upon error

2005-03-29 Thread Roel van Dijk
I'm using Jetspeed 1.6-dev.

Is it possible to stop the rendering of a portlet when an error occurs in
the buildNormalContext method? For example, if the portlet uses a URL and
the URL can't be reached, the portlet doesn't need to be displayed. Any
ideas?

Thanks,

Roel



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]