Konstantin Piroumian wrote: >From: "Artur Bialecki" <[EMAIL PROTECTED]> > > > >>Actions are great, however it would be nice If >>I could dynamically create them with XSP so in >>my sitemap I have: >><map:action >> name="my-action" >> src="/actions/my-action.xsp" >> logger="action.my-action" >>/> >> >>Where my-action.xsp gets trasfomed to java using >>some action.xsl, builtin and custom logicsheets. >> >>Cocoon already has everything I need other than the >>action.xsl. >> >> > >Are you looking for this: >xml-cocoon2\src\java\org\apache\cocoon\components\language\markup\xsp\java\a >ction.xsl ? > >
And org.apache.cocoon.acting.ServerPagesAction (Vadim was faster ;) >>How would I go about adding this functionality? >>Where do I start? >> >> > >May I ask a question? Why do you need an XSP based action? IMHO, actions >should be pure Java classes that perform some programmatic logic and you >have Generators for XML generation, based on the result from actions. > >Are there any real use-cases? > I think the need expressed by Arthur is the hot-recompilation nature of XSPs, which it really great at development time, along with the high-level constructs offered by taglibs. But there are cases where an XSP can be more than a generator : consider the ESQL logicsheet, which provides powerful tags for querying databases. But what if you would like to choose a particular page depending on the query results ? If the XSP is the pipeline generator, redirect (even internal) is not possible. If the XSP is an action, redirect is possible. That's what the ServerPagesAction is for. It is to be used in conjonction with the action taglib (providing redirect and action result primitives) and the capture taglib (for capturing parts of the XSP-produced XML for later use). In a sense, the XSP action belongs to the same domain than pipe-aware selectors that were discussed a while ago. Sylvain -- Sylvain Wallez Anyware Technologies Apache Cocoon http://www.anyware-tech.com mailto:[EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]