cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From un...@apache.org
Subject cvs commit: cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor sitemap2xconf.xsl
Date Sun, 30 Nov 2003 21:16:15 GMT
unico       2003/11/30 13:16:15

  Modified:    src/java/org/apache/cocoon/components/treeprocessor
                        sitemap2xconf.xsl
  Log:
  act semantics and view registry
  
  Revision  Changes    Path
  1.3       +51 -9     cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor/sitemap2xconf.xsl
  
  Index: sitemap2xconf.xsl
  ===================================================================
  RCS file: /home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor/sitemap2xconf.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemap2xconf.xsl	17 Nov 2003 23:08:39 -0000	1.2
  +++ sitemap2xconf.xsl	30 Nov 2003 21:16:15 -0000	1.3
  @@ -9,6 +9,18 @@
     <xsl:template match="map:sitemap">
       <sitemap>
         <xsl:apply-templates select="map:components|map:views|map:resources|map:action-sets|map:pipelines"/>
  +      <view-registry id="default">
  +        <xsl:for-each select="/map:sitemap/map:components/*/*">
  +          <xsl:if test="@label">
  +            <component id-ref="{@name}-{local-name()}" label="{@label}" />
  +          </xsl:if>
  +        </xsl:for-each>
  +        <xsl:for-each select="/map:sitemap/map:views/*">
  +          <view id-ref="v-{position()}">
  +            <xsl:copy-of select="@from-label|@from-position|@name" />
  +          </view>
  +        </xsl:for-each>
  +      </view-registry>
       </sitemap>
     </xsl:template>
     
  @@ -42,7 +54,7 @@
     <xsl:template match="map:pipelines">
       <xsl:variable name="id">p</xsl:variable>
       <pipelines-node id="{$id}">
  -      <xsl:apply-templates select="map:global-parameters|map:component-configurations"
mode="copy" />
  +      <xsl:apply-templates select="map:component-configurations" mode="copy" />
         <xsl:for-each select="map:pipeline|map:handle-errors">
           <xsl:element name="{local-name()}">
             <xsl:attribute name="id">
  @@ -85,7 +97,7 @@
       <xsl:variable name="id">
         <xsl:value-of select="$parent-id"/>-<xsl:value-of select="position()"/>
       </xsl:variable>
  -    <resource-node id="{$id}">
  +    <named-container-node id="{$id}">
         <xsl:apply-templates select="@*" mode="copy" />
         <xsl:for-each select="map:match|map:select|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
           <xsl:element name="{local-name()}">
  @@ -94,7 +106,7 @@
             </xsl:attribute>
           </xsl:element>
         </xsl:for-each>
  -    </resource-node>
  +    </named-container-node>
       <xsl:apply-templates select="map:match|map:select|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
         <xsl:with-param name="parent-id">
           <xsl:value-of select="$id"/>
  @@ -113,7 +125,7 @@
         <!-- TODO:
         allow map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to
?
         -->
  -      <xsl:for-each select="map:match|map:select|map:handle-errors">
  +      <xsl:for-each select="map:match|map:select|map:act|map:handle-errors">
           <xsl:element name="{local-name()}">
             <xsl:attribute name="id-ref">
               <xsl:value-of select="$id"/>-<xsl:value-of select="position()" />
  @@ -121,7 +133,7 @@
           </xsl:element>
         </xsl:for-each>
       </xsl:element>
  -    <xsl:apply-templates select="map:match|map:select|map:handle-errors">
  +    <xsl:apply-templates select="map:match|map:select|map:act|map:handle-errors">
         <xsl:with-param name="parent-id">
           <xsl:value-of select="$id" />
         </xsl:with-param>
  @@ -143,7 +155,7 @@
             </xsl:attribute>
           </xsl:if>
         </xsl:if>
  -      <xsl:for-each select="map:match|map:select|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
  +      <xsl:for-each select="map:match|map:select|map:act|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
           <xsl:element name="{local-name()}">
             <xsl:attribute name="id-ref">
               <xsl:value-of select="$id"/>-<xsl:value-of select="position()" />
  @@ -151,7 +163,7 @@
           </xsl:element>
         </xsl:for-each>
       </match-node>
  -    <xsl:apply-templates select="map:match|map:select|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
  +    <xsl:apply-templates select="map:match|map:select|map:act|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
         <xsl:with-param name="parent-id">
           <xsl:value-of select="$id"/>
         </xsl:with-param>
  @@ -215,6 +227,36 @@
       </xsl:apply-templates>
     </xsl:template>
     
  +  <xsl:template match="map:act">
  +    <xsl:param name="parent-id" />
  +    <xsl:variable name="id">
  +      <xsl:value-of select="$parent-id"/>-<xsl:value-of select="position()"/>
  +    </xsl:variable>
  +    <act-node id="{$id}">
  +      <xsl:apply-templates select="@*|map:parameter" mode="copy" />
  +      <xsl:if test="not(@type)">
  +        <!-- set the default type -->
  +        <xsl:if test="/map:sitemap/map:components/map:actions/@default">
  +          <xsl:attribute name="type">
  +            <xsl:value-of select="/map:sitemap/map:components/map:actions/@default"
/>
  +          </xsl:attribute>
  +        </xsl:if>
  +      </xsl:if>
  +      <xsl:for-each select="map:match|map:select|map:act|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
  +        <xsl:element name="{local-name()}">
  +          <xsl:attribute name="id-ref">
  +            <xsl:value-of select="$id"/>-<xsl:value-of select="position()" />
  +          </xsl:attribute>
  +        </xsl:element>
  +      </xsl:for-each>
  +    </act-node>
  +    <xsl:apply-templates select="map:match|map:select|map:act|map:call|map:aggregate|map:generate|map:transform|map:serialize|map:read|map:mount|map:redirect-to">
  +      <xsl:with-param name="parent-id">
  +        <xsl:value-of select="$id"/>
  +      </xsl:with-param>
  +    </xsl:apply-templates>
  +  </xsl:template>
  +  
     <xsl:template match="map:generate">
       <xsl:param name="parent-id" />
       <xsl:variable name="id">
  @@ -271,9 +313,9 @@
       <xsl:variable name="id">
         <xsl:value-of select="$parent-id"/>-<xsl:value-of select="position()"/>
       </xsl:variable>
  -    <call id="{$id}">
  +    <read-node id="{$id}">
         <xsl:apply-templates select="@*" mode="copy" />
  -    </call>
  +    </read-node>
     </xsl:template>
     
     <xsl:template match="map:call[@function]">
  
  
  

Mime
View raw message