Hello,

This requirement is the primary function that I'll need from Cocoon,
otherwise it's not good for me and I'll have to find some other servlet
generating framework.

I have a system where I have objects generating XHTML code based on some
input I give them (other XML descriptors, Database queries, etc.). I'm
looking for a way to take this HTML output and apply transformation on it
for further styling. Cocoon pipelines would be perfect for that, but
unfortunately I am starting to understand that I'll still need to create
separate servlets that provide the HTML output and then inject it into
Coccoon, which is a stupid thing to do because I am looking for a way to
create my servlets in the first place.

What I require is an "Action Generator" (rather than the existing
FileGenerator) that takes XHTML output that a POJO (i.e. and Action class)
returns and then moves it down the pipeline.

Perhaps someone can suggest another framework that can achieve this?


Joerg Heinicke wrote:
> 
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-inject-the-result-of-an-action-into-a-generator-tp16108820p16290507.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to