On 3/25/08, shai200 <[EMAIL PROTECTED]> wrote: > 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 > Cocoon, 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?
You do not need Actions. You may never need Actions. Most uses of Actions are better handled by other components. Please forget you ever heard of Cocoon Actions. Did you know that the "src" parameter can use many protocols including "http:" and "ftp:"? If XHTML (or any XML) is being generated by a servlet, you can use: <map:generate src="http://example.com/myXHTMLservlet"/> You could also pass querystring parameters to your generate: <map:generate src="http://example.com/myXHTMLservlet?{request-param:xmlDescriptor}&{request-param:query}"/> But wait, Cocoon provides more for the same low price. Generators are Java so you do not need to create servlets. A custom Generator can use your POJOs! (You are already creating an Action so I assume you program Java.) This exactly meets your specifications for an "ActionGenerator". <map:generate type="myActionGenerator"> <map:param name="xmlDescriptor" value="something"/> <map:param name="query" value="databaseQuery"/> </map:generate> The definition of a custom Generator is an XML source that is created with custom Java code and will be processed by other Cocoon components (at least a Serializer, but also as many Transformers as you wish!) A custom Generator will handle all the requirements you have mentioned without the headaches you have encountered while attempting to use the wrong component for the task. solprovider --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]