jmartin     01/02/09 00:27:01

  Modified:    src/xsl  left-advanced.xsl
  Log:
  Fixed project grouping
  
  Revision  Changes    Path
  1.13      +37 -81    jakarta-alexandria/src/xsl/left-advanced.xsl
  
  Index: left-advanced.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-alexandria/src/xsl/left-advanced.xsl,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- left-advanced.xsl 2001/02/06 23:54:24     1.12
  +++ left-advanced.xsl 2001/02/09 08:27:00     1.13
  @@ -4,112 +4,68 @@
     <xsl:output omit-xml-declaration="yes" />
     <xsl:strip-space elements="*" />
   
  -<!--
  +  <!--
       An XSL transform that will make a Javascript to build a tree control
       -->
  -  <xsl:template match="/workspace">foldersTree = gFld("Available modules", ""); 
  -    <xsl:apply-templates select="project">
  -      <xsl:sort select="name" order="ascending"
  -        case-order="upper-first" />
  -    </xsl:apply-templates>
  -  </xsl:template>
  -
  -  <xsl:template match="project">
  -    <xsl:variable name="title" select="title" />
  +  <xsl:template match="/workspace">
  +  foldersTree = gFld("Available modules", ""); 
   
  -    <xsl:variable name="module" select="module" />
  +    <!--
  +    Generate unique list of projects
  +    -->
  +    <xsl:variable name="project-list"
  +      select="project[not(title=preceding-sibling::project/title)]"
  +    />
   
  +    <!-- For each projcet get the list of projects and tegs that match
  +    -->
  +    <xsl:for-each select="$project-list">
       <xsl:variable name="project-url"
  -      select="concat('../right.html#', $module)" />
  -
  -      level1 = insFld(foldersTree, gFld("<xsl:value-of select="$title" />", " 
<xsl:value-of select="$project-url" /> ")); 
  -
  -    <xsl:variable name="type" select="@type" />
  -
  -    <xsl:variable name="opensource" select="@opensource" />
  +      select="concat('../right.html#', module)" />
  +  level1 = insFld(foldersTree, gFld("<xsl:value-of select="title" />", " 
<xsl:value-of select="$project-url" /> ")); 
  +      <xsl:sort select="title" order="ascending" case-order="upper-first" />
  +        <xsl:apply-templates select="/workspace/project[title=current()/title]"/>
  +    </xsl:for-each>
  +  </xsl:template>
   
  +  <xsl:template match="project">
       <xsl:variable name="build.file" select="build/@file" />
  -
       <xsl:variable name="test.file" select="test/@file" />
  -
  -    <xsl:variable name="module" select="module" />
  -
  -    <xsl:variable name="tag" select="@tag" />
  -
  -    <xsl:variable name="root" select="root" />
  -
  -    <xsl:variable name="javasrc" select="javasrc" />
  -
  -    <xsl:variable name="title" select="title" />
  -
  -    <xsl:variable name="cvsweb" select="cvsweb" />
  -
  -    <xsl:variable name="project-url"
  -      select="concat('../right.html#', $module)" />
   
  -  level2 = insFld(level1, gFld("<xsl:value-of select="$tag" />", "")); 
  -    <xsl:apply-templates select="javasrc" />
  -
  -    <!-- cvsweb -->
  -    <xsl:if test="$type='cvs'">insDoc(level2, gLnk(2, "CVSWeb","<xsl:value-of 
select="concat($cvsweb, $module)" />"));</xsl:if>
  +    <xsl:variable name="browse-url"
  +      select="concat('../../cvs/', module, '/', @tag, '/', module )" />
   
  -    <!-- browse -->
  -    <xsl:if test="string-length( $opensource ) = 0">
  -      <xsl:variable name="browse-url"
  -        select="concat('../../cvs/', $module, '/', $tag, '/', $module, 
'/alexandria.index.html')" />
  +    level2 = insFld(level1, gFld("<xsl:value-of select="@tag" />", "")); 
   
  -        insDoc(level2, gLnk(2, "Browse","<xsl:value-of select="$browse-url" />"));
  +    <xsl:if test="@type='cvs'">
  +      insDoc(level2, gLnk(2, "CVSWeb","<xsl:value-of select="concat(cvsweb, 
module)" />"));
  +    </xsl:if>
  +    <xsl:if test="opensource='true'">
  +      insDoc(level2, gLnk(2, "Browse","<xsl:value-of select="concat($browse-url, 
'/alexandria.index.html')" />"));
       </xsl:if>
   
       <!-- ChangeLog -->
  -    <xsl:variable name="browse-url"
  -      select="concat('../../cvs/', $module, '/', $tag, '/', $module, 
'/ChangeLog.html')" />
  -
  -    insDoc(level2, gLnk(2, "Change Log","<xsl:value-of select="$browse-url" />")); 
  +      insDoc(level2, gLnk(2, "Change Log","<xsl:value-of 
select="concat($browse-url, '/ChangeLog.html')" />")); 
       <xsl:if test="string-length( $build.file ) &gt; 0">
   
         <!-- Build Log -->
  -      <xsl:variable name="browse-url"
  -        select="concat('../../cvs/', $module, '/', $tag, '/', $module, 
'/build.html')" />
  -
  -        insDoc(level2, gLnk(2, "Build Log","<xsl:value-of select="$browse-url" 
/>")); 
  +      insDoc(level2, gLnk(2, "Build Log","<xsl:value-of select="concat($browse-url, 
'/build.html')" />")); 
         <xsl:variable name="blame-url"
  -        select="concat('../../html/', $module, '.', $tag, '.blame.html')" />
  +        select="concat('../../html/', module, '.', @tag, '.blame.html')" />
   
         <!-- Blame Log -->
  -        insDoc(level2, gLnk(2, "Blame Log","<xsl:value-of select="$blame-url" />"));
  +      insDoc(level2, gLnk(2, "Blame Log","<xsl:value-of select="$blame-url" />"));
       </xsl:if>
  -
       <xsl:if test="string-length( $test.file ) &gt; 0">
         <!-- Test Log -->
  -      <xsl:variable name="browse-url"
  -        select="concat('../../cvs/', $module, '/', $tag, '/', $module, 
'/testsuite.html')" />
  -
  -      insDoc(level2, gLnk(2, "Unit Tests","<xsl:value-of select="$browse-url" 
/>")); 
  +      insDoc(level2, gLnk(2, "Unit Tests","<xsl:value-of 
select="concat($browse-url, '/testsuite.html')" />")); 
         <!-- Test Log -->
  -      <xsl:variable name="browse-url"
  -        select="concat('../../cvs/', $module, '/', $tag, '/', $module, 
'/stats.html')" />
  -
  -      insDoc(level2, gLnk(2, "Unit Tests Stats","<xsl:value-of select="$browse-url" 
/>")); 
  +      insDoc(level2, gLnk(2, "Unit Tests Stats","<xsl:value-of 
select="concat($browse-url, '/stats.html')" />")); 
         <!-- Build Log -->
  -      <xsl:variable name="browse-url"
  -        select="concat('../../cvs/', $module, '/', $tag, '/', $module, 
'/test.html')" />
  -
  -      insDoc(level2, gLnk(2, "Test Log","<xsl:value-of select="$browse-url" />"));
  +      insDoc(level2, gLnk(2, "Test Log","<xsl:value-of select="concat($browse-url, 
'/test.html')" />"));
       </xsl:if>
  -  </xsl:template>
  -
  -  <xsl:template match="javasrc">
  -    <xsl:variable name="module" select="../module" />
  -
  -    <!-- FIX ME: this will break on multiple revisions -->
  -    <xsl:variable name="tag" select="../@tag" />
  -
  -    <xsl:variable name="title" select="../title" />
  -
  -    <xsl:variable name="browse-url"
  -      select="concat('../javadoc/', $module, '/', $tag, '/index.html')" />
  -
  -    insDoc(level2, gLnk(2, "Javadoc","<xsl:value-of select="$browse-url" />"));
  +    <xsl:if test="javasrc">
  +      insDoc(level2, gLnk(2, "Javadoc","<xsl:value-of select="concat($browse-url, 
'/index.html')" />"));
  +    </xsl:if>
     </xsl:template>
   </xsl:stylesheet>
  
  
  

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

Reply via email to