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 2001/07/14 01:18:12 UTC

cvs commit: jakarta-taglibs/page/xml page.xml

glenn       01/07/13 16:18:12

  Modified:    page     build.xml
  Added:       page/xml page.xml
  Log:
  Convert to new build
  
  Revision  Changes    Path
  1.7       +10 -213   jakarta-taglibs/page/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/page/build.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- build.xml	2001/07/01 20:08:25	1.6
  +++ build.xml	2001/07/13 23:18:12	1.7
  @@ -1,220 +1,17 @@
  -<!-- ANT Build Script for the "page" Custom Tag Library -->
  -<project name="page" default="main" basedir=".">
  +<?xml version="1.0"?>
   
  -    <!-- ******************** Adjustable Properties *********************** -->
  +<!-- Define and use the common.xml ant build file for building
  +     your taglib -->
   
  -    <!--
  +<!DOCTYPE project [
  +    <!ENTITY common SYSTEM "file:../common.xml">
  +]>
   
  -        The following property values should be examined and customized
  -        for each custom tag library subproject.
  +<!-- Your main ant build declaration -->
   
  -        ant.home                    Home directory for the ANT build tool
  -                                    This is normally defaulted from the
  -                                    ANT_HOME environment variable in the
  -                                    build script.
  +<project name="page" default="main">
   
  -        servlet.jar                 Pathname of the servlet API classes
  -                                    you are using to compile, such as the
  -                                    one that comes with Tomcat.  This is
  -                                    normally defaulted from the SERVLET_JAR
  -                                    environment variable in the build script.
  -
  -        taglib.name                 Base name of this tag library subproject.
  -
  -    -->
  -
  -    <property name="taglib.name"    value="page"/>
  -    <property name="ant.home"       value="../../jakarta-ant"/>
  -    <property name="servlet.jar"    value="../../jakarta-servletapi/lib/servlet.jar"/>
  -
  -
  -    <!-- ****************** 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}/${taglib.name}.jar"/>
  -    <property name="dist.tld"       value="${dist.dir}/${taglib.name}/${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}/javadoc"/>
  -    <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>
  -
  -    <javadoc packagenames="org.apache.taglibs.page.*"
  -	     classpath="${servlet.jar}"
  -             sourcepath="src"
  -             destdir="${build.doc}/javadoc"
  -             author="true"   
  -             version="true"
  -	     use="true"
  -             windowtitle="Jakarta PAGE custom tag library API"
  -             doctitle="Jakarta PAGE custom tag library"
  -             bottom="Copyright &#169; 2000 Apache Software Foundation. All Rights Reserved."
  -    />
  -  </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="${conf.src}/page.tld" tofile="${dist.tld}"/>
  -    <copy file="${dist.tld}"
  -              tofile="${build.examples}/WEB-INF/${taglib.name}.tld"/>
  -    <copy file="${dist.library}"
  -              tofile="${build.examples}/WEB-INF/lib/${taglib.name}.jar"/>
  -    <copy file="${examples.src}/web/page.jsp"
  -              tofile="${build.examples}/page.txt"/>
  -  </target>
  -
  -  <!-- Compile the tag library itself -->
  -  <target name="library" depends="prepare">
  -    <copy file="${conf.src}/page.tld"
  -              tofile="${build.library}/META-INF/taglib.tld"/>
  -    <javac srcdir="${library.src}" destdir="${build.library}"
  -           classpath="${servlet.jar}" 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>
  -
  -  <!-- Create the library distribution files -->
  -  <target name="library-dist" depends="library">
  -    <jar jarfile="${dist.library}" basedir="${build.library}"/>
  -    <copy file="${conf.src}/${taglib.name}.tld" tofile="${dist.tld}"/>
  -  </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>
  +  <!-- Include the common.xml ant build declarations -->
  +  &common;
   
   </project>
  
  
  
  1.1                  jakarta-taglibs/page/xml/page.xml
  
  Index: page.xml
  ===================================================================
  <?xml version="1.0" ?>
  
  <!-- Change all instances of page with the jakarta-taglib 
       name for this tag library.
  
       Change all instances of Page with the name to use
       for things such as titles in the tag library documentation.
  
       Change all instances of {your-name} with your name for
       for things such as author name in the tag library documentation.
  
       Change <prefix>foo</prefix> below to a short prefix for this
       tag library.
       -->
  
  <document url="./page.xml">
  
  <!-- More properties can be added.  Good place to stick loose
       data needed elsewhere. -->
  <properties>
    <!-- The title here overrides the title generated by the 
         stylesheet for the documentation HTML <title> tag
    <title>Jakarta Project: Page JSP Tag Library</title>
         -->
    <!-- The name here is used in the HTML <meta name="author"...> tag -->
    <author>Morgan Delagrange</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>page</short-name>
    <!-- URI of taglib -->
    <uri>http://jakarta.apache.org/taglibs/page-1.0</uri>
    <!-- The name to use in titles, etc. for the taglib -->
    <display-name>Page Tag library (Pre Beta)</display-name>
  
    <description>
      <P>The PAGE custom tag library contains tags which can be used to
        access all the information about the PageContext for a JSP page.</P>
      <P>Tags are provided to access information in "page" scoped attributes.</P>
    </description> 
  
    <!-- The taglib-location is used to fill in the web.xml configuration
         information in the HTML doc. -->
    <taglib-location>/WEB-INF/page.tld</taglib-location>
  
    <!-- The prefix is used to fill in the taglib directive
         configuration information in the HTML doc. -->
    <prefix>page</prefix>
  
    <!-- This element must be straight text and is copied right into
         the "Requirements" section of the HTML doc. -->
    <requirements-info>
      <P>This custom tag library requires no software other than a servlet
        container that supports the JavaServer Pages Specification, version 1.2.
      </P>  
  
      <P>The tag library also works in some JSP version 1.1 servlet containers,
        such as Tomcat, but not in others, such as Weblogic.  The tags in this
        tag library are designed according to the JSP 1.2 specification, which
        makes this requirement of the &lt;jsp:getProperty ... /&gt; tag:</P>
  
      <DL><DD>
        The value of the name attribute in jsp:setProperty and jsp:getProperty
        will refer to an object that is obtained from the pageContext object
        through its findAttribute() method.
      </DD></DL>
  
      <P>The JSP 1.1 specification does not require this behaviour, and while
        Tomcat happens to support it, Weblogic does not.  Note that it is
        fairly straightforward to write a custom tag that emulates this
        behaviour for Weblogic users.  Sample source code for such a tag can be
        found <a href="GetPropertyTag.java">here</a>.</P>
    </requirements-info>
  
    <tagtoc name="Page Attribute Tags">
  
      <tag>
        <name>attribute</name>
        <tag-class>org.apache.taglibs.page.AttributeTag</tag-class>
        <body-content>empty</body-content>
        <display-name>attribute</display-name>
  
        <description>
          Get the value of a single page attribute.
        </description>
  
        <summary>Get the value of a single page attribute.</summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
  
        <attribute>
          <name>name</name>
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Name of page attribute to get.
          </description>
          <availability>1.0</availability>
        </attribute>
  
        <example>
          <usage>
            <comment>
              Output the value of the page attribute with name "test1"
            </comment>
            <code>
  <![CDATA[
  <page:attribute name="test1"/>
  ]]>
            </code>
          </usage>
        </example>
  
      </tag>
  
      <tag>
        <name>attributes</name>
        <tag-class>org.apache.taglibs.page.AttributesTag</tag-class>
        <tei-class>org.apache.taglibs.page.AttributesTEI</tei-class>
        <body-content>JSP</body-content>
        <display-name>attributes</display-name>
  
        <description>
          Loop through all page attributes.
        </description>
  
        <summary>Loop through all page attributes.</summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
  
        <variable>
          <name-from-attribute>id</name-from-attribute>
          <variable-class>org.apache.taglibs.page.AttributesTag</variable-class>
          <declare>true</declare>
          <scope>NESTED</scope>
          <description>Page Attribute Bean</description>
          <availability>1.0</availability>
  
          <beanprop>
            <name>name</name>
            <get>Yes</get>
            <set>No</set>
            <description>
              Page attribute name.
            </description>
            <availability>1.0</availability>
          </beanprop>
          <beanprop>
            <name>value</name>
            <get>Yes</get>
            <set>No</set>
            <description>
              Page attribute value.
            </description>
            <availability>1.0</availability>
          </beanprop>
        </variable>
  
        <attribute>
          <name>id</name>
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Script variable id for use with standard <B>jsp:getProperty</B> tag.
          </description>
          <availability>1.0</availability>
        </attribute>
         
        <example>
          <usage>
            <comment>
              Output the name and value of all the page attributes
            </comment>
            <code>
  <![CDATA[
  <page:attributes id="loop">
  Name: <jsp:getProperty name="loop" property="name"/>
  Value: <jsp:getProperty name="loop" property="value"/>
  </page:attributes>
  ]]>    
            </code>
          </usage>
        </example>
         
      </tag>
  
      <tag>
        <name>equalsAttribute</name>
        <tag-class>org.apache.taglibs.page.EqualsAttributeTag</tag-class>
        <body-content>JSP</body-content>
        <display-name>equalsAttribute</display-name>
   
        <description>
          Includes the body of the tag if the page attribute value equals
          the <b>match</b> attribute.
        </description>
   
        <summary>
          See if a page attribute equals some value.
        </summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
   
        <attribute>
          <name>name</name>
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Name of page attribute.
          </description>
          <availability>1.0</availability>
        </attribute>
  
        <attribute>
          <name>value</name>
          <required>no</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            If value is set to <b>false</b> the equalsAttribute tag includes body
            of tag if page attribute does not equal the <b>match</b> attribute.
            Default is <b>true</b>.
          </description>
          <availability>1.0</availability>
        </attribute>
  
        <attribute>
          <name>match</name>
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            String to test for equality with page attribute value.
          </description>
          <availability>1.0</availability>
        </attribute>
  
        <attribute>
          <name>ignoreCase</name>
          <required>no</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Set to <b>true</b> to test for equality while ignoring
            the case of the letters.  Set to <b>false</b> to test
            for case sensitive equality.  Default is <b>false</b>
          </description>
          <availability>1.0</availability>
        </attribute>
  
        <example>
          <usage>
            <comment>
              Determine if the page attribute "test1" value equals "blah"
            </comment>
            <code>
  <![CDATA[
  <page:equalsAttribute name="test1" match="blah">
    The page attribute with name test1 matches the string "blah".
  </page:equalsAttribute>
  <page:equalsAttribute name="test1" match="blah" value="false">
    The page attribute with name test1 does not match the string "blah".
  </page:equalsAttribute>
  ]]>
            </code>
          </usage>
        </example>
  
      </tag>
  
      <tag>
        <name>existsAttribute</name>
        <tag-class>org.apache.taglibs.page.ExistsAttributeTag</tag-class>
        <body-content>JSP</body-content>
        <display-name>existsAttribute</display-name>
    
        <description>
          Includes the body of the tag if the page attribute exists.
        </description>
    
        <summary>
          See if a page attribute exists.
        </summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
    
        <attribute>
          <name>name</name>
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Name of page attribute.
          </description>
          <availability>1.0</availability>
        </attribute>
  
        <attribute>
          <name>value</name>
          <required>no</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            If value is set to <b>false</b> the existsAttribute tag includes body
            of tag if page attribute does not exist. Default is <b>true</b>.
          </description>
          <availability>1.0</availability>
        </attribute>
              
        <example>
          <usage>
            <comment>
              Determine if the "test1" Page attribute exists
            </comment>
            <code>
  <![CDATA[
  <page:existsAttribute name="test1">
   The page attribute with name test1 exists.
  </page:existsAttribute>
  <page:existsAttribute name="test1" value="false">
   The page attribute with name test1 does not exist.
  </page:existsAttribute>
  ]]>         
            </code>
          </usage>
        </example>
           
      </tag>
  
      <tag>
        <name>removeAttribute</name>
        <tag-class>org.apache.taglibs.page.RemoveAttributeTag</tag-class>
        <body-content>empty</body-content>    
        <display-name>removeAttribute</display-name>
  
        <description>
          Removes an attribute from a page.
        </description>
    
        <summary>Removes an attribute from a page.</summary>
        <availability>1.0</availability> 
        <restrictions>None</restrictions>
    
        <attribute>
          <name>name</name> 
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Name of page attribute to remove.
          </description>
          <availability>1.0</availability>
        </attribute>
        
        <example>
          <usage> 
            <comment>
              Remove the page attribute with name "test1"
            </comment>
            <code>   
  <![CDATA[
  <page:removeAttribute name="test1"/>
  ]]>
            </code>
          </usage>
        </example>
                 
      </tag>
  
      <tag>
        <name>setAttribute</name>
        <tag-class>org.apache.taglibs.page.SetAttributeTag</tag-class>
        <body-content>JSP</body-content>
        <display-name>setAttribute</display-name>
  
        <description>
          Sets the value of the page attribute to the content of the tag body.
        </description>
   
        <summary>Sets the value of a page attribute.</summary>
        <availability>1.0</availability>
        <restrictions>None</restrictions>
    
        <attribute>
          <name>name</name>
          <required>yes</required>
          <rtexprvalue>no</rtexprvalue>
          <description>
            Name of page attribute to set value for.
          </description> 
          <availability>1.0</availability>
        </attribute>
      
        <example>
          <usage>
            <comment>
              Set the page attribute with name "test1"
            </comment> 
            <code>   
  <![CDATA[
  <page:setAttribute name="test1">Test Value</page:setAttribute>
  ]]> 
            </code>
          </usage>
        </example>
  
      </tag>
  
    </tagtoc>
  
  </taglib>
  
  <revision release="Pre Beta" date="07/13/2001">
    <description>
      Clean up of tag library prior to performing a beta
      release, moving toward an official release.
    </description>
    <section name="Tag Changes">
      <item>
        Changed the name of the <b>existsattribute</b> tag to
        <b>existsAttribute</b>.
      </item>
      <item>
        Changed the name of the <b>removeattribute</b> tag to
        <b>removeAttribute</b>.
      </item>
      <item>
        Changed the name of the <b>setattribute</b> tag to
        <b>setAttribute</b>.
      </item>
      <item>
        Changed the name of the <b>equalsattribute</b> tag to
        <b>equalsAttribute</b>.
      </item>
      <item>
        Change the name of the <b>equalsAttribute</b> tag <b>ignorecase</b>
        attribute to <b>ignoreCase</b>.
      </item>
    </section>
  </revision>
         
  <revision release="Development" date="12/25/2000"> 
    <description>
      Initial version of tag library before Jakarta-Taglibs
      had an official release policy for tag libraries.
    </description>
  </revision>
  
  </document>