Hi all,
The short question:
How do I find the URI of the current Cocoon subapplication?
E.g. if the sitemap is in cocoon/mount/gem/, I want the URI "mount/gem".
Here's what I'm trying to do:
Suppose I'm deep in a stylesheet somewhere and want to produce a URI
for creating a file (this will be sent to SourceWritingTransformer
as the href attribute).
>From experience, the URIs that work are
context:/path...
where "path" is relative to the Cocoon webapp top-level directory.
My "subapplication" (what's the right term?) is in cocoon/mount/gem,
i.e. that's where my main sitemap is.
So I want to produce something like
context:/mount/gem/foo/bar.xml
I've found that I can use the "request" InputModule in the sitemap to
get some of this information.
{request:requestURI} gives something like:
"/mount/gem/zip/zang.xml"
while {request:sitemapURI} gives
"zip/zang.xml"
for the same request.
Therefore, I can just cut sitemapURI off the end of requestURI
and get "/mount/gem", the URI of my subapplication.
This works just fine, at least when you're not recursively calling
pipelines within pipelines.
HOWEVER,
if you have something in your sitemap with
src="cocoon:/foo/bar.xml"
then there are two request URLs in play; and while the sitemapURI
gives a value based on the outer URL, the requestURI
gives a value based on the inner URL. So trying to cut off the sitemapURI
from the requestURI can give garbage.
If you know the name of the application ("gem") for sure, you
can do string surgery based on it. But in our practice, this
has sometimes changed ... gem2, gem-tmp, gem-bak, gem-trunk, etc.
So... does anyone have a foolproof way to find the URI of the application
(mount/gem)?
Thanks,
Lars
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]