Re: how to access post parameters from sitemap
On 04/26/2011 04:10 PM, Robby Pelssers wrote: When I post to this url firebug shows the id's are posted just fine. But when I debug the queryString is null when making post requests. When POST method is used, query string is null, since parameters are passed in the body of the request. Is there some cocoon component which allows me to get access to BOTH request and post parameters? To access said paramerers, a simple request-param should do, for instance: map:call function=addPerson map:parameter name=bizdata value={request-param:bizdata}/ /map:call Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: how to access post parameters from sitemap
Hi Luca, thx for the reply... That was indeed the first option for me to consider. Unfortunately this solution will not work for me since I setup a highly generic pipeline which starts an xquery generator. So basically the correct xquery is generated and the idea is that all needed parameters are set by the xquery generator from request parameters as well as post parameters which are different for each xquery. map:generate src=xquery/{1}.xquery type=queryStringXquery map:parameter name=contextPath value={request:contextPath}/ !-- does not work for post parameters map:parameter name=queryString value={request:queryString}/ -- /map:generate I'm actually debugging the custom Xquery Generator now and it seems somehow deeply nested I can retrieve those parameters from 'Map objectModel' without the need to inject them from within my sitemap. Will keep you posted ;-) void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) Kind regards, Robby -Oorspronkelijk bericht- Van: Luca Morandini [mailto:lmorand...@ieee.org] Verzonden: wo 27-4-2011 11:29 Aan: users@cocoon.apache.org Onderwerp: Re: how to access post parameters from sitemap On 04/26/2011 04:10 PM, Robby Pelssers wrote: When I post to this url firebug shows the id's are posted just fine. But when I debug the queryString is null when making post requests. When POST method is used, query string is null, since parameters are passed in the body of the request. Is there some cocoon component which allows me to get access to BOTH request and post parameters? To access said paramerers, a simple request-param should do, for instance: map:call function=addPerson map:parameter name=bizdata value={request-param:bizdata}/ /map:call Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: how to access post parameters from sitemap
On Wed, 2011-04-27 at 12:03 +0200, Robby Pelssers wrote: Hi Luca, thx for the reply... That was indeed the first option for me to consider. Unfortunately this solution will not work for me since I setup a highly generic pipeline which starts an xquery generator. So basically the correct xquery is generated and the idea is that all needed parameters are set by the xquery generator from request parameters as well as post parameters which are different for each xquery. map:generate src=xquery/{1}.xquery type=queryStringXquery map:parameter name=contextPath value={request:contextPath}/ !-- does not work for post parameters map:parameter name=queryString value={request:queryString}/ -- /map:generate I'm actually debugging the custom Xquery Generator now and it seems somehow deeply nested I can retrieve those parameters from 'Map objectModel' without the need to inject them from within my sitemap. Will keep you posted ;-) void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) If the component is under your control why not use the objectModel to get the request in the setup and do it from there: Request request = org.apache.cocoon.environment.ObjectModelHelper.getRequest(objectModel); Has the benefit that you get rid of map:parameter name=queryString value={request:queryString}/ all together in the sitemap. HTH salu2 Kind regards, Robby -Oorspronkelijk bericht- Van: Luca Morandini [mailto:lmorand...@ieee.org] Verzonden: wo 27-4-2011 11:29 Aan: users@cocoon.apache.org Onderwerp: Re: how to access post parameters from sitemap On 04/26/2011 04:10 PM, Robby Pelssers wrote: When I post to this url firebug shows the id's are posted just fine. But when I debug the queryString is null when making post requests. When POST method is used, query string is null, since parameters are passed in the body of the request. Is there some cocoon component which allows me to get access to BOTH request and post parameters? To access said paramerers, a simple request-param should do, for instance: map:call function=addPerson map:parameter name=bizdata value={request-param:bizdata}/ /map:call Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org -- Thorsten Scherler thorsten.at.apache.org codeBusters S.L. - web based systems consulting, training and solutions http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: how to access post parameters from sitemap
Hi Thorsten, that is exactly what i'm going to do. It can also get rid of that QueryStringAnalyzer I wrote. ;-) Cheers, Robby -Oorspronkelijk bericht- Van: Thorsten Scherler [mailto:scher...@gmail.com] Verzonden: wo 27-4-2011 12:21 Aan: users@cocoon.apache.org Onderwerp: RE: how to access post parameters from sitemap On Wed, 2011-04-27 at 12:03 +0200, Robby Pelssers wrote: Hi Luca, thx for the reply... That was indeed the first option for me to consider. Unfortunately this solution will not work for me since I setup a highly generic pipeline which starts an xquery generator. So basically the correct xquery is generated and the idea is that all needed parameters are set by the xquery generator from request parameters as well as post parameters which are different for each xquery. map:generate src=xquery/{1}.xquery type=queryStringXquery map:parameter name=contextPath value={request:contextPath}/ !-- does not work for post parameters map:parameter name=queryString value={request:queryString}/ -- /map:generate I'm actually debugging the custom Xquery Generator now and it seems somehow deeply nested I can retrieve those parameters from 'Map objectModel' without the need to inject them from within my sitemap. Will keep you posted ;-) void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) If the component is under your control why not use the objectModel to get the request in the setup and do it from there: Request request = org.apache.cocoon.environment.ObjectModelHelper.getRequest(objectModel); Has the benefit that you get rid of map:parameter name=queryString value={request:queryString}/ all together in the sitemap. HTH salu2 Kind regards, Robby -Oorspronkelijk bericht- Van: Luca Morandini [mailto:lmorand...@ieee.org] Verzonden: wo 27-4-2011 11:29 Aan: users@cocoon.apache.org Onderwerp: Re: how to access post parameters from sitemap On 04/26/2011 04:10 PM, Robby Pelssers wrote: When I post to this url firebug shows the id's are posted just fine. But when I debug the queryString is null when making post requests. When POST method is used, query string is null, since parameters are passed in the body of the request. Is there some cocoon component which allows me to get access to BOTH request and post parameters? To access said paramerers, a simple request-param should do, for instance: map:call function=addPerson map:parameter name=bizdata value={request-param:bizdata}/ /map:call Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org -- Thorsten Scherler thorsten.at.apache.org codeBusters S.L. - web based systems consulting, training and solutions http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org winmail.dat - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
Re: how to access post parameters from sitemap
On 04/27/2011 12:30 PM, Robby Pelssers wrote: that is exactly what i'm going to do. It can also get rid of that QueryStringAnalyzer I wrote. ;-) Wouldn't be simpler to use a pre-processing stage with the JX Template generator ? A fragment like this should make you access request parameters easily without knowing their names and generate XML: jx:forEach var=p select=${cocoon.request.getParameterNames()} p${p}=${cocoon.request.getParameter(p)}/p /jx:forEach Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: how to access post parameters from sitemap
Ok... I'm facing a strange issue right now. So in my java code I have following: Request request = ObjectModelHelper.getRequest(objectModel); Map parameters = request.getParameters(); When debugging the content of parameters in Eclipse i see: {id=SAA7715AH} But using firebug I do see that I do post multiple values for parameter 'id' as expected: Parametersapplication/x-www-form-urlencoded id SAA7715AH id SAA7724H id SAA7706H id SAF7780HL Bron id=SAA7715AHid=SAA7724Hid=SAA7706Hid=SAF7780HL I would assume a bug here but maybe I'm missing something? Anyone some pointers here? Cheers, Robby -Oorspronkelijk bericht- Van: Robby Pelssers [mailto:robby.pelss...@ciber.com] Verzonden: wo 27-4-2011 12:30 Aan: users@cocoon.apache.org Onderwerp: RE: how to access post parameters from sitemap Hi Thorsten, that is exactly what i'm going to do. It can also get rid of that QueryStringAnalyzer I wrote. ;-) Cheers, Robby -Oorspronkelijk bericht- Van: Thorsten Scherler [mailto:scher...@gmail.com] Verzonden: wo 27-4-2011 12:21 Aan: users@cocoon.apache.org Onderwerp: RE: how to access post parameters from sitemap On Wed, 2011-04-27 at 12:03 +0200, Robby Pelssers wrote: Hi Luca, thx for the reply... That was indeed the first option for me to consider. Unfortunately this solution will not work for me since I setup a highly generic pipeline which starts an xquery generator. So basically the correct xquery is generated and the idea is that all needed parameters are set by the xquery generator from request parameters as well as post parameters which are different for each xquery. map:generate src=xquery/{1}.xquery type=queryStringXquery map:parameter name=contextPath value={request:contextPath}/ !-- does not work for post parameters map:parameter name=queryString value={request:queryString}/ -- /map:generate I'm actually debugging the custom Xquery Generator now and it seems somehow deeply nested I can retrieve those parameters from 'Map objectModel' without the need to inject them from within my sitemap. Will keep you posted ;-) void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) If the component is under your control why not use the objectModel to get the request in the setup and do it from there: Request request = org.apache.cocoon.environment.ObjectModelHelper.getRequest(objectModel); Has the benefit that you get rid of map:parameter name=queryString value={request:queryString}/ all together in the sitemap. HTH salu2 Kind regards, Robby -Oorspronkelijk bericht- Van: Luca Morandini [mailto:lmorand...@ieee.org] Verzonden: wo 27-4-2011 11:29 Aan: users@cocoon.apache.org Onderwerp: Re: how to access post parameters from sitemap On 04/26/2011 04:10 PM, Robby Pelssers wrote: When I post to this url firebug shows the id's are posted just fine. But when I debug the queryString is null when making post requests. When POST method is used, query string is null, since parameters are passed in the body of the request. Is there some cocoon component which allows me to get access to BOTH request and post parameters? To access said paramerers, a simple request-param should do, for instance: map:call function=addPerson map:parameter name=bizdata value={request-param:bizdata}/ /map:call Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org -- Thorsten Scherler thorsten.at.apache.org codeBusters S.L. - web based systems consulting, training and solutions http://www.codebusters.es/ - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org winmail.dat - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org
RE: how to access post parameters from sitemap [resolved]
Ok... I figured it out meanwhile and below implementation works like a charm. //inject request or post parameters as xquery parameters handleRequestParameters(ObjectModelHelper.getRequest(objectModel)); protected void handleRequestParameters(Request request) { @SuppressWarnings(unchecked) EnumerationString parameterNames = request.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameterName = parameterNames.nextElement(); String[] parameterValue = request.getParameterValues(parameterName); xqueryParameters.put(parameterName, parameterValue); } } Thx for all the help. Robby -Oorspronkelijk bericht- Van: Robby Pelssers [mailto:robby.pelss...@ciber.com] Verzonden: wo 27-4-2011 12:53 Aan: users@cocoon.apache.org Onderwerp: RE: how to access post parameters from sitemap Ok... I'm facing a strange issue right now. So in my java code I have following: Request request = ObjectModelHelper.getRequest(objectModel); Map parameters = request.getParameters(); When debugging the content of parameters in Eclipse i see: {id=SAA7715AH} But using firebug I do see that I do post multiple values for parameter 'id' as expected: Parametersapplication/x-www-form-urlencoded id SAA7715AH id SAA7724H id SAA7706H id SAF7780HL Bron id=SAA7715AHid=SAA7724Hid=SAA7706Hid=SAF7780HL I would assume a bug here but maybe I'm missing something? Anyone some pointers here? Cheers, Robby -Oorspronkelijk bericht- Van: Robby Pelssers [mailto:robby.pelss...@ciber.com] Verzonden: wo 27-4-2011 12:30 Aan: users@cocoon.apache.org Onderwerp: RE: how to access post parameters from sitemap Hi Thorsten, that is exactly what i'm going to do. It can also get rid of that QueryStringAnalyzer I wrote. ;-) Cheers, Robby -Oorspronkelijk bericht- Van: Thorsten Scherler [mailto:scher...@gmail.com] Verzonden: wo 27-4-2011 12:21 Aan: users@cocoon.apache.org Onderwerp: RE: how to access post parameters from sitemap On Wed, 2011-04-27 at 12:03 +0200, Robby Pelssers wrote: Hi Luca, thx for the reply... That was indeed the first option for me to consider. Unfortunately this solution will not work for me since I setup a highly generic pipeline which starts an xquery generator. So basically the correct xquery is generated and the idea is that all needed parameters are set by the xquery generator from request parameters as well as post parameters which are different for each xquery. map:generate src=xquery/{1}.xquery type=queryStringXquery map:parameter name=contextPath value={request:contextPath}/ !-- does not work for post parameters map:parameter name=queryString value={request:queryString}/ -- /map:generate I'm actually debugging the custom Xquery Generator now and it seems somehow deeply nested I can retrieve those parameters from 'Map objectModel' without the need to inject them from within my sitemap. Will keep you posted ;-) void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters) If the component is under your control why not use the objectModel to get the request in the setup and do it from there: Request request = org.apache.cocoon.environment.ObjectModelHelper.getRequest(objectModel); Has the benefit that you get rid of map:parameter name=queryString value={request:queryString}/ all together in the sitemap. HTH salu2 Kind regards, Robby -Oorspronkelijk bericht- Van: Luca Morandini [mailto:lmorand...@ieee.org] Verzonden: wo 27-4-2011 11:29 Aan: users@cocoon.apache.org Onderwerp: Re: how to access post parameters from sitemap On 04/26/2011 04:10 PM, Robby Pelssers wrote: When I post to this url firebug shows the id's are posted just fine. But when I debug the queryString is null when making post requests. When POST method is used, query string is null, since parameters are passed in the body of the request. Is there some cocoon component which allows me to get access to BOTH request and post parameters? To access said paramerers, a simple request-param should do, for instance: map:call function=addPerson map:parameter name=bizdata value={request-param:bizdata}/ /map:call Regards, Luca Morandini http://www.lucamorandini.it - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org - To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org -- Thorsten Scherler thorsten.at.apache.org codeBusters S.L. - web based systems consulting, training and solutions http://www.codebusters.es