RE: Re: Launching actions

"Anthony Eden" <[email protected]> Thu, 12 Dec 2002 23:08:50 -0500
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <000501c2a25d$57cd0f30$01000001@mobile1>
Yes, the 'action' parameter would trigger an action and you can either
use a name specified in jpublish.xml or you can give the path to a
script action.  Global actions are really a different purpose, they are
designed to be executed on every request.  This would be useful for
doing logging for example.

If you want to execute an action from another action then you can do:

  SiteContext siteContext = (SiteContext)context.get("site");
  siteContext.getActionManager().execute("MyAction", context);

Sincerely,
Anthony Eden

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of Laurie Harper
> Sent: Thursday, December 12, 2002 9:03 PM
> To: Anthony Eden
> Cc: [email protected]
> Subject: [JPublish-developer] Re: Launching actions
> 
> 
> Do you mean that an 'action' parameter automatically triggers 
> the named action to be run? In which case what should the 
> parameter value be, the action name from jpublish.xml?
> 
> Or would I need a global action to provide that 
> functionality? In which case how do I lookup and invoke an 
> action from another action?
> 
> L.
> 
> [PS, sorry for the slow reply, I was watching for something 
> on the list, not realising I'd mis-typed the address!]
> 
> On 12/5/02 10:47 PM, "Anthony Eden" <[email protected]> wrote:
> 
> > There are two possible approaches:
> > 
> > 1.) Use a pre-evaluation action which executes the action 
> and does a 
> > redirect.
> > 2.) Link back to the list view page and either add an action to the 
> > URL with an action= parameter or execute the action every time and 
> > check for a particular request parameter value.
> > 
> > P.S. If you want to send a message to the JPublish 
> developer list then 
> > send it to [email protected] .
> > 
> > Sincerely,
> > Anthony Eden
> > 
> >> -----Original Message-----
> >> From: Laurie Harper [mailto:[email protected]]
> >> Sent: Thursday, December 05, 2002 10:03 PM
> >> To: [email protected]
> >> Subject: Launching actions
> >> 
> >> 
> >> Is there any way I can cause an action to be run without 
> asociating 
> >> it with a particular page? I'd like to be able to specify links
> >> and forms 
> >> which cause an action to be run before rendering the 
> result page, but
> >> the action shouldn't be run every time the page is displayed.
> >> 
> >> As a concrete example, consider a page with a list of order items. 
> >> The page has a button or link to create a new order item which
> >> takes you to 
> >> another page containing a form. When you submit the form, you
> >> should be 
> >> taken back to the original list view page, where the new
> >> order item will 
> >> now be included in the list.
> >> 
> >> On form submission, I need to execute an action to add the 
> new order 
> >> item to the database or whatever. But that action shouldn't be 
> >> associated with the list view page, since it only makes sense to 
> >> execute it when the new order item form is submitted.
> >> 
> >> The only solution I can see is to define a page whose sole 
> purpose is 
> >> to execute the action and forward to the list view. What am I 
> >> missing?
> >> 
> >> Thanks,
> >> 
> >> L.
> >> 
> >> 
> > 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:
> With Great Power, Comes Great Responsibility 
> Learn to use your power at OSDN's High Performance Computing 
> Channel http://hpc.devchannel.org/ 
> _______________________________________________
> Jpublish-developer mailing list 
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer
> 



-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/