cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject cvs commit: xml-cocoon2/webapp/protected sitemap.xmap
Date Tue, 22 May 2001 16:21:30 GMT
sylvain     01/05/22 09:21:28

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        sitemap.xsl
               webapp   sitemap.xmap
               webapp/i18n sitemap.xmap
               webapp/protected sitemap.xmap
  Log:
  Moved parameters to sitemap namespace (map:parameter) and deprecated use of map:value in
configurations
  
  Revision  Changes    Path
  1.8       +76 -26    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- sitemap.xsl	2001/05/18 16:45:50	1.7
  +++ sitemap.xsl	2001/05/22 16:20:47	1.8
  @@ -99,7 +99,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.7 2001/05/18 16:45:50 dims Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.8 2001/05/22 16:20:47 sylvain 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"/>";
  @@ -503,15 +503,22 @@
         <xsl:value-of select="java:isFactory($factory-loader, string(/map:sitemap/map:components/map:matchers/map:matcher[@name=$matcher-type]/@src))"/>
       </xsl:variable>
   
  +    <!-- break on error when old parameter syntax exists -->
  +    <xsl:if test="parameter">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">Sitemap parameters should now be in the sitemap
namespace (map:parameter).</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <!-- test if we have to define parameters for this matcher -->
  -    <xsl:if test="count(parameter)>0">
  +    <xsl:if test="count(map:parameter)>0">
         param = new Parameters ();
       </xsl:if>
   
       <!-- generate the value used for the parameter argument in the invocation of this
matcher -->
       <xsl:variable name="component-param">
         <xsl:choose>
  -        <xsl:when test="count(parameter)>0">
  +        <xsl:when test="count(map:parameter)>0">
             param
           </xsl:when>
           <xsl:otherwise>
  @@ -521,7 +528,7 @@
       </xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
           <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
  @@ -562,15 +569,22 @@
   
       <!-- Modified 20010509 L.Sutic Changed to pass sitemap parameters. -->
   
  +    <!-- break on error when old parameter syntax exists -->
  +    <xsl:if test="parameter">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">Sitemap parameters should now be in the sitemap
namespace (map:parameter).</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <!-- test if we have to define parameters for this action -->
  -    <xsl:if test="count(parameter)>0">
  +    <xsl:if test="count(map:parameter)>0">
         param = new Parameters ();
       </xsl:if>
   
       <!-- generate the value used for the parameter argument in the invocation of the
act method of this action -->
       <xsl:variable name="component-param">
         <xsl:choose>
  -        <xsl:when test="count(parameter)>0">
  +        <xsl:when test="count(map:parameter)>0">
             param
           </xsl:when>
           <xsl:otherwise>
  @@ -580,23 +594,30 @@
       </xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
           <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
  -    <!-- modification end -->
  -
  +    <!-- modification end -->		
  +		
   	<!-- Modified 20010510 L.Sutic Changed to pass sitemap parameters. -->
   
  +    <!-- break on error when old parameter syntax exists -->
  +    <xsl:if test="parameter">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">Sitemap parameters should now be in the sitemap
namespace (map:parameter).</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
   	<!-- test if we have to define parameters for this action -->
  -    <xsl:if test="count(parameter)>0">
  +    <xsl:if test="count(map:parameter)>0">
         param = new Parameters ();
       </xsl:if>
   
       <!-- generate the value used for the parameter argument in the invocation of the
act method of this action -->
       <xsl:variable name="component-param">
         <xsl:choose>
  -        <xsl:when test="count(parameter)>0">
  +        <xsl:when test="count(map:parameter)>0">
             param
           </xsl:when>
           <xsl:otherwise>
  @@ -606,7 +627,7 @@
       </xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
           <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
  @@ -695,15 +716,22 @@
         ((Action)this.actions.select("<xsl:value-of select="$action-type"/>")).act
       </xsl:variable>
   
  +    <!-- break on error when old parameter syntax exists -->
  +    <xsl:if test="parameter">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">Sitemap parameters should now be in the sitemap
namespace (map:parameter).</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <!-- test if we have to define parameters for this action -->
  -    <xsl:if test="count(parameter)>0">
  +    <xsl:if test="count(map:parameter)>0">
         param = new Parameters ();
       </xsl:if>
   
       <!-- generate the value used for the parameter argument in the invocation of the
act method of this action -->
       <xsl:variable name="component-param">
         <xsl:choose>
  -        <xsl:when test="count(parameter)>0">
  +        <xsl:when test="count(map:parameter)>0">
             param
           </xsl:when>
           <xsl:otherwise>
  @@ -713,13 +741,13 @@
       </xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
         <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
       <!-- generate the invocation of the act method of the action component -->
       <xsl:choose>
  -      <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0']">
  +      <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0' and
