Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 73476 invoked from network); 12 Jun 2002 06:07:38 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jun 2002 06:07:38 -0000 Received: (qmail 4183 invoked by uid 97); 12 Jun 2002 06:07:47 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 4159 invoked by uid 97); 12 Jun 2002 06:07:46 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 4146 invoked by uid 97); 12 Jun 2002 06:07:45 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 12 Jun 2002 06:07:29 -0000 Message-ID: <20020612060729.50977.qmail@icarus.apache.org> From: werken@apache.org To: jakarta-commons-sandbox-cvs@apache.org Subject: cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/werkz example.jelly X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N werken 2002/06/11 23:07:29 Modified: jelly build.xml jelly/src/java/org/apache/commons/jelly/tags/ant AntTagLibrary.java TaskPropertyTag.java jelly/src/java/org/apache/commons/jelly/tags/werkz WerkzTagLibrary.java jelly/src/test/org/apache/commons/jelly/werkz example.jelly Added: jelly/src/java/org/apache/commons/jelly/tags/werkz AttainGoalTag.java AttainTag.java GoalTag.java PostGoalTag.java PreGoalTag.java Removed: jelly/src/java/org/apache/commons/jelly/tags/werkz CallTargetTag.java PostTargetTag.java PreTargetTag.java TargetTag.java Log: * demo.werkz2 now actually works and runs the demo. * Re-aligned the Werkz taglib to the actual werkz vocabulary and semantics. -- renamed everything Target to Goal. -- changed Call to Attain. -- Implemented one-off and multi-goals-within-a-session attainment. * Fixed build.xml to pick up the Jelly default properties for the internally registered jelly:foo taglibs. Still munging test.classpath. Revision Changes Path 1.42 +1 -0 jakarta-commons-sandbox/jelly/build.xml Index: build.xml =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/build.xml,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- build.xml 12 Jun 2002 04:32:27 -0000 1.41 +++ build.xml 12 Jun 2002 06:07:29 -0000 1.42 @@ -16,6 +16,7 @@ + 1.6 +13 -1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java Index: AntTagLibrary.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant/AntTagLibrary.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AntTagLibrary.java 11 Jun 2002 22:59:22 -0000 1.5 +++ AntTagLibrary.java 12 Jun 2002 06:07:29 -0000 1.6 @@ -80,6 +80,8 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; +import org.apache.tools.ant.BuildLogger; +import org.apache.tools.ant.NoBannerLogger; import org.apache.tools.ant.types.DataType; import org.apache.tools.ant.types.Reference; @@ -137,8 +139,18 @@ } public AntTagLibrary() { - // need to spoof an Ant project + this.project = new Project(); + + BuildLogger logger = new NoBannerLogger(); + + logger.setMessageOutputLevel( org.apache.tools.ant.Project.MSG_INFO ); + logger.setOutputPrintStream( System.out ); + logger.setErrorPrintStream( System.err); + + project.addBuildListener( logger ); + + project.init(); } public AntTagLibrary(Project project) { 1.5 +1 -1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant/TaskPropertyTag.java Index: TaskPropertyTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/ant/TaskPropertyTag.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- TaskPropertyTag.java 5 Jun 2002 07:12:58 -0000 1.4 +++ TaskPropertyTag.java 12 Jun 2002 06:07:29 -0000 1.5 @@ -104,7 +104,7 @@ // CompilableTag interface //------------------------------------------------------------------------- public void compile() throws Exception { - TaskTag tag = (TaskTag) findAncestorWithClass( TaskTag.class ); + TaskTag tag = (TaskTag) findAncestorWithClass( Task.class ); if ( tag == null ) { throw new JellyException( "You should only use Ant DataType tags within an Ant Task" ); } 1.2 +5 -4 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/WerkzTagLibrary.java Index: WerkzTagLibrary.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/WerkzTagLibrary.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WerkzTagLibrary.java 11 Jun 2002 21:41:11 -0000 1.1 +++ WerkzTagLibrary.java 12 Jun 2002 06:07:29 -0000 1.2 @@ -84,9 +84,10 @@ public WerkzTagLibrary() { registerTag("project", ProjectTag.class); - registerTag("target", TargetTag.class); - registerTag("preTarget", PreTargetTag.class); - registerTag("postTarget", PostTargetTag.class); - registerTag("callTarget", CallTargetTag.class); + registerTag("goal", GoalTag.class); + registerTag("preGoal", PreGoalTag.class); + registerTag("postGoal", PostGoalTag.class); + registerTag("attain", AttainTag.class); + registerTag("attainGoal", AttainGoalTag.class); } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/AttainGoalTag.java Index: AttainGoalTag.java =================================================================== /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package org.apache.commons.jelly.tags.werkz; import com.werken.werkz.Goal; import com.werken.werkz.Session; import com.werken.werkz.Project; import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Attains one or more goals. * * @author bob mcwhirter * @version $Revision: 1.1 $ */ public class AttainGoalTag extends WerkzTagSupport { /** The Log to which logging calls will be made. */ private Log log = LogFactory.getLog(AttainGoalTag.class); /** The goal name. */ private String name; public AttainGoalTag() { } // Tag interface //------------------------------------------------------------------------- /** * Evaluate the body to register all the various goals and pre/post conditions * then run all the current targets */ public void doTag(final XMLOutput output) throws Exception { AttainTag attainTag = (AttainTag) findAncestorWithClass( AttainTag.class ); Session session = null; if ( attainTag == null ) { session = new Session(); } else { session = attainTag.getSession(); } ProjectTag projectTag = (ProjectTag) findAncestorWithClass( ProjectTag.class ); Project project = projectTag.getProject(); project.attainGoal( getName(), session ); // getBody().run(context, output); } // Properties //------------------------------------------------------------------------- public void setName(String name) { this.name = name; } public String getName() { return this.name; } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/AttainTag.java Index: AttainTag.java =================================================================== /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package org.apache.commons.jelly.tags.werkz; import com.werken.werkz.Goal; import com.werken.werkz.Session; import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Attains one or more goals. * * @author bob mcwhirter * @version $Revision: 1.1 $ */ public class AttainTag extends WerkzTagSupport { /** The Log to which logging calls will be made. */ private Log log = LogFactory.getLog(AttainTag.class); /** The goal session. */ private Session session; public AttainTag() { log.debug( "ctor()" ); this.session = new Session(); } // Tag interface //------------------------------------------------------------------------- /** * Evaluate the body to register all the various goals and pre/post conditions * then run all the current targets */ public void doTag(final XMLOutput output) throws Exception { this.session.clear(); getBody().run(context, output); } // Properties //------------------------------------------------------------------------- public Session getSession() { return this.session; } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/GoalTag.java Index: GoalTag.java =================================================================== /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package org.apache.commons.jelly.tags.werkz; import com.werken.werkz.DefaultGoal; import java.util.Iterator; import java.util.List; import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Implements a <target> tag which is similar to the Ant equivalent tag * but is based on the Werkz goal engine. * * @author James Strachan * @version $Revision: 1.1 $ */ public class GoalTag extends WerkzTagSupport { /** The Log to which logging calls will be made. */ private Log log = LogFactory.getLog(GoalTag.class); /** the name of the target */ private String name; public GoalTag() { } // Tag interface //------------------------------------------------------------------------- /** * Evaluate the body to register all the various goals and pre/post conditions * then run all the current targets */ public void doTag(final XMLOutput output) throws Exception { log.debug("doTag(..):" + name); // lets register a new goal... DefaultGoal goal = new DefaultGoal(name) { public void performAction() throws Exception { // lets run the body log.debug("Running target: " + name); getBody().run(context, output); } public boolean requiresAction() { return true; } }; getProject().addGoal(goal); } // Properties //------------------------------------------------------------------------- /** * @return the name of the target */ public String getName() { return name; } /** * Sets the name of the target */ public void setName(String name) { log.debug("setName(" + name + ")" ); this.name = name; } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PostGoalTag.java Index: PostGoalTag.java =================================================================== /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package org.apache.commons.jelly.tags.werkz; import com.werken.werkz.Goal; import com.werken.werkz.PostGoalCallback; import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Implements a <postTarget> tag which provides a callback * which is evaluated after a target has executed. * * @author James Strachan * @version $Revision: 1.1 $ */ public class PostGoalTag extends CallbackTagSupport { public PostGoalTag() { } // Tag interface //------------------------------------------------------------------------- /** * Evaluate the body to register all the various goals and pre/post conditions * then run all the current targets */ public void doTag(final XMLOutput output) throws Exception { getGoal(getName()).addPostGoalCallback( new PostGoalCallback() { public void firePostGoal(Goal goal) throws Exception { // lets run the body log.info( "Running post target: " + getName() ); getBody().run( context, output); } } ); } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PreGoalTag.java Index: PreGoalTag.java =================================================================== /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ package org.apache.commons.jelly.tags.werkz; import com.werken.werkz.Goal; import com.werken.werkz.PreGoalCallback; import org.apache.commons.jelly.JellyException; import org.apache.commons.jelly.XMLOutput; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Implements a <preTarget> tag which provides a callback * which is evaluated before a target. * * @author James Strachan * @version $Revision: 1.1 $ */ public class PreGoalTag extends CallbackTagSupport { public PreGoalTag() { } // Tag interface //------------------------------------------------------------------------- /** * Evaluate the body to register all the various goals and pre/post conditions * then run all the current targets */ public void doTag(final XMLOutput output) throws Exception { getGoal(getName()).addPreGoalCallback( new PreGoalCallback() { public void firePreGoal(Goal goal) throws Exception { // lets run the body log.info( "Running pre target: " + getName() ); getBody().run( context, output); } } ); } } 1.3 +13 -11 jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/werkz/example.jelly Index: example.jelly =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/werkz/example.jelly,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- example.jelly 11 Jun 2002 22:59:22 -0000 1.2 +++ example.jelly 12 Jun 2002 06:07:29 -0000 1.3 @@ -3,29 +3,31 @@ - + - + - + - + - + - + - + - + - - - + + + + + -- To unsubscribe, e-mail: For additional commands, e-mail: