cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <>
Subject RE: [ cocoon3 ] map parameters
Date Mon, 07 Nov 2011 12:21:19 GMT
Hi Andre,

Are you sure these @Path annotations are correct?

In your sitemap you specify the pattern "create/image/creator/*"

In your component I see following annotations
public class ImageResource

     @Produces({"application/xml", "application/json"})
     public Response newImage(@PathParam("id") String creatorId, final FormDataMultiPart parts)

Just wondering if the first annotation should not be 

public class ImageResource


-----Original Message-----
From: Andre Juffer [] 
Sent: Monday, November 07, 2011 12:35 PM
Subject: Re: [ cocoon3 ] map parameters

Hi Francesco,

yes, that's right, I saw that file. It is the one I was referring to, as 
a matter of fact.

Line 188 is

<map:generate src="sax-pipeline/{map:1}.xml" />

I have similar lines in my pipeline.

The difference is that I now have:

<map:match pattern="create/image/creator/*">
   <map:generate type="new-image">
     <map:parameter name="creatorId" value="{map:1}" />

Thus, I am trying to pass a parameter to the Generator. When checking 
the parameter in the Generator, it is always null. In fact, there are 
many parameters available to the Generator (not set by me) and the 
'creatorId' is the only one that is null.

The request that I was using


should however give a value of 3276800 for creatorId.


On 11/07/2011 01:25 PM, Francesco Chicchiriccò wrote:
> On 07/11/2011 11:57, Andre Juffer wrote:
>> Hi,
>> I have the following pipeline in a sitemap of some block. This
>> pipeline is called by other blocks, that have components in place to
>> upload images. They subsequently connect to the image block to store
>> it in an image database.
>> The pipeline uses a self made Generator, that requires two parameters
>> ('creatorId' and 'filename').
>> <map:match pattern="create/image/creator/*">
>> <map:generate type="new-image">
>> <map:parameter name="creatorId" value="{map:1}" />
>> <map:parameter name="filename"
>> value= {jexl:cocoon.request.filename}" />
>> </map:generate>
>> <map:serialize type="xml"/>
>> </map:match>
>> Other blocks call this pipeline with a request like
>> http://localhost:8888/img/create/image/creator/3276800?filename=/tmp/3276800-tribc-eap-areal-view.jpg
>> The value of 'creatorId' is always null, although it should have been
>> '3276800'. The value of 'filename' is OK.
>> Looking through the sitemap of the sample application, I did not find
>> a case like the one above:
>> <map:parameter name="creatorId" value="{map:1}" />
>> My question: Is it possible to create parameter values from the
>> request itself (that is, other than using request parameters)?
> Of course it is possible: take a look at line 188 of [1]; moreover, in
> C3 you can also use named matches: take a look at line 40 for this.
>> I can of course modify the request such that the creatorId is also
>> regular request parameter, but I would like to have an answer to this
>> question.
> [1]

Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email:
University of Oulu, Finland  | WWW:
StruBioCat                   | WWW:
Triacle Biocomputing         | WWW:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message