cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject RE: cvs commit: xml-cocoon/webapp/docs/samples/xsp cookie.xsp
Date Thu, 19 Apr 2001 13:48:52 GMT

>--- Jeremy Quinn <jeremy@media.demon.co.uk> wrote:

>> This is why I suggested earlier that some way be found to compile Actions
>> from XML like happens with XSP and generators, so that non-java programmers
>> can once again leverage the power of TagLibs that they loose by moving to
>> C2.

At 5:32 AM -0700 19/4/01, Davanum Srinivas wrote:
>Jeremy,
>Can you take a stab at a sample action specified in XML to illustrate your
>point of view?

Eek!

OK, I'll have a go.

What I have in my head was the statement from Ricardo Rocha that one day
XSP would be able to generate _any_ type of class.

I have no idea what the XSP syntax would be, so please take this with a
grain of salt. Also please keep in mind that I understand very little of
C2, and this sample is drawn from my C1 experience (and consequentially
uses C1 namespaces).

What I am trying to show here is what an Action generated from XSP that
modifies a file using the FP Taglib might look like as XML, so this is an
Action not a Generator.


<xsp:action
	xmlns:fp="http://apache.org/cocoon/XSP/FP/1.0"
	xmlns:map="http://www.apache.org/2001/XSP/Sitemap"
	xmlns:xsp="http://www.apache.org/1999/XSP/Core"
	language="java"
>

	<action>

		<!-- set up the TagLib using values from the Map(?) -->

		<fp:resource id="external-item">
			<fp:resource-file><map:read-param
name="file-to-modify"/></fp:resource-file>
			<fp:resource-node>item[position()=<map:get-request-parameter
name="item"/>]</fp:resource-node>
			<fp:default-mode>replace</fp:default-mode>
		</fp:resource>

		<!-- Send success/failure response from TagLib out via the Map Object -->
		<!-- There are obviously a bunch of different ways this could be done -->

		<map:write-param name="set-title-status">

			<!-- perform something using a TagLib with data from the Map -->

			<fp:write to="external-item" select="title">
				<map:get-request-parameter name="title"/>
			</fp:write>

		</map:write-param>

	</action>
</xsp:action>


This is obviously completely hypothetical!!!

I hopes this illustrates the idea better Dims.


regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message