Return-Path: X-Original-To: apmail-cocoon-users-archive@www.apache.org Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DA837C5CA for ; Thu, 20 Jun 2013 13:42:58 +0000 (UTC) Received: (qmail 1182 invoked by uid 500); 20 Jun 2013 13:42:57 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 1003 invoked by uid 500); 20 Jun 2013 13:42:57 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 971 invoked by uid 99); 20 Jun 2013 13:42:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jun 2013 13:42:53 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gelo1234@gmail.com designates 209.85.219.52 as permitted sender) Received: from [209.85.219.52] (HELO mail-oa0-f52.google.com) (209.85.219.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jun 2013 13:42:48 +0000 Received: by mail-oa0-f52.google.com with SMTP id g12so7804140oah.39 for ; Thu, 20 Jun 2013 06:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KgnVjYjGBTEbA0NmgLyF4ImmmTiuFK3EUDaiDM1WOPc=; b=O08EmxJBtV7TIdIYQNt9VAO4yeGkC4bE4rMLwJc0pp3qurX7ObAadvzjz6UPZLs/A4 i5p0D0cwLIRTurJk+F2jh4qxS0LhzecPwuwJbEyASFd0xHeQy/VEZ3GRaFyoYOspqmWf 2D5I59VdqG+gBbM7CV+Dy0eDsDH9FMcKOOEFfqjYd/+vspFkPXGzC9qpwtIB9djEyfvo BGYBh1175yEy//wpAhu3BWVo9mdRX68nzdpdC+XkvY8lYIdHgh3cWX8msQTkxur9zNFF J07kmkYCTAGQN5Z/wRpk9M3iskcZg4KPDkA3ceEPQ4j9bU3NX743RqxN31ZrzmGrkY3m Rnag== MIME-Version: 1.0 X-Received: by 10.182.55.72 with SMTP id q8mr1489673obp.96.1371735746763; Thu, 20 Jun 2013 06:42:26 -0700 (PDT) Received: by 10.76.114.163 with HTTP; Thu, 20 Jun 2013 06:42:26 -0700 (PDT) In-Reply-To: <51C30533.7050403@gmail.com> References: <51C2AA15.1020403@apache.org> <51C30533.7050403@gmail.com> Date: Thu, 20 Jun 2013 15:42:26 +0200 Message-ID: Subject: Re: Cocoon 3.0 components From: gelo1234 To: Cocoon Users Content-Type: multipart/alternative; boundary=089e01538afce961ef04df961dc2 X-Virus-Checked: Checked by ClamAV on apache.org --089e01538afce961ef04df961dc2 Content-Type: text/plain; charset=ISO-8859-1 Can you provide me with some simple example of that new language interpreter (module) ? :) Greetings, Greg 2013/6/20 Thorsten Scherler > 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 >> check-reload="yes"/> >>> >>> so the configuration is as follows: >>> >>> >>> >>> >>> >> check-reload="yes"/> >>> >>> >>> >> check-reload="yes"/> >>> >>> >>> >>> >>> 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 would need additional : > > > > > > > > > > > > > > > > > > OR (a little bit more elegant and compact): > > > src="files/{jexl:cocoon:request.hostName}/homepage.xml"/> > > > > > 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: > > > src="servlet:{jexl:cocoon:request.hostName}/homepage.xml"/> > > > > > 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 > codeBusters S.L. - web based systems > > http://www.codebusters.es/ > > --089e01538afce961ef04df961dc2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Can you provide me with some simple example of that n= ew language interpreter (module) ? :)

Greetings,
Greg<= br>



2013/6/20 Thorsten Scherler <scherler@gmail.com>
=20 =20 =20
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=3D"" src=3D"domain_X" chec= k-reload=3D"yes"/>

so the configuration is as follows:

<map:pipeline>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 <map:select type=3D"cutomDomainSelector">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<map:wh= en test=3D"domainA">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 &= lt;map:mount uri-prefix=3D"" src=3D"./domaina" che= ck-reload=3D"yes"/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</map:w= hen>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<map:wh= en test=3D"domainB">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0<map:mount uri-prefix=3D"" src=3D"./domainb" che= ck-reload=3D"yes"/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</map:w= hen>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</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 mak= e 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 ...>:

=A0<!--=A0 e.g. the main / context -->

=A0=A0 <map:match pattern=3D"">
=A0=A0=A0=A0=A0=A0 <map:select value=3D"{jexl:cocoon.request.hostName}">
=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:when equals=3D"domai= nA">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:generate src=3D"files/domainA/homepage.xml" />
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:transform src=3D"files/xslt/homepage.xslt"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:serialize />
=A0=A0=A0=A0=A0=A0=A0=A0=A0 </map:when>
=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:when equals=3D"domai= nB">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:generate src=3D"files/domainB/homepage.xml" />
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:transform src=3D"files/xslt/homepage.xslt"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:serialize />
=A0=A0=A0=A0=A0=A0=A0=A0=A0 </map:when>
=A0 </map:match>

OR (a little bit more elegant and compact):

<map:match pattern=3D"">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:generate src=3D"files/{jexl:cocoon:request.hostName}/homepage.x= ml"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:transform src=3D"files/xslt/homepage.xslt"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:serialize />
=A0 </map:match>

I don't want to handle 100 VMs with C3 app for each ww= w 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=3D"">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:generate src=3D"servlet:{jexl:cocoon:request.hostName}/homepage.xml"= />
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:transform src=3D"files/xslt/homepage.xslt"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <map:serialize />
=A0 </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

=A0



--=20
Thorsten Scherler <scherler.at.gmail.com>
codeBusters S.L. - web based systems
<consulting, training and solutions>

http://www.codebus=
ters.es/

--089e01538afce961ef04df961dc2--