dion        2002/11/16 19:23:58

  Modified:    src/plugins-build/xdoc site.jelly
  Log:
  html head now renders ok. Have a bug it appears in jsl/jelly/jaxen that makes
  the xpath a little icky
  
  Revision  Changes    Path
  1.4       +45 -53    jakarta-turbine-maven/src/plugins-build/xdoc/site.jelly
  
  Index: site.jelly
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/xdoc/site.jelly,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- site.jelly        16 Nov 2002 23:23:25 -0000      1.3
  +++ site.jelly        17 Nov 2002 03:23:57 -0000      1.4
  @@ -13,60 +13,32 @@
     #end
   #end
   
  -## Sets the navigation file
  -##
  -#macro (loadNavigation $filename)
  -  #set( $nav = $node.selectSingleNode("document('$filename')/project") )
  -#end
  -
  -## Selects the appropriate navigation file to use for the navbar.  The
  -## current search priority is: 
  -##    
  -##    - navigation.xml in current directory
  -##    - navigation.xml in xdocs directory 
  -##    - project.xml in xdocs directory (deprecated)
  -##    - project.xml in xdocs/stylesheets
  -##
  -#macro (selectNavigation $fileUtil $docSrc)
  -
  -  #if ($fileUtil.file("$docSrc/$currentDir/navigation.xml").exists())
  -    #loadNavigation ("$docSrc/$currentDir/navigation.xml")
  -
  -  #elseif ($fileUtil.file("$docSrc/navigation.xml").exists())
  -    #loadNavigation ("$docSrc/navigation.xml")
  -  
  -  #elseif ($fileUtil.file("$docSrc/project.xml").exists())
  -    #loadNavigation ("$docSrc/project.xml")
  -
  -  #elseif ($fileUtil.file("$docSrc/stylesheets/project.xml").exists())
  -    #loadNavigation ("$docSrc/stylesheets/project.xml")
  -  #end
  -
  -#end
   -->
  -<project xmlns:b="jelly:beanshell"
  +<m:project xmlns:b="jelly:beanshell"
            xmlns:j="jelly:core" 
            xmlns:jsl="jelly:jsl"
            xmlns:log="jelly:log"
  +         xmlns:m="jelly:jeez"
            xmlns:util="jelly:util"
  -         xmlns:x="jelly:xml">
  +         xmlns:x="jelly:xml"
  +         xmlns="dummy">
            
  -  <goal name="xdoc:jelly-transform">
  +  <m:goal name="xdoc:jelly-transform">
       <j:set var="destdir" value="${maven.docs.dest}" />
       <j:set var="outputencoding" value="${maven.docs.outputencoding}" />
   
       <!-- need to parse navigation into $nav -->
     
  -    <fileScanner var="docFiles">
  -      <fileset dir="${maven.docs.src}">
  -        <patternset>
  -          <exclude name="**/project.xml" />
  -          <exclude name="**/template.xml" />
  -          <exclude name="**/navigation.xml" />
  -          <include name="**/*.xml"/>
  -        </patternset>
  -      </fileset>
  -    </fileScanner>
  +    <m:fileScanner var="docFiles">
  +      <m:fileset dir="${maven.docs.src}">
  +        <m:patternset>
  +          <m:exclude name="**/project.xml" />
  +          <m:exclude name="**/template.xml" />
  +          <m:exclude name="**/navigation.xml" />
  +          <m:include name="**/*.xml"/>
  +        </m:patternset>
  +      </m:fileset>
  +    </m:fileScanner>
   
       <!-- all this replace'ing is for the mapper's benefit - it treats 
       / and \ as different chars -->  
  @@ -86,10 +58,9 @@
         <j:set var="outFiles" value="${mapper.mapFileName(outFileForward)}" />
         <j:set var="outFile" value="${outFiles[0]}" />
   
  -      <echo>Generating ${outFile} from ${file}</echo>
  +      <m:echo>Generating ${outFile} from ${file}</m:echo>
         <util:replace var="docsForward" oldChar="\" newChar="/" 
value="${maven.docs.src}"/>
  -      <echo>relative=${pathTool.getRelativePath(docsForward, 
outFileForward)},off=${outFileForward},df=${docsForward}</echo>
  -      <x:parse var="doc" xml="${file.toURL()}" />
  +      <j:set var="relativePath" value="${pathTool.getRelativePath(docsForward, 
outFileForward)}"/>
   
         <util:available file="${maven.docs.src}/stylesheets/project.xml">
           <j:set var="navFile" value="${maven.docs.src}/stylesheets/project.xml" />
  @@ -103,11 +74,14 @@
         <util:available file="${file.parentFile.absoluteFile}/navigation.xml">
           <j:set var="navFile" value="${file.parentFile.absoluteFile}/navigation.xml" 
/>
         </util:available>
  -      <echo>nav = ${navFile}</echo>
  -      <!--<x:parse var="nav" xml="${navFile}" />-->
  -      <x:set var="nav" select="document($navFile)/project" />
  +      <m:echo>nav = ${navFile}, file=${file.toURL()}</m:echo>
  +
  +      <x:parse var="navXML" xml="${navFile}" />
  +      <x:set var="nav" select="$navXML/project" />
   
         <!-- stick a j:file around this and make it a tag -->      
  +      <x:parse var="doc" xml="${file.toURL()}" />
  +      <x:expr select="$doc/document/properties/title" />
         <jsl:stylesheet select="$doc">
           <jsl:template match="document" trim="no">
             <x:doctype name="html" 
  @@ -115,12 +89,30 @@
               systemId="http://www.collabnet.com/dtds/collabnet_transitional_10.dtd"; 
/>
             <html>
               <head>
  +              <j:set var="docTitle"><x:expr select="$doc/document/properties/title" 
/></j:set>
                 <x:if select="$nav/title">
  -                <title><x:expr select="$nav/title" /> - <x:expr 
select="./properties/title" /></title>
  +                <title><x:expr select="$nav/title" /> - ${docTitle}</title>
                 </x:if>
                 <x:if select="not($nav/title)">
  -                <title>${pom.name} - <x:expr select="./properties/title"/></title>
  +                <title>${pom.name} - ${docTitle}</title>
                 </x:if>
  +
  +              <style type="text/css">
  +                @import url("${relativePath}/style/tigris.css");
  +                @import url("${relativePath}/style/maven.css");
  +              </style>
  +              <script type="text/javascript">
  +                if (document.layers) {
  +                  document.writeln('<link rel="stylesheet" type="text/css" 
href="${relativePath}/style/ns4_only.css" media="screen" />'+
  +                  '<link rel="stylesheet" type="text/css" 
href="${relativePath}/style/maven_ns4_only.css" media="screen" />')
  +                }
  +              </script>
  +              <link rel="stylesheet" type="text/css" 
href="${relativePath}/style/print.css" media="print" />
  +              <x:forEach var="author" select="$doc/document/properties/author">
  +                <meta name="author" value="${author.text}"/>
  +                <meta name="email" value="${author.attribute('email').value}" />
  +              </x:forEach>
  +
               </head>
             </html>
           </jsl:template>
  @@ -128,6 +120,6 @@
       
       </j:forEach>
     
  - </goal>
  + </m:goal>
    
  - </project>
  \ No newline at end of file
  + </m:project>
  \ No newline at end of file
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to