alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
</j:if> </tr> </table> </div> </body> </html> </jsl:template> <!-- process the properties of the doc --> <jsl:template match="properties" trim="false"> <!-- stick head block here later --> </jsl:template> <!-- Process a menu for the navigation bar --> <jsl:template match="menu" trim="false"> <div> <strong> <jsl:applyTemplates select="item"/> </div> </jsl:template> <jsl:template match="item" trim="false"> <div> <j:set var="_name"> <j:set var="_link"> <small> <jsl:applyTemplates select="item"/> </div> </jsl:template> <!-- Process the breadcrumb navbar --> <jsl:template match="links" trim="false"> <j:set var="linkCount" value="1"/> <x:forEach var="link" select="item"> <j:if test="${linkCount != 1}">| <j:set var="_name"> <x:expr select="@name"/> </j:set> <j:set var="_link"> <x:expr select="@href"/> </j:set> <doc:itemLink name="${_name}" link="${_link}"/> <j:set var="linkCount" value="${1+linkCount}"/> </x:forEach> </jsl:template> <!-- process a documentation section --> <jsl:template match="section" trim="false"> <div class="h3"> <j:set var="_sectionName"> <j:if test="${!empty(_sectionName)}"> <h3> <a name="${_sectionName}">${_sectionName} </h3> </j:if> <jsl:applyTemplates select="*"/> </div> </jsl:template> <jsl:template match="subsection" trim="false"> <div class="h4"> <j:set var="_sectionName"> <j:if test="${!empty(_sectionName)}"> <h4> <a name="${_sectionName}">${_sectionName} </h4> </j:if> <jsl:applyTemplates select="*"/> </div> </jsl:template> <jsl:template match="source" trim="false"> <div id="source"> <pre> </div> </jsl:template> <jsl:template match="table" trim="false"> <j:set var="rowcount" value="0"/> <table cellpadding="3" cellspacing="2" border="1" width="100%"> <jsl:applyTemplates select="*"/> </table> </jsl:template> <jsl:template match="tr" trim="false"> <j:choose> <j:when test="${rowMode == 'a'}"> <j:set var="rowMode" value="b"/> </j:when> <j:otherwise> <j:set var="rowMode" value="a"/> </j:otherwise> </j:choose> <!-- copy attributes FIXME: Shouldn't this only be colspan|rowspan? --> <x:element name="tr"> <x:attribute name="class">${rowMode} <x:forEach var="attr" select="@*"> <x:attribute name="${attr.name}">${attr.value} </x:forEach> <jsl:applyTemplates select="*"/> </j:whitespace> </jsl:template> <!--************************--> <!-- glossary documentation --> <!--************************--> <jsl:template match="glossary" trim="false"> <jsl:applyTemplates select="glossary-entries/glossary-entry" /> </jsl:template> <jsl:template match="glossary-entry" trim="false"> <strong> <br/> <x:expr select="definition" /> <p/> </jsl:template> <!--************************--> <!-- goals documentation --> <!--************************--> <jsl:template match="goals" trim="false"> <!-- reset row alternation --> <j:set var="rowMode" value="" /> <div class="h3"> <h3>Goals <table> <tr width='100%'> <jsl:applyTemplates select="goal"/> </table> </div> </jsl:template> <!-- a goal --> <!-- FIXME: this is copied from tr - there must be a way of calling templates in jsl? --> <jsl:template match="goal" trim="false"> <j:choose> <j:when test="${rowMode == 'a'}"> <j:set var="rowMode" value="b"/> </j:when> <j:otherwise> <j:set var="rowMode" value="a"/> </j:otherwise> </j:choose> <x:element name="tr"> <x:attribute name="class">${rowMode} <j:set var="_goalName"> <td width='200'>${_goalName} <td> </j:whitespace> </jsl:template> <jsl:template match="description"> <x:expr select="."/> </jsl:template> <!--************************--> <!-- changelog documentation--> <!--************************--> <jsl:template match="changelog" trim="false"> <j:set var="rowMode" value="" /> <table width="100%"> <tr> <th>Date </tr> <jsl:applyTemplates select="changelog-entry" /> </table> </jsl:template> <!-- transform a changelog entry --> <!-- FIXME: tr code copied from above --> <jsl:template match="changelog-entry" trim="false"> <j:choose> <j:when test="${rowMode == 'a'}"> <j:set var="rowMode" value="b"/> </j:when> <j:otherwise> <j:set var="rowMode" value="a"/> </j:otherwise> </j:choose> <x:element name="tr"> <x:attribute name="class">${rowMode} <td> <td> <td> <pre> </td> </j:whitespace> </jsl:template> <jsl:template match="file"> <j:set var="url">${pom.repository.url} <j:set var="revUrl">${url}?&content-type=text/vnd.viewcvs-markup <a href="${url}"> - <a href="${revUrl}">v <br/> </jsl:template> <!-- copy any other elements through --> <jsl:template match="*" trim="false"> <jsl:copy trim="false"> <jsl:applyTemplates trim="false"/> </jsl:copy> </jsl:template> <!-- element values don't pass through as text --> <jsl:template match="@*"/> </jsl:stylesheet>

