You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Vaduvoiu Tiberiu <va...@yahoo.com> on 2007/07/23 09:03:58 UTC

problem mounting

Hi, I am having a problem mounting some sitemaps. Right now, for my application I am using a single sitemap...that has become to big...and for performance/mentainance reasons, I've decided to split the big sitemap in smaller ones using mount. However I am dealing with a problem. Right now, a match pattern in the big site might look like this:

   <map:match pattern="*/*/*/index.html">
 <map:aggregate element="root" label="source">    
          <map:part element="menu" src="cocoon:/{1}/{2}/menu.xml"/>
          <map:part element="document" src="cocoon:/{1}/{2}/{3}/index.xml"/>
        </map:aggregate>
        <map:transform src="transformers/page.xsl">
        <map:parameter name="developorlive" value="{1}"/>
        <map:parameter name="language" value="{2}"/>
       <map:parameter name="use-request-parameters" value="true"/>
        </map:transform>
        <map:transform type="i18n">
          <map:parameter name="locale" value="{2}"/>
        </map:transform>
        <map:transform src="transformers/stripnamespaces.xsl"/>
        <map:serialize type="xhtml"/>
      </map:match>

in this case the first star represents if I'm working with preview or live content, and the second is the language /en/ /fr/ etc.

so I decided that in the big sitemap I will write 

      <map:match pattern="*/*/">
        <map:mount uri-prefix="" src="{2}/sitemap.xmap" />
      </map:match>

and in the en/sitemap.xmap file I write 

<map:match pattern="*/index.html">
   <map:aggregate element="root" label="source">
          <map:part element="menu" src="cocoon:/menu.xml"/>
          <map:part element="document" src="cocoon:/{1}/index.xml"/>
        </map:aggregate>
        <map:transform src="transformers/page.xsl">
          <map:parameter name="language" value="??"/>
          <map:parameter name="developorlive" value="??"/>


so my problem is that now I can't now the values of the 2 parameters language and developorlive.....so how can I pass some values in the sub-sitemaps from the original sitemap? so I would need something like 

<map:parameter name="language" value="the first star from the upper sitemap"/>..i remeber reading something in the cocoon tutorials....using {../1} or something like that..anyone can help me? 10x


       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

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


Re: problem mounting

Posted by Jason Johnston <co...@lojjic.net>.
Vaduvoiu Tiberiu wrote:
> Hi, I am having a problem mounting some sitemaps. Right now, for my
> application I am using a single sitemap...that has become to
> big...and for performance/mentainance reasons, I've decided to split
> the big sitemap in smaller ones using mount. 
...
> in this case the first star represents if I'm working with preview or
> live content, and the second is the language /en/ /fr/ etc.
> 
> so I decided that in the big sitemap I will write
> 
> <map:match pattern="*/*/"> 
 >    <map:mount uri-prefix="" src="{2}/sitemap.xmap" />
 > </map:match>

Shouldn't the above match pattern be something like pattern="*/*/**" ? 
Yours will only match URIs ending in the slash.

> 
> and in the en/sitemap.xmap file I write
> 
> <map:match pattern="*/index.html"> 
>   <map:aggregate element="root" label="source">
>     <map:part element="menu" src="cocoon:/menu.xml"/> 
>     <map:part element="document" src="cocoon:/{1}/index.xml"/> 
>   </map:aggregate>
 >   <map:transform src="transformers/page.xsl">
>     <map:parameter name="language" value="??"/>
 >     <map:parameter name="developorlive" value="??"/>

I haven't used sitemap mounting a ton, but my understanding is that 
since you used uri-prefix="" in the map:mount call, it won't strip off 
any of the URI, and therefore the full URI will be passed to the 
sub-sitemap for matching.  So in your subsitemap you should just be able 
to do

<map:match pattern="*/*/*/index.html">

...and have access to all the parameter parts.

I hope that helps, like I said I haven't used mounting much so I could 
be wrong about how the uri-prefix thing works.

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