cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Crafter <>
Subject Re: [C2/Patch] Selector Heaven :-)
Date Thu, 30 Nov 2000 15:01:35 GMT
Hi Giacomo,

On Thu, 30 Nov 2000, Giacomo Pati wrote:

> Awesome or awefull (I never really know which is correct). Sound really
> great. But let me bring up some thoughts poping up :)

	I hope 'awesome' was the word you were looking for :-)

	Thanks for your comments, my responses are listed below.

> > 	Each of the selectors use an underlying boolean engine which can
> > 	parse and evaluate strings for truthness. The boolean engine uses
> > JLex
> > 	and CUP to scan and parse strings according to a defined (and
> > 	extensible) grammar.
> Have you checked the license of those tools (no GPL allowed in apache
> cvs)

	I checked the license of thses tools. They're not GPL. The licence for
	Jlex is as follows (CUP is the same, different author though):


Copyright 1996 by Elliot Joel Berk. 

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is
hereby granted, provided that the above copyright notice appear in all copies
and that both the copyright notice and
this permission notice and warranty disclaimer appear in supporting
documentation, and that the name of Elliot Joel
Berk not be used in advertising or publicity pertaining to distribution of the
software without specific, written prior

Elliot Joel Berk disclaims all warranties with regard to this software,
including all implied warranties of merchantability
and fitness. In no event shall Elliot Joel Berk be liable for any special,
indirect or consequential damages or any
damages whatsoever resulting from loss of use, data or profits, whether in an
action of contract, negligence or other
tortious action, arising out of or in connection with the use or performance
of this software. 

	I'm not a lawyer, but it looks ok to me - What do you think ? Is it
	ok ?

> > 	Currently, the following operators (programmer-style and
> > 	english-style) are supported:
> > 
> > 	=, !=, <, >, <=, >=, &&, || , !, (, )
> AFAIK some of these symbols are illegal in XML documents (< > &).
> Shouldn't we get rid of them and use the following only [but of course
> keeping !, ( and )]

	I definitely tested the < and > symbols - they worked ok and there
	were no parse errors. I don't know about & as I used the 'and'
	alternative in my tests. I'll check this out and see if its a problem.

> and if I use something like
>    <map:select type="parm" test="myparm gt yourparm"/>

	This will work using string comparison. getParameter() returns a
	string, so the symbol created to represent this value will be a string. 

	If integer or floating point arithmetic is required, we'll need to
	find another solution ? any ideas ? attempting to convert the
	arguments to higher precedence types everytime could give us unwanted
	side effects.

> > 	I've also noticed that my coding style is a slightly different from
> > 	Apache's. Is there a code formatter one can use to automatically
> > 	format code according to Apache's guidelines ? (where are the
> > 	guidelines ?). Something like indent for C ?
> Apaches coding style is the same as sun's. There is a formatter in the
> C2 lib (JStyle and JBeautifier classes in the jstyle.jar which have a
> simple pipe aproche to use)
>    cat | \
>       java jstyle.JStyle | \
>       java jstyle.JBeautifier >

	Ok, thanks. I'll start to use it from now on.

> > 	If the Cocoon developers are OK with it, I'm happy for this to
> > 	be included in the general Cocoon 2 distribution. The files are
> > ready
> > 	to be dropped into CVS as is, except for the parser and scanner java
> > 	files which must be generated (I didn't touch the build.xml, perhaps
> > 	one of the other more 'ant' familiar developers might be able to
> > help
> Sure. No problem.


> > 	Well, if there any questions, problems, suggestions, etc, please let
> > 	me know. 
> Yes I have :)

	Great! :-) More than anything I wanted to start a productive
	discussion about what functionality people want.

> 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"/>
> I mean can we prefix the context of the variable used to test (header,
> parameter, session, context so far).

	This would be possible. Would you like me to try it out ?


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

View raw message