cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@cc.oulu.fi>
Subject Re: [ cocoon3 ] map parameters
Date Mon, 07 Nov 2011 12:08:00 GMT
On 11/07/2011 02:03 PM, Francesco Chicchiriccò wrote:
> Il 07/11/2011 12:48, Andre Juffer ha scritto:
>> On 11/07/2011 01:43 PM, Francesco Chicchiriccò wrote:
>>> On 07/11/2011 12:35, Andre Juffer wrote:
>>>
>>> What happens if you use one of standard generators - like the XML
>>> generator in the first example? I mean:
>>>
>>> <map:match pattern="create/image/creator/*">
>>> <map:generate src="sax-pipeline/{map:1}.xml" />
>>>
>>> You should now get an exception for something missing: is it
>>> "sax-pipeline/3276800.xml" or "sax-pipeline/null.xml"?
>>>
>>
>> This is exactly the error I get. I tried:
>>
>> <map:generate src="{map:1}.xml" />
>>
>> The exception I get
>>
>> Caused by: java.io.FileNotFoundException:
>> /home/juffer/TriBC/projects/cocoon3-webapp/tribc-img/src/main/resources/COB-INF/3276800.xml
>> (No such file or directory)
>
> Ok, this means that {map:1} is handled correctly by the sitemap, since
> it is passed to XML generator.
>
> See attached a patch for cocoon-sample that modifies the current sample
> for StringTemplateGenerator by passing an additional parameter from URL
> match: once applied the patch and launched "mvn jetty:run" under
> cocoon-sample, you will be able to access URLs like as
>
> http://localhost:8888/string-template/generator/anUrlParameter
>
> getting an XML document that shows, among usual things, "anUrlParameter"
> or whatever value you pass after generator/.
>
> I am giving this example because StringTemplateGenerator is the first
> generator coming into my mind that supports parameter passing.
>
> I suspect there should be something wrong with your generator, then;
> take a look at StringTemplateGenerator's sources [1] for reference.

OK, thanks. I have a look at your suggestions.

Please have a look the generator code that I have send in an earlier 
email. I did test the Generator by having the creatorId included as a 
regular request parameter (like 'filename'). I did work as expected.

Best regards,
André


>
> Cheers.
>
> [1]
> http://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-stringtemplate/src/main/java/org/apache/cocoon/stringtemplate/StringTemplateGenerator.java
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: andre.juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
Triacle Biocomputing         | WWW: www.triacle-bc.com

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


Mime
View raw message