cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java sitemap.xsl
Date Sat, 07 Jul 2001 03:29:54 GMT
vgritsenko    01/07/06 20:29:53

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        sitemap.xsl
  Log:
  Correct generated code formatting.
  Now JStyleFormatter is really optional.
  
  Revision  Changes    Path
  1.25      +42 -46    xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- sitemap.xsl	2001/07/06 16:29:02	1.24
  +++ sitemap.xsl	2001/07/07 03:29:53	1.25
  @@ -128,7 +128,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.24 2001/07/06 16:29:02 vgritsenko Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.25 2001/07/07 03:29:53 vgritsenko 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"/>";
  @@ -473,8 +473,7 @@
                 </xsl:variable>
                 // method for handling "<xsl:value-of select="@pattern"/>"
                 if(<xsl:value-of select="translate($matcher-type, '- ', '__')"/>Match<xsl:value-of
select="generate-id(.)"/>(
  -                                                    environment, pipeline, eventPipeline,
  -                                                    internalRequest,listOfMaps))
  +                      environment, pipeline, eventPipeline, internalRequest,listOfMaps))
                   return true;
               </xsl:for-each>
             } catch (ConnectionResetException cre) {
  @@ -488,9 +487,7 @@
                   getLogger().warn("Error, try to process the error page", e);
                   try {
                     return error_process_<xsl:value-of select="$pipeline-position"/>
(environment,
  -                                                                                    environment.getObjectModel(),
  -                                                                                    e,
  -                                                                                    internalRequest);
  +                          environment.getObjectModel(), e, internalRequest);
                   } catch (Exception ex) {
                     getLogger().warn("Sitemap Error Process", ex);
                   }
  @@ -505,6 +502,7 @@
               }
             </xsl:if>
           </xsl:for-each>
  +
           return false;
         }
   
  @@ -593,10 +591,10 @@
       <xsl:variable name="component-param">
         <xsl:choose>
           <xsl:when test="count(map:parameter)>0">
  -          param
  +          <xsl:text>param</xsl:text>
           </xsl:when>
           <xsl:otherwise>
  -          emptyParam
  +          <xsl:text>emptyParam</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  @@ -614,7 +612,7 @@
             <xsl:value-of select="translate($matcher-type, '- ', '__')"/>Match(<xsl:value-of
select="$matcher-name2"/>_expr, objectModel, <xsl:value-of select="$component-param"/>)
           </xsl:when>
           <xsl:otherwise>
  -          ((Matcher)this.matchers.select("<xsl:value-of select="$matcher-type"/>")).match(substitute(listOfMaps,"<xsl:value-of
select="$pattern-value"/>"), objectModel, <xsl:value-of select="$component-param"/>)
  +          <xsl:text>((Matcher)this.matchers.select("</xsl:text><xsl:value-of
select="$matcher-type"/>")).match(substitute(listOfMaps,"<xsl:value-of select="$pattern-value"/>"),
objectModel, <xsl:value-of select="$component-param"/><xsl:text>)</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  @@ -680,10 +678,10 @@
       <xsl:variable name="component-param">
         <xsl:choose>
           <xsl:when test="count(map:parameter)>0">
  -          param
  +          <xsl:text>param</xsl:text>
           </xsl:when>
           <xsl:otherwise>
  -          emptyParam
  +          <xsl:text>emptyParam</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  @@ -701,12 +699,11 @@
             <xsl:value-of select="translate($matcher-type, '- ', '__')"/>Match(<xsl:value-of
select="$matcher-name2"/>_expr, objectModel, <xsl:value-of select="$component-param"/>)
           </xsl:when>
           <xsl:otherwise>
  -          ((Matcher)this.matchers.select("<xsl:value-of select="$matcher-type"/>")).match(substitute(listOfMaps,"<xsl:value-of
select="$pattern-value"/>"), objectModel, <xsl:value-of select="$component-param"/>)
  +          <xsl:text>((Matcher)this.matchers.select(</xsl:text>"<xsl:value-of
select="$matcher-type"/>")).match(substitute(listOfMaps,"<xsl:value-of select="$pattern-value"/>"),
objectModel, <xsl:value-of select="$component-param"/><xsl:text>)</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
   
  -
       <!-- this is the actual code produced -->
       // method for handling "<xsl:value-of select="@pattern"/>"
       private boolean <xsl:value-of select="translate($matcher-type, '- ', '__')"/>Match<xsl:value-of
select="generate-id(.)"/>(
  @@ -761,10 +758,10 @@
       <xsl:variable name="component-param">
         <xsl:choose>
           <xsl:when test="count(map:parameter)>0">
  -          param
  +          <xsl:text>param</xsl:text>
           </xsl:when>
           <xsl:otherwise>
  -          emptyParam
  +          <xsl:text>emptyParam</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  @@ -811,7 +808,7 @@
               <xsl:value-of select="translate($selector-type, '- ', '__')"/>Select(<xsl:value-of
select="$selector-name2"/>_expr, objectModel, <xsl:value-of select="$component-param"/>)
             </xsl:when>
             <xsl:otherwise>
  -            ((Selector)this.selectors.select("<xsl:value-of select="$selector-type"/>")).select(substitute(listOfMaps,"<xsl:value-of
select="$test-value"/>"), objectModel, <xsl:value-of select="$component-param"/>)
  +            <xsl:text>((Selector)this.selectors.select("</xsl:text><xsl:value-of
select="$selector-type"/>")).select(substitute(listOfMaps,"<xsl:value-of select="$test-value"/>"),
objectModel, <xsl:value-of select="$component-param"/><xsl:text>)</xsl:text>
             </xsl:otherwise>
           </xsl:choose>
         </xsl:variable>
  @@ -821,8 +818,8 @@
           else
         </xsl:if>
         if (<xsl:value-of select="$selector-name"/>) {
  -       getLogger().debug("Select <xsl:value-of select="$selector-type"/>");
  -       <xsl:apply-templates/>
  +        getLogger().debug("Select <xsl:value-of select="$selector-type"/>");
  +        <xsl:apply-templates/>
         }
       </xsl:for-each>
   
  @@ -857,7 +854,7 @@
   
       <!-- gets the string how the action is to be invoked in java code -->
       <xsl:variable name="action-name">
  -      ((Action)this.actions.select("<xsl:value-of select="$action-type"/>")).act
  +      <xsl:text>((Action)this.actions.select("</xsl:text><xsl:value-of select="$action-type"/><xsl:text>")).act</xsl:text>
       </xsl:variable>
   
       <!-- break on error when old parameter syntax exists -->
  @@ -876,10 +873,10 @@
       <xsl:variable name="component-param">
         <xsl:choose>
           <xsl:when test="count(map:parameter)>0">
  -          param
  +          <xsl:text>param</xsl:text>
           </xsl:when>
           <xsl:otherwise>
  -          emptyParam
  +          <xsl:text>emptyParam</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  @@ -893,24 +890,24 @@
       <xsl:choose>
         <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0' and
local-name() != 'parameter']">
           if ((map = <xsl:value-of select="$action-name"/> (redirector, environment,
objectModel, substitute(listOfMaps,<xsl:value-of select="$action-source"/>), <xsl:value-of
select="$component-param"/>)) != null) {
  -         if (redirector.hasRedirected()) {
  +          if (redirector.hasRedirected()) {
                return true;
  -         }
  -         getLogger().debug("Action <xsl:value-of select="translate($action-name,'&quot;','
')"/>");
  +          }
  +          getLogger().debug("Action <xsl:value-of select="translate($action-name,'&quot;','
')"/>");
             listOfMaps.add (map);
             <xsl:apply-templates select="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0'
and local-name() != 'parameter']"/>
             listOfMaps.remove(listOfMaps.size()-1);
           }
  -         if (redirector.hasRedirected()) {
  -             return true;
  -         }
  +        if (redirector.hasRedirected()) {
  +          return true;
  +        }
         </xsl:when>
         <xsl:otherwise>
           map = <xsl:value-of select="$action-name"/> (redirector, environment, objectModel,
substitute(listOfMaps,<xsl:value-of select="$action-source"/>), <xsl:value-of select="$component-param"/>);
   
  -         if (redirector.hasRedirected()) {
  -             return true;
  -         }
  +        if (redirector.hasRedirected()) {
  +          return true;
  +        }
         </xsl:otherwise>
       </xsl:choose>
     </xsl:template> <!-- match="map:act[@type]" -->
  @@ -936,7 +933,7 @@
   
       <!-- gets the string how the action is to be invoked in java code -->
       <xsl:variable name="action-name">
  -      ((Action)this.actions.select("<xsl:value-of select="$action-type"/>")).act
  +      <xsl:text>((Action)this.actions.select("</xsl:text><xsl:value-of select="$action-type"/><xsl:text>")).act</xsl:text>
       </xsl:variable>
   
       <!-- test if we have to define parameters for this action -->
  @@ -989,7 +986,7 @@
   
       <!-- gets the string how the action is to be invoked in java code -->
       <xsl:variable name="action-name">
  -      action_set_<xsl:value-of select="$action-set"/>
  +      <xsl:text>action_set_</xsl:text><xsl:value-of select="$action-set"/>
       </xsl:variable>
   
       <!-- break on error when old parameter syntax exists -->
  @@ -1008,10 +1005,10 @@
       <xsl:variable name="component-param">
         <xsl:choose>
           <xsl:when test="count(map:parameter)>0">
  -          param
  +          <xsl:text>param</xsl:text>
           </xsl:when>
           <xsl:otherwise>
  -          emptyParam
  +          <xsl:text>emptyParam</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  @@ -1033,15 +1030,15 @@
             <xsl:apply-templates select="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0'
and local-name() != 'parameter']"/>
             listOfMaps.remove(listOfMaps.size()-1);
           }
  -          if (redirector.hasRedirected()) {
  -              return true;
  -          }
  +        if (redirector.hasRedirected()) {
  +          return true;
  +        }
         </xsl:when>
         <xsl:otherwise>
           map = <xsl:value-of select="$action-name"/> (redirector, cocoon_action, listOfMaps,
environment, objectModel, substitute(listOfMaps,<xsl:value-of select="$action-source"/>),
<xsl:value-of select="$component-param"/>);
  -          if (redirector.hasRedirected()) {
  -              return true;
  -          }
  +        if (redirector.hasRedirected()) {
  +          return true;
  +        }
         </xsl:otherwise>
       </xsl:choose>
     </xsl:template> <!-- match="map:act[@set]" -->
  @@ -1094,7 +1091,6 @@
       </xsl:if>
       <!-- the if(true) prevents "unreachable statement" errors during compile -->
       if(true) return true;
  -
     </xsl:template> <!-- match="map:serialize" -->
   
     <!-- generate the code to invoke a reader -->
  @@ -1164,7 +1160,7 @@
       if (internalRequest)
         return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps,"<xsl:value-of
select="@uri-prefix"/>"), substitute(listOfMaps,"<xsl:value-of select="@src"/>"),
<xsl:value-of select="$check-reload"/>, <xsl:value-of select="$reload-method"/>,
pipeline, eventPipeline);
       else
  -      if(true)return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps,"<xsl:value-of
select="@uri-prefix"/>"), substitute(listOfMaps,"<xsl:value-of select="@src"/>"),
<xsl:value-of select="$check-reload"/>, <xsl:value-of select="$reload-method"/>);
  +      if (true) return sitemapManager.invoke (this.manager, environment, substitute(listOfMaps,"<xsl:value-of
select="@uri-prefix"/>"), substitute(listOfMaps,"<xsl:value-of select="@src"/>"),
<xsl:value-of select="$check-reload"/>, <xsl:value-of select="$reload-method"/>);
     </xsl:template> <!-- match="map:mount" -->
   
     <!-- generate the code to redirect a request -->
  @@ -1299,7 +1295,7 @@
           DefaultConfiguration cconf1 = new DefaultConfiguration("<xsl:value-of select="translate(@name,
'- ', '__')"/>", LOCATION);
           <xsl:for-each select="attribute::*[name(.)!=$qname]">
             cconf1.addAttribute ("<xsl:value-of select="name(.)"/>",
  -                                "<xsl:value-of select="."/>");
  +                               "<xsl:value-of select="."/>");
           </xsl:for-each>
   
           <!-- get nested configuration definitions -->
  @@ -1320,7 +1316,7 @@
               sitemap.load_component (Sitemap.<xsl:value-of select="$type"/>, "<xsl:value-of
select="@name"/>", "<xsl:value-of select="@src"/>", cconf1, null);
             </xsl:otherwise>
           </xsl:choose>
  -    }
  +      }
         </xsl:if>
       </xsl:for-each>
     </xsl:template>
  @@ -1437,10 +1433,10 @@
       <xsl:variable name="component-param">
         <xsl:choose>
           <xsl:when test="count(map:parameter)>0">
  -          param
  +          <xsl:text>param</xsl:text>
           </xsl:when>
           <xsl:otherwise>
  -          emptyParam
  +          <xsl:text>emptyParam</xsl:text>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
  
  
  

----------------------------------------------------------------------
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