cocoon-users mailing list archives

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

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"
	src="org.apache.cocoon.selection.RequestParameterSelector">
	<parameter-name>command</parameter-name>
</map: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>
		<map:when test="SmileyEditView">
			<map:generate type="file" src="cocoon:/sp-get-smiley.xml"/>
		</map:when>
		<map:otherwise>
			<map:generate type="file" src="documents/smileys.xml"/>
		</map:otherwise>
	</map:select>
	<map:transform src="stylesheets/jconfer-page.xsl"/>
	<map:serialize type="html"/>
</map:match>

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
guess.
How to get an EJB from Cocoon... no idea sorry, I steered well clear of JSP, Servlets and
EJBs.

Regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message