You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2002/11/04 20:51:55 UTC

Re: Accessing uri-prefix from within sub-sitemaps?

Hello Justin,

is it possible to use the RequestParamAction 
(http://xml.apache.org/cocoon/apidocs/org/apache/cocoon/acting/RequestParamAction.html), 
to pass the {requestURI} to the stylesheet and to have there some logic 
to get the correct substring?

Regards,

Joerg

Justin Fagnani-Bell wrote:
> Hi,
> 
>   I'm using sub-sitemaps now to host several projects at once in my 
> development environment. I access the projects through a URL that looks 
> like this - "http://localhost/projects/proj1", and in the sub-sitemaps I 
> have a XSLTransformer prepend a sitemap variable called base to the 
> beginning of all absolute urls, so that all my links work. I end up 
> entering the uri-prefix by hand, the matcher looks something like this:
> 
> <map:generate src="{1}"/>
> <map:transform src="style.xsl"/>
> <map:transform src="fix_urls.xsl">
>           <map:parameter name="base" value="/projects"/>
> </map:transform>
> <map:serialize/>
> 
> What I would like to do is have "base" automatically set by accessing 
> the uri-prefix set in the mount element on the main sitemap, then when I 
> deploy the project, there's absoutely no changes that need to be made to 
> the sub-sitemap. Is there a way to do this?
> 
> Thanks,
>   Justin


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Accessing uri-prefix from within sub-sitemaps?

Posted by Justin Fagnani-Bell <ju...@paraliansoftware.com>.
Thanks for the reply Joerg,

I looked into your suggestion, but I don't quite see how to do it. For  
a project in development the URI will be something like:

  http://dev.myhost.com/projects/proj1/

and for a deployed project the URI will just be

http://somehost.com/

but after that the URI could contain any path, so I feel like checking  
if the URI starts with "/projects/*/" would be a hack and could cause  
problems if by chance the site contained a top level projects folder.  
I'm already passing either "projects/proj1" or "" (an empty string) to  
the stylesheet. I would just like to find a way to pass it to the  
sub-sitemap, from the main sitemap.

Anyway, this problem isn't that big of a deal, just a cleanliness issue  
really. I'm creating the development system so that there's a "deploy"  
button which will upload the site to the server, (like GoLive or  
Dreamweaver). Right now there's three things I need to do to any  
project folder, add the WEB-INF director, fix the sitemap to take away  
the "base" parameter, and add a correct cocoon.xconf file. I'm just  
looking to simplify the process. If anyone can help me on the  
cocoon.xconf problems I'm having I'd very much appreciate it. (I think  
it could be a bug see  
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=103592834813138&w=2 )

Thanks,
   Justin

ps. oh i made a mistake in my sitemap code below, the parameter line  
should be:

<map:parameter name="base" value="/projects/proj1"/>

On Monday, November 4, 2002, at 11:51  AM, Joerg Heinicke wrote:

> Hello Justin,
>
> is it possible to use the RequestParamAction  
> (http://xml.apache.org/cocoon/apidocs/org/apache/cocoon/acting/ 
> RequestParamAction.html), to pass the {requestURI} to the stylesheet  
> and to have there some logic to get the correct substring?
>
> Regards,
>
> Joerg
>
> Justin Fagnani-Bell wrote:
>> Hi,
>>   I'm using sub-sitemaps now to host several projects at once in my  
>> development environment. I access the projects through a URL that  
>> looks like this - "http://localhost/projects/proj1", and in the  
>> sub-sitemaps I have a XSLTransformer prepend a sitemap variable  
>> called base to the beginning of all absolute urls, so that all my  
>> links work. I end up entering the uri-prefix by hand, the matcher  
>> looks something like this:
>> <map:generate src="{1}"/>
>> <map:transform src="style.xsl"/>
>> <map:transform src="fix_urls.xsl">
>>           <map:parameter name="base" value="/projects"/>
>> </map:transform>
>> <map:serialize/>
>> What I would like to do is have "base" automatically set by accessing  
>> the uri-prefix set in the mount element on the main sitemap, then  
>> when I deploy the project, there's absoutely no changes that need to  
>> be made to the sub-sitemap. Is there a way to do this?
>> Thanks,
>>   Justin


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>