Leszek Gawron wrote:
Sylvain Wallez wrote:
<snip/>
Additionally, we should have a system-defined URI which allows
clients to fetch these resources, implemented in the root sitemap:
<map:match pattern="_cocoon_/*/**">
<map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
</map:match>
By standardizing this URI pattern, we can easily solve
cross-referencing problems among resources, e.g. CForms XSLs having
to produce <script src="..."/> to load the JS files, etc.
This URI pattern could even be written **_cocoon_/*/** to be
location-independent so that we don't have to mess around with
{request:contextPath}.
This is a good idea with one small "but": <map:match
pattern="_cocoon_/*/**"> should be the last pipeline definition to
make overriding in subsitemaps as easy as possible.
Yep. In which case **_cocoon_/*/** (location-independent) may be better
to allow local overrides in some subsitemaps or sub-applications. The
standard implementation of this URI could also be written:
<map:match pattern="**_cocoon_/*/**">
<map:act type="resource-exists" src="context://resources/{2}/{3}">
<!-- resource overriden by the application -->
<map:read src="context://resources/{2}/{3}"/>
</map:act>
<map:read src="resource://org/apache/cocoon/{2}/resources/{3}"/>
</map:match>
Sylvain
--
Sylvain Wallez Anyware Technologies
http://people.apache.org/~sylvain http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director