forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Multiple sites in one Cocoon instance (skins)
Date Wed, 14 May 2003 22:13:57 GMT
Andreas Hartmann wrote:
> Hi Forrest developers,
> 
> I want to run multiple Forrest-based sites (with different
> skins) in one Cocoon instance. Is there any other way to
> define the skin than in cocoon.xconf?

The skin is located with {forrest:skin} inputmodule references in the 
sitemap. The 'forrest' inputmodule is defined in cocoon.xconf as:

       <component-instance logger="core.modules.input" name="forrest" 
  class="org.apache.cocoon.components.modules.input.ChainMetaModule">
         <input-module name="request-param"/>
         <input-module name="request-attr"/>
         <input-module name="session-attr"/>
         <input-module name="defaults"/>
       </component-instance>

And 'defaults' is where the actual skin value is usually obtained from:

     <component-instance name="defaults" 
class="org.apache.cocoon.components.modules.input.DefaultsMetaModule">
       <values>
         <skin>@skin@</skin>
       </values>
     </component-instance>

ChainMetaModule queries each of its inputmodules in order, so if you can 
put a different 'skin' attribute in each site's session 
(session.setAttribute("skin", "...");), that will have the desired 
effect.  Probably the simplest way to do this is by writing a Cocoon Action.

Alternatively, you could just replace the single <skin> entry in the 
DefaultsMetaModule with <skin-site1> and <skin-site2>, but then the 
sitemaps would have to have {forrest:skin} changed to 
{forrest:skin-site1|2} too.

--Jeff

> Thanks in advance!
> 
> Andreas
> 
> 
> 



Mime
View raw message