You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Andreas Hartmann <an...@apache.org> on 2003/05/14 15:36:01 UTC
Multiple sites in one Cocoon instance (skins)
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?
Thanks in advance!
Andreas
Re: Multiple sites in one Cocoon instance (skins)
Posted by Jeff Turner <je...@apache.org>.
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
>
>
>