Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 62811 invoked from network); 12 Jun 2002 22:09:56 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jun 2002 22:09:56 -0000 Received: (qmail 13573 invoked by uid 97); 12 Jun 2002 22:10:00 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 13511 invoked by uid 97); 12 Jun 2002 22:09:59 -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 13490 invoked by uid 97); 12 Jun 2002 22:09:58 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Date: 12 Jun 2002 22:09:47 -0000 Message-ID: <20020612220947.45542.qmail@icarus.apache.org> From: werken@apache.org To: jakarta-commons-sandbox-cvs@apache.org Subject: cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz PostActionTag.java PreActionTag.java PostGoalTag.java PreGoalTag.java WerkzTagLibrary.java 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/12 15:09:47 Modified: jelly/src/java/org/apache/commons/jelly/tags/werkz PostGoalTag.java PreGoalTag.java WerkzTagLibrary.java Added: jelly/src/java/org/apache/commons/jelly/tags/werkz PostActionTag.java PreActionTag.java Log: Added pre/post-action callback tags. Edited javadocs some to get in line with Werkz vocabulary. Revision Changes Path 1.2 +4 -4 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PostGoalTag.java Index: PostGoalTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PostGoalTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PostGoalTag.java 12 Jun 2002 06:07:29 -0000 1.1 +++ PostGoalTag.java 12 Jun 2002 22:09:46 -0000 1.2 @@ -68,8 +68,8 @@ import org.apache.commons.logging.LogFactory; /** - * Implements a <postTarget> tag which provides a callback - * which is evaluated after a target has executed. + * Implements a <postGoal> tag which provides a callback + * which is evaluated after a goal has executed. * * @author James Strachan * @version $Revision$ @@ -93,7 +93,7 @@ new PostGoalCallback() { public void firePostGoal(Goal goal) throws Exception { // lets run the body - log.info( "Running post target: " + getName() ); + log.info( "Running post goal: " + getName() ); getBody().run( context, output); } } 1.3 +4 -4 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PreGoalTag.java Index: PreGoalTag.java =================================================================== RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PreGoalTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PreGoalTag.java 12 Jun 2002 17:09:41 -0000 1.2 +++ PreGoalTag.java 12 Jun 2002 22:09:46 -0000 1.3 @@ -68,8 +68,8 @@ import org.apache.commons.logging.LogFactory; /** - * Implements a <preTarget> tag which provides a callback - * which is evaluated before a target. + * Implements a <preGoal> tag which provides a callback + * which is evaluated before a goal. * * @author James Strachan * @version $Revision$ @@ -93,7 +93,7 @@ new PreGoalCallback() { public void firePreGoal(Goal goal) throws Exception { // lets run the body - log.debug( "Running pre target: " + getName() ); + log.debug( "Running pre goal: " + getName() ); getBody().run( context, output); } } 1.3 +2 -0 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.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WerkzTagLibrary.java 12 Jun 2002 06:07:29 -0000 1.2 +++ WerkzTagLibrary.java 12 Jun 2002 22:09:46 -0000 1.3 @@ -87,6 +87,8 @@ registerTag("goal", GoalTag.class); registerTag("preGoal", PreGoalTag.class); registerTag("postGoal", PostGoalTag.class); + registerTag("preAction", PreActionTag.class); + registerTag("postAction", PostActionTag.class); registerTag("attain", AttainTag.class); registerTag("attainGoal", AttainGoalTag.class); } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PostActionTag.java Index: PostActionTag.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.PostActionCallback; 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 <postAction> tag which provides a callback * which is evaluated after an action. * * @author James Strachan * @version $Revision: 1.1 $ */ public class PostActionTag extends CallbackTagSupport { public PostActionTag() { } // 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()).addPostActionCallback( new PostActionCallback() { public void firePostAction(Goal goal) throws Exception { // lets run the body log.info( "Running post action: " + getName() ); getBody().run( context, output); } } ); } } 1.1 jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/werkz/PreActionTag.java Index: PreActionTag.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.PreActionCallback; 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 <preAction> tag which provides a callback * which is evaluated before an action. * * @author James Strachan * @version $Revision: 1.1 $ */ public class PreActionTag extends CallbackTagSupport { public PreActionTag() { } // 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()).addPreActionCallback( new PreActionCallback() { public void firePreAction(Goal goal) throws Exception { // lets run the body log.debug( "Running pre action: " + getName() ); getBody().run( context, output); } } ); } } -- To unsubscribe, e-mail: For additional commands, e-mail: