cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl
Date Wed, 25 Apr 2001 07:55:48 GMT
giacomo     01/04/25 00:55:48

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        Tag: xml-cocoon2 sitemap.xsl
  Log:
  Added a internal-only attribute to the map:pipeline element to protect them
  from being accessed by normal user request. The only way to access them by
  use of the src attribute of the map:part element or the xinclude:href of
  the XIncludeSAXConnector which implements transparent xinclude capability
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.108 +32 -23    xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
  retrieving revision 1.1.2.107
  retrieving revision 1.1.2.108
  diff -u -r1.1.2.107 -r1.1.2.108
  --- sitemap.xsl	2001/04/24 22:26:48	1.1.2.107
  +++ sitemap.xsl	2001/04/25 07:55:46	1.1.2.108
  @@ -98,7 +98,7 @@
        *
        * @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
        * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  -     * @version CVS $Id: sitemap.xsl,v 1.1.2.107 2001/04/24 22:26:48 giacomo Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.1.2.108 2001/04/25 07:55:46 giacomo Exp $
        */
       public class <xsl:value-of select="@file-name"/> extends AbstractSitemap {
         static final String LOCATION = "<xsl:value-of select="translate(@file-path, '/',
'.')"/>.<xsl:value-of select="@file-name"/>";
  @@ -421,6 +421,9 @@
           <!-- for each pipeline element generate a try/catch block -->
           <xsl:for-each select="/map:sitemap/map:pipelines/map:pipeline">
             <xsl:variable name="pipeline-position" select="position()"/>
  +          <xsl:if test="@internal-only = 'yes' or @internal-only='true'">
  +            if (internalRequest) {
  +          </xsl:if>
             try {
               <xsl:apply-templates select="./*"/>
             } catch (ResourceNotFoundException rse) {
  @@ -442,6 +445,9 @@
                 </xsl:otherwise>
               </xsl:choose>
             }
  +          <xsl:if test="@internal-only = 'yes' or @internal-only='true'">
  +            }
  +          </xsl:if>
           </xsl:for-each>
           return false;
         }
  @@ -831,18 +837,20 @@
         environment.setStatus(<xsl:value-of select="@status-code"/>);
       </xsl:if>
   
  -    if (!internalRequest) {
  -      boolean result = false;
  +    <xsl:if test="not(ancestor::map:pipeline[@internal-only='yes' or @internal-only='true'])">
  +      if (!internalRequest) {
  +        boolean result = false;
   
  -      try {
  -          result = pipeline.process(environment);
  -      } catch (Exception pipelineException<xsl:value-of select="generate-id(.)"/>)
{
  -          getLogger().debug("Error processing pipeline", pipelineException<xsl:value-of
select="generate-id(.)"/>);
  -          throw pipelineException<xsl:value-of select="generate-id(.)"/>;
  -      }
  +        try {
  +            result = pipeline.process(environment);
  +        } catch (Exception pipelineException<xsl:value-of select="generate-id(.)"/>)
{
  +            getLogger().debug("Error processing pipeline", pipelineException<xsl:value-of
select="generate-id(.)"/>);
  +            throw pipelineException<xsl:value-of select="generate-id(.)"/>;
  +        }
   
  -      return result;
  -    }
  +        return result;
  +      }
  +    </xsl:if>
       <!-- the if(true) prevents "unreachable statement" errors during compile -->
       if(true) return true;
   
  @@ -857,19 +865,20 @@
         <xsl:with-param name="mime-type" select="@mime-type"/>
       </xsl:call-template>
   
  -    <!-- the "if(true)" is needed to prevent "statement not reachable" error messages
during compile -->
  -    if (!internalRequest) {
  -      boolean result = false;
  -
  -      try {
  -          result = pipeline.process(environment);
  -      } catch (Exception RpipelineException<xsl:value-of select="generate-id(.)"/>)
{
  -          getLogger().debug("Error processing pipeline", RpipelineException<xsl:value-of
select="generate-id(.)"/>);
  -          throw RpipelineException<xsl:value-of select="generate-id(.)"/>;
  -      }
  +    <xsl:if test="not(ancestor::map:pipeline[@internal-only='yes' or @internal-only='true'])">
  +      if (!internalRequest) {
  +        boolean result = false;
   
  -      return result;
  -    }
  +        try {
  +            result = pipeline.process(environment);
  +        } catch (Exception RpipelineException<xsl:value-of select="generate-id(.)"/>)
{
  +            getLogger().debug("Error processing pipeline", RpipelineException<xsl:value-of
select="generate-id(.)"/>);
  +            throw RpipelineException<xsl:value-of select="generate-id(.)"/>;
  +        }
  +
  +        return result;
  +      }
  +    </xsl:if>
       <!-- the if(true) prevents "unreachable statement" errors during compile -->
       if(true)return true;
     </xsl:template> <!-- match="map:read" -->
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message