Sylvain Wallez wrote:
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>
This is not "block friendly" IMO. Imagine you have 2 cforms applications in one cocoon every one having different forms.css

it is easier then to implement own overrides and fallback to default ones for ones developer does not care:

subsitemap:
<map:match pattern="cforms/css/**">
        <map:read src="cocoon:/skin-resource/styles/{1}"/>
</map:match>

parent sitemap:
<map:match pattern="cforms/**">
        <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/>
</map:match>


--
Leszek Gawron                                      [EMAIL PROTECTED]
IT Manager                                         MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Reply via email to