Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 45639 invoked from network); 2 Apr 2005 10:05:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Apr 2005 10:05:21 -0000 Received: (qmail 65142 invoked by uid 500); 2 Apr 2005 10:05:16 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 65128 invoked by uid 500); 2 Apr 2005 10:05:16 -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 Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 65115 invoked by uid 99); 2 Apr 2005 10:05:16 -0000 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from v07274.home.net.pl (HELO v07274.home.net.pl) (212.85.125.162) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 02 Apr 2005 02:05:13 -0800 Received: from gprs5.idea.pl (HELO ?172.20.45.217?) (lgawron.mobilebox@home@217.116.100.251) by matrix15.home.net.pl with SMTP; 2 Apr 2005 10:05:08 -0000 Message-ID: <424E6E5C.7010203@mobilebox.pl> Date: Sat, 02 Apr 2005 12:05:16 +0200 From: Leszek Gawron User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Using business objects instead of XML References: <424E4F67.4070502@cc.oulu.fi> In-Reply-To: <424E4F67.4070502@cc.oulu.fi> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Andre Juffer wrote: > Dear List, > > I am trying to insert a domain object into the pipiline with control > flow following a suggestion given earlier on this list: > > http://www.mail-archive.com/users@cocoon.apache.org/msg23293.html > > Suppose, I return some object from a domain class instance, like > > var domainObject = com.foo.myClass.doSomething(); > > The domainObject has all the getters available, e.g. getName(), etc, so > it acts like a regular bean. > > Now, I would like insert this object in the pipeline with > > cocoon.sendPage ("page", domainObject); try: cocoon.sendPage( "page", { "domainObject" : domainObject } ); If you pass it as you previously did your domain object is the main context. flow-attr:domainObject looks for an object "domainObject" in main context so in fact in your case it queries for /domainObject/domainObject which is incorrect > > In the sitemap, I have > > > > > > > (This is just to see how it looks like.) > > The result of all this is an error of the form: > > org.apache.cocoon.ProcessingException: Exception during source > resolving.: org.apache.excalibur.source.SourceException: The attribute: > domainObject is empty > > This looks obvious to me, since it is probably not clear that the > domainObject in facts represents some class, defined in com.foo.myClass. > So, I tried to define the DomainObject class in JavaScripy, like > > function DomainObject() > { > } > DomainObject.prototype.name; > > and populate the object manually before calling cocoon.sendPage. The > result is however the same. > > I am using cocoon 2.1.7. > > Could anyone point out in some detail how exactly I should do this. > > Thanks, > -- Leszek Gawron lgawron@mobilebox.pl IT Manager MobileBox sp. z o.o. +48 (61) 855 06 67 http://www.mobilebox.pl mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org