cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject RFC: Logic TagLib
Date Thu, 11 Jan 2001 19:22:44 GMT
Dear Cocooners,

I develop XSP TagLibs, as part of my work on the CRUDLET project.


We have developed a draft proposal of a TagLib for handling "content logic"
for webapps; to allow contextual content selection logic to be encoded in
an XSP page without the user having to write Java Code inside <xsp:logic/>

This is something that was critical for our project to allow us to develop
in a more scaleable way to the techniques we are using now.

The Logic TagLib was designed to be generic it has no dependencies on the
CRUDLET project, it was always intended to be contributed to Cocoon.

We invite all interested parties to read and comment on the proposal.


I understand that some people may find this controversial .... I am not too
worried, we know it is something we need ;) but I am interested in your
opinions and I am totally prepared to alter the specification, or to not
incorporate it into Cocoon or whatever, depending on the response.

As a taster, here are two examples from the proposal:

A simple test for equality between the value that arrived in the request
parameter called "blag" and an empty String. If the parameter was empty,
the TextNode "The request param is empty" is output to the parent element
of the <logic:if/> tag; otherwise there is no output.

		<logic:test op="eq">
			<logic:arg><request:get-parameter name="blag"/></logic:arg>
		<logic:then>The request param is empty</logic:then>

This is a typical use of the <logic:choose/> tag whereby multiple
<logic:when/> clauses are evaluated until one of them returns something. If
none of them returned anything, the contents of <logic:otherwise/> is
output. There should be one or more <logic:when/> clauses and only one
<logic:otherwise/>. The equivalent forms of nesting available to the
<logic:if/> tag will also work with the <logic:choose/> tag.

			<logic:test op="eq">
				<logic:arg><request:get-parameter name="type"/></logic:arg>
			<logic:then>This is a Fish</logic:then>
			<logic:test op="eq">
				<logic:arg><request:get-parameter name="type"/></logic:arg>
			<logic:then>This is a Dogcow</logic:then>
		<logic:otherwise>It was none of the above</logic:otherwise>

This will get implemented over the coming weeks.

Let me know what you think, (but please read the whole thing first ;)


regards Jeremy

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <>     		 <>
    <phone:+44.[0].20.7737.6831>        <>
View raw message