cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Refondini <patrick.refond...@pobox.com>
Subject Re: Two domain within cocoon
Date Wed, 12 Apr 2006 18:14:59 GMT
Sergio del Amo Caballero wrote:
> Hi,
> I am running Cocoon as a tomcat web application.  I am using Apache as a 
> front end to all requests that come to my server. Then i configured the 
> apache mod_jk2 module to forward certain URLs to Tomcat. Particulary to 
> cocoon (webapps/cocoon). I have two website developed under cocoon.
> One of them is under webapps/cocoon/site1 and the other one under 
> webapps/cocoon/site2.
> Both domains names point to cocoon root directory (i tried pointing them 
> to the subdirectory but it does not recognises them as a webapp).
> So, i have:
> domain1.com => webapps/cocoon
> domain2.com => webapps/cocoon
> 
> I thought i could configure cocoon matchers to match directly urls but 
> it does not work. I tried:
> 
> <map:match pattern="http://www.domain1.com">
>      <map:generate src="domain1/content/index.xml"/>
>      <map:transform src="domain1/style/xsl/presentation.xsl" />
>      <map:serialize type="xhtml"/>
> </map:match>
> 
> <map:match pattern="http://www.domain2.com">
>      <map:generate src="domain2/content/index.xml"/>
>      <map:transform src="domain2/style/xsl/presentation.xsl" />
>      <map:serialize type="xhtml"/>
> </map:match>
> 
> Can anyone point what should i do, two manage two domains names within 
> cocoon?
> 
> thanks in advanced for the help,
> Sergio
> 

Hi Sergio,

an alternative you may try to avoid running several Cocoon instance:

     <!-- CUSTOMISED -->
   <map:selectors>
     <map:selector logger="sitemap.selector.host" name="host" 
src="org.apache.cocoon.selection.HostSelector">
       <host name="domain1-site" value="www.domain1.com"/>
       <host name="domain1-site" value="domain1.com"/>
       <host name="domain2-site" value="www.domain2.com"/>
       <host name="domain2-site" value="domain2.com"/>
     </map:selector>
   </map:selectors>


   <map:pipeline>

     <map:select
       type="host">
       <map:when test="domain1-site">
           <map:mount uri-prefix="" src="domain1/sitemap.xmap"/>
       </map:when>
       <map:when test="domain2-site">
           <map:mount uri-prefix="" src="domain2/sitemap.xmap"/>
       </map:when>
       <map:otherwise>
           <map:mount uri-prefix="" src="sitemap.xmap"/>
       </map:otherwise>
     </map:select>


(...)


   </map:pipeline>


Then in each domain1/sitemap.xmap ,domain2/sitemap.xmap you may define:

<map:match pattern="">
       <map:generate src="content/index.xml"/>
       <map:transform src="style/xsl/presentation.xsl" />
       <map:serialize type="xhtml"/>
</map:match>

being customised after their own context.


Patrick


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message