cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: Why two different matchers for project root and subdirectories?
Date Wed, 17 May 2006 09:00:20 GMT
Ferdinand Soethe schrieb:
>  
>
>
>
>
>
>
> Andrew Stevens wrote:
>
>   
>> How about just matching on "**" rather than "**/*"?
>>     
>
> That might work in some cases, but sometimes I need the filename on
> its own, for example to do a <map:select
> type="resource-exists">-cascade through the given directory and all
> parents.
>
> Or when need to split path from filename for something like (Forrest)
>
>         <map:match pattern="*.html">
>         <map:aggregate element="site">
>           <map:part src="cocoon:/skinconf.xml"/>
>           <map:part src="cocoon:/build-info"/>
>           <map:part src="cocoon:/tab-{0}"/>
>           <map:part src="cocoon:/menu-{0}"/>
>           <map:part src="cocoon:/body-{0}"/>
>         </map:aggregate>
>
> and
>
>         <map:match pattern="**/*.html">
>         <map:aggregate element="site">
>           <map:part src="cocoon:/skinconf.xml"/>
>           <map:part src="cocoon:/build-info"/>
>           <map:part src="cocoon:/{1}/tab-{2}.html"/>
>           <map:part src="cocoon:/{1}/menu-{2}.html"/>
>           <map:part src="cocoon:/{1}/body-{2}.html"/>
>         </map:aggregate>
>         <map:call resource="skinit">
>           <map:parameter name="type" value="site2xhtml"/>
>           <map:parameter name="path" value="{0}"/>
>         </map:call>
>       </map:match>        
>
> --
> Ferdinand Soethe
>   

Remember what I said about the pattern "cocoon:/{1}/tab-{2}.html " that 
they cause problems? The above is one example for this. The solution 
might be to use the regexp matcher.
Have a look at 
http://eris.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap?view=annotate

at line 97 to see a basic usage example. There are some other plugin 
which contain some other examples.

Happy regexp coding.

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


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


Mime
View raw message