cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rudolf Fáber <>
Subject Own transformer - problem with passing parameters from sitemap
Date Fri, 16 Jun 2006 11:58:15 GMT

I tried to write my own transformer(just a little test) and I encountered a problem. Everything
works fine except passing parameters from sitemap. I have implemented following setup method

 public void setup(SourceResolver resolver, Map objectModel,
                      String source, Parameters parameters)
    throws ProcessingException, SAXException, IOException {
      Request request = ObjectModelHelper.getRequest(objectModel);
      session = request.getSession(false);
      if (session != null) {       
        String[] names = parameters.getNames();       
        fileName = parameters.getParameter(FileSaveTransformer.FILE_NAME,null);

Where FileSaveTransformer.FILE_NAME is "file-name".
I used existing transformers as inspiration. But when I use it in sitemap like this :

 <map:match pattern="phone-*.xml">
	      <map:generate type="serverpages" src="phone-maker_src.xml">
	      <map:parameter name="phone-maker" value="{1}"/>	      		      
	      <map:transform type="FileSave">
	        <map:paramater name="file-name" value="pokus2.xml"/>
<map:serialize type="xml"/>

Parameter file-name doesn't pass to transformer (FileSaveTransformer is my transformer). I
ERROR   (2006-06-16) 11:09.26:783   [sitemap] (/ts/xml/dynamic/phone-Nokia.xml) AJPRequestHandler-ApplicationServerThread-8/FileSaveTransformer:
FileSaveTransformer: need file-name 
In error.log and fileName remains null in transformer. 
Everything other works in the way I expected. I don't know where is the problem, I would be
thankful for any ideas.
I use Cocoon 2.1.9.

Thanks a lot for any answer

Rudolf Fáber
Dynatech s.r.o.
Nevädzova 8,
821 01 Bratislava
tel.:  +421 2 48 210 633

View raw message