Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 85106 invoked from network); 26 Mar 2008 02:46:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Mar 2008 02:46:14 -0000 Received: (qmail 93316 invoked by uid 500); 26 Mar 2008 02:46:08 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 93247 invoked by uid 500); 26 Mar 2008 02:46:08 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 93233 invoked by uid 99); 26 Mar 2008 02:46:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Mar 2008 19:46:08 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Mar 2008 02:45:18 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JeLdy-0001da-GJ for users@cocoon.apache.org; Tue, 25 Mar 2008 19:45:38 -0700 Message-ID: <16294417.post@talk.nabble.com> Date: Tue, 25 Mar 2008 19:45:38 -0700 (PDT) From: shai200 To: users@cocoon.apache.org Subject: Re: How to inject the result of an action into a generator In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: shai200@gmail.com References: <16108820.post@talk.nabble.com> <47DF3379.1050605@gmx.de> <16268117.post@talk.nabble.com> <47E8F115.8030002@gmx.de> <16290507.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Alright, so since you're already in the groove of answering my questions (thanks btw), I would need my generator class to also have access to the entire Request Map (preferably in the form Map where the String[] key is the set of values in case a value is declared twice, but that's not so crucial) as well as the Session object / map... how would I go about that? Shai solprovider-2 wrote: > > On 3/25/08, shai200 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: > > You could also pass querystring parameters to your 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". > > > > > > 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: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > > > -- View this message in context: http://www.nabble.com/How-to-inject-the-result-of-an-action-into-a-generator-tp16108820p16294417.html Sent from the Cocoon - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org