You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by xweber <xw...@googlemail.com> on 2007/07/31 19:01:13 UTC

[cocoon 2.2.x] how to get request params in called block?

hi,

i want to deal e.g. html POST parameters in the called block. The sitemap in
myBlock1 has something like:
<map:generate src="servlet:myBlock2:/dosomeprocessing"/> 

but unfortunatly in the called block all parameters are gone.

so, how to get request params in called block?

Alex

PS: is there any "pure" cocoon 2.2 project out there, so i could get a sneak
peak how to put all things together?
-- 
View this message in context: http://www.nabble.com/-cocoon-2.2.x--how-to-get-request-params-in-called-block--tf4194334.html#a11928299
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


Re: [cocoon 2.2.x] how to get request params in called block?

Posted by xweber <xw...@googlemail.com>.

Grzegorz Kossakowski-3 wrote:
> 
> xweber pisze:
>> so, how to get request params in called block?
> 
> If parameters are simple strings you can pass them using such construct:
> servlet:someblock:/somepipeline?request1={request-param:request1}
> 
> Of course, such solution has it's own limitations but may be sufficient in
> many situations.
> 
> As you want to use some pipeline for processing XML stream I think that
> the best way would be to use servletService transformer.
> You need your XML data in the pipeline, so you should use:
> <map:generate type="stream">
>    <map:parameter name="form-name" value="name_of_request_parameter"/>
> <!-- the name 'form-name' is rather misleading -->
> </map:generate>
> 
> And then you should use servletService transformer:
> <map:transform type="servletService">
>    <map:parameter name="service"
> value="servlet:myBlock2:/dosomeprocessing"/>
> </map:transform>
> 

so if i got you right, there is no way to handle form processing in a called
block, because all information of the request is lost?

That would be a real show-stopper.

Url Parameters (the ?var=xx stuff) is not a big problem, since it could be
set e.g. to the requested page name and so the URI can be put to the called
block. I have that working here.

But this way cannot be used for POST variable. Its hard to believe that this
is impossible with current code.

Alex
-- 
View this message in context: http://www.nabble.com/-cocoon-2.2.x--how-to-get-request-params-in-called-block--tf4194334.html#a11943630
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


Re: [cocoon 2.2.x] how to get request params in called block?

Posted by xweber <xw...@googlemail.com>.


Rice Yeh wrote:
> 
> There is a patch for cocoon-2066 in JIRA written by me that can solve this
> problem.
> 

Yepp, confirmed - your patch solves that problem. Thank you!

Why is it not already in trunk applied?

Alex

-- 
View this message in context: http://www.nabble.com/-cocoon-2.2.x--how-to-get-request-params-in-called-block--tf4194334.html#a11952024
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


Re: [cocoon 2.2.x] how to get request params in called block?

Posted by Rice Yeh <ri...@gmail.com>.
There is a patch for cocoon-2066 in JIRA written by me that can solve this
problem.

Rice

On 8/1/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
>
> xweber pisze:
> > hi,
> >
> > i want to deal e.g. html POST parameters in the called block. The
> sitemap in
> > myBlock1 has something like:
> > <map:generate src="servlet:myBlock2:/dosomeprocessing"/>
> >
> > but unfortunatly in the called block all parameters are gone.
>
> It's a known problem and limitation of current implementation. See
> COCOON-2050[1] for some details.
> Alex, actually I recommend you taking a look at JIRA page[2] for Servlet
> Service framework issues overview. This will give an idea what's
> already there and what's not.
>
> Also, voting for particular issues can speed up process of implementing
> them. Of course you should choose issues carefully, voting for all
> of them will not help us anyhow. Speaking about myself, I would be very
> happy to work on all these issues but currently I'm busy with my
> Google of Summer tasks that have highest priority.
>
> > so, how to get request params in called block?
>
> If parameters are simple strings you can pass them using such construct:
> servlet:someblock:/somepipeline?request1={request-param:request1}
>
> Of course, such solution has it's own limitations but may be sufficient in
> many situations.
>
> As you want to use some pipeline for processing XML stream I think that
> the best way would be to use servletService transformer.
> You need your XML data in the pipeline, so you should use:
> <map:generate type="stream">
>    <map:parameter name="form-name" value="name_of_request_parameter"/>
> <!-- the name 'form-name' is rather misleading -->
> </map:generate>
>
> And then you should use servletService transformer:
> <map:transform type="servletService">
>    <map:parameter name="service"
> value="servlet:myBlock2:/dosomeprocessing"/>
> </map:transform>
>
> > Alex
> >
> > PS: is there any "pure" cocoon 2.2 project out there, so i could get a
> sneak
> > peak how to put all things together?
>
> Unfortunately, not yet. I'm working on such project, but as I said above,
> GSoC is more important for me now.
>
>
> [1] https://issues.apache.org/jira/browse/COCOON-2050
> [2]
> https://issues.apache.org/jira/secure/IssueNavigator.jspa?sorter/field=created&sorter/order=DESC
>
>
> --
> Grzegorz Kossakowski
> http://reflectingonthevicissitudes.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: [cocoon 2.2.x] how to get request params in called block?

Posted by Grzegorz Kossakowski <gk...@apache.org>.
xweber pisze:
> hi,
> 
> i want to deal e.g. html POST parameters in the called block. The sitemap in
> myBlock1 has something like:
> <map:generate src="servlet:myBlock2:/dosomeprocessing"/> 
> 
> but unfortunatly in the called block all parameters are gone.

It's a known problem and limitation of current implementation. See COCOON-2050[1] for some details.
Alex, actually I recommend you taking a look at JIRA page[2] for Servlet Service framework issues overview. This will give an idea what's 
already there and what's not.

Also, voting for particular issues can speed up process of implementing them. Of course you should choose issues carefully, voting for all 
of them will not help us anyhow. Speaking about myself, I would be very happy to work on all these issues but currently I'm busy with my 
Google of Summer tasks that have highest priority.

> so, how to get request params in called block?

If parameters are simple strings you can pass them using such construct:
servlet:someblock:/somepipeline?request1={request-param:request1}

Of course, such solution has it's own limitations but may be sufficient in many situations.

As you want to use some pipeline for processing XML stream I think that the best way would be to use servletService transformer.
You need your XML data in the pipeline, so you should use:
<map:generate type="stream">
   <map:parameter name="form-name" value="name_of_request_parameter"/> <!-- the name 'form-name' is rather misleading -->
</map:generate>

And then you should use servletService transformer:
<map:transform type="servletService">
   <map:parameter name="service" value="servlet:myBlock2:/dosomeprocessing"/>
</map:transform>

> Alex
> 
> PS: is there any "pure" cocoon 2.2 project out there, so i could get a sneak
> peak how to put all things together?

Unfortunately, not yet. I'm working on such project, but as I said above, GSoC is more important for me now.


[1] https://issues.apache.org/jira/browse/COCOON-2050
[2] https://issues.apache.org/jira/secure/IssueNavigator.jspa?sorter/field=created&sorter/order=DESC


-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org