cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warrell" <warr...@iquo.co.uk>
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 [mailto:faber@dynatech.sk] 
Sent: 16 June 2006 12:58
To: users@cocoon.apache.org
Subject: Own transformer - problem with passing parameters from sitemap

 

Hello, 

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:generate> 
              <map:transform type="FileSave"> 
                <map:paramater name="file-name" value="pokus2.xml"/> 
              </map:transform>  
<map:serialize type="xml"/> 
</map:match> 

Parameter file-name doesn't pass to transformer (FileSaveTransformer is my
transformer). I get 
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
Developer
--------------------------
Dynatech s.r.o.
Nevädzova 8,
821 01 Bratislava
tel.:  +421 2 48 210 633 
faber@dynatech.sk 
 <http://www.dynatech.eu/> http://www.dynatech.eu/

 


Mime
View raw message