cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: Q: Dynamically choosing action type.
Date Wed, 07 Aug 2002 07:30:02 GMT
On 06.Aug.2002 -- 02:45 PM, Ilya A. Kriveshko wrote:
> Ilya A. Kriveshko wrote:
> My previous question still stands:
> 
> >Can I write a custom dispatcher class that would look at the request 
> >and then decide which action from the set should get executed, and 
> >install that dispatcher for a particular action-set in the sitemap?
> 
> I wish there were a way to call setAction() on Environment or some other 
> alternative way to specify the action, other than having a 
> pre-determined request parameter. Maybe even dynamically inside another 
> action, so that one can have several tiers of action sets, one executed 
> after another and the former determining the action to execute in the 
> latter.
> 
> Is there already a way to do this that I overlooked?

I believe that with compiled sitemap as well as treeprocessor you
can't do it through the sitemap.

However, you could write an action that dispatches other
actions. Afterall, actions are just avalon components and they share
the same component manager to some extent. Your action would need to
be composable to get the component manager instance needed.

But watchout: This custom action needs to be declared in the very
sitemap you want to use it, since this way it would inherit all
components from managers of ancestor sitemaps. Obviously, as long as
you don't access components declared on subsitemaps this could be
relaxed to declare the action on the same level or below the one your
other actions are declared.

If you were using the flow layer in 2.1-dev, you could do it from
there. 

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message