You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by Apache Wiki <wi...@apache.org> on 2006/08/30 10:49:57 UTC

[Cocoon Wiki] Trivial Update of "SitemapURIModule" by NicoVerwer

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.

The following page has been changed by NicoVerwer:
http://wiki.apache.org/cocoon/SitemapURIModule

------------------------------------------------------------------------------
- __NOTE: This module is no longer of any use. An extension to the `RequestModule` will be proposed__
+ __NOTE: This module is no longer of any use. An extension to the `RequestModule` has been implemented; You can now use {request:sitemapURIPrefix}__
  
  This is an input module that determines the absolute URI to the base of the sitemap.
  It can help you to make your Cocoon application relocatable.
- The problem with this was described by Gianugo [http://www.rabellino.it/blog/index.php?title=things_to_remember_for_the_next_cocoon_p&more=1&c=1&tb=1&pb=1]:
+ The problem with this was described by Gianugo [http://www.rabellino.it/blog/?p=68]:
  
    Always take relocability of your Cocoon application into account, from the very beginning of your project. Your application should work from the webapp root (mounted as /), under a context path (/whatever) or as a sub-sitemap (/whatever/the/user/wants). This means that you should always pass a "mount-point" attribute within your rendering pipelines and components, calculating where your application has been mounted, and building paths accordingly. Unfortunately the current Cocoon API will only tell you the full request path and the URI handled by the sitemap, so you need to mangle those data by substracting (string-wise) the sitemap URI from the request URI in order to obtain the path you're looking for. That is, if your sitemap is mounted on /context/foo and your request is for /context/foo/bar/baz, the sitemap URI will be bar/baz, while the data you need is actually /context/foo to build your links properly.