Other Commons Attributes examples (source code examples)

Here is a short list of links related to this Commons Attributes site.jsl source code file:

Commons Attributes example source code file (site.jsl)

This example Commons Attributes source code file (site.jsl) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Commons Attributes tags/keywords

activity, fixme, fixme, last, license, license, process, process, project, project, source, test, the, xreference

The Commons Attributes site.jsl source code

<?xml version="1.0"?>
<!--
=
= Copyright 2003-2004 The Apache Software Foundation
= 
= Licensed under the Apache License, Version 2.0 (the "License");
= you may not use this file except in compliance with the License.
= You may obtain a copy of the License at
= 
=     http://www.apache.org/licenses/LICENSE-2.0
= 
= Unless required by applicable law or agreed to in writing, software
= distributed under the License is distributed on an "AS IS" BASIS,
= WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
= See the License for the specific language governing permissions and
= limitations under the License.
=
-->
<!-- stylesheet to be used -->
<jsl:stylesheet select="$doc"
  xmlns:define="jelly:define"
  xmlns:j="jelly:core"
  xmlns:jsl="jelly:jsl"
  xmlns:log="jelly:log"
  xmlns:util="jelly:util"
  xmlns:x="jelly:xml"
  xmlns:doc="doc"
  xmlns="dummy" trim="false">
  <jsl:template match="document" trim="false">

    <x:doctype name="html"
      publicId="-//CollabNet//DTD XHTML 1.0 Transitional//EN"
      systemId="http://www.collabnet.com/dtds/collabnet_transitional_10.dtd"/>

    <html>
      <head>
        <j:set var="docTitle">
          <x:expr select="./properties/title"/>
        </j:set>
        <x:if select="$nav/title">
          <title>
            <x:expr select="$nav/title"/> - ${docTitle}
          </title>
        </x:if>
        <x:if select="not($nav/title)">
          <title>${pom.name} - ${docTitle}
        </x:if>
        <j:set var="tigrisCss" value='"${relativePath}/style/tigris.css"'/>
        <j:set var="mavenCss" value='"${relativePath}/style/maven.css"'/>
        <j:set var="osmCss" value='"${relativePath}/style/osm.css"'/>
        <style type="text/css">
        <!-- FIXME: once someone works out how to stop this breaking
        <x:element name="script">text/javascript
          if (document.layers) {
                document.writeln(''+
                '<link rel="stylesheet" type="text/css" href="${relativePath}/style/ns4_only.css" media="screen" />');
              }
            </x:element>
        -->
        <link rel="stylesheet" type="text/css" href="${relativePath}/style/print.css" media="print"/>
        <x:forEach var="author" select="./properties/author">
          <meta name="author" value="${author.text}"/>
          <meta name="email" value="${author.attribute('email').value}"/>
        </x:forEach>
      </head>

      <body class="composite" marginwidth="0" marginheight="0">
        <div id="banner">
          <table border="0" cellspacing="0" cellpadding="8" width="100%" height="103">
            <tr>
              <!-- organization logo -->
              <td>
                <j:set var="logo" value="${pom.organization.logo}"/>
                <j:if test="${!empty(logo)}">
                  <!-- set url to org or project url -->
                  <j:set var="url" value="${pom.organization.url}"/>
                  <j:if test="${!empty(url)}">
                    <j:set var="home" value="${pom.organization.url}"/>
                  </j:if>
                  <j:if test="${empty(url)}">
                    <j:set var="home" value="${pom.url}"/>
                  </j:if>
                  <!-- set image to relative or complete -->
                  <j:set var="image" value="${pom.organization.logo}"/>
                  <j:if test="${!image.startsWith('http://')}">
                    <j:set var="image" value="${relativePath}${image}"/>
                  </j:if>
                  <a href="${home}">
                    <img src="${image}" align="left" alt="${pom.organization.name}" border="0"/>
                  </a>
                </j:if>
              </td>

              <!-- project logo and link -->
              <td>
                <div align="right" id="login">
                  <j:set var="logo" value="${pom.logo}"/>
                  <j:if test="${logo != null and logo != ''}">
                    <!-- set image to relative or complete -->
                    <j:set var="image" value="${pom.logo}"/>
                    <j:if test="${!image.startsWith('http://')}">
                      <j:set var="image" value="${relativePath}${image}"/>
                    </j:if>

                    <a href="${pom.url}">
                      <img src="${image}" align="right" alt="${pom.name}" border="0"/>
                    </a>
                  </j:if>
                </div>
              </td>
            </tr>
          </table>
        </div>

        <div id="breadcrumbs">
          <table border="0" cellspacing="0" cellpadding="4" width="100%">
            <tr>
              <j:if test="${date == 'left'}">
                <j:set var="version" value="${maven.xdoc.version}"/>
                <td>Last published: ${build.date}
                  <j:if test="${!empty(version)}">| Doc for ${version}
                </td>
              </j:if>
              <td>
                <div align="right">
                  <j:if test="${date == 'right'}">
                    Last published: ${build.date}
                    <x:if select="$nav/body/links">|
                  </j:if>
                  <!-- render links -->
                  <x:if select="$nav/body/links">
                    <jsl:applyTemplates select="$nav/body/links"/>
                  </x:if>
                  <x:if select="not($nav/body/links)">
                    <!-- FIXME   -->
                  </x:if>
                </div>
              </td>
            </tr>
          </table>
        </div>

        <!-- Body of the page -->
        <table border="0" cellspacing="0" cellpadding="8" width="100%"> 
          <tr valign="top">
            <td id="leftcol" width="200">
              <div id="navcolumn">
                <j:if test="${context.findVariable('maven.xdoc.date') == 'navigation-top'}">
                  <div>
                    <small>Last published: ${buildDate}
                  </div>
                </j:if>

                <x:if select="$nav">
                  <jsl:applyTemplates select="$nav/body/menu"/>
                </x:if>

                <!-- Standard Maven Navigation -->
                <j:set var="fileName">${file}

                <!-- 
                 ! Check to see if the user wishes to include the
                 ! maven-generated docs on their site.
                 !-->
                <j:if test="${includeProjectDocumentation.equals('yes')}">
                <div>
                  <strong>Project Documentation
                  <!--
                  <div>
                    <small>
                      <a href="${relativePath}/index.html">Front Page
                    </small>
                  </div>
                  -->
                  <div>
                    <small>
                      <a href="${relativePath}/project-info.html">Project Info
                    </small>
                    <util:tokenize var="projectInfoFiles" delim=",">${maven.xdoc.projectInfo}
                    <j:forEach var="infoFile" items="${projectInfoFiles}">
                      <j:if test="${relativePath == '.' and fileName.endsWith(infoFile)}">
                        <div>
                          <small>
                            <a href="${relativePath}/mail-lists.html">Mailing Lists
                          </small>
                        </div>
                        <div>
                          <small>
                            <a href="${relativePath}/team-list.html">Project Team
                          </small>
                        </div>
                        <div>
                          <small>
                            <a href="${relativePath}/dependencies.html">Dependencies
                          </small>
                        </div>
                        <j:if test="${!empty(pom.repository.url)}">
                          <div>
                            <small>
                              <a href="${relativePath}/cvs-usage.html">Source Repository
                            </small>
                          </div>
                        </j:if>
                        <j:if test="${!empty(pom.issueTrackingUrl)}">
                          <div>
                            <small>
                              <a href="${relativePath}/issue-tracking.html">Issue Tracking
                            </small>
                          </div>
                        </j:if>
                      </j:if>
                    </j:forEach>
                  </div>
                  <div>
                    <small>
                      <a href="${relativePath}/maven-reports.html">Project Reports
                    </small>
                    <j:choose>
                      <j:when test="${!pom.reports.isEmpty()}">
                        <!--
                         | Check to see if we need to include the report
                         | links in this document.  The only time we
                         | need to do this is when the current document
                         | either the maven-reports.xml doc (the page
                         | is displayed when clicking on Project
                         | Reports) or when the current document is one
                         | of the actual reports (in which case we want
                         | to leave the project report links expanded.
                         |-->
                         <j:set var="includeReportLinks" value="false"/>
                         <j:forEach var="report" items="${reports}">
                           <j:set var="linkWithXmlExt" value="${report.link}.xml"/>
                           <j:if test="${relativePath == '.' and (fileName.endsWith('maven-reports.xml') or fileName.endsWith(linkWithXmlExt))}">
                            <j:set var="includeReportLinks" value="true"/>
                          </j:if>
                        </j:forEach>
                        <!--
                         | If we need to include the report links, then
                         | do so.  This is determined by the above
                         | block.
                         |-->
                        <j:if test="${includeReportLinks == 'true'}">
                          <j:forEach var="report" items="${reports}">
                            <div>
                              <small>
                                <a href="${relativePath}/${report.link}.html">
                                  ${report.name}
                                </a>
                              </small>
                            </div>
                          </j:forEach>
                        </j:if>
                      </j:when>
                      <j:otherwise>
                        <!-- The old static method -->
                        <util:tokenize var="projectReportFiles" delim=",">${maven.xdoc.projectReports}
                        <j:forEach var="reportFile" items="${projectReportFiles}">
                          <j:if test="${relativePath == '.' and fileName.endsWith(reportFile.trim())}">
                            <util:available file="${maven.docs.src}/tasks.xml">
                              <div>
                                <small>
                                  <a href="${relativePath}/tasks.html">Tasks
                                </small>
                              </div>
                            </util:available>
                            <util:available file="${maven.gen.docs}/task-list.xml">
                              <div>
                                <small>
                                  <a href="${relativePath}/task-list.html">Task List
                                </small>
                              </div>
                            </util:available>
                            <util:available file="${maven.docs.src}/changes.xml">
                              <div>
                                <small>
                                  <a href="${relativePath}/changes.html">Changes
                                </small>
                              </div>
                            </util:available>
                            <j:if test="${!empty(pom.repository.connection)}">
                              <div>
                                <small>
                                  <a href="${relativePath}/changelog-report.html">Change Log
                                </small>
                              </div>
                              <div>
                                <small>
                                  <a href="${relativePath}/developer-activity-report.html">Developer Activity
                                </small>
                              </div>
                              <div>
                                <small>
                                  <a href="${relativePath}/file-activity-report.html">File Activity
                                </small>
                              </div>
                            </j:if>
                            <j:if test="${unitTestSourcesPresent}">
                              <div>
                                <small>
                                  <a href="${relativePath}/junit-report.html">Unit Tests
                                </small>
                              </div>
                            </j:if>
                            <j:if test="${sourcesPresent}">
                              <div>
                                <small>
                                  <a href="${relativePath}/jdepend-report.html">Metric Results
                                </small>
                              </div>
                              <div>
                                <small>
                                  <a href="${relativePath}/checkstyle-report.html">Checkstyle Report
                                </small>
                              </div>
                              <div>
                                <small>
                                  <a href="${relativePath}/javadoc.html">Javadoc Report
                                </small>
                              </div>
                            </j:if>
                            <util:available file="${maven.docs.dest}/clover">
                              <div>
                                <small>
                                  <a href="${relativePath}/clover/index.html">Clover Test Coverage
                                </small>
                              </div>
                            </util:available>
                            <util:available file="${maven.gen.docs}/cactus-report.xml">
                              <div>
                                <small>
                                  <a href="${relativePath}/cactus-report.html">Cactus Tests
                                </small>
                              </div>
                            </util:available>
                          </j:if>
                        </j:forEach>
                      </j:otherwise>
                    </j:choose>
                  </div>
                  <j:if test="${pom.reports.isEmpty()}">
                    <j:if test="${sourcesPresent}">
                      <div>
                        <small>
                          <a href="${relativePath}/apidocs/index.html">JavaDocs
                        </small>
                      </div>
                      <div>
                        <small>
                          <a href="${relativePath}/xref/index.html">Source XReference
                        </small>
                      </div>
                      <j:if test="${unitTestSourcesPresent == 'true'}">
                        <div>
                          <small>
                            <a href="${relativePath}/xref-test/index.html">Test XReference
                          </small>
                        </div>
                      </j:if>
                    </j:if>
                  </j:if>
                  <!--
                  <j:set var="devProcess" value="false"/>
                  <util:available file="${maven.docs.src}/development-process.xml">
                    <j:set var="devProcess" value="true"/>
                  </util:available>
                  <j:if test="${devProcess}">
                    <div>
                      <small>
                        <a href="${relativePath}/development-process.html">Development Process
                      </small>
                    </div>
                  </j:if>
                  <j:if test="${!devProcess}">
                    <div>
                      <small>
                        <j:set var="devProcess">${maven.xdoc.developmentProcessUrl}
                        <a href="${devProcess}">Development Process
                      </small>
                    </div>
                  </j:if>
                  -->
                  <div>
                    <small>
                      <a href="${relativePath}/license.html">License
                    </small>
                  </div>
                </div>
              </j:if>
                <j:if test="${context.findVariable('maven.xdoc.date') == 'navigation-bottom'}">
                  <div>
                    <small>Last published: ${build.date}
                  </div>
                </j:if>
              </div>
            </td>
            <td>
              <div id="bodycol">
                <!-- Insert MAIN body here -->
                <div class="app">
                  <!-- FIXME really shouldn't use $doc, but jelly loses it's context again -->
                  <jsl:applyTemplates select="$doc/document/body/section"/>
                  <jsl:applyTemplates select="$doc/document/body/glossary" />
                  <jsl:applyTemplates select="$doc/document/body/release" />
                  <jsl:applyTemplates select="$doc/document/body/changelog" />
                  <jsl:applyTemplates select="$doc/document/body/taskList" />
                  <jsl:applyTemplates select="$doc/document/body/goals" />
                </div>
              </div>
            </td>
          </tr>
        </table>
        <div id="footer">
          <table border="0" cellspacing="0" cellpadding="4">
            <tr>
              <td>
                <j:if test="${!empty(pom.organization.name)}">
                  <j:if test="${!empty(pom.inceptionYear)}">
                    <j:if test="${pom.inceptionYear == mavenCurrentYear}">
                      <!-- FIXME © -->${mavenCurrentYear}, ${pom.organization.name}
                    </j:if>
                    <j:if test="${pom.inceptionYear != mavenCurrentYear}">
                      <!-- FIXME © --> ${pom.inceptionYear}-${mavenCurrentYear}, ${pom.organization.name}
                    </j:if>
                  </j:if>
                  <j:if test="${empty(pom.inceptionYear)}">
                    <!-- FIXME © --> ${mavenCurrentYear}, ${pom.organization.name}
                  </j:if>
                </j:if>

                <j:if test="${context.findVariable('maven.xdoc.date') == 'bottom'}">
                  - Last published: ${build.date}
                </j:if>
              </td>
              <j:if test="${context.findVariable('maven.xdoc.date') == 'bottom-right'}">
                <td align="right">Last published: ${build.date}
GoalDescription
AuthorFiles/Message
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.