cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cocoon Wiki] Trivial Update of "SitemapURIModule" by NicoVerwer
Date Tue, 21 Jun 2005 08:54:28 GMT
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. Please use the [:EnvironmentInputModule] described
at the end of this document__
+ __NOTE: This module is no longer of any use. An extension to the `RequestModule` will be
proposed__
  
  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.
@@ -39, +39 @@

    "/a/b/c/d" - "e" = ???
  
  As far as I can see, this is not easily solved in the input module itself.
- However, the sitemap-base-URI is available internally in the (Http)Environment of the (Http)Request,
through the getURIPrefix() method.
+ However, the sitemap-base-URI is available internally in the Environment of the Request,
through the getURIPrefix() method. This could be accessed through the `RequestModule`.
  
- == EnvironmentInputModule ==
- 
- The sitemap URIPrefix (base-sitemap-URI) is available in the Cocoon environment. However,
as of 2.1.7 there is no standard input module to access it.
- The following code fixes this, and will be submitted to the buglist.
- 
- {{{
- package org.apache.cocoon.components.modules.input;
- 
- import java.util.Map;
- 
- import org.apache.avalon.framework.configuration.Configuration;
- import org.apache.cocoon.components.CocoonComponentManager;
- import org.apache.cocoon.environment.Environment;
- 
- /**
-  * The EnvironmentInputModule accesses properties of the current environment using JXPath
syntax.
-  * These properties are: URI, URIPrefix, action, context, rootContext, view.
-  * @see org.apache.cocoon.environment.Environment
-  */
- 
- public class EnvironmentInputModule extends AbstractJXPathModule {
- 
-   protected Object getContextObject(Configuration modeConf, Map objectModel) {
-     Environment env = CocoonComponentManager.getCurrentEnvironment();
-     return env;
-   }
- 
- }
- }}}
- 

Mime
View raw message