portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weaver, Scott" <Swea...@rippe.com>
Subject RE: [Bug 18865] - [Enhancement] MVC Portlet Action Life Cycle
Date Mon, 14 Apr 2003 16:51:29 GMT
> Is there documentation anywhere on how to use the new MVC portlets?
> Looking at PortletActionEvent, there is a method "fireEvent" that has
> no java docs on how it works ( alluding to a message on the other dev
> list ;-)

Ouch!  I already I said was no angel when it comes to documentation, but it does say "Convenience
method for firing portlet events." ;)

> Im walking thru the code, trying to figure out how this all works.
> It seems that the MVC is trying to call the action from within
> BuildNormalContext, which is too late IMO.
> The action phase should occur before any rendering starts.
> Anyway, if we can get a portlet from within an action event, that would
> be a great improvement, even though the phasing is out of sync.

The action is called from the buildContent() method which is invoked by the standard getContent()
method defined in the GenericMVCPortlet, not within the buildNormalContext() of the action.
 This is done prior to the view processor's handling of the appropriate template, so the action
phase is completed prior to rendering, with the context fully populated.  

The only way this fails is if the action is not being invoked directly by the GenericMVCPortlet,
i.e. you are passing in an "action" parameter either through a url or form field and not relying
on the value provided within the registry definition.  Which I have a feeling is what is happening
in your case, am I correct?

I'll definitely try and whip up some documentation on the MVC portlets.


*===================================*
* Scott T Weaver                    *
* Jakarta Jetspeed Portal Project   *
* weaver@apache.org                 *
*===================================*
  


> -----Original Message-----
> From: David Sean Taylor [mailto:david@bluesunrise.com]
> Sent: Monday, April 14, 2003 12:03 PM
> To: Jetspeed Developers List
> Subject: Re: [Bug 18865] - [Enhancement] MVC Portlet Action Life Cycle
> 
> 
> On Monday, April 14, 2003, at 05:57  AM, Weaver, Scott wrote:
> 
> > David,
> >
> >> I tested this a few days ago.
> >> Have you tested this within action events (not BuildNormalContext)?
> > Yes, it works fine, for me at least ;)
> >
> >> Please reverify. That would be an awesome patch to Jetspeed.
> >
> >
> > Are you saying that the Portlet is actually part of the method
> > signature of the action event method?  How exactly are attempting to
> > retrieve the portlet?  Could you send me simple case where you cannot
> > retrieve the portlet in your event method?
> >
> 
> I have an action event on an action that inherits from
> VelocityPortletAction
> 
> public void doUpdate(Rundata rundata, Context context)
> {
> 	Portlet portlet = context.get("portlet");
> 	System.out.println("portlet = " + portlet);
> ...
> 
> Which prints:
> 
> portlet = null
> 
> Perhaps its because Im using the old signature?
> Is there documentation anywhere on how to use the new MVC portlets?
> Looking at PortletActionEvent, there is a method "fireEvent" that has
> no java docs on how it works ( alluding to a message on the other dev
> list ;-)
> Is my signature wrong?
> 
> Im walking thru the code, trying to figure out how this all works.
> It seems that the MVC is trying to call the action from within
> BuildNormalContext, which is too late IMO.
> The action phase should occur before any rendering starts.
> Anyway, if we can get a portlet from within an action event, that would
> be a great improvement, even though the phasing is out of sync.
> 
> Could you provide an example Portlet Action in the distribution of how
> to use a MVC Portlet Event Action, and also add a page to the docs
> describing MVC Portlets?
> 
> Thanks,
> 
> --
> David Sean Taylor
> Bluesunrise Software
> david@bluesunrise.com
> +01 707 773-4646
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message