> Btw i did not full understand ur last hint .... about a 'my 
> own inputmodule' ... do u mean to make a resource 
> parametrized with {myparams} and in the match pattern doing a 
> call to that resource, passing as param all url params i 
> need? es.: [btw i did not try these lines of code yet] 
> 

No, I meant something else. In the cocoon.xconf, there are a bunch of 
inputModules defined, like request,session, request-param, date, etc etc. But, 
if you need something that  is not yet there, you just create your own input 
module. Look at the implementation of some inputModule, and extend it, or make 
an entire new one, that meets your goals. That is what I meant. Think you 
should still try how the POST is translated to a queryString when you add non 
ASCII chars (not sure if only non ASCII but you know what I mean, right?) 

> 
> Btw i presume that the impossibility to do a POST is due to 
> the use of TextSerializer ... maybe the HtmlSerializer could 
> do the job.

No no, you are thinking here in the wrong direction. It is totally irrespective 
of whatever you do after the generator. You just have a generator, that happens 
to be a url to another server/site. After your generator, your call to the 
other server is finished. The serializer you choose changes nothing. What you 
actually want, is to forward the POST via a generator or transformer, and then 
get the result, right? I know there is some proxy stuff, you could look for, 
but I think the easiest way is by far the cinclude transformer:

http://cocoon.apache.org/2.1/userdocs/cinclude-transformer.html

though, this is about including external XML. And you want javascript. Not sure 
what happens, but I think when you fetch the external data and wrap it with 
<date> and serialize it as text/javascript, it probably will strip the 
element...never tried, but I suppose it works :-)

Good luck,

Ard

> 
> Regards,
> Maurizio
> --------------
> 
> 
> 2006/11/6, Ard Schrijvers <[EMAIL PROTECTED]>:
> I know there was something to include all the params at once, 
> without having to configure them all seperately...something 
> with queryString. Must be in the archives somewhere.
> 
> And otherwise, just create your own inputmodule, {myparams} 
> and let this inputmodule return all params + values in one 
> string, like the GET looks like (perhaps you have to url 
> encode as well...). 
> 
> Regards Ard
> 
> 
> 
> 
> In fact i am using ur solution adding params on the url... 
> the bad side is that for each different json call and 
> different params i have to write different matches in 
> sitemap... each one with his params... btw in GET is 
> functioning... also fi i think it's not the best solution btw. 
> 
> Thank u very much for the quick answer
> 
> Best regards,
> Maurizio
> --------------
> 
> 
> 2006/11/5, Ard Schrijvers <[EMAIL PROTECTED] >:
> Is it possible to add the parameters to src=" 
> http://www.myhost.com/{1}.php"; ? So, if you get a post with 
> param id, just call src=" 
> http://www.myhost.com/{1}.php?id={request-param:id} ". There 
> also must be some way to append all request parameters with 
> one input module, I forgot how, but there has been a thread 
> about it ones, you could find it in the archives. But, you 
> are then changing a POST into a GET then, with parameters in 
> the url, perhaps you dont want this. 
> 
> Can't the ProxyTransformer, or the cinclude transformer help 
> you out (though I am not to familiar with both)...you 
> probably have to change them a little since you are expecting 
> text/javascript...
> 
> Regards Ard 
> 
> 
> Greetings all.
> 
> I found out that FileGenerator may let me grab output from a 
> PHP page that outputs javascript code (header("Content-Type: 
> text/javascript");):
> Unfortunately it does NOT propagate the POST data sent by 
> javascript JSON call. 
> 
> <!--sitemap snip-->
> <map:match pattern="*.json">
>   <map:generate type="text" 
> mime-type="application/javascript" src=" 
http://www.myhost.com/{1}.php";>
  <map:serialize type="text">
</map:match>

Indeed i successfully receive the Javascript string that i produce from PHP, 
but PHP does NOT receive POST data from JSON call. 

The QUESTION is: i DO POST data from browser javascript function ---> to cocoon 
--> arriving to PHP and back, but in some way in PHP i don't see any parameter 
sent by the browser, so i presume that cocoon is NOT sending the params that 
browser sent to it through calling xmlhttp.send.

I tested the example using just php and it is functioning good (POST data from 
json call is in $GLOBALS['HTTP_RAW_POST_DATA']), but when i pass through cocoon 
i loose POST data in some way.

Is there any way i can POST data in javascript to a PHP page ? 

May a gentle soul between U all give me an hint (and maybe a piece of code) 
that can drive me to solution, please?

Any idea is well accepted.

thanks in advance to all.

Maurizio
-----------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Saluti,
Maurizio

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Saluti,
Maurizio 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to