cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist <>
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> 


and then match 'em like this:

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

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:


and in the sitemap:

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

That worked great.


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 

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

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}/{$}.continue" />

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 :-/



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

View raw message