cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist <mlundqui...@comcast.net>
Subject [cforms] Matching continuation resources
Date Tue, 14 Dec 2004 18:31:23 GMT
Hi everyone,

When I first started using CForms, I would write  my <ft:form-template> 
with

	action="{$continuation.id}.continue"

and then match 'em like this:

	<map:match pattern="*.continue">
		<call continuation="{1}" />
	</map:match>

That worked fine, until I had forms served at URIs nested more than one 
level deep in the webapp URI space.  Because the URI in the served form 
page is relative, the request might come back with a path that is 
really "foo/bar/835746597348942.continue", and that doesn't hit in the 
matcher shown above.  "Aha," I thought, "the solution is to make the 
URI absolute" , like this:

	action="/{$continuation.id}.continue"

and in the sitemap:

	<map:match pattern="/*.continue">
		<call continuation="{1}" />
	</map:match>

That worked great.

Until...

Until I mounted a subsitemap that also served forms.  What happens is 
that the continuation resource is matched correctly, but it's matched 
in the context of the root sitemap.  So, when the flowscript does a 
cocoon.sendPage() after the return from showForm(), it's not resolved 
in the context of the subsitemap, and the redirect is really to a 
non-existent resource in the root sitemap.

So it's clear that each subsitemap has to have its own matcher for 
continuations, and the continuation URIs have to be relative.  But that 
puts me back where I started.  I guess I can use two matchers, like 
this:

	<map:match pattern="*.continue">
		<call continuation="{1}" />
	</map:match>
	<map:match pattern="**/*.continue">
  		<call continuation="{2}" />
	</map:match>

But that seems klunky.

If there were some way for the subsitemap to know it's mount point, 
then I could use the (undocumented) form-action parameter to the 
FormsTemplateTransformer, something like this:

	<map:transform type="forms>
		<map:parameter name="form-action" 
value="{mount-uri}/{$continuation.id}.continue" />
	</map:transform>

Acctually, this is not the first time I've wished for a sitemap to be 
able to know it's mount point.  I can't remember why I wanted it 
before, though :-/

Thoughts?

~ml


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


Mime
View raw message