You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cr...@apache.org on 2003/12/18 06:18:28 UTC

cvs commit: cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms sitemap2descr01.xsl sitemapdescr2html.xsl

crossley    2003/12/17 21:18:28

  Modified:    src/blocks/scratchpad/samples/sitemap-viewer sitemap.xmap
               src/blocks/scratchpad/samples/sitemap-viewer/html intro.xml
               src/blocks/scratchpad/samples/sitemap-viewer/scripts
                        ie.javascript
               src/blocks/scratchpad/samples/sitemap-viewer/transforms
                        sitemap2descr01.xsl sitemapdescr2html.xsl
  Log:
  Changed serializer from xhtml back to html.
  
  Submitted by: Jelle Alten jelle<AT>ordina.nl
  PR: 25433
  
  Revision  Changes    Path
  1.4       +4 -5      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap	17 Dec 2003 07:05:18 -0000	1.3
  +++ sitemap.xmap	18 Dec 2003 05:18:28 -0000	1.4
  @@ -8,7 +8,6 @@
     <map:generators   default="file"/>
     <map:transformers default="xslt"/>
     <map:readers      default="resource"/>
  -  <map:serializers  default="html"/>
     <map:matchers     default="wildcard"/>
     <map:selectors    default="browser">
       <map:selector name="resource-exists"
  @@ -25,7 +24,7 @@
    
     <map:pipes        default="caching"/>
   
  -  <map:serializers>
  +  <map:serializers default="html">
   
      <map:serializer name="xhtml-transitional"     src="org.apache.cocoon.serialization.XMLSerializer"  mime-type="text/html"      logger="sitemap.serializer.xhtml"
                pool-grow="2" pool-max="64" pool-min="2">
  @@ -51,7 +50,7 @@
               
               <map:transform src="transforms/sitemapdescr2html.xsl">
   
  -                <!-- set showsources to 0 if you don't want the link to the sources (secure) or to 1 
  +                <!-- change showsources to 0 if you don't want the link to the sources (secure) or to 1 
                          if you want to show the sources (unsecure) -->
                   <map:parameter name="showsources" value="{showsources}"/>
               </map:transform>
  @@ -66,7 +65,7 @@
                   </map:otherwise>
               </map:select>
   
  -            <map:serialize type="xhtml-transitional"/>
  +            <map:serialize/>
   
   
         </map:resource>
  @@ -146,7 +145,7 @@
   
           </map:pipeline>
               
  -        <map:pipeline internal-only="yes">
  +        <map:pipeline internal-only="no">
               
               <map:match pattern="*.descr01">
                   <map:act type="request">
  
  
  
  1.4       +3 -5      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/html/intro.xml
  
  Index: intro.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/html/intro.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- intro.xml	17 Dec 2003 07:05:18 -0000	1.3
  +++ intro.xml	18 Dec 2003 05:18:28 -0000	1.4
  @@ -4,17 +4,15 @@
       This is a Sitemap-viewer, made by Jelle Alten.
   </p>
   <p>
  -    This viewer reads a sitemap, attempts to follow links, references and other interesting lines in the &apos;match&apos; elements and generates an HTML file from this information. If you use IE or Mozilla, the resulting HTML has clickable buttons for folding and unfoling elements. 
  +    This viewer reads a sitemap, attempts to follow links, references and other interesting lines in the &apos;match&apos; elements and generates an HTML file from this information. If you use IE or Mozilla, the resulting HTML has clickable buttons for folding and unfolding elements. 
   </p>
   <p>
       <b>Warning: This tool can show the contents of sitemaps, don't put this tool in a production environment for security reasons.</b>
  -    The source-viewing is turned on and off in the sitemap, by setting the internal-only attribute of the "srcviewing"-pipeline. 
  -    To be able to use all of the viewer, make sure to set internal-only attribute of the pipeline labeled "srcviewing" 
  -    to "no". To have a secure version, set it to "yes" (default).
  +    The source-viewing is turned on and off in the sitemap, in the "showsources" parameter and by setting the internal-only attribute of the "srcviewing"-pipeline.
   </p>
   <p>See this <a href="example.html">example of a difficult sitemap</a> to see where it won't work.</p>
   <p>
  -    It is in a testing stage, and some work, cleanup and documentation should still be done. 
  +    It is in a testing stage, and some work, cleanup and documentation should still be done. It works fine on Cocoon 2.1.2+
   </p>
   <p>
       <h4>Known bugs</h4>
  
  
  
  1.3       +58 -71    cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/scripts/ie.javascript
  
  Index: ie.javascript
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/scripts/ie.javascript,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ie.javascript	12 Dec 2003 04:48:51 -0000	1.2
  +++ ie.javascript	18 Dec 2003 05:18:28 -0000	1.3
  @@ -1,75 +1,62 @@
  -/*                      status='javascript loading';
  -//                      alert('loading');
   
  -function test()
  +function Toggle(button)
   {
  -    alert("test");
  +    ypos = document.body.scrollTop;
  +
  +    src = button.firstChild.src.split('/');
  +    srcparts = src[src.length-1].split('_');
  +    if (srcparts[1]=='op.gif')
  +    {
  +        button.firstChild.src= srcparts[0] + '_neer.gif';
  +        button.parentNode.nextSibling.style.display='';
  +    }
  +    else if (srcparts[1]=='neer.gif')
  +    {
  +        button.firstChild.src= srcparts[0] + '_op.gif';
  +        button.parentNode.nextSibling.style.display='none';
  +    }
  +    
  +}
  +
  +
  +function DoRecursive(node,newDisplay,newImgSuffix)
  +{
  +  if (node.hasChildNodes())
  +  {                      
  +    if (node.style!=null && node.style.display!=newDisplay)
  +    {
  +        if (node.previousSibling && node.previousSibling.firstChild && node.previousSibling.firstChild.firstChild && node.previousSibling.firstChild.firstChild.src && node.previousSibling.firstChild.firstChild.src.indexOf('_pre') <0 )
  +        {
  +            node.style.display=newDisplay;
  +
  +            src = node.previousSibling.firstChild.firstChild.src.split('/');
  +            srcparts = src[src.length-1].split('_');
  +
  +            node.previousSibling.firstChild.firstChild.src=srcparts[0]+newImgSuffix;
  +        }
  +    }
  +    DoRecursive(node.firstChild,newDisplay,newImgSuffix);
  +  }
  +  if (node.nextSibling)
  +    DoRecursive(node.nextSibling,newDisplay,newImgSuffix);
   }
  -*/
   
  -                  function Toggle(button)
  -                  {
  -//                      alert('toggle');
  -                      ypos = document.body.scrollTop;
  -//                      alert(button.firstChild.src);
  -
  -                      src = button.firstChild.src.split('/');
  -                      srcparts = src[src.length-1].split('_');
  -                      if (srcparts[1]=='op.gif')
  -                      {
  -                          button.firstChild.src= srcparts[0] + '_neer.gif';
  -                          button.parentNode.nextSibling.style.display='';
  -                      }
  -                      else if (srcparts[1]=='neer.gif')
  -                      {
  -                          button.firstChild.src= srcparts[0] + '_op.gif';
  -                          button.parentNode.nextSibling.style.display='none';
  -                      }
  -                      
  -                  }
  -
  -                
  -                  function DoRecursive(node,newDisplay,newImgSuffix)
  -                  {
  -                    if (node.hasChildNodes())
  -                    {                      
  -                      if (node.style!=null && node.style.display!=newDisplay)
  -                      {
  -                          if (node.previousSibling && node.previousSibling.firstChild && node.previousSibling.firstChild.firstChild && node.previousSibling.firstChild.firstChild.src && node.previousSibling.firstChild.firstChild.src.indexOf('_pre') <0 )
  -                          {
  -                              node.style.display=newDisplay;
  -
  -                              src = node.previousSibling.firstChild.firstChild.src.split('/');
  -                              srcparts = src[src.length-1].split('_');
  -
  -                              node.previousSibling.firstChild.firstChild.src=srcparts[0]+newImgSuffix;
  -                          }
  -                      }
  -                      DoRecursive(node.firstChild,newDisplay,newImgSuffix);
  -                    }
  -                    if (node.nextSibling)
  -                      DoRecursive(node.nextSibling,newDisplay,newImgSuffix);
  -                  }
  -
  -
  -                  
  -                  function ToggleAll(button)
  -                  {
  -                      src = button.firstChild.src.split('/');
  -                      srcparts = src[src.length-1].split('_');
  -                      
  -//                      alert(srcparts[0] + "_" + srcparts[1]);
  -
  -                      if (srcparts[1]=='op.gif')
  -                      {
  -                          DoRecursive(button.parentNode.nextSibling,'','_neer.gif');        
  -                      }
  -                      else if (srcparts[1]=='neer.gif')
  -                      {
  -                          DoRecursive(button.parentNode.nextSibling,'none','_op.gif');        
  -                      }
  -                      
  -                      event.cancelBubble=true;
  -                      return false;
  -                  }
  -//                      alert('javascript loaded');
  +
  +
  +function ToggleAll(button)
  +{
  +    src = button.firstChild.src.split('/');
  +    srcparts = src[src.length-1].split('_');
  +    
  +    if (srcparts[1]=='op.gif')
  +    {
  +        DoRecursive(button.parentNode.nextSibling,'','_neer.gif');        
  +    }
  +    else if (srcparts[1]=='neer.gif')
  +    {
  +        DoRecursive(button.parentNode.nextSibling,'none','_op.gif');        
  +    }
  +    
  +    event.cancelBubble=true;
  +    return false;
  +}
  
  
  
  1.4       +0 -5      cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemap2descr01.xsl
  
  Index: sitemap2descr01.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemap2descr01.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap2descr01.xsl	17 Dec 2003 07:05:18 -0000	1.3
  +++ sitemap2descr01.xsl	18 Dec 2003 05:18:28 -0000	1.4
  @@ -12,11 +12,6 @@
       
       <xsl:template match="/">
           <sitemap location="{$location}" filename="{$filename}" >
  -            <info>
  -                <xsl:call-template name="normalize-path">
  -                    <xsl:with-param name="path"  select="'123/hoep/..'"/>
  -                </xsl:call-template>
  -            </info>
               <xsl:apply-templates/>
           </sitemap>
       </xsl:template>
  
  
  
  1.4       +13 -8     cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemapdescr2html.xsl
  
  Index: sitemapdescr2html.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/samples/sitemap-viewer/transforms/sitemapdescr2html.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemapdescr2html.xsl	17 Dec 2003 07:05:18 -0000	1.3
  +++ sitemapdescr2html.xsl	18 Dec 2003 05:18:28 -0000	1.4
  @@ -49,10 +49,6 @@
                   </table>
                   
                   <xsl:apply-templates select="*"/>
  -                <script type="text/javascript">
  -//                    alert("done");
  -//                    test();
  -                </script>"
               </body>
           </html>
       
  @@ -209,10 +205,10 @@
       
       
   
  -    <xsl:template match="call">
  +    <!--xsl:template match="call">
           <xsl:if test="$debug"><xsl:apply-templates select="." mode="debug"/></xsl:if>
           <xsl:apply-templates/>
  -    </xsl:template>
  +    </xsl:template-->
   
   
       <xsl:template match="*">
  @@ -363,7 +359,7 @@
       <xsl:param name="refinfo"  select="''"/>
   
       <xsl:if test=" $afterslashes=$nomatch or 
  -            name()='serialize' or name()='act' or name()='transform' or $afterslashes!='' or
  +            name()='serialize' or name()='act' or name()='call' or name()='transform' or $afterslashes!='' or
                concat(substring-before($name,$afterslashes),$refinfo,@element,@test, @mime-type,@type,@parameter)!='' or
                count(parameter)>0">
                
  @@ -404,7 +400,7 @@
                       </xsl:otherwise>
                   </xsl:choose>
                   <xsl:choose>
  -                    <xsl:when test="name()='serialize' or name()='act'"><xsl:value-of select="name()"/></xsl:when>
  +                    <xsl:when test="name()='serialize' or name()='act' or name()='call'"><xsl:value-of select="name()"/></xsl:when>
                       <xsl:when test="name()='transform'">xlst</xsl:when>
                   </xsl:choose>
               </td></tr>
  @@ -430,8 +426,17 @@
                           <xsl:when test="@mime-type">
                               <xsl:value-of select="@mime-type"/>
                           </xsl:when>
  +                        <xsl:when test="@function">
  +                            <xsl:value-of select="@function"/>
  +                        </xsl:when>
                           <xsl:when test="@parameter">
                               <xsl:value-of select="@parameter"/>
  +                        </xsl:when>
  +                        <xsl:when test="@*">
  +                            <xsl:for-each select="@*[name()!='pattern' and name()!='@src' and name()!='ref']">
  +                                <xsl:value-of select="concat(name(),'=',.)"/>
  +                                <xsl:if test="position()>1"><br/></xsl:if>
  +                            </xsl:for-each>
                           </xsl:when>
                       </xsl:choose>
                   </pre>