You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dominic Chambers <do...@telefonica.net> on 2003/06/20 15:17:42 UTC
ing, but with shared sitemap?
The <mount> tag allows sitemaps to be sub-divided, but it also allows
the request context (directory and url paths) to be changed. Is there
any way to get the cocoon to mount an application directory (i.e. switch
context), but still use a common sitemap file? I need a number of
virtual hosts all running the same cocoon app, but with different
content; like:
>base-dir
sitemap.xmap (a simple virtual host switcher)
common.xmap (the file to be mounted for each host-dir)
>host1-dir
>host2-dir
I get this to work at the moment using symbolic links from the host-dir
to the base-dir, but that seems like a hack, and may come to haunt me
later - like when I try to deploy this stuff.
Any help would be much appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
SOLVED: ing, but with shared sitemap?
Posted by Dominic Chambers <do...@ya.com>.
On Fri, 2003-06-20 at 17:57, Christian Haul wrote:
> Dominic Chambers wrote:
> > Almost, but I need to switch based on host name. Perhaps if I could make
> > the result of the host name comparison a variable, like {1} is for
> > wildcard matches, that would work perfectly. I just tried this
> > experiemnt:
>
> Try (Cocoon >= 2.0.4)
>
> <map:pipeline>
> <map:match pattern="">
> <map:redirect-to uri="{request:serverName}/test.html"/>
> </map:match>
> </map:pipeline>
>
Yes, that is perfect. Thanks Chris, Upayavira & Michael for the
excellent help!
> Chris.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: ing, but with shared sitemap?
Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Dominic Chambers wrote:
> Almost, but I need to switch based on host name. Perhaps if I could make
> the result of the host name comparison a variable, like {1} is for
> wildcard matches, that would work perfectly. I just tried this
> experiemnt:
Try (Cocoon >= 2.0.4)
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="{request:serverName}/test.html"/>
</map:match>
</map:pipeline>
Chris.
--
C h r i s t i a n H a u l
haul@informatik.tu-darmstadt.de
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
AW: ing, but with shared sitemap?
Posted by Michael Raffenberg <mi...@t-online.de>.
Hi, maybe this is what you are looking for:
<map:pipeline>
<map:match pattern="**">
<map:select type="host">
<map:when test="pelzfashion">
<map:mount uri-prefix="" src="file:///d:/data/www/pelz-fashion/"
check-reload="true"/>
</map:when>
<map:when test="raffy">
<map:mount uri-prefix="" src="file:///d:/data/www/raffy/"
check-reload="true"/>
</map:when>
<map:otherwise>
<map:mount uri-prefix="" src="file:///d:/data/www/cocoon/"
check-reload="true"/>
</map:otherwise>
</map:select>
</map:match>
</map:pipeline>
Hope that helps,
Raffy
> -----Ursprüngliche Nachricht-----
> Von: dominic.chambers@ya.com [mailto:dominic.chambers@ya.com]
> Gesendet: Freitag, 20. Juni 2003 16:31
> An: cocoon-users@xml.apache.org
> Betreff: Re: <mount>ing, but with shared sitemap?
>
>
> On Fri, 2003-06-20 at 16:25, Upayavira wrote:
> > > Yes. Exactly that. Is that possible?
> >
> > Hmm. As I was writing that I was hoping you weren't going
> to say yes!!
> >
> > Anyway, I have built something similar recently, although I didn't
> > have the two
> > sitemaps, I did it all with one.
> >
> > I used stuff like:
> >
> > <map:match pattern="*/page.html">
> > <map:generate src="skins/{1}/config.xml"/>
> > <map:transform src="common/prepare.xsl"/>
> > <map:transform src="skins/{1}/skin.xsl">
> > <map:parameter name="skin" value="{1}"/>
> > </map:transform>
> > <map:serialize type="html"/>
> > </map:match>
> >
> > There you have a site that'll work for the following structure:
> >
> > root/
> > sitemap.xmap
> > skins/
> > foo/
> > config.xml
> > skin.xsl
> > bar/
> > config.xml
> > skin.xsl
> > common/
> > prepare.xsl
> >
>
> Yes, that is very clever, I didn't think of that; that even
> works if you need to match multiple pages by using two
> wildcards, like "*/**.html".
> but ...
>
> > With a system like that, you can have some files accessed from your
> > 'skins' directory
> > structure, and others from your common shared files,
> depending upon whether you
> > want them shared or separate.
> >
> > Then you just need an error handling pipeline to catch those
> > situations where the
> > URL doesn't match a valid skin.
> >
> > Make sense? Does this do what you want?
> >
>
> Almost, but I need to switch based on host name. Perhaps if I
> could make the result of the host name comparison a variable,
> like {1} is for wildcard matches, that would work perfectly.
> I just tried this
> experiemnt:
>
> <map:pipeline>
> <map:match pattern="">
> <map:select type="host">
> <map:redirect-to uri="{host}/test.html"/>
> </map:select>
> </map:match>
> </map:pipeline>
>
> where host was a previously defined HostSelector. Of course
> it didn't work!
>
> Do you know of another way? I kind of need variables,
> although I would probably think less highly of Cocoon if it
> provided them: who wants to program in XML?
>
> Thanks for your help!
>
> > Regards, Upayavira
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: ing, but with shared sitemap?
Posted by Dominic Chambers <do...@ya.com>.
On Fri, 2003-06-20 at 16:25, Upayavira wrote:
> > Yes. Exactly that. Is that possible?
>
> Hmm. As I was writing that I was hoping you weren't going to say yes!!
>
> Anyway, I have built something similar recently, although I didn't have the two
> sitemaps, I did it all with one.
>
> I used stuff like:
>
> <map:match pattern="*/page.html">
> <map:generate src="skins/{1}/config.xml"/>
> <map:transform src="common/prepare.xsl"/>
> <map:transform src="skins/{1}/skin.xsl">
> <map:parameter name="skin" value="{1}"/>
> </map:transform>
> <map:serialize type="html"/>
> </map:match>
>
> There you have a site that'll work for the following structure:
>
> root/
> sitemap.xmap
> skins/
> foo/
> config.xml
> skin.xsl
> bar/
> config.xml
> skin.xsl
> common/
> prepare.xsl
>
Yes, that is very clever, I didn't think of that; that even works if you
need to match multiple pages by using two wildcards, like "*/**.html".
but ...
> With a system like that, you can have some files accessed from your 'skins' directory
> structure, and others from your common shared files, depending upon whether you
> want them shared or separate.
>
> Then you just need an error handling pipeline to catch those situations where the
> URL doesn't match a valid skin.
>
> Make sense? Does this do what you want?
>
Almost, but I need to switch based on host name. Perhaps if I could make
the result of the host name comparison a variable, like {1} is for
wildcard matches, that would work perfectly. I just tried this
experiemnt:
<map:pipeline>
<map:match pattern="">
<map:select type="host">
<map:redirect-to uri="{host}/test.html"/>
</map:select>
</map:match>
</map:pipeline>
where host was a previously defined HostSelector. Of course it didn't
work!
Do you know of another way? I kind of need variables, although I would
probably think less highly of Cocoon if it provided them: who wants to
program in XML?
Thanks for your help!
> Regards, Upayavira
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: ing, but with shared sitemap?
Posted by Upayavira <uv...@upaya.co.uk>.
> > Presumably what you're saying is that you want to be able to mount
> > the common.xmap, but for that sitemap to be able to find out the
> > name of the directory that it was mounted to, so that it can be used
> > in locating other resources? Is that right?
> Yes. Exactly that. Is that possible?
Hmm. As I was writing that I was hoping you weren't going to say yes!!
Anyway, I have built something similar recently, although I didn't have the two
sitemaps, I did it all with one.
I used stuff like:
<map:match pattern="*/page.html">
<map:generate src="skins/{1}/config.xml"/>
<map:transform src="common/prepare.xsl"/>
<map:transform src="skins/{1}/skin.xsl">
<map:parameter name="skin" value="{1}"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
There you have a site that'll work for the following structure:
root/
sitemap.xmap
skins/
foo/
config.xml
skin.xsl
bar/
config.xml
skin.xsl
common/
prepare.xsl
With a system like that, you can have some files accessed from your 'skins' directory
structure, and others from your common shared files, depending upon whether you
want them shared or separate.
Then you just need an error handling pipeline to catch those situations where the
URL doesn't match a valid skin.
Make sense? Does this do what you want?
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: ing, but with shared sitemap?
Posted by Dominic Chambers <do...@ya.com>.
On Fri, 2003-06-20 at 15:36, Upayavira wrote:
> On 20 Jun 2003 at 15:17, Dominic Chambers wrote:
>
> > The <mount> tag allows sitemaps to be sub-divided, but it also allows
> > the request context (directory and url paths) to be changed. Is there
> > any way to get the cocoon to mount an application directory (i.e.
> > switch context), but still use a common sitemap file? <snip/>
>
> Presumably what you're saying is that you want to be able to mount the
> common.xmap, but for that sitemap to be able to find out the name of the directory
> that it was mounted to, so that it can be used in locating other resources? Is that
> right?
>
Yes. Exactly that. Is that possible?
> Regards, Upayavira
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: ing, but with shared sitemap?
Posted by Upayavira <uv...@upaya.co.uk>.
On 20 Jun 2003 at 15:17, Dominic Chambers wrote:
> The <mount> tag allows sitemaps to be sub-divided, but it also allows
> the request context (directory and url paths) to be changed. Is there
> any way to get the cocoon to mount an application directory (i.e.
> switch context), but still use a common sitemap file? I need a number
> of virtual hosts all running the same cocoon app, but with different
> content; like:
>
> >base-dir
> sitemap.xmap (a simple virtual host switcher)
> common.xmap (the file to be mounted for each host-dir)
> >host1-dir
> >host2-dir
Presumably what you're saying is that you want to be able to mount the
common.xmap, but for that sitemap to be able to find out the name of the directory
that it was mounted to, so that it can be used in locating other resources? Is that
right?
Regards, Upayavira
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org