cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rui Alberto L." Gonçalves <rui-l-goncal...@ptinovacao.pt>
Subject Re: use parameter from sitemap in java transformer
Date Wed, 21 Jan 2004 14:17:35 GMT
Hi Stefan,
you need to implement  Parameterizable interface in
your transformer...

Something like:

public class LinkTransformer ... implements Parameterizable 
{
...

public void parameterize(Parameters params) throws ParameterException
{
 try
 {
   value = params.getParameter( "componentTag");
 } 
 catch(ParameterException pe)
  ...
}

the parametrize method is invoked each time the component 
is requested...

Hope this helps
Rui


On Wed, 2004-01-21 at 12:51, Stefan Pietschmann wrote:
> Hi,
> 
>  
> 
> i’ve written a transformer in java, 
> 
>  
> 
> <map:transformer name="addLinks"
> src="de.amacont.dom.transformation.LinkTransformer"/>
> 
>  
> 
> which works well. Now I want to use a parameter in it, which I can set
> in the sitemap, like
> 
>  
> 
>  
> 
> <map:transform type="addLinks">
> 
>     <map:parameter name="componentTag" value="span"/>
> 
> </map:transform>
> 
>  
> 
> I don’t know how to, though. I know who I can use such a parameter in
> XSL Stylesheets, but Java? How do I instantiate them?
> 
> My transformer extends from AbstractDOMTransformer and just implements
> the transform(Document) method.
> 
>  
> 
>  
> 
> Thx for your help
> 
> stefan
> 
>  
-- 
Rui Alberto L. Gonçalves <rui-l-goncalves@ptinovacao.pt>
PT Inovação


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


Mime
View raw message