cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Crafter <craft...@dresdnerbank.de>
Subject Re: [C2/Patch] Selector Heaven :-)
Date Mon, 04 Dec 2000 16:31:20 GMT
Hi Davanum,

	Looks good. Thanks for checking it in. Attached is a patch which
	removes an unneeded conditional test from the factory, and one
	which adds the coded selector to the webapp/sitemap.xmap file as well.

	Cheers,

	Marcus

On Mon, 4 Dec 2000, Davanum Srinivas wrote:

> Marcus,
> Checked in... Please cross-check.
> 
> Thanks,
> dims
> 
> --- Marcus Crafter <crafterm@osa.de> wrote:
> > Hi Sylvain,
> >  
> > 	Thanks for your reply!
> > 
> > > > Yes I have :) Does it make sense to combine all Selectors above into
> > > > one and use a syntax like
> > > > 
> > > >   <map:when test="parameter.myparm eq "foo" and session.myvar gt 3"/>
> > > 
> > > So why not allow these expressions to be raw Java boolean expression
> > > which the CodeFactory can include as is in the sitemap generated code,
> > > thus avoiding interpretation overhead ?
> > 
> > 	Great idea. I've implemented it and attached it to this email under
> > 	the name of CodedSelectorFactory. :-)
> > 
> > 	Cheers,
> > 
> > 	Marcus
> > 
> > 	PS: The attached sitemap.diff will also need to be applied to the
> > 	current CVS sitemap.xsl file. It removes the inclusion of the 'test'
> > 	clauses in the generation of the class level variable names
> > 	(generate-node(.) creates unique id's for us anyway, and it saves us
> > 	the bother of having to translate all operators/whitespace into
> > 	underscores).
> > 
> > -- 
> >         .....
> >      ,,$$$$$$$$$,      Marcus Crafter
> >     ;$'      '$$$$:    Computer Systems Engineer
> >     $:         $$$$:   Open Software Associates GmbH
> >      $       o_)$$$:   82-84 Mainzer Landstrasse
> >      ;$,    _/\ &&:'   60327 Frankfurt Germany
> >        '     /( &&&
> >             _&&&&'     Email : Marcus.Crafter@osa.de
> >           &&&&.        Business Hours : +49 69 9757 200
> >     &&&&&&&:           After Hours    : +49 69 4908
6750
> > > Index: sitemap.xsl
> > ===================================================================
> > RCS file:
> >
> /home/cvspublic/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
> > retrieving revision 1.1.2.64
> > diff -u -r1.1.2.64 sitemap.xsl
> > --- sitemap.xsl	2000/12/02 11:54:17	1.1.2.64
> > +++ sitemap.xsl	2000/12/03 01:47:36
> > @@ -104,7 +104,6 @@
> >              <xsl:variable name="matcher-name">
> >                <xsl:call-template name="generate-name">
> >                  <xsl:with-param name="prefix">matcher_</xsl:with-param>
> > -                <xsl:with-param name="value" select="@pattern"/>
> >                  <xsl:with-param name="suffix"><xsl:value-of select="$type"/>_<xsl:value-of
> > select="generate-id(.)"/></xsl:with-param>
> >                </xsl:call-template>
> >              </xsl:variable>
> > @@ -127,7 +126,6 @@
> >            <xsl:variable name="matcher-name">
> >              <xsl:call-template name="generate-name">
> >                <xsl:with-param name="prefix">matcher_</xsl:with-param>
> > -              <xsl:with-param name="value" select="@pattern"/>
> >                <xsl:with-param name="suffix"><xsl:value-of select="$type"/>_<xsl:value-of
> > select="generate-id(.)"/></xsl:with-param>
> >              </xsl:call-template>
> >            </xsl:variable>
> > @@ -150,8 +148,7 @@
> >              <xsl:variable name="selector-name">
> >                <xsl:call-template name="generate-name">
> >                  <xsl:with-param name="prefix">selector_</xsl:with-param>
> > -                <xsl:with-param name="value" select="@test"/>
> > -                <xsl:with-param name="suffix"><xsl:value-of select="$type"/>_<xsl:value-of
> > select="generate-id(..)"/></xsl:with-param>
> > +                <xsl:with-param name="suffix"><xsl:value-of select="$type"/>_<xsl:value-of
> > select="generate-id(.)"/></xsl:with-param>
> >                </xsl:call-template>
> >              </xsl:variable>
> >              <xsl:variable name="this-test">
> > @@ -178,8 +175,7 @@
> >            <xsl:variable name="selector-name">
> >              <xsl:call-template name="generate-name">
> >                <xsl:with-param name="prefix">selector_</xsl:with-param>
> > -              <xsl:with-param name="value" select="@test"/>
> > -              <xsl:with-param name="suffix"><xsl:value-of select="$type"/>_<xsl:value-of
> > select="generate-id(..)"/></xsl:with-param>
> > +              <xsl:with-param name="suffix"><xsl:value-of select="$type"/>_<xsl:value-of
> > select="generate-id(.)"/></xsl:with-param>
> >              </xsl:call-template>
> >            </xsl:variable>
> >            <xsl:variable name="this-test">
> > @@ -386,7 +382,6 @@
> >      <xsl:variable name="matcher-name2">
> >        <xsl:call-template name="generate-name">
> >          <xsl:with-param name="prefix">matcher_</xsl:with-param>
> > -        <xsl:with-param name="value" select="@pattern"/>
> >          <xsl:with-param name="suffix"><xsl:value-of select="$matcher-type"/>_<xsl:value-of
> > select="generate-id(.)"/></xsl:with-param>
> >        </xsl:call-template>
> >      </xsl:variable>
> > @@ -460,8 +455,7 @@
> >        <xsl:variable name="selector-name2">
> >          <xsl:call-template name="generate-name">
> >            <xsl:with-param name="prefix">selector_</xsl:with-param>
> > -          <xsl:with-param name="value" select="@test"/>
> > -          <xsl:with-param name="suffix"><xsl:value-of select="$selector-type"/>_<xsl:value-of
> > select="generate-id(..)"/></xsl:with-param>
> > +          <xsl:with-param name="suffix"><xsl:value-of select="$selector-type"/>_<xsl:value-of
> > select="generate-id(.)"/></xsl:with-param>
> >          </xsl:call-template>
> >        </xsl:variable>
> >  
> > @@ -917,11 +911,9 @@
> >  
> >    <!-- replace invalid characters with underscores -->
> >    <xsl:template name="generate-name">
> > -    <xsl:param name="value"/>
> >      <xsl:param name="prefix"/>
> >      <xsl:param name="suffix"/>
> > -    <xsl:variable name="value1" select="translate($value,'/-
> > *?@:{}()[].#^\\$|!~\','______________________')"/>
> > -    <xsl:value-of select="$prefix"/><xsl:value-of
> > select='translate($value1,"'","")'/><xsl:value-of select="$suffix"/>
> > +    <xsl:value-of select="$prefix"/><xsl:value-of select="$suffix"/>
> >    </xsl:template>
> >  
> >    <!-- These are the usual utility templates for logicsheets -->
> > 
> 
> > ATTACHMENT part 3 application/octet-stream name=codedselector.tgz
> 
> 
> 
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
> 
> 

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : Marcus.Crafter@osa.de
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:           After Hours    : +49 69 49086750


Mime
View raw message