Reinier van den Born wrote:
Hi,

I am doing a multisite project and configured a locationmap as described in:
    http://www.hippocms.org/display/CMS/Using+different+types+per+folder
to restrict the document types per site subtree (subfolders in /content).

Now when I match using a pattern like:
    *:/content/site
the document types are restricted in the main site folder (content/site) but not in any subfolders.

Conversely, when I use a pattern like:
    *:/content/folder/**
then the document types are resctricted in the entire subtree but not in content/site itself.

I can also use:
    *:/content/site/*
which restricts document types only in immediate subfolders of content/site but again not in the site folder itself.

So it seems that for every site I will need two match rules, or is there some way around this?

The above I guessed, also from looking at the preview configuration in the location map.
Is there any more documentation on the pattern language?
Or can you point me at the code so I can figure it out myself...


there is no documentation AFAIK. The code for the locationmap module can be found here:

http://svn.hippocms.org/viewvc/hippo-cocoon-extensions/trunk/locationmap/src/java/nl/hippo/forrest/locationmap/

I think you're using the default WilcardLocationMapMatcher, but you can plugin your own matcher. You can then add a "type" attribute to a match element to use your custom matcher, e.g.:

<?xml version="1.0" encoding="UTF-8"?>
<locationmap xmlns="http://apache.org/forrest/locationmap/1.0";>
<components>
   <matchers default="locationmap">
     <matcher name="locationmap" 
src="nl.hippo.forrest.locationmap.WildcardLocationMapHintMatcher"/>
     <matcher name="myCustomMatcher" src="my.custom.Matcher"/>
   </matchers>
 </components>
<locator> <match pattern="types:/content/site**" type="myCustomMatcher"> <location src=""/> </match>

   <match pattern="preview-url:**">
     <!-- no preview url defined by default -->
     <location src=""/>
   </match>
</locator> </locationmap>


I didn't test this, so I can't give any guarantees :) but I think it should work.

regards,
Dennis




Thanks,

Reinier

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html


********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to