cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Pietschmann" <sp186...@inf.tu-dresden.de>
Subject AW: use parameter from sitemap in java transformer
Date Wed, 21 Jan 2004 13:30:16 GMT
Thanx for your quick answer. However It didn't work. I overwrote the setup
method in my transformer like this had to catch the ParameterException

public void setup(SourceResolver resolver,Map objectModel,String src,
Parameters par)
	        	throws ProcessingException, SAXException,
IOException {

if (par.isParameter("componentTag")) {
	try {
		this.COMP_TAG = par.getParameter("componentTag");
	}catch (ParameterException pe) {
		System.out.println("Failed to get parameter \"componentTag\"
from sitemap!");
	}
}
}

):, but the parameter COMP_TAG stays on the default initialization value, no
matter how I change the parameter in the sitemap.
When is the setup method called? I tried to put a system.out.println into
setup(), but it didn't even show up in the console :o

stefan	

> -----Ursprüngliche Nachricht-----
> Von: news [mailto:news@sea.gmane.org] Im Auftrag von Jorg Heymans
> Gesendet: Mittwoch, 21. Januar 2004 14:04
> An: users@cocoon.apache.org
> Betreff: Re: use parameter from sitemap in java transformer
> 
> override the setup() method
> 
>      public void setup(
>          SourceResolver resolver,
>          Map objectModel,
>          String src,
>          Parameters par)
>          throws ProcessingException, SAXException, IOException {
> 
>              if (par.isParameter("myparameter")) {
>                  this.parameter = par.getParameter("myparameter");
>              }
> 
> 
> 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
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


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


Mime
View raw message