You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by do...@apache.org on 2002/06/16 11:31:12 UTC

cvs commit: jakarta-avalon-phoenix/tools announcement2header.xsl announcement2readme.xsl announcement2site.xsl announcement2txt.xsl

donaldp     2002/06/16 02:31:12

  Modified:    .        docs.xml
  Added:       src/xdocs announcement.xml
               tools    announcement2header.xsl announcement2readme.xsl
                        announcement2site.xsl announcement2txt.xsl
  Log:
  Get annoucnement/distribution htmls being created.
  
  Revision  Changes    Path
  1.10      +13 -7     jakarta-avalon-phoenix/docs.xml
  
  Index: docs.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-phoenix/docs.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- docs.xml	16 Jun 2002 09:00:47 -0000	1.9
  +++ docs.xml	16 Jun 2002 09:31:11 -0000	1.10
  @@ -24,6 +24,11 @@
       <property name="jakarta-site.dir" value="../jakarta-site"/>
       <property name="dist.base" value="distributions"/>    
   
  +    <property name="announce2txt" value="tools/announcement2txt.xsl"/>
  +    <property name="announce2header" value="tools/announcement2header.xsl"/>
  +    <property name="announce2readme" value="tools/announcement2readme.xsl"/>
  +    <property name="announce2site" value="tools/announcement2site.xsl"/>
  +
       <path id="project.class.path">
                   <fileset dir="${jakarta-site.dir}/lib">
                       <include name="*.jar"/>
  @@ -60,7 +65,7 @@
               style="docs.vsl"
               projectfile="stylesheets/project.xml"
               includes="**/*.xml"
  -            excludes="stylesheets/** history/** changes.xml"
  +            excludes="stylesheets/** history/** changes.xml announcement.xml"
               velocitypropertiesfile="${xdocs.dir}/stylesheets/velocity.properties"
               />
   
  @@ -124,18 +129,19 @@
           <mkdir dir="${build.dir}" />
           <mkdir dir="${dist.base}" />
       
  -        <copy todir="${build.xdocs}" overwrite="true" filtering="on">
  +        <copy todir="${build.dir}" filtering="on">
             <fileset dir="${xdocs.dir}">
  -            <exclude name="**/images/**"/>
  +            <include name="announcement.xml"/>
  +            <include name="changes.xml"/>
             </fileset>
           </copy>
       
  -        <style style="${announce2txt}" in="${build.xdocs}/announcement.xml" out="Announcement.txt"/>
  -        <style style="${announce2header}" in="${build.xdocs}/announcement.xml"
  +        <style style="${announce2txt}" in="${build.dir}/announcement.xml" out="Announcement.txt"/>
  +        <style style="${announce2header}" in="${build.dir}/announcement.xml"
                  out="${dist.base}/HEADER.html"/>
  -        <style style="${announce2readme}" in="${build.xdocs}/announcement.xml"
  +        <style style="${announce2readme}" in="${build.dir}/announcement.xml"
                  out="${dist.base}/README.html"/>
  -        <style style="${announce2site}" in="${build.xdocs}/announcement.xml"
  +        <style style="${announce2site}" in="${build.dir}/announcement.xml"
                  out="jakarta-news.xml"/>
       
         </target>
  
  
  
  1.3       +8 -11     jakarta-avalon-phoenix/src/xdocs/announcement.xml
  
  
  
  
  1.1                  jakarta-avalon-phoenix/tools/announcement2header.xsl
  
  Index: announcement2header.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:output method="html" indent="yes"/>
  
    <xsl:template match="changes">
      <xsl:variable name="version" select="@version"/>
      <xsl:apply-templates select="document(@file,/)/changes/release[attribute::version=string($version)]"/>
    </xsl:template>
  
    <xsl:template match="announcement">
      <style>
        body { background-color: #FFFFFF }
        p { font-size: 10pt; font-family: Helvetica, Arial, sans-serif }
        li,ul { font-size: 10pt; font-family: Helvetica, Arial, sans-serif }
        div { font-size: 10pt; font-family: Helvetica, Arial, sans-serif; font-style:italic }
        h1 { font-size: 14pt; font-family: Helvetica, Arial, sans-serif; font-weight: bold }
        h2 { font-size: 12pt; font-family: Helvetica, Arial, sans-serif; font-weight: bold }
        h3 { font-size: 10pt; font-family: Helvetica, Arial, sans-serif; font-weight: bold }
        A:link { color: #0000A0 }          /* unvisited link */
        A:visited { color: #A00000 }       /* visited links */
        A:active { color: #00A000 }        /* active links */
      </style>
      <h1 align="center"><xsl:value-of select="title"/><xsl:text> Released</xsl:text></h1>
      <xsl:apply-templates select="abstract"/>
  
      <xsl:for-each select="project">
        <h2>About <xsl:value-of select="title"/></h2>
        <xsl:apply-templates select="."/>
      </xsl:for-each>
  
    </xsl:template>
  
    <xsl:template match="project">
      <p><xsl:apply-templates select="description"/></p>
  
      <p>For more information about <xsl:value-of select="title"/>, please go to
      <a><xsl:attribute name="href"><xsl:value-of select="@site"/></xsl:attribute>
      <xsl:value-of select="@site"/></a>.</p>
  
      <!-- print out ChangeLog if present --> 
      <!--
      <xsl:if test="changes">
        <h3>ChangeLog for <xsl:value-of select="title"/></h3>
        <xsl:apply-templates select="changes"/>
      </xsl:if>
      -->
    </xsl:template>
  
    <xsl:template match="abstract">
      <div align="center">
        <xsl:apply-templates/>
      </div>
    </xsl:template>
  
    <xsl:template match="para">
      <p><xsl:apply-templates/></p>
    </xsl:template>
  
    <xsl:template match="ulink">
      <a href="{@uri}"><xsl:value-of select="."/></a>
    </xsl:template>
  
    <xsl:template match="release">
      <ul>
      <xsl:for-each select="action">
        <li> 
          <xsl:value-of select="normalize-space(.)"/>
          <xsl:if test="@dev">
            <xsl:text>[</xsl:text><xsl:value-of select="@dev"/><xsl:text>]</xsl:text>
          </xsl:if>
        </li>
      </xsl:for-each>
      </ul>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  jakarta-avalon-phoenix/tools/announcement2readme.xsl
  
  Index: announcement2readme.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:output method="html" indent="yes"/>
  
    <xsl:template match="changes">
      <xsl:variable name="version" select="@version"/>
      <xsl:apply-templates select="document(@file,/)/changes/release[attribute::version=string($version)]"/>
    </xsl:template>
  
    <xsl:template match="announcement">
      <style>
        body { background-color: #FFFFFF }
        p { font-size: 10pt; font-family: Helvetica, Arial, sans-serif }
        li,ul { font-size: 10pt; font-family: Helvetica, Arial, sans-serif }
        div { font-size: 10pt; font-family: Helvetica, Arial, sans-serif; font-style:italic }
        h1 { font-size: 14pt; font-family: Helvetica, Arial, sans-serif; font-weight: bold }
        h2 { font-size: 12pt; font-family: Helvetica, Arial, sans-serif; font-weight: bold }
        h3 { font-size: 10pt; font-family: Helvetica, Arial, sans-serif; font-weight: bold }
        A:link { color: #0000A0 }          /* unvisited link */
        A:visited { color: #A00000 }       /* visited links */
        A:active { color: #00A000 }        /* active links */
      </style>
  
      <a name="sig"><h2>PGP Signatures</h2></a>
  
      <p>Many of the distribution kits have been digitally signed (using
      PGP).  If so, there will be an accompanying
      <samp><em>distribution</em>.asc</samp> file in the same directory as
      the distribution.  The PGP keys can be found in the distribution
      directory at &lt;<a href="http://jakarta.apache.org/builds/jakarta-avalon/release/KEYS">
      <samp>http://jakarta.apache.org/builds/jakarta-avalon/release/KEYS</samp></a>&gt;.</p>
  
      <xsl:variable name="filename"><xsl:value-of 
        select="project/downloads/@name"/>-<xsl:value-of 
        select="project/changes/@version"/>-bin.tar.gz</xsl:variable>
  
      <pre>Always test available signatures, <i>e.g.</i>,
  &gt; pgpk -a KEYS
  &gt; pgpv <xsl:value-of select="$filename"/>.asc
  <i>or</i>,
  &gt; pgp -ka KEYS
  &gt; pgp <xsl:value-of select="$filename"/>.asc
  <i>or</i>,
  &gt; gpg --import KEYS
  &gt; gpg --verify <xsl:value-of select="$filename"/>.asc
  </pre>
  
      <xsl:for-each select="project">
        <xsl:if test="downloads">
          <h2>About <xsl:value-of select="title"/></h2>
          <xsl:apply-templates select="."/>
        </xsl:if>
      </xsl:for-each>
  
    </xsl:template>
  
    <xsl:template match="project">
  
      <p>For more information about <xsl:value-of select="title"/>, please go to
      <a><xsl:attribute name="href"><xsl:value-of select="@site"/></xsl:attribute>
      <xsl:value-of select="@site"/></a>.</p>
  
      <!-- print out ChangeLog if present --> 
      <xsl:if test="changes">
        <h3>ChangeLog for <xsl:value-of select="title"/></h3>
        <xsl:apply-templates select="changes"/>
      </xsl:if>
    </xsl:template>
  
    <xsl:template match="ulink">
      <a href="{@uri}"><xsl:value-of select="."/></a>
    </xsl:template>
  
    <xsl:template match="release">
      <ul>
      <xsl:for-each select="action">
        <li> 
          <xsl:value-of select="normalize-space(.)"/>
          <xsl:if test="@dev">
            <xsl:text>[</xsl:text><xsl:value-of select="@dev"/><xsl:text>]</xsl:text>
          </xsl:if>
        </li>
      </xsl:for-each>
      </ul>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  jakarta-avalon-phoenix/tools/announcement2site.xsl
  
  Index: announcement2site.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:lxslt="http://xml.apache.org/xslt"
      xmlns:my-ext="ext1"
      extension-element-prefixes="my-ext"
  >
  
    <xsl:output method="xml" indent="yes"/>
    <!--The component and its script are in the lxslt namespace and define the 
                    implementation of the extension.-->
                  <lxslt:component prefix="my-ext" elements="timelapse" functions="getdate">
                    <lxslt:script lang="javascript">
  		    var month = new Array (
  		      "January",
  		      "February",
  		      "March",
  		      "April",
  		      "May",
  		      "June",
  		      "July",
  		      "August",
  		      "September",
  		      "October",
  		      "November",
  		      "December"
  		    );
  
                      function getdate()
                      {
  		      var d = new Date();
  		      var mo = month[d.getMonth()];
  		      var dy = d.getDate();
  		      var yr = d.getFullYear();
  		      var dateString = dy + " " + mo + " " + yr;
                        return dateString;
                      }
                    </lxslt:script>
                  </lxslt:component>
  
    <xsl:template match="changes">
      <xsl:variable name="version" select="@version"/>
      <xsl:apply-templates select="document(@file,/)/changes/release[attribute::version=string($version)]"/>
    </xsl:template>
  
    <xsl:template match="announcement">
      <h3><xsl:value-of select="my-ext:getdate()"/> - <xsl:value-of select="title"/><xsl:text> Released</xsl:text></h3>
      <xsl:apply-templates select="abstract"/>
  
      <xsl:for-each select="project">
        <p><b>About <xsl:value-of select="title"/>:</b>
          <xsl:apply-templates select="."/>
        </p>
      </xsl:for-each>
  
      <hr noshade="" size="1"/>
    </xsl:template>
  
    <xsl:template match="project">
      <xsl:apply-templates select="description"/>
  
      <p>For more information about <xsl:value-of select="title"/>, please go to
      <a><xsl:attribute name="href"><xsl:value-of select="@site"/></xsl:attribute>
      <xsl:value-of select="@site"/></a>.</p>
  
      <!-- ignore changelog for site -->
    </xsl:template>
  
    <xsl:template match="abstract">
      <p><xsl:apply-templates/></p>
    </xsl:template>
  
    <xsl:template match="description">
      <xsl:choose>
        <xsl:when test="para">
          <xsl:apply-templates select="para[position()=1]/node()"/>
  	<xsl:apply-templates select="para[position()>1]"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
    <xsl:template match="para">
      <p><xsl:apply-templates/></p>
    </xsl:template>
  
    <xsl:template match="ulink">
      <a href="{@uri}"><xsl:value-of select="."/></a>
    </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  jakarta-avalon-phoenix/tools/announcement2txt.xsl
  
  Index: announcement2txt.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:output method="text" indent="no"/>
  
    <xsl:template match="changes">
      <xsl:variable name="version" select="@version"/>
      <xsl:apply-templates select="document(@file,/)/changes/release[attribute::version=string($version)]"/>
    </xsl:template>
  
    <xsl:template name="print-title">
      <xsl:param name="title"/>
  <xsl:variable name="text" select="normalize-space($title)"/>
  <xsl:value-of select="$text"/><xsl:text>
  </xsl:text>
      <xsl:call-template name="line">
        <xsl:with-param name="len" select="string-length($text)"/>
      </xsl:call-template>
      <xsl:text>
  </xsl:text>
    </xsl:template>
  
    <xsl:template match="announcement">
      <text>
        <xsl:call-template name="print-title">
          <xsl:with-param name="title"><xsl:value-of select="title"/> Released</xsl:with-param>
        </xsl:call-template>
        <xsl:call-template name="word-wrap">
          <xsl:with-param name="text" select="normalize-space(abstract)"/>
          <xsl:with-param name="count" select="0"/>
        </xsl:call-template>
      <xsl:text>
  
  </xsl:text>
        <xsl:for-each select="project">
          <xsl:call-template name="print-title">
            <xsl:with-param name="title">About <xsl:value-of select="title"/></xsl:with-param>
          </xsl:call-template>
          <xsl:apply-templates select="."/>
          <xsl:text>
  
  </xsl:text>
        </xsl:for-each>
      </text>
    </xsl:template>
  
    <xsl:template match="project">
      <xsl:choose>
        <xsl:when test="description/para">
          <xsl:for-each select="description/para">
  	  <xsl:call-template name="word-wrap">
  	    <xsl:with-param name="text">
  	      <xsl:apply-templates select="."/>
  	    </xsl:with-param>
  	    <xsl:with-param name="count" select="0"/>
  	  </xsl:call-template>
  	  <xsl:text>
  
  </xsl:text>
  	</xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="word-wrap">
            <xsl:with-param name="text">
  	    <xsl:apply-templates select="description"/>
  	  </xsl:with-param>
            <xsl:with-param name="count" select="0"/>
          </xsl:call-template>
  	<xsl:text>
  </xsl:text>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:text>
  For more information about </xsl:text>
      <xsl:value-of select="title"/>
      <xsl:text>, please go to
  </xsl:text>
      <xsl:value-of select="@site"/>
  
      <!-- print out ChangeLog if present --> 
      <xsl:if test="changes">
        <xsl:text>
  
  ChangeLog for </xsl:text>
        <xsl:value-of select="title"/>
        <xsl:text>
  
  </xsl:text>
        <xsl:apply-templates select="changes"/>
      </xsl:if>
  
      <!-- print out Downloads if present --> 
      <xsl:if test="downloads">
        <xsl:text>
  Downloads for </xsl:text><xsl:value-of select="title"/> available at 
  
  <xsl:value-of select="downloads/@base"/>/latest
      </xsl:if>
  
    </xsl:template>
  
    <xsl:template match="para">
      <xsl:apply-templates/>
      <xsl:text>
  </xsl:text>
    </xsl:template>
  
    <xsl:template match="ulink">
      <xsl:value-of select="."/>
      <xsl:text> (</xsl:text>
      <xsl:value-of select="@uri"/>
      <xsl:text>)</xsl:text>
    </xsl:template>
  
    <xsl:template match="release">
      <xsl:for-each select="action">
        <xsl:text>*) </xsl:text>
        <xsl:call-template name="word-wrap">
          <xsl:with-param name="text" select="."/>
          <xsl:with-param name="count" select="0"/>
        </xsl:call-template><xsl:text> </xsl:text>
        <xsl:if test="@dev">
          <xsl:text>[</xsl:text><xsl:value-of select="@dev"/><xsl:text>]</xsl:text>
        </xsl:if>
        <xsl:text>
  
  </xsl:text>
      </xsl:for-each>
    </xsl:template>
  
    <xsl:template name="line">
      <xsl:param name="len"/>
      <xsl:if test="number($len) > 0">
        <xsl:text>-</xsl:text>
        <xsl:call-template name="line">
          <xsl:with-param name="len" select="number($len)-1"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:template>
  
    <xsl:template name="word-wrap">
      <xsl:param name="text"/>
      <xsl:param name="count"/>
      <xsl:param name="mytext" select="normalize-space($text)"/>
      <xsl:choose>
        <xsl:when test="$count > 40">
          <xsl:text>
  </xsl:text>
          <xsl:call-template name="word-wrap">
            <xsl:with-param name="text" select="$mytext"/>
            <xsl:with-param name="count" select="0"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="not(contains($mytext,' '))">
          <xsl:text> </xsl:text>
          <xsl:value-of select="$mytext"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:variable name="word" select="substring-before($mytext,' ')"/>
          <xsl:variable name="remainder" select="substring-after($mytext,' ')"/>
          <xsl:text> </xsl:text>
          <xsl:value-of select="$word"/>
          <xsl:if test="string-length($word) > 0">
            <xsl:call-template name="word-wrap">
              <xsl:with-param name="text" select="$remainder"/>
              <xsl:with-param name="count" select="$count + string-length($word)"/>
            </xsl:call-template>
          </xsl:if>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  

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