You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by gl...@apache.org on 2002/12/01 19:52:46 UTC
cvs commit: jakarta-taglibs/bsf/xml bsf.xml intro.xml
glenn 2002/12/01 10:52:45
Modified: bsf build.xml
bsf/doc/conf web.xml
bsf/examples/web temps.jsp
bsf/src/org/apache/taglibs/bsf expression.java
scriptlet.java
bsf/xml intro.xml
Added: bsf/xml bsf.xml
Log:
Migrate bsf to common taglibs build and update for BSF 2.3
Revision Changes Path
1.10 +18 -184 jakarta-taglibs/bsf/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/bsf/build.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- build.xml 22 Oct 2002 02:40:36 -0000 1.9
+++ build.xml 1 Dec 2002 18:52:45 -0000 1.10
@@ -1,195 +1,29 @@
-<!-- ANT Build Script for the "bsf" Custom Tag Library -->
-<!-- $Id$ -->
-<project name="bsf" default="main" basedir=".">
+<?xml version="1.0"?>
- <property file="../build.properties"/>
- <property name="classpath" value="${servlet.jar}:${bsf.jar}"/>
+<!DOCTYPE project [
+ <!ENTITY common SYSTEM "file:../common.xml">
+]>
- <!-- ******************** Adjustable Properties *********************** -->
+<project name="bsf" default="main">
- <!--
+ <property file="../build.properties"/>
+ <property name="classpath" value="${servlet.jar}:${bsf.jar}"/>
- The following property values should be examined and customized
- for each custom tag library subproject.
+ <property name="checkRequirements.pre" value="checkRequirements.pre"/>
+ <property name="examples.pre" value="examples.pre"/>
- taglib.name Base name of this tag library subproject.
-
- -->
-
- <property name="taglib.name" value="bsf"/>
-
-
- <!-- ****************** Project Standard Properties ******************* -->
-
- <!--
-
- The following property values reflect the standard directory
- organization for the jakarta-taglibs project, and should not
- be changed or overridden.
-
- build.dir Base directory for build targets
- dist.dir Base directory for distribution targets
- taglibs.xsl Taglibs stylesheet
-
- -->
-
- <property name="build.dir" value="../build"/>
- <property name="dist.dir" value="../dist"/>
- <property name="taglibs.xsl" value="../src/doc/stylesheets/taglibs.xsl"/>
-
- <!-- *********************** Default Properties ********************** -->
-
- <!--
-
- The following property values reflect the recommended directory
- structure for each custom tag library subproject. You should only
- need to adjust or override them if you use a different organization.
-
- conf.src Library configuration source directory
- doc.src Documentation app source directory
- examples.src Examples app source directory
- library.src Library Java source directory
-
- -->
-
- <property name="conf.src" value="conf"/>
- <property name="doc.src" value="doc"/>
- <property name="examples.src" value="examples"/>
- <property name="library.src" value="src"/>
- <property name="lib.src" value="lib"/>
-
-
- <!-- ********************* Derived Properties ************************* -->
-
- <!--
-
- These property values are derived from the previously defined values,
- and should not normally be overridden from the command line.
-
- build.doc Target directory for documentation app
- build.examples Target directory for examples app
- build.library Target directory for tag library
- dist.doc Destination WAR for documentation app
- dist.examples Destination WAR for examples app
- dist.library Destination JAR for tag library
- dist.tld Destination TLD file for tag library
-
- -->
-
- <property name="build.doc" value="${build.dir}/${taglib.name}/${taglib.name}-doc"/>
- <property name="build.examples" value="${build.dir}/${taglib.name}/${taglib.name}-examples"/>
- <property name="build.library" value="${build.dir}/${taglib.name}/${taglib.name}"/>
- <property name="dist.doc" value="${dist.dir}/${taglib.name}/${taglib.name}-doc.war"/>
- <property name="dist.examples" value="${dist.dir}/${taglib.name}/${taglib.name}-examples.war"/>
- <property name="dist.library" value="${dist.dir}/${taglib.name}/taglibs-${taglib.name}.jar"/>
- <property name="dist.tld" value="${dist.dir}/${taglib.name}/taglibs-${taglib.name}.tld"/>
- <property name="taglibs.doc" value="${dist.dir}/doc/doc/${taglib.name}-doc"/>
-
-
- <!-- ********************** Destination Preparation ********************* -->
-
- <target name="prepare">
- <!-- Set up build directories -->
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.doc}"/>
- <mkdir dir="${build.doc}/WEB-INF"/>
- <mkdir dir="${build.doc}/WEB-INF/classes"/>
- <mkdir dir="${build.doc}/WEB-INF/lib"/>
- <mkdir dir="${build.examples}"/>
- <mkdir dir="${build.examples}/WEB-INF"/>
- <mkdir dir="${build.examples}/WEB-INF/classes"/>
- <mkdir dir="${build.examples}/WEB-INF/lib"/>
- <mkdir dir="${build.library}"/>
- <mkdir dir="${build.library}/META-INF"/>
- <!-- Set up distribution directory -->
- <mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.dir}/${taglib.name}"/>
- </target>
-
-
- <!-- **************** Compile Tag Library Components ******************** -->
-
- <!-- Compile the documentation application -->
- <target name="documentation" depends="prepare">
- <copy todir="${build.doc}/WEB-INF">
- <fileset dir="${doc.src}/conf"/>
- </copy>
- <!-- intro.xml isn't part of the documentation application,
- this is just a handy place to build it for the web site. -->
- <style in="xml/intro.xml"
- destdir="${build.doc}"
- out="${build.doc}/intro.html"
- style="${taglibs.xsl}">
- <param name="prefix" expression="../../"/>
- </style>
- <copy todir="${build.doc}">
- <fileset dir="${doc.src}/web">
- <include name="**/*.html"/>
- </fileset>
- </copy>
- </target>
-
- <!-- Compile the examples application -->
- <target name="examples" depends="library-dist">
- <copy todir="${build.examples}/WEB-INF">
- <fileset dir="${examples.src}/conf"/>
- </copy>
- <copy todir="${build.examples}">
- <fileset dir="${examples.src}/web"/>
- </copy>
- <copy file="${dist.tld}"
- tofile="${build.examples}/WEB-INF/taglibs-${taglib.name}.tld"/>
- <copy file="${dist.library}"
- tofile="${build.examples}/WEB-INF/lib/taglibs-${taglib.name}.jar"/>
- </target>
-
- <!-- Compile the tag library itself -->
- <target name="library" depends="prepare">
- <copy file="${conf.src}/taglib.tld"
- tofile="${build.library}/META-INF/taglib.tld"/>
- <javac srcdir="${library.src}" destdir="${build.library}"
- classpath="${classpath}" debug="on"/>
- </target>
-
- <!-- Compile the library as well as the associated applications -->
- <target name="main" depends="library,documentation,examples"/>
-
-
- <!-- ******************* Create Distribution Files ********************** -->
-
- <!-- Create the documentation application WAR file -->
- <target name="documentation-dist" depends="documentation">
- <jar jarfile="${dist.doc}" basedir="${build.doc}" excludes="intro.html"/>
- <mkdir dir="${taglibs.doc}"/>
- <copy todir="${taglibs.doc}">
- <fileset dir="${build.doc}">
- <exclude name="WEB-INF"/>
- </fileset>
- </copy>
- </target>
-
- <!-- Create the examples application WAR file -->
- <target name="examples-dist" depends="examples">
- <jar jarfile="${dist.examples}" basedir="${build.examples}"/>
+ <target name="checkRequirements.pre">
+ <antcall target="checkRequiredFile">
+ <param name="file" value="${bsf.jar}"/>
+ <param name="fail.message" value="a jar file containing the IBM BSF classes is required to compile the bsf taglib. please define the property bsf.jar in your build.properties file and ensure that the file exists"/>
+ </antcall>
</target>
- <!-- Create the library distribution files -->
- <target name="library-dist" depends="library">
- <jar jarfile="${dist.library}" basedir="${build.library}"/>
- <copy file="${conf.src}/taglib.tld" tofile="${dist.tld}"/>
+ <target name="examples.pre">
+ <copy file="${bsf.jar}"
+ todir="${build.examples}/WEB-INF/lib"/>
</target>
- <!-- Create the entire set of distribution files -->
- <target name="dist" depends="library-dist,examples-dist,documentation-dist"/>
-
-
-
- <!-- ************************ Utility Commands ************************** -->
-
- <!-- Delete output directories and files so we can build from scratch -->
- <target name="clean">
- <delete dir="${build.dir}/${taglib.name}"/>
- <delete dir="${dist.dir}/${taglib.name}"/>
- </target>
+ &common;
</project>
1.4 +14 -16 jakarta-taglibs/bsf/doc/conf/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/bsf/doc/conf/web.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- web.xml 22 Oct 2002 02:40:36 -0000 1.3
+++ web.xml 1 Dec 2002 18:52:45 -0000 1.4
@@ -1,16 +1,14 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
- "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
-
-<web-app>
- <taglib>
- <taglib-uri>
- BSFTAGS
- </taglib-uri>
- <taglib-location>
- /WEB-INF/taglibs-tld/xmltags.tld
- </taglib-location>
- </taglib>
-</web-app>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
+ "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
+
+<web-app>
+
+ <description>
+ Documentation for the "bsf" custom tag library,
+ from the JAKARTA-TAGLIBS project.
+ </description>
+
+</web-app>
1.2 +2 -1 jakarta-taglibs/bsf/examples/web/temps.jsp
Index: temps.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/bsf/examples/web/temps.jsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- temps.jsp 23 May 2000 23:16:47 -0000 1.1
+++ temps.jsp 1 Dec 2002 18:52:45 -0000 1.2
@@ -1,5 +1,6 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
-<%@ taglib uri="http://jakarta.apache.org/taglibs/bsf-2.0" prefix="bsf" %>
+<%@ taglib uri="http://jakarta.apache.org/taglibs/bsf-1.0" prefix="bsf" %>
<head>
<title>Temperature Table</title>
</head>
1.2 +1 -1 jakarta-taglibs/bsf/src/org/apache/taglibs/bsf/expression.java
Index: expression.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/bsf/src/org/apache/taglibs/bsf/expression.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- expression.java 23 May 2000 23:16:47 -0000 1.1
+++ expression.java 1 Dec 2002 18:52:45 -0000 1.2
@@ -4,7 +4,7 @@
import javax.servlet.jsp.tagext.* ;
import java.io.IOException ;
-import com.ibm.bsf.* ;
+import org.apache.bsf.* ;
public class expression implements BodyTag
{
1.2 +1 -1 jakarta-taglibs/bsf/src/org/apache/taglibs/bsf/scriptlet.java
Index: scriptlet.java
===================================================================
RCS file: /home/cvs/jakarta-taglibs/bsf/src/org/apache/taglibs/bsf/scriptlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- scriptlet.java 23 May 2000 23:16:47 -0000 1.1
+++ scriptlet.java 1 Dec 2002 18:52:45 -0000 1.2
@@ -4,7 +4,7 @@
import javax.servlet.jsp.tagext.* ;
import java.io.IOException ;
-import com.ibm.bsf.* ;
+import org.apache.bsf.* ;
public class scriptlet implements BodyTag
{
1.3 +35 -4 jakarta-taglibs/bsf/xml/intro.xml
Index: intro.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/bsf/xml/intro.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- intro.xml 22 Jul 2001 15:32:12 -0000 1.2
+++ intro.xml 1 Dec 2002 18:52:45 -0000 1.3
@@ -13,17 +13,36 @@
<p>The Bean Scripting Framework (BSF) is an architecture for incorporating
scripting into Java applications and applets. Scripting languages such
- as Netscape Rhino (Javascript), VBScript, Perl, Tcl, Python, NetRexx and
- Rexx are commonly used to augment an application's function or to script
+ as Netscape Rhino (Javascript), Tcl, Python, NetRexx, Ruby, JudoScript,
+ and XSLT are commonly used to augment an application's function or to script
together a set of application components to form an application.</p>
+ <p>More information about the Bean Scripting Framework can be found at the
+ <a href="http://jakarta.apache.org/bsf/">Apache Jakarta BSF</a> project.</p>
+
+ </section>
+
+ <section name="News" href="News">
+ <news>
+ <newsitem date="12/1/2002">
+ Updated for BSF Version 2.3 Release Candidate 1.
+ </newsitem>
+ </news>
</section>
<section name="Documentation" href="Documentation">
<p>For more information about the BSF Tag Library, look at the on-line documentation:</p>
<ul>
- <li>View the <a href="index.html">BSF Taglib Documentation</a></li>
+ <!--
+ <li>
+ View the current release <a href="bsf-1.0/index.html">
+ BSF 1.0 Taglib Documentation</a></li>
+ -->
+ <li>
+ View the development version of the <a href="index.html">
+ BSF Taglib Documentation</a>
+ </li>
</ul>
<p>For information on how to use the distributions, look at the following documentation:</p>
@@ -39,7 +58,18 @@
<p>A binary download of the BSF Tag Library is available</p>
<ul>
- <li>Download <a href="http://jakarta.apache.org/builds/jakarta-taglibs/nightly/projects/bsf/">BSF Tag Library</a></li>
+ <!--
+ <li>
+ Download the BSF Tag Library
+ <a href="http://jakarta.apache.org/builds/jakarta-taglibs/releases/bsf/">
+ 1.0 Release</a>
+ </li>
+ -->
+ <li>
+ Download the BSF Tag Library
+ <a href="http://jakarta.apache.org/builds/jakarta-taglibs/nightly/projects/bsf/">
+ nightly development build</a>
+ </li>
</ul>
<p>The following distributions are also available for download:</p>
@@ -57,6 +87,7 @@
<li>Doug Davis</li>
<li>Sam Ruby</li>
<li>Craig R. McClanahan</li>
+ <li>Glenn L. Nielsen</li>
</ul>
</section>
1.1 jakarta-taglibs/bsf/xml/bsf.xml
Index: bsf.xml
===================================================================
<?xml version="1.0" ?>
<!-- Change all instances of {taglib-name} with the jakarta-taglib
name for this tag library.
Change all instances of {display-name} with the name to use
for things such as titles in the tag library documentation.
Change <prefix>foo</prefix> below to a short prefix for this
tag library.
-->
<document url="./bsf.xml">
<!-- More properties can be added. Good place to stick loose
data needed elsewhere. -->
<properties>
<!-- The name here is used in the HTML <meta name="author"...> tag -->
<author>Doug Davis</author>
<author>Sam Ruby</author>
<author>Craig R. McClanahan</author>
</properties>
<!-- The following defines elements uses both to create the taglib
documentation and the tag library descriptor .tld file. The
elements used are those from the JSP 1.2 TLD DTD and special
elements used when creating the tagib documentation. Although
the JSP1.2 TLD DTD is used, this document can be used to
generate both a JSP 1.1 and a JSP 1.2 TLD.
-->
<taglib>
<!-- The following elements are from the JSP 1.2 TLD DTD -->
<!-- Version number of this tagib -->
<tlib-version>1.0</tlib-version>
<!-- Minimum version of JSP spec required -->
<jsp-version>1.1</jsp-version>
<!-- jakarta-taglib name of this tag library -->
<short-name>bsf</short-name>
<!-- URI of taglib -->
<uri>http://jakarta.apache.org/taglibs/bsf-1.0</uri>
<!-- The name to use in titles, etc. for the taglib -->
<display-name>BSF Tag library</display-name>
<!-- JSP 1.2 tag library DTD only, not used for generating
documentation.
<large-icon></large-icon>
<small-icon></small-icon>
-->
<!-- Used for generating Overview section of HTML documentation
and for the description element for a JSP 1.2 TLD.
Enter information here as straight XHTML paragraphs. Inside the
paragraphs regular XHTML can be used (but an external CSS is
encouraged). The information is copied into the generated HTML doc,
and the <p> elements are essential for that. -->
<description>
<p>The BSF (Bean Scripting Framework) Tag Library enables JSP
writers to write the code portion of their JSP in languages other
than Java.</p>
<p>For a much more detailed description of BSF itself see
<a href="http://jakarta.apache.org/bsf/">
http://jakarta.apache.org/bsf/</a>,
but here are a few key excerpts:</p>
<p>
The <strong>Bean Scripting Framework (BSF)</strong> is a set of
Java classes which provides scripting language support within
Java applications, and access to Java objects and methods from
scripting languages.</p>
<p>
The standard set of JSP implicit objects is available within BSF.
These implicit objects must be used for input and output with respect
to the generated page, since the scripting languages do not have any
awareness of having been called within a JSP. For example, in order to
print a line of text into the page generated by the JSP, one must use the
<code>println()</code> method of the <code>out</code> implicit object.
</p>
<p>
BSF supports several scripting languages currently:
<ul>
<li>Javascript (using Rhino ECMAScript, from the Mozilla project)</li>
<li>Python (using either Jython or JPython)</li>
<li>Tcl (using Jacl)</li>
<li>NetRexx (an extension of the IBM REXX scripting language in Java)</li>
<li>XSLT Stylesheets (as a component of Apache XML project's Xalan and Xerces)</li>
</ul>
</p>
<p>In addition, the following languages are supported with their own BSF
engines:
<ul>
<li>Java (using BeanShell, from the BeanShell project)</li>
<li>JRuby</li>
<li>JudoScript</li>
</ul>
</p>
<p>Information on where to obtain scripting languages for use with BSF is
available on the <a href="http://jakarta.apache.org/bsf/projects.html">
BSF Related Projects</a> page.</p>
<p><font size="3">The BSF taglib also allows JSP writers to use
multiple scripting languages within the same JSP document.</font></p>
</description>
<!-- The following elements are for JSP 1.2 tag libraries only,
and are not used for generating documentation yet.
<validator>
</validator>
<listener>
</listener>
-->
<!-- The taglib-location is used to fill in the web.xml configuration
information in the HTML doc. -->
<taglib-location>/WEB-INF/bsf.tld</taglib-location>
<!-- The prefix is used to fill in the taglib directive
configuration information in the HTML doc. -->
<prefix>bsf</prefix>
<!-- This date must be straight text and is copied right into
the "Requirements" section of the HTML doc. -->
<requirements-info>
This custom tag library requires no software other than a servlet container
that supports the JavaServer Pages Specification, version 1.1 or higher.
And Version 2.2 of the <a href="http://jakarta.apache.org/bsf/">
Bean Scripting Framework</a>.
</requirements-info>
<!-- The tagtoc element provides the ability to categorize the
tags in the tag library. There must be at least one tagtoc.
1 .. N tags can be nested within a tagtoc.
-->
<tagtoc name="BSF Tags">
<tag>
<name>expression</name>
<tag-class>org.apache.taglibs.bsf.expression</tag-class>
<body-content>tagdependent</body-content>
<display-name>expression</display-name>
<description>
This tag is the BSF taglib equivalent of the "<%="
JSP tag.
</description>
<!-- The next three non-standard elements are used to inform the relevant
sections of the HTML doc. See, for example, the BSF
taglib docs for examples of the output. -->
<!-- One line summary of what tag does for Tag Summary section -->
<summary>Run a BSF expression.</summary>
<!-- Version of taglib when this tag became available,
deprecated is a possible value. -->
<availability>1.0</availability>
<!-- Any restrictions on use of the tag -->
<attribute>
<name>language</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
Defines the scripting language used within the body of the tag.
</description>
<availability>1.0</availability>
</attribute>
<!-- The entire example section is for usage examples that you want to
have added to the HTML doc under "Example" for each tag. The
example section is also included with a JSP 1.2 TLD. The
contents of these elements are rendered into a simple form of
syntax highlighting by the XSL sheet. Multiple usage sections
are allowed, and each will be display as a separate example
in the resultant HTML. -->
<example>
<usage>
<!--Enter a JSP comment without the opening and closing tags.
Those will be added by the XSL. Put no HTML mark-up in here.
Currently, only one comment per usage section is supported. -->
<comment>
Ouput the current date.
</comment>
<!-- The code element is for an example of using the tag. I
normally put these in CDATA sections so that the XSL
transform to HTML will turn the angle brackets into the
appropriate < and > entities automatically. Only
one code element per usage element is supported.
The resultant HTML is formatted and colorized. -->
<code>
<![CDATA[<bsf:expression language="perlscript">
CreateBean("java.util.Date")
</bsf:expression>]]>
</code>
</usage>
</example>
</tag>
<tag>
<name>scriptlet</name>
<tag-class>org.apache.taglibs.bsf.scriptlet</tag-class>
<body-content>tagdependent</body-content>
<display-name>scriptlet</display-name>
<description>
This tag is the BSF taglib equivalent of the "<%"^M
JSP tag.
</description>
<summary>
Run a BSF script.
</summary>
<availability>1.0</availability>
<restrictions>
</restrictions>
<attribute>
<name>language</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
<description>
Defines the scripting language used within the body of the tag.
</description>
<availability>1.0</availability>
</attribute>
<example>
<usage>
<comment>
Print Hello World using tcl as the scripting language.
</comment>
<code>
<![CDATA[<bsf:scriptlet language="tcl">
$out println "Hello world"
</bsf:scriptlet>]]>
</code>
</usage>
</example>
</tag>
</tagtoc>
</taglib>
<revision release="1.0" date="12/1/2002">
<description>1.0 Release</description>
</revision>
</document>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>