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
[EMAIL PROTECTED]
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>