local-name() != 'parameter']">
           if ((map = <xsl:value-of select="$action-name"/> (environment, objectModel,
substitute(listOfMaps,<xsl:value-of select="$action-source"/>), <xsl:value-of select="$component-param"/>))
!= null) {
            getLogger().debug("Action <xsl:value-of select="translate($action-name,'&quot;','
')"/>");
             listOfMaps.add (map);
  @@ -764,7 +792,7 @@
       <xsl:variable name="component-param">nparam</xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
         <xsl:with-param name="param" select="$component-param"/>
       </xsl:apply-templates>
   
  @@ -772,7 +800,7 @@
   
       <!-- generate the invocation of the act method of the action component -->
       <xsl:choose>
  -      <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0']">
  +      <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0' and
local-name() != 'parameter']">
           if ((map = <xsl:value-of select="$action-name"/> (environment, objectModel,
substitute(listOfMaps,<xsl:value-of select="$action-source"/>), <xsl:value-of select="$component-param"/>))
!= null) {
            getLogger().debug("Action <xsl:value-of select="translate($action-name,'&quot;','
')"/>");
             listOfMaps.add (map);
  @@ -810,15 +838,22 @@
         action_set_<xsl:value-of select="$action-set"/>
       </xsl:variable>
   
  +    <!-- break on error when old parameter syntax exists -->
  +    <xsl:if test="parameter">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">Sitemap parameters should now be in the sitemap
namespace (map:parameter).</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <!-- test if we have to define parameters for this action -->
  -    <xsl:if test="count(parameter)>0">
  +    <xsl:if test="count(map:parameter)>0">
         param = new Parameters ();
       </xsl:if>
   
       <!-- generate the value used for the parameter argument in the invocation of the
act method of this action -->
       <xsl:variable name="component-param">
         <xsl:choose>
  -        <xsl:when test="count(parameter)>0">
  +        <xsl:when test="count(map:parameter)>0">
             param
           </xsl:when>
           <xsl:otherwise>
  @@ -828,13 +863,13 @@
       </xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
           <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
       <!-- generate the invocation of the act method of the action component -->
       <xsl:choose>
  -      <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0']">
  +      <xsl:when test="./*[namespace-uri()='http://apache.org/cocoon/sitemap/1.0' and
local-name() != 'parameter']">
           if ((map = <xsl:value-of select="$action-name"/> (cocoon_action, listOfMaps,
environment, objectModel, substitute(listOfMaps,<xsl:value-of select="$action-source"/>),
<xsl:value-of select="$component-param"/>)) != null) {
            getLogger().debug("Action <xsl:value-of select="translate($action-name,'&quot;','
')"/>");
             listOfMaps.add (map);
  @@ -1051,7 +1086,7 @@
     </xsl:template> <!-- match="map:part" -->
   
     <!-- collect parameter definitions -->
  -  <xsl:template match="map:pipeline//parameter | map:action-set//parameter">
  +  <xsl:template match="map:pipeline//map:parameter | map:action-set//map:parameter">
       <xsl:param name="param"/>
       <xsl:if test="not($param='')">
         <xsl:value-of select="$param"/>.setParameter ("<xsl:value-of select="@name"/>",
substitute(listOfMaps, "<xsl:value-of select="@value"/>"));
  @@ -1127,6 +1162,14 @@
         <xsl:value-of select="concat($nsprefix, ':value')"/>
       </xsl:variable>
   
  +    <!-- break on error when old map:value syntax exists -->
  +    <xsl:if test="attribute::*[name(.)=$qname]">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">"map:value" has been deprecated. Use child
text nodes for the value.</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
  +
       <!-- process content -->
       <xsl:for-each select="$components">
         {
  @@ -1200,15 +1243,22 @@
         </xsl:call-template>
       </xsl:variable>
   
  +    <!-- break on error when old parameter syntax exists -->
  +    <xsl:if test="parameter">
  +      <xsl:call-template name="error">
  +        <xsl:with-param name="message">Sitemap parameters should now be in the sitemap
namespace (map:parameter).</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:if>
  +
       <!-- test if we have to define parameters for this component -->
  -    <xsl:if test="count(parameter)>0">
  +    <xsl:if test="count(map:parameter)>0">
         param = new Parameters ();
       </xsl:if>
   
       <!-- generate the value used for the parameter argument in the invocation of the
act method of this action -->
       <xsl:variable name="component-param">
         <xsl:choose>
  -        <xsl:when test="count(parameter)>0">
  +        <xsl:when test="count(map:parameter)>0">
             param
           </xsl:when>
           <xsl:otherwise>
  @@ -1218,7 +1268,7 @@
       </xsl:variable>
   
       <!-- collect the parameters -->
  -    <xsl:apply-templates select="parameter">
  +    <xsl:apply-templates select="map:parameter">
           <xsl:with-param name="param">param</xsl:with-param>
       </xsl:apply-templates>
   
  
  
  
  1.8       +20 -20    xml-cocoon2/webapp/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- sitemap.xmap	2001/05/22 12:42:45	1.7
  +++ sitemap.xmap	2001/05/22 16:21:06	1.8
  @@ -21,14 +21,14 @@
   
     <map:transformers default="xslt">
      <map:transformer     name="xslt"      src="org.apache.cocoon.transformation.TraxTransformer">
  -    <use-store map:value="true"/>
  -    <use-request-parameters map:value="false"/>
  -    <use-browser-capabilities-db map:value="false"/>
  +    <use-store>true</use-store>
  +    <use-request-parameters>false</use-request-parameters>
  +    <use-browser-capabilities-db>false</use-browser-capabilities-db>
      </map:transformer>
      <map:transformer     name="ext-xslt"      src="org.apache.cocoon.transformation.TraxTransformer">
  -    <use-store map:value="true"/>
  -    <use-request-parameters map:value="true"/>
  -    <use-browser-capabilities-db map:value="true"/>
  +    <use-store>true</use-store>
  +    <use-request-parameters>true</use-request-parameters>
  +    <use-browser-capabilities-db>true</use-browser-capabilities-db>
      </map:transformer>
      <map:transformer     name="log"       src="org.apache.cocoon.transformation.LogTransformer"/>
      <map:transformer     name="sql"       src="org.apache.cocoon.transformation.SQLTransformer"/>
  @@ -293,7 +293,7 @@
      <map:match pattern="news/aggregate.xsp">
       <map:generate type="serverpages" src="docs/samples/xsp/aggregate.xsp"/>
       <map:transform src="stylesheets/news/news.xsl">
  -        <parameter name="view-source" value="docs/samples/xsp/aggregate.xsp"/>
  +        <map:parameter name="view-source" value="docs/samples/xsp/aggregate.xsp"/>
       </map:transform>
       <map:serialize/>
      </map:match>
  @@ -373,15 +373,15 @@
      -->
      <map:match type="regexp" pattern="i18n/images/(.*)_(.*)_(.*).png">
       <map:generate type="serverpages" src="docs/samples/i18n/navimages.xsp">
  -     <parameter name="text" value="{1}"/>
  -     <parameter name="lang" value="{2}"/>
  -     <parameter name="kind" value="{3}"/>
  +     <map:parameter name="text" value="{1}"/>
  +     <map:parameter name="lang" value="{2}"/>
  +     <map:parameter name="kind" value="{3}"/>
       </map:generate>
       <map:transform type="i18n" src="docs/samples/i18n/nav_trans.xml">
  -     <parameter name="lang" value="{2}"/>
  -     <parameter name="default_lang" value="en"/>
  -     <parameter name="available_lang_1" value="en"/>
  -     <parameter name="available_lang_2" value="de"/>
  +     <map:parameter name="lang" value="{2}"/>
  +     <map:parameter name="default_lang" value="en"/>
  +     <map:parameter name="available_lang_1" value="en"/>
  +     <map:parameter name="available_lang_2" value="de"/>
       </map:transform>
       <map:serialize type="svg2png"/>
      </map:match>
  @@ -390,7 +390,7 @@
      <map:match pattern="xsp/*">
       <map:generate type="serverpages" src="docs/samples/xsp/{1}.xsp"/>
       <map:transform src="stylesheets/dynamic-page2html.xsl">
  -        <parameter name="view-source" value="docs/samples/xsp/{1}.xsp"/>
  +        <map:parameter name="view-source" value="docs/samples/xsp/{1}.xsp"/>
       </map:transform>
       <map:serialize/>
      </map:match>
  @@ -403,7 +403,7 @@
      <map:match pattern="sql/*">
       <map:generate src="docs/samples/sql/{1}.xml"/>
       <map:transform type="sql">
  -      <parameter name="use-connection" value="personnel"/>
  +      <map:parameter name="use-connection" value="personnel"/>
       </map:transform>
       <map:transform src="stylesheets/simple-sql2html.xsl"/>
       <map:serialize/>
  @@ -412,10 +412,10 @@
      <!-- ========================== Forms ================================= -->
      <map:match pattern="forms/employee">
        <map:act set="employee">
  -       <parameter name="form-descriptor" value="context://docs/samples/forms/employee.xml"/>
  +       <map:parameter name="form-descriptor" value="context://docs/samples/forms/employee.xml"/>
          <map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
          <map:transform src="stylesheets/dynamic-page2html.xsl">
  -          <parameter name="view-source" value="docs/samples/forms/employee.xsp"/>
  +          <map:parameter name="view-source" value="docs/samples/forms/employee.xsp"/>
          </map:transform>
          <map:serialize/>
        </map:act>
  @@ -424,7 +424,7 @@
      <map:match pattern="forms/*">
        <map:generate type="serverpages" src="docs/samples/forms/{1}.xsp"/>
        <map:transform src="stylesheets/dynamic-page2html.xsl">
  -        <parameter name="view-source" value="docs/samples/forms/{1}.xsp"/>
  +        <map:parameter name="view-source" value="docs/samples/forms/{1}.xsp"/>
        </map:transform>
        <map:serialize/>
      </map:match>
  @@ -437,7 +437,7 @@
      <map:match pattern="session/*.xsp*">
        <map:generate type="serverpages" src="docs/samples/session/{1}.xsp"/>
        <map:transform src="stylesheets/dynamic-page2html.xsl">
  -        <parameter name="view-source" value="docs/samples/session/{1}.xsp"/>
  +        <map:parameter name="view-source" value="docs/samples/session/{1}.xsp"/>
        </map:transform>
        <map:serialize/>
      </map:match>
  
  
  
  1.4       +8 -8      xml-cocoon2/webapp/i18n/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/i18n/sitemap.xmap,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sitemap.xmap	2001/05/22 14:53:37	1.3
  +++ sitemap.xmap	2001/05/22 16:21:16	1.4
  @@ -5,12 +5,12 @@
   		<map:generators default="file"/>
   		<map:transformers default="xslt">
   			<map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer2">
  -				<parameter name="available_lang_1" value="en"/>
  -				<parameter name="available_lang_2" value="ru"/>
  -				<parameter name="available_lang_3" value="de"/>
  -				<parameter name="available_lang_4" value="pl"/>
  -				<parameter name="available_lang_5" value="sp"/>
  -				<parameter name="available_lang_6" value="hy"/>
  +				<map:parameter name="available_lang_1" value="en"/>
  +				<map:parameter name="available_lang_2" value="ru"/>
  +				<map:parameter name="available_lang_3" value="de"/>
  +				<map:parameter name="available_lang_4" value="pl"/>
  +				<map:parameter name="available_lang_5" value="sp"/>
  +				<map:parameter name="available_lang_6" value="hy"/>
   			</map:transformer>
   		</map:transformers>
   		<map:readers default="resource"/>
  @@ -26,7 +26,7 @@
   			<map:match pattern="**.xml">
   				<map:generate src="{1}.xml"/>
   				<map:transform type="i18n">
  -					<parameter name="src" value="translations/{1}_dict.xml"/>
  +					<map:parameter name="src" value="translations/{1}_dict.xml"/>
   				</map:transform>
   				<map:transform src="simple.xsl"/>
   				<map:serialize/>
  @@ -34,7 +34,7 @@
   			<map:match pattern="**.xsp">
   				<map:generate type="serverpages" src="{1}.xsp"/>
   				<map:transform type="i18n">
  -					<parameter name="src" value="translations/{1}_dict.xml"/>
  +					<map:parameter name="src" value="translations/{1}_dict.xml"/>
   				</map:transform>
   				<map:transform src="simple.xsl"/>
   				<map:serialize/>
  
  
  
  1.3       +5 -5      xml-cocoon2/webapp/protected/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/webapp/protected/sitemap.xmap,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sitemap.xmap	2001/05/22 14:53:47	1.2
  +++ sitemap.xmap	2001/05/22 16:21:24	1.3
  @@ -58,11 +58,11 @@
         <map:match pattern="do-login">
           <!-- first validate whether submitted values are ok -->
           <map:act type="form-validator">
  -          <parameter name="descriptor" value="context://protected/descriptors/params.xml"/>
  -          <parameter name="validate" value="username"/>
  +          <map:parameter name="descriptor" value="context://protected/descriptors/params.xml"/>
  +          <map:parameter name="validate" value="username"/>
             <!-- now try to log in -->
             <map:act type="db-authenticator">
  -            <parameter name="descriptor" value="context://protected/descriptors/auth.xml"/>
  +            <map:parameter name="descriptor" value="context://protected/descriptors/auth.xml"/>
               <!-- now go to protected area -->
               <map:redirect-to uri="protected"/>
             </map:act>
  @@ -77,8 +77,8 @@
         <map:match pattern="protected">
           <!-- first validate whether user has logged in -->
           <map:act type="session-validator">
  -          <parameter name="descriptor" value="context://protected//descriptors/params.xml"/>
  -          <parameter name="validate" value="username,department_id,theme"/>
  +          <map:parameter name="descriptor" value="context://protected//descriptors/params.xml"/>
  +          <map:parameter name="validate" value="username,department_id,theme"/>
             <!-- generate protected content -->
             <map:generate type="serverpages" src="docs/protected.xsp"/>
             <map:transform src="stylesheets/{theme}-page2html.xsl"/>
  
  
  

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