Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 20336 invoked from network); 11 Sep 2006 09:10:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Sep 2006 09:10:14 -0000 Received: (qmail 24986 invoked by uid 500); 11 Sep 2006 09:10:12 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 24912 invoked by uid 500); 11 Sep 2006 09:10:11 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 24900 invoked by uid 99); 11 Sep 2006 09:10:11 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 02:10:11 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of riceyeh@gmail.com designates 64.233.166.177 as permitted sender) Received: from [64.233.166.177] (HELO py-out-1112.google.com) (64.233.166.177) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 02:10:10 -0700 Received: by py-out-1112.google.com with SMTP id c59so2029578pyc for ; Mon, 11 Sep 2006 02:09:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=EbPGcR4vTysNRwjqsv+2S+dAHg9nQ+41GNM651o2hhW3/VUeAVykOraOw+17eI4yRc7Bs84yQ5LUX/Qy92+uoTheeVh0yWhCJBHD2t/szRsNkzWcAKAk5PPpMJruR8h8CIyVvLMoay0Hlc26wjeSo2DpmZgziDrw7rc0o8xZYOc= Received: by 10.35.91.15 with SMTP id t15mr8432356pyl; Mon, 11 Sep 2006 02:09:49 -0700 (PDT) Received: by 10.35.134.3 with HTTP; Mon, 11 Sep 2006 02:09:48 -0700 (PDT) Message-ID: <47f71d940609110209j527f18bclac0a80292a20ecd3@mail.gmail.com> Date: Mon, 11 Sep 2006 17:09:48 +0800 From: "Rice Yeh" To: dev@cocoon.apache.org Subject: Re: [cforms] Can sendForm or sendPage functions use differnt sitemap which invokes the javascript containing them? In-Reply-To: <4505152E.5020901@mobilebox.pl> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_87491_7491145.1157965788807" References: <47f71d940609110035v5055b005m7c6fe36aaa9bdf67@mail.gmail.com> <450512D9.5080807@mobilebox.pl> <4505152E.5020901@mobilebox.pl> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_87491_7491145.1157965788807 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you. By the way, what keyword should I use to specify the current block in an cocoon url, Iilke the following my error guess: src="cocoon://{this_block}/parties/library/commons/GetCountrySelectionList" Rice On 9/11/06, Leszek Gawron wrote: > > Leszek Gawron wrote: > > Rice Yeh wrote: > >> Can sendForm or sendPage functions use the sitemap that is different > >> from the sitemap which invokes the javascript containing them? > >> Here is my example: > >> > >> directory structure: > >> > >> parties/sitemap.xml > >> parties/flows/MaintainParties.js > >> parties/flows/sitemap.xml > >> > >> A function CretatePerson() in parties/flows/MaintainParties.js is > >> called from parties/sitemap.xml. But CreatePerson function wants to use > >> the parties/flows/sitemap.xml to render a form, instead of > >> parties/sitemap.xml. Is this possbile? The reason for me to have 2 > >> sitemap is that I want to separate controller and view concerns; the > >> parties/sitemap.xml plays the controller and parties/flows/sitemap.xml > >> plays the view. > >> > >> > >> Regards, > >> Rice > > I probably misread it and did not answer your question correctly. If > parties/sitemap.xmap plays the controller it should contain flow scripts > too (they are also controller part). > > so tweaking it a little bit: > > parties/sitemap.xmap > parties/flow/MaintainParties.js > parties/view/sitemap.xmap > parties/view/jx/parties.jx > > first of all mount your subsitemap in parties/sitemap.xmap: > > > > > > then in subsitemap have something that generates the view: > > > > > > > > then in MaintainParties.js just do: > > function maintain() { > var bizData = obtainBizdata(); > modifyBizdata( bizData ); > persistModifications( bizData ); > > cocoon.sendPage( "view/jx/maintainParties", bizData ); > } > > -- > Leszek Gawron, 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 > ------=_Part_87491_7491145.1157965788807 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thank you.

By the way, what keyword should I use to specify the current block in an cocoon url, Iilke the following my error guess: src="cocoon://{this_block}/parties/library/commons/GetCountrySelectionList"

Rice



On 9/11/06, Leszek Gawron <lgawron@mobilebox.pl> wrote:
Leszek Gawron wrote:
> Rice Yeh wrote:
>> Can sendForm or sendPage functions use the sitemap that is different
>> from the sitemap which invokes the javascript containing them?
>> Here is my example:
>>
>> directory structure:
>>
>> parties/sitemap.xml
>> parties/flows/MaintainParties.js
>> parties/flows/sitemap.xml
>>
>> A function CretatePerson() in parties/flows/MaintainParties.js is
>> called from parties/sitemap.xml. But CreatePerson function wants to use
>> the parties/flows/sitemap.xml to render a form, instead of
>> parties/sitemap.xml. Is this possbile? The reason for me to have 2
>> sitemap is that I want to separate controller and view concerns; the
>> parties/sitemap.xml plays the controller and parties/flows/sitemap.xml
>> plays the view.
>>
>>
>> Regards,
>> Rice

I probably misread it and did not answer your question correctly. If
parties/sitemap.xmap plays the controller it should contain flow scripts
too (they are also controller part).

so tweaking it a little bit:

parties/sitemap.xmap
parties/flow/MaintainParties.js
parties/view/sitemap.xmap
parties/view/jx/parties.jx

first of all mount your subsitemap in parties/sitemap.xmap:

<map:match pattern="view/**">
   <map:mount uri-prefix="view" src="view/"/>
</map:match>

then in subsitemap have something that generates the view:

<map:match pattern="jx/*">
   <map:generate type="jx" src="jx/{1}.jx"/>
   <further transformations/>
   <map:serialize/>
</map:match>

then in MaintainParties.js just do:

function maintain() {
   var bizData = obtainBizdata();
   modifyBizdata( bizData );
   persistModifications( bizData );

   cocoon.sendPage( "view/jx/maintainParties", bizData );
}

--
Leszek Gawron, 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

------=_Part_87491_7491145.1157965788807--