You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/03/07 04:57:13 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/pnuts example.jelly

jstrachan    02/03/06 19:57:13

  Modified:    jelly    build.properties.sample build.xml
               jelly/src/java/org/apache/commons/jelly jelly.properties
               jelly/src/java/org/apache/commons/jelly/tags/bsf
                        BSFExpression.java BSFExpressionFactory.java
                        BSFTagLibrary.java
  Added:       jelly/src/java/org/apache/commons/jelly/tags/bsf
                        JPythonTagLibrary.java JavaScriptTagLibrary.java
                        PNutsTagLibrary.java
               jelly/src/test/org/apache/commons/jelly/javascript
                        example.jelly
               jelly/src/test/org/apache/commons/jelly/pnuts example.jelly
  Log:
  Added JavaScript, JPython and PNuts core tag libraries. They kinda work, at least the PNuts one does, though more investigation is required to map BSF beans properly to Jelly scopes. Right now there's a minor hack in there to get it to work. Also for some wierd reason JavaScript (Rhino) doesn't see declared beans.
  
  Revision  Changes    Path
  1.5       +6 -0      jakarta-commons-sandbox/jelly/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/build.properties.sample,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- build.properties.sample	7 Mar 2002 02:46:03 -0000	1.4
  +++ build.properties.sample	7 Mar 2002 03:57:12 -0000	1.5
  @@ -30,3 +30,9 @@
   #
   # beanshell.jar - go to http://www.beanshell.org
   beanshell.jar=/java/beanshell/beanshell.jar
  +
  +
  +# for pnuts scripts the following jar is required
  +# http://javacenter.sun.co.jp/pnuts/index.html
  +pnuts.jar=/java/pnuts/pnuts.jar
  +
  
  
  
  1.9       +26 -1     jakarta-commons-sandbox/jelly/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/build.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- build.xml	7 Mar 2002 02:46:03 -0000	1.8
  +++ build.xml	7 Mar 2002 03:57:12 -0000	1.9
  @@ -3,7 +3,7 @@
   
   <!--
           "Jelly" component of the Jakarta Commons Subproject
  -        $Id: build.xml,v 1.8 2002/03/07 02:46:03 jstrachan Exp $
  +        $Id: build.xml,v 1.9 2002/03/07 03:57:12 jstrachan Exp $
   -->
   
   
  @@ -101,6 +101,7 @@
       <pathelement location="${jaxp.parser.jar}"/>
       <pathelement location="${dom4j.jar}"/>
       <pathelement location="${bsf.jar}"/>
  +    <pathelement location="${pnuts.jar}"/>
       <pathelement location="${rhino.jar}"/>
       <pathelement location="${tools.jar}"/>
       <pathelement location="${beanshell.jar}"/>
  @@ -124,6 +125,7 @@
       <pathelement location="${jaxp.parser.jar}"/>
       <pathelement location="${dom4j.jar}"/>
       <pathelement location="${bsf.jar}"/>
  +    <pathelement location="${pnuts.jar}"/>
       <pathelement location="${rhino.jar}"/>
       <pathelement location="${tools.jar}"/>
       <pathelement location="${beanshell.jar}"/>
  @@ -169,6 +171,10 @@
                  classpathref="compile.classpath"
                  classname="org.python.util.PythonInterpreter"/>
   
  +    <available property="pnuts.present"
  +               classpathref="compile.classpath"
  +               classname="pnuts.ext.PnutsBSFEngine"/>
  +
       <available property="rhino.present"
                  classpathref="compile.classpath"
                  classname="org.mozilla.javascript.Scriptable"/>
  @@ -189,6 +195,9 @@
     <target name="checkRhino" unless="rhino.present">
       <echo message="Warning: Rhino dependencies were not resolved."/>
     </target>
  +  <target name="checkPNuts" unless="pnuts.present">
  +    <echo message="Warning: PNuts dependencies were not resolved."/>
  +  </target>
     <target name="checkDependencies" 
             depends="checkBsf, checkBeanShell, checkJPython, checkRhino"
             description="Checks for dependend (but non-essential) JARs are present"/>
  @@ -372,6 +381,22 @@
       <java classname="org.apache.commons.jelly.Jelly" fork="yes">
         <classpath refid="test.classpath"/>
         <arg value="src/test/org/apache/commons/jelly/show_properties.jelly"/> 
  +    </java>
  +   </target>
  +
  +   <target name="demo.pnuts" depends="compile, checkPNuts" 
  +      description="Runs a pnuts demo which displays system properties">
  +    <java classname="org.apache.commons.jelly.Jelly" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <arg value="src/test/org/apache/commons/jelly/pnuts/example.jelly"/> 
  +    </java>
  +   </target>
  +
  +   <target name="demo.javascript" depends="compile, checkRhino" 
  +      description="Runs a javascript demo which displays system properties">
  +    <java classname="org.apache.commons.jelly.Jelly" fork="yes">
  +      <classpath refid="test.classpath"/>
  +      <arg value="src/test/org/apache/commons/jelly/javascript/example.jelly"/> 
       </java>
      </target>
   
  
  
  
  1.2       +6 -3      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/jelly.properties
  
  Index: jelly.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/jelly.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jelly.properties	7 Mar 2002 02:46:03 -0000	1.1
  +++ jelly.properties	7 Mar 2002 03:57:12 -0000	1.2
  @@ -1,4 +1,7 @@
   # register the default tag libraries with an abbreviated name
  -beanshell = org.apache.commons.jelly.tags.beanshell.BeanShellTagLibrary
  -bsf       = org.apache.commons.jelly.tags.bsf.BSFTagLibrary
  -xml       = org.apache.commons.jelly.tags.xml.XMLTagLibrary
  +beanshell   = org.apache.commons.jelly.tags.beanshell.BeanShellTagLibrary
  +bsf         = org.apache.commons.jelly.tags.bsf.BSFTagLibrary
  +javascript  = org.apache.commons.jelly.tags.bsf.JavaScriptTagLibrary
  +jpython     = org.apache.commons.jelly.tags.bsf.JPythonTagLibrary
  +pnuts       = org.apache.commons.jelly.tags.bsf.PNutsTagLibrary
  +xml         = org.apache.commons.jelly.tags.xml.XMLTagLibrary
  
  
  
  1.2       +19 -6     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java
  
  Index: BSFExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BSFExpression.java	7 Mar 2002 02:46:04 -0000	1.1
  +++ BSFExpression.java	7 Mar 2002 03:57:12 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java,v 1.1 2002/03/07 02:46:04 jstrachan Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/07 02:46:04 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java,v 1.2 2002/03/07 03:57:12 jstrachan Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/03/07 03:57:12 $
    *
    * ====================================================================
    *
  @@ -57,11 +57,14 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: BSFExpression.java,v 1.1 2002/03/07 02:46:04 jstrachan Exp $
  + * $Id: BSFExpression.java,v 1.2 2002/03/07 03:57:12 jstrachan Exp $
    */
   package org.apache.commons.jelly.tags.bsf;
   
   import com.ibm.bsf.BSFEngine;
  +import com.ibm.bsf.BSFManager;
  +
  +import java.util.Iterator;
   
   import org.apache.commons.jelly.Context;
   import org.apache.commons.jelly.expression.ExpressionSupport;
  @@ -73,7 +76,7 @@
   /** Represents a BSF expression
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.1 $
  +  * @version $Revision: 1.2 $
     */
   public class BSFExpression extends ExpressionSupport {
   
  @@ -85,13 +88,16 @@
       
       /** The BSF Engine to evaluate expressions */
       private BSFEngine engine;
  +    /** The BSF Manager to evaluate expressions */
  +    private BSFManager manager;
       
       /** The adapter to BSF's ObjectRegistry that uses the Context */
       private ContextRegistry registry;
       
  -    public BSFExpression(String text, BSFEngine engine, ContextRegistry registry) {
  +    public BSFExpression(String text, BSFEngine engine, BSFManager manager, ContextRegistry registry) {
           this.text = text;
           this.engine = engine;
  +        this.manager = manager;
           this.registry = registry;
       }
   
  @@ -104,7 +110,14 @@
           // (and so create a BSFManager for a context)
           synchronized (registry) {
               registry.setContext(context);
  +            
               try {
  +                // XXXX: hack - there must be a better way!!!
  +                for ( Iterator iter = context.getVariableNames(); iter.hasNext(); ) {
  +                    String name = (String) iter.next();
  +                    Object value = context.getVariable( name );
  +                    manager.declareBean( name, value, value.getClass() );
  +                }
                   return engine.eval( text, -1, -1, text );
               }
               catch (Exception e) {
  
  
  
  1.2       +6 -24     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpressionFactory.java
  
  Index: BSFExpressionFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpressionFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BSFExpressionFactory.java	7 Mar 2002 02:46:04 -0000	1.1
  +++ BSFExpressionFactory.java	7 Mar 2002 03:57:12 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpressionFactory.java,v 1.1 2002/03/07 02:46:04 jstrachan Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/07 02:46:04 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFExpressionFactory.java,v 1.2 2002/03/07 03:57:12 jstrachan Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/03/07 03:57:12 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: BSFExpressionFactory.java,v 1.1 2002/03/07 02:46:04 jstrachan Exp $
  + * $Id: BSFExpressionFactory.java,v 1.2 2002/03/07 03:57:12 jstrachan Exp $
    */
   package org.apache.commons.jelly.tags.bsf;
   
  @@ -76,7 +76,7 @@
   /** Represents a factory of BSF expressions
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.1 $
  +  * @version $Revision: 1.2 $
     */
   public class BSFExpressionFactory implements ExpressionFactory {
   
  @@ -131,7 +131,7 @@
       // ExpressionFactory interface
       //------------------------------------------------------------------------- 
       public Expression createExpression(String text) throws Exception {
  -        return new BSFExpression( text, getBSFEngine(), registry );
  +        return new BSFExpression( text, getBSFEngine(), getBSFManager(), registry );
       }
       
       // Implementation methods
  @@ -145,24 +145,6 @@
       /** Factory method */
       protected BSFManager createBSFManager() {
           BSFManager answer = new BSFManager();
  -        
  -        // sets a temporary directory
  -        answer.setTempDir( "/tmp" );
  -/*        
  -        this fails on windows...
  - 
  -        try {
  -            File file = File.createTempFile( "foo", "bar" );
  -            File tmpDirectory = file.getParentFile();
  -            if ( tmpDirectory != null ) {
  -                log.debug( "Setting scripting temporary directory to be: " + tmpDirectory );
  -                answer.setTempDir( tmpDirectory.getAbsolutePath() );
  -            }
  -        }
  -        catch (Exception e) {
  -            log.error( "Failed to set temporary directory for BSF manager" );
  -        }
  -*/
           return answer;
       }
   }
  
  
  
  1.2       +11 -7     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFTagLibrary.java
  
  Index: BSFTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFTagLibrary.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BSFTagLibrary.java	7 Mar 2002 02:46:04 -0000	1.1
  +++ BSFTagLibrary.java	7 Mar 2002 03:57:12 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFTagLibrary.java,v 1.1 2002/03/07 02:46:04 jstrachan Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/03/07 02:46:04 $
  + * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/BSFTagLibrary.java,v 1.2 2002/03/07 03:57:12 jstrachan Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/03/07 03:57:12 $
    *
    * ====================================================================
    *
  @@ -57,7 +57,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    * 
  - * $Id: BSFTagLibrary.java,v 1.1 2002/03/07 02:46:04 jstrachan Exp $
  + * $Id: BSFTagLibrary.java,v 1.2 2002/03/07 03:57:12 jstrachan Exp $
    */
   package org.apache.commons.jelly.tags.bsf;
   
  @@ -68,13 +68,17 @@
   /** Describes the Taglib. This class could be generated by XDoclet
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.1 $
  +  * @version $Revision: 1.2 $
     */
   public class BSFTagLibrary extends CoreTagLibrary {
   
  -    private ExpressionFactory expressionFactory = new BSFExpressionFactory();
  +    private BSFExpressionFactory expressionFactory = new BSFExpressionFactory();
       
  -        /** Allows derived tag libraries to use their own factory */
  +    public void setLanguage(String language) {
  +        expressionFactory.setLanguage(language);
  +    }
  +    
  +    /** Allows derived tag libraries to use their own factory */
       protected ExpressionFactory getExpressionFactory() {
           return expressionFactory;
       }
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/JPythonTagLibrary.java
  
  Index: JPythonTagLibrary.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/JPythonTagLibrary.java,v 1.1 2002/03/07 03:57:12 jstrachan Exp $
   * $Revision: 1.1 $
   * $Date: 2002/03/07 03:57:12 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 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", "Commons", 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
   * <http://www.apache.org/>.
   * 
   * $Id: JPythonTagLibrary.java,v 1.1 2002/03/07 03:57:12 jstrachan Exp $
   */
  package org.apache.commons.jelly.tags.bsf;
  
  /** Describes the Taglib. This class could be generated by XDoclet
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class JPythonTagLibrary extends BSFTagLibrary {
  
      public JPythonTagLibrary() {
          setLanguage( "jpython" );
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/JavaScriptTagLibrary.java
  
  Index: JavaScriptTagLibrary.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/JavaScriptTagLibrary.java,v 1.1 2002/03/07 03:57:12 jstrachan Exp $
   * $Revision: 1.1 $
   * $Date: 2002/03/07 03:57:12 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 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", "Commons", 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
   * <http://www.apache.org/>.
   * 
   * $Id: JavaScriptTagLibrary.java,v 1.1 2002/03/07 03:57:12 jstrachan Exp $
   */
  package org.apache.commons.jelly.tags.bsf;
  
  /** Describes the Taglib. This class could be generated by XDoclet
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class JavaScriptTagLibrary extends BSFTagLibrary {
  
      public JavaScriptTagLibrary() {
          setLanguage( "javascript" );
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/PNutsTagLibrary.java
  
  Index: PNutsTagLibrary.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/bsf/PNutsTagLibrary.java,v 1.1 2002/03/07 03:57:12 jstrachan Exp $
   * $Revision: 1.1 $
   * $Date: 2002/03/07 03:57:12 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 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", "Commons", 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
   * <http://www.apache.org/>.
   * 
   * $Id: PNutsTagLibrary.java,v 1.1 2002/03/07 03:57:12 jstrachan Exp $
   */
  package org.apache.commons.jelly.tags.bsf;
  
  import com.ibm.bsf.BSFManager;
  
  /** Describes the Taglib. This class could be generated by XDoclet
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision: 1.1 $
    */
  public class PNutsTagLibrary extends BSFTagLibrary {
  
      public PNutsTagLibrary() {
          BSFManager.registerScriptingEngine(
              "pnuts", 
              "pnuts.ext.PnutsBSFEngine", 
              new String[]{"pnut"}
          );
          setLanguage( "pnuts" );
      }
      
  }
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/javascript/example.jelly
  
  Index: example.jelly
  ===================================================================
  <?xml version="1.0"?>
  <j:jelly xmlns:j="jelly:javascript">
    <j:forEach var="arg" items="args"><j:expr value="arg"/> </j:forEach>
  </j:jelly>
  
  
  1.1                  jakarta-commons-sandbox/jelly/src/test/org/apache/commons/jelly/pnuts/example.jelly
  
  Index: example.jelly
  ===================================================================
  <?xml version="1.0"?>
  <j:jelly xmlns:j="jelly:pnuts">
    <j:forEach var="arg" items="args"><j:expr value="arg"/> </j:forEach>
  </j:jelly>
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>