cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-cocoon/webapp sitemap.xmap
Date Wed, 09 May 2001 16:42:29 GMT
dims        01/05/09 09:42:29

  Modified:    src/org/apache/cocoon/components/language/markup/sitemap/java
                        Tag: xml-cocoon2 sitemap.xsl
               src/org/apache/cocoon/selection Tag: xml-cocoon2
                        Selector.java
               webapp   Tag: xml-cocoon2 sitemap.xmap
  Added:       src/org/apache/cocoon/selection Tag: xml-cocoon2
                        ParameterSelectorFactory.java
  Log:
  Patch from Leo Sutic (leo.sutic@inspireinfrastructure.com ) for:
  "A Selector that tests on sitemap parameters".
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.111 +32 -4     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.110
  retrieving revision 1.1.2.111
  diff -u -r1.1.2.110 -r1.1.2.111
  --- sitemap.xsl	2001/04/30 14:17:08	1.1.2.110
  +++ sitemap.xsl	2001/05/09 16:42:15	1.1.2.111
  @@ -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.110 2001/04/30 14:17:08 bloritsch Exp $
  +     * @version CVS $Id: sitemap.xsl,v 1.1.2.111 2001/05/09 16:42:15 dims 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"/>";
  @@ -170,7 +170,7 @@
             <xsl:variable name="type" select="translate(@name, '- ', '__')"/>
             <xsl:variable name="default" select="@name = ../@default"/>
             <xsl:variable name="config" select="descendant-or-self::*"/>
  -          private boolean <xsl:value-of select="$name"/>Select (<xsl:value-of
select="java:getParameterSource($factory-loader, string($src),$config)"/> pattern, Map
objectModel) {
  +          private boolean <xsl:value-of select="$name"/>Select (<xsl:value-of
select="java:getParameterSource($factory-loader, string($src),$config)"/> pattern, Map
objectModel, Parameters param) {
               <xsl:value-of select="java:getMethodSource($factory-loader, string($src),$config)"/>
             }
             <xsl:for-each select="/map:sitemap/map:pipelines/map:pipeline/descendant::map:select[@type=$name
or (not(@type) and $default)]/map:when">
  @@ -565,7 +565,33 @@
           <xsl:with-param name="default"><xsl:value-of select="/map:sitemap/map:components/map:selectors/@default"/></xsl:with-param>
         </xsl:call-template>
       </xsl:variable>
  +   
  +	<!-- Modified 20010509 L.Sutic Changed to pass sitemap parameters. -->
  +   	
  +	<!-- test if we have to define parameters for this action -->
  +    <xsl:if test="count(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">
  +          param
  +        </xsl:when>
  +        <xsl:otherwise>
  +          emptyParam
  +        </xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:variable>
  +
  +    <!-- collect the parameters -->
  +    <xsl:apply-templates select="parameter">
  +        <xsl:with-param name="param">param</xsl:with-param>
  +    </xsl:apply-templates>
  +
  +	<!-- modification end -->
  +		
       <!-- loop through all the when cases -->
       <xsl:for-each select="./map:when">
   
  @@ -601,15 +627,17 @@
           </xsl:choose>
         </xsl:variable>
   
  +			
  +	  <!-- Modified 20010509 L.Sutic Changed to pass sitemap parameters. -->
         <!-- gets the string how the selector is to be invoced in java code -->
         <xsl:variable name="selector-name">
           <!-- check if we have a selector definition in this sitemap otherwise get it
from the parent -->
           <xsl:choose>
             <xsl:when test="string($is-factory)='true'">
  -            <xsl:value-of select="translate($selector-type, '- ', '__')"/>Select(<xsl:value-of
select="$selector-name2"/>_expr, objectModel)
  +            <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)
  +            ((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:otherwise>
           </xsl:choose>
         </xsl:variable>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.11  +5 -2      xml-cocoon/src/org/apache/cocoon/selection/Attic/Selector.java
  
  Index: Selector.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/selection/Attic/Selector.java,v
  retrieving revision 1.1.2.10
  retrieving revision 1.1.2.11
  diff -u -r1.1.2.10 -r1.1.2.11
  --- Selector.java	2001/04/30 14:17:35	1.1.2.10
  +++ Selector.java	2001/05/09 16:42:24	1.1.2.11
  @@ -9,11 +9,13 @@
   
   import java.util.Map;
   import org.apache.avalon.framework.component.Component;
  +import org.apache.avalon.framework.parameters.Parameters;
   
   /**
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/04/30 14:17:35 $
  + * @author <a href="mailto:leo.sutic">Leo Sutic</a>
  + * @version CVS $Revision: 1.1.2.11 $ $Date: 2001/05/09 16:42:24 $
    */
   public interface Selector extends Component {
       /**
  @@ -23,9 +25,10 @@
        * @param objectModel The <code>Map</code> containing object of the
        *                    calling environment which may be used
        *                    to select values to test the expression.
  +     * @param parameters  The sitemap parameters, as specified by &lt;parameter/&gt;
tags.
        * @return boolean    Signals successfull test.
        */
  -    boolean select (String expression, Map objectModel);
  +    boolean select (String expression, Map objectModel, Parameters parameters);
   }
   
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +70 -0     xml-cocoon/src/org/apache/cocoon/selection/Attic/ParameterSelectorFactory.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.59  +1 -0      xml-cocoon/webapp/Attic/sitemap.xmap
  
  Index: sitemap.xmap
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/webapp/Attic/sitemap.xmap,v
  retrieving revision 1.1.2.58
  retrieving revision 1.1.2.59
  diff -u -r1.1.2.58 -r1.1.2.59
  --- sitemap.xmap	2001/05/08 14:23:29	1.1.2.58
  +++ sitemap.xmap	2001/05/09 16:42:27	1.1.2.59
  @@ -80,6 +80,7 @@
       <browser name="netscape" useragent="Mozilla"/>
      </map:selector>
      <map:selector name="coded" factory="org.apache.cocoon.selection.CodedSelectorFactory"/>
  +   <map:selector name="parameter" factory="org.apache.cocoon.selection.ParameterSelectorFactory"/>
     </map:selectors>
   
     <map:matchers default="wildcard">
  
  
  

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