Hi again, Below you can see what's in my sitemap an in the transformer currently. The transformer is still working fine, the parameter not. With some system.out's I've found out, that it doesn't seem to go into the if-loop in setup(). When I try a system.out.println(par.toString()) it doesn't give me anything, so it seems to me the parameter isn't passed to the setup method. Anything I need to specify in the sitemap perhaps to make my transformer work with parameters?
Oh, and thanks a lot for your help so far ;) stefan <map:transformer name="addLinks" src="de.amacont.dom.transformation.LinkTransformer"/> ... ... <map:transform type="addLinks"> <map:parameter name="componentTag" value="comp"/> </map:transform> ----------------------- public class LinkTransformer extends AbstractDOMTransformer { ... private String COMP_TAG = "span"; ... public void setup(...)throws ProcessingException, SAXException, IOException{ if (par.isParameter("componentTag")) { try { this.COMP_TAG = par.getParameter("componentTag"); } catch (ParameterException pe) {...} } } public Document transform(Document docu) { .....} > -----Ursprüngliche Nachricht----- > Von: Rui Alberto L. Gonçalves [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 21. Januar 2004 20:51 > An: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Betreff: Re: AW: AW: use parameter from sitemap in java transformer > > You're right Marco. I got confused! > My apologies! > > On Wed, 2004-01-21 at 17:10, Marco Rolappe wrote: > > overriding the setup method (SiteMapModelComponent interface IIRC) is > the > > way to go, he must have made a mistake somewhere. > > > > and getting sitemap parameters won't work via the Parameterizable > interface > > AFAIK; the parameterize() method will provide a component's > configuration as > > Parameters converted from a Configuration object. > > > > > -----Ursprüngliche Nachricht----- > > > Von: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] > Auftrag > > > von Jorg Heymans > > > Gesendet: Mittwoch, 21. Januar 2004 16:18 > > > An: [EMAIL PROTECTED] > > > Betreff: Re: AW: use parameter from sitemap in java transformer > > > > > > > > > ztrange :) > > > This has worked for me exactly like this a million times before. Are > you > > > seeing anything in error.log? > > > Alternatively the parameterizable interface that Rui suggests should > > > also work, although for me setup() is more clear. setup() is called on > > > each pipeline component during pipeline setup. > > > > > > Try putting extensive logging everywhere, i have a feeling something > is > > > not happening like you think it is, but can't pinpoint it (how's that > > > for a useless vague statement eh :) > > > > > > > > > Jorg > > > Stefan Pietschmann wrote: > > > > > > > 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 > > > > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > -- > Rui Alberto L. Gonçalves <[EMAIL PROTECTED]> > PT Inovação > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]