forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: OutOfMemoryException with customized project sitemap. Was: linkmap customization
Date Thu, 29 Dec 2005 14:52:04 GMT
Tim Williams wrote:
> On 12/29/05, Ross Gardler <rgardler@apache.org> wrote:
> 
>>David Crossley wrote:
>>
>>>Torsten Stolpmann wrote:
>>>
>>>
>>>>David Crossley wrote:
>>>>
>>
>>...
>>
>>

...

>>>>For the <map:match pattern="*.html"> and
>>>>the <map:match pattern="**/*.html"> blocks the changes consist of an
>>>>additional <map:part src="cocoon:/news/news.xml"/> statement.
>>>
>>>
>>>For that sort of change, i recommend that you
>>>make your adjustments directly to the core sitemap.
>>
>>I disagree. Modifying the core sitemap will create problems upgrading to
>>future versions of Forrest as the changes will have to be merged, and
>>there are *lots* of changes in the next release. By doing it in a
>>project sitemap there should be no need to edit the extension.
>>
>>I think you will also need to copy the "skinit" resource into your
>>project sitemap to make this work, but try it without first (less
>>maintenance when upgrading).
>>
>>An alternative approach would be to use an internal plugin. However, in
>>this case since the Dispatcher will make doing this kind of thing much
>>easier the plugin is unlikely to be reused. Therefore I wouldn't bother
>>with the extra overhead.
>>
>>
>>>The project sitemap is not really intended to over-ride
>>>the core in this way. See comments by Tim earlier in this
>>>thread.
>>
>>There is no problem with the project sitemap overriding core. In fact it
>>is designed to do so. Just make sure the only matches in your sitemap
>>are for the pipelines you want to override. In this case the "**.html"
>>ones.
>>
>>Ross
> 
> 
> I think you're going to run into problems overriding only the **.html
> and **/*.html pipes.  I played around a bit yesterday with this but
> didn't have time to come to any real solution.  I *think* what's
> happening is that it is recursively calling itself when it gets to the
> body-*.html, menu-*.html, etc matches since **.html is such a greedy
> match.  I confirmed there's no major problem with your sitemap by
> changing the extension to html2 and manually putting in an .html
> extension in the aggregation section.  

Yes, that is a good point.

The solution is therefore to use a regexp matcher in the project sitemap 
so that it does not match body-* and menu-* etc. This will allow you to 
use the sitemap extension mechanism without touching the core sitemap. I 
*strongly* advise against touching any of the core Forrest files as it 
will cause problems for you in upgrading Forrest in the future.

There are examples of regexp matchers in the core sitemap. I'm pretty 
poor with regular expressions, if you don't know what to put in the 
pattern ask here, I'm sure there will be someone who can tell you how to 
match

**.html but not (**/menu-*.html or **/body-*.html or **/tabs-*.html)

(I think they are the only ones you need to avoid).

Ross

Mime
View raw message