cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: How to inject the result of an action into a generator
Date Tue, 25 Mar 2008 12:33:25 GMT
On 25.03.2008 00:31, shai200 wrote:

> This doesn't work for me for some reason. I get an error (see end of this
> message).
> 
> My code snippet is:
> 
> public class XMLInjectAction extends AbstractAction {
>   public Map act (Redirector redirector,    SourceResolver resolver, Map
> objectModel, String source,                  Parameters params) {	  
> 	  Map sitemapParams = new HashMap();
> 	  String xml="<content><h1>Automatically Generated By Action:
> Hello</h1></content>";
> 	  sitemapParams.put("paramAction", xml);
> 	  return sitemapParams;
>   }
> }
> 
> 
> And my sitemap entry is:
> 
> 	<map:match pattern="xmlaction">
> 			<map:act type="xml-injection">
> 				 <map:generate>
>      			             <map:parameter name="param" value="{paramAction}"/>
>    				</map:generate> 
> 			</map:act>
> 			<map:transform src="demo/welcome.xslt"/>
> 			<map:serialize type="xhtml"/>
> 		</map:match>

Additionally to Vadim's comment, your approach of injecting XML from an 
action into a generator is "wrong". An action is for deciding sitemap 
paths, constructing pipelines, not for creating or working with the 
actual data. A solution to your problem might be flowscript but you 
better might explain what you actually try to do, your requirements.

Joerg

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


Mime
View raw message