Can you provide me with some simple example of that new language interpreter (module) ? :)
Greetings, Greg 2013/6/20 Thorsten Scherler <scher...@gmail.com> > On 06/20/2013 03:02 PM, gelo1234 wrote: > > > I've got Cocoon site that hosts multiple www domains, all based on the >>> same sitemap.xmap with <map:mount uri-prefix="" src="domain_X" >>> check-reload="yes"/> >>> >>> so the configuration is as follows: >>> >>> <map:pipeline> >>> <map:select type="cutomDomainSelector"> >>> <map:when test="domainA"> >>> <map:mount uri-prefix="" src="./domaina" >>> check-reload="yes"/> >>> </map:when> >>> <map:when test="domainB"> >>> <map:mount uri-prefix="" src="./domainb" >>> check-reload="yes"/> >>> </map:when> >>> </map:select> >>> </map:pipeline> >>> >>> Is it still possible with C3 ? Or should I use some separate blocks >>> config ? >>> The problem with separate blocks config is that I want to use empty URI >>> (not different) for each site >>> >>> So >>> site1: http://www.domainA.org/ >>> site2: http://www.domainB.org/ >>> >>> NOT >>> >>> http://www.some.org/domainA/ >>> http://www.some.org/domainB/ >>> >>> under one C3 war (sitemap.xmap config). >>> >> >> I'd suggest to empower some reverse proxy in order to make things easier >> here. >> > > Reverse Proxy would give the opposite effect - collecting into one URL > from multiple domain servers. I would like to have > only ONE backend server that serves as the origin for multiple domains. > > With mod_jk/mod_proxy I can setup multiple workers for each domain but > where should I point them to serve my clients if having only one backend > server with C3 ? > > > Lets say I have a separate Cocoon block for each www domain. In C2.1 I > had a MAIN sitemap.xmap (Controller) that controlled which context to mount > upon different Hostname requests. > > In C3 the only way I could achieve that is passing through with each > request INFO about Hostname value. That is not very elegant > solution. But I cannot find any other. > > So either every <map:match ...> would need additional <map:select ...>: > > <!-- e.g. the main / context --> > > <map:match pattern=""> > <map:select value="{jexl:cocoon.request.hostName}"> > <map:when equals="domainA"> > <map:generate src="files/domainA/homepage.xml" /> > <map:transform src="files/xslt/homepage.xslt"/> > <map:serialize /> > </map:when> > <map:when equals="domainB"> > <map:generate src="files/domainB/homepage.xml" /> > <map:transform src="files/xslt/homepage.xslt"/> > <map:serialize /> > </map:when> > </map:match> > > OR (a little bit more elegant and compact): > > <map:match pattern=""> > <map:generate > src="files/{jexl:cocoon:request.hostName}/homepage.xml"/> > <map:transform src="files/xslt/homepage.xslt"/> > <map:serialize /> > </map:match> > > I don't want to handle 100 VMs with C3 app for each www domain. That > would be very resource-expensive config. > > I would like to have only ONE C3 app for all www domains. > > > so why not: > > <map:match pattern=""> > <map:generate > src="servlet:{jexl:cocoon:request.hostName}/homepage.xml"/> > <map:transform src="files/xslt/homepage.xslt"/> > <map:serialize /> > </map:match> > > Or even simply create a new language interpreter (formally known as > module) which does the resolving. That has the benefit that you can use > full blown java and use spring config file to do the mapping or a simple > properties file. > > salu2 > > > Greetings, > Greg > > > > > > -- > Thorsten Scherler <scherler.at.gmail.com> > codeBusters S.L. - web based systems > <consulting, training and solutions> > http://www.codebusters.es/ > >