cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Morandini" <>
Subject Smileys Cocoon sample... the sequel
Date Sun, 26 Jan 2003 12:35:12 GMT

I've developed a tentative Cocoon implemtation of your sample.

1) I've defined a suitable selector in order to switch to different contents according to
its value:
<map:selector name="command-selector"

2) Then use it to make the actual switching:
<map:match name="wildcard" pattern="*.html">
	<map:select type="command-selector">
		<map:when test="SysAdminView">
			<map:generate type="file" src="cocoon:/sp-getall-smileys.xml"/>
		<map:when test="SmileyEditView">
			<map:generate type="file" src="cocoon:/sp-get-smiley.xml"/>
			<map:generate type="file" src="documents/smileys.xml"/>
	<map:transform src="stylesheets/jconfer-page.xsl"/>
	<map:serialize type="html"/>

You may notice that now you don't have to aearch the servlets to understand how the content-reading
switching works, it is all in
one place: the pipeline.

This begs the question: where can you get your content from ? Or, better, how Cocoon deals
with RDBMS (which are the most common
persistence mechanism around).

Well, I use (as you may infer from the names I gave to contents URIs), Stored Procedures via
SQLTransformer. Probably not the
fastest way, but sure the most flexible and SoC-oriented.

You can use DatabaseActions, ESQL, or EJBs... which is the option appealing most to you, I
How to get an EJB from Cocoon... no idea sorry, I steered well clear of JSP, Servlets and


               Luca Morandini
               GIS Consultant

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message