You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Gordon <go...@zareus.com> on 2003/02/01 08:22:58 UTC

[Jelly] werkz tags

If I create a jelly script using the werkz tags, how do I invoke a
specific goal of that script?

For example, I have the following script...

<project>

  <goal name="one">
    <!-- do something -->
  </goal>

  <goal name="two">
    <!-- do something -->
  </goal>

  <goal name="three">
    <!-- do something -->
  </goal>

</project>

I want to process just goal "three" of the script. Is there sample code
on how to do this?

Gordon


RE: [Jelly] werkz tags

Posted by Gordon <go...@zareus.com>.
That does work. However, how do I invoke (attain) a certain goal via
java code? Currently I execute the jelly script with the following
code...

  Writer writer = new StringWriter();
  XMLOutput output = XMLOutput.createXMLOutput(writer);

  Jelly jelly = new Jelly();
  jelly.setScript(scriptFile); // scriptFile is a string that gets
passed in.

  Script script = jelly.compileScript();

  JellyContext context = jelly.getJellyContext();
  context.setVariables(vars); // vars is a HashMap that gets passed in.

  script.run(context, output);

  output.flush();

So in my java code is there a way to specify which goal to attain? Do I
need to use the werkz api to accomplish this? If you can point me in the
right direction, I can take it from there.

Thanks,
Gordon




-----Original Message-----
From: James Strachan [mailto:james_strachan@yahoo.co.uk] 
Sent: Saturday, February 01, 2003 4:27 AM
To: Jakarta Commons Users List
Subject: Re: [Jelly] werkz tags


Try adding

    <attainGoal name="three"/>

when you need to attain a goal. I can't see any werkz JellyUnit test
cases around anywhere - it could be an idea to add some to the werkz
project.

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: "Gordon" <go...@zareus.com>
To: <co...@jakarta.apache.org>
Sent: Saturday, February 01, 2003 7:22 AM
Subject: [Jelly] werkz tags


> If I create a jelly script using the werkz tags, how do I invoke a 
> specific goal of that script?
>
> For example, I have the following script...
>
> <project>
>
>   <goal name="one">
>     <!-- do something -->
>   </goal>
>
>   <goal name="two">
>     <!-- do something -->
>   </goal>
>
>   <goal name="three">
>     <!-- do something -->
>   </goal>
>
> </project>
>
> I want to process just goal "three" of the script. Is there sample 
> code on how to do this?
>
> Gordon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>

__________________________________________________

Do You Yahoo!?

Everything you'll ever need on one web page

from News and Sport to Email and Music Charts

http://uk.my.yahoo.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



Re: [Jelly] werkz tags

Posted by James Strachan <ja...@yahoo.co.uk>.
Try adding

    <attainGoal name="three"/>

when you need to attain a goal. I can't see any werkz JellyUnit test cases
around anywhere - it could be an idea to add some to the werkz project.

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: "Gordon" <go...@zareus.com>
To: <co...@jakarta.apache.org>
Sent: Saturday, February 01, 2003 7:22 AM
Subject: [Jelly] werkz tags


> If I create a jelly script using the werkz tags, how do I invoke a
> specific goal of that script?
>
> For example, I have the following script...
>
> <project>
>
>   <goal name="one">
>     <!-- do something -->
>   </goal>
>
>   <goal name="two">
>     <!-- do something -->
>   </goal>
>
>   <goal name="three">
>     <!-- do something -->
>   </goal>
>
> </project>
>
> I want to process just goal "three" of the script. Is there sample code
> on how to do this?
>
> Gordon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com