cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warrell" <>
Subject RE: Own transformer - problem with passing parameters from sitemap
Date Fri, 16 Jun 2006 15:28:49 GMT
Have you noticed that you have called it <map: paramater name=….




From: Rudolf Fáber [] 
Sent: 16 June 2006 12:58
Subject: Own transformer - problem with passing parameters from sitemap



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 =


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 get 
ERROR   (2006-06-16) 11:09.26:783   [sitemap]
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