cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maurizio P." <ilmauri...@gmail.com>
Subject Cocoon, JSON, PHP
Date Tue, 03 Oct 2006 17:26:10 GMT
Hello ppl, kind regards to you all, beg ur pardon for my bad english.

My goal: having Cocoon (in tomcat's webapps) "talking" with PHP (in apache2
httpd) both living on same machine or same subnet.
The "talking" should also permit JSON syntax from browser to PHP page,
passing through Cocoon.

Let's say that the user won't ever know that in a portion of the page that
he is looking there is cocoon that is asking to php what to output, by a
POST form or by a JSON call, both through cocoon.
Let's also assume that we don't care "why" we need to do this (hey it's not
my crazy idea, i was asked to... ).

I have played successfully with sitemap's mapping to http url of apache
servers where PHP pages are living:
 <map:match pattern="php-info">
     <map:read src=" http://default.local/info.php"/>
 </map:match>

Btw, I'd like to use FlowScript, calling PHP pages from there (with
cocoon.load maybe ?), exchange "data" between FlowScript and PHP in
JavaScript syntax:
cocoon.load("http://default.local/test.php?par_1=aaa&par_2=bbb&par_3=nnn");
// yes it works, PHP outputs a JS array

I'd like also to use JSON for the communication, and i am browsing around
Cocoon's AJAX examples to understand what to put on sitemap to permit JSON
communication.

So in few words, POST or JSON communication (sitemap will decide), here is
what i'd like to realize
A. POST or JSON request (how?) ---> Cocoon FlowScript ---> JS array to PHP
(how?) ---> do something with data ---> output another JS stuff array --->
grab it with FlowScript and answer back to browser
B. howto let sitemap choose between POST or JSON communication way?
C. am i obliged to use dojo? i found json-lib (link:
http://json-lib.sourceforge.net/usage.html ) may i use it? if yes, how?

Many thanks in advance to anyone who will answer to A, B, or C or all three
questions.

I'll be glad to clear out any dark points in what i wrote before.
ty

-- 
Best Regards,
Maurizio

Mime
View raw message