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/06/18 14:25:25 UTC

problem in sitemap

long story short. I'm trying to develop a small site using cocoon. I have the following problem.

My site has some categories. Some categories have subcategories. And here is the part in sitemap where I have my problem

   <map:match pattern="*/*/*/*/">
    <map:aggregate element="root" label="source">
        <map:part element="menu" src="cocoon:/{1}/menu.xml"/>
        <map:part element="menu2" src="cocoon:/{1}/{2}/menu.xml"/>
   <map:part element="menu3" src="cocoon:/{1}/{2}/{3}/menu.xml"/>
   
   <map:part element="document" src="cocoon:/{1}/{2}/{3}/{4}/index.xml"/>
   <map:part element="menu4" src="cocoon:/{1}/{2}/{3}/{4}/menu.xml"/>

so here's the catch. 
mysite.com/A/B/C/D has some subcategories(D/x)
mysite.com/A/B/C/E doesn't have subcategories 

So when I load the /D url, everything works fine because the element menu4 exists.(there is a menu.xml in A/B/C/D folder)
when I load the /E url, I get http resource not found error because there is no menu4 element(there is no menu.xml in A/B/C/E folder.
So how can I make this "optional"?
How can I tell cocoon "hey, if you don't find the menu4 element, it's no problem, just go on?"
10x in advance


       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

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


Re: problem in sitemap

Posted by so...@apache.org.
On 6/18/07, Vaduvoiu Tiberiu <va...@yahoo.com> wrote:
> My site has some categories. Some categories have subcategories. And here is the part in sitemap where I have my problem
>    <map:match pattern="*/*/*/*/">
>     <map:aggregate element="root" label="source">
>         <map:part element="menu" src="cocoon:/{1}/menu.xml"/>
>         <map:part element="menu2" src="cocoon:/{1}/{2}/menu.xml"/>
>    <map:part element="menu3" src="cocoon:/{1}/{2}/{3}/menu.xml"/>
>    <map:part element="document" src="cocoon:/{1}/{2}/{3}/{4}/index.xml"/>
>    <map:part element="menu4" src="cocoon:/{1}/{2}/{3}/{4}/menu.xml"/>
>
> so here's the catch.
> mysite.com/A/B/C/D has some subcategories(D/x)
> mysite.com/A/B/C/E doesn't have subcategories
>
> So when I load the /D url, everything works fine because the element menu4 exists.(there is a menu.xml in A/B/C/D folder)
> when I load the /E url, I get http resource not found error because there is no menu4 element(there is no menu.xml in A/B/C/E folder.
> So how can I make this "optional"?
> How can I tell cocoon "hey, if you don't find the menu4 element, it's no problem, just go on?"

Your "problem" is in the approach. Solutions:
1. Use single menu.xml.
Why do you need a menu.xml in every directory?   That sounds
unnecessarily  complicated.

2. Use an XPathDirectoryGenerator
http://cocoon.apache.org/2.1/userdocs/xpathdirectory-generator.html
This Generator merges XML files.  Configure the starting directory,
filter on filename menu.xml, and set the depth higher than the number
of levels of subcategories (I use 99.)

If menu.xml is just tracking other files, you could use the
XPathDirectoryGenerator to dynamically create the menu so menu.xml is
not needed.

Either way, use XSL to remove extra information. Pass the desired path
as a parameter to the XSLT so you can remove entries from other paths.

solprovider

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


Re: problem in sitemap

Posted by Hanne Moa <ha...@uninett.no>.
Vaduvoiu Tiberiu wrote:
> long story short. I'm trying to develop a small site using cocoon. I have the following problem.
> 
> My site has some categories. Some categories have subcategories. And here is the part in sitemap where I have my problem
> 
>    <map:match pattern="*/*/*/*/">
>     <map:aggregate element="root" label="source">
>         <map:part element="menu" src="cocoon:/{1}/menu.xml"/>
>         <map:part element="menu2" src="cocoon:/{1}/{2}/menu.xml"/>
>    <map:part element="menu3" src="cocoon:/{1}/{2}/{3}/menu.xml"/>
>    
>    <map:part element="document" src="cocoon:/{1}/{2}/{3}/{4}/index.xml"/>
>    <map:part element="menu4" src="cocoon:/{1}/{2}/{3}/{4}/menu.xml"/>
> 
> so here's the catch. 
> mysite.com/A/B/C/D has some subcategories(D/x)
> mysite.com/A/B/C/E doesn't have subcategories 
> 
> So when I load the /D url, everything works fine because the element menu4 exists.(there is a menu.xml in A/B/C/D folder)
> when I load the /E url, I get http resource not found error because there is no menu4 element(there is no menu.xml in A/B/C/E folder.
> So how can I make this "optional"?
> How can I tell cocoon "hey, if you don't find the menu4 element, it's no problem, just go on?"
> 10x in advance

I'd say you're trying to do too much with a single match. Make a match 
just for mysite.com/A/B/C/E or is there some reason you must do 
everything in a single match?


t.

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


Re: problem in sitemap

Posted by Jan-Willem Boer <jb...@be-value.nl>.
Vaduvoiu Tiberiu schreef:
> [...]
>    <map:part element="menu4" src="cocoon:/{1}/{2}/{3}/{4}/menu.xml"/>
>
> so here's the catch. 
> mysite.com/A/B/C/D has some subcategories(D/x)
> mysite.com/A/B/C/E doesn't have subcategories 
>
> So when I load the /D url, everything works fine because the element menu4 exists.(there is a menu.xml in A/B/C/D folder)
> when I load the /E url, I get http resource not found error because there is no menu4 element(there is no menu.xml in A/B/C/E folder.
> So how can I make this "optional"?
>   
You could give the resourceexist-selector a try: 
http://cocoon.apache.org/2.1/userdocs/resourceexists-selector.html


Jan Willem Boer
http://www.linkedin.com/in/janwillemboer