You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by oceatoon <t....@systheo.com> on 2005/07/19 12:57:55 UTC

Sitemap : Selector inside an Aggregation

Hi everyone 

I would like to have a map:select (Request parameter selector) inside my
aggregation section , is this possible in some way ?
I manage to put it outside but offcourse this makes me duplicate a bunch of
map:parts that are common to all the selections.
This would really clean up my code, any ideas ?

Thanks for the thoughts
Tibor

This is what I have
*******************
<map:match pattern="mypipe/*">
 <map:select type="parameter">
 <map:parameter name="parameter-selector-test" value="{1}"/>
  <map:when test="europe">
     <map:aggregate element="lists">
     <map:part src="cocoon:/listdata"/>
     <map:part src="some.xml"/>
     <map:part src="europe.xml"/>
     </map:aggregate>
  </map:when>
<map:when test="region">
     <map:aggregate element="lists">
     <map:part src="cocoon:/listdata"/>
     <map:part src="some.xml"/>
     <map:part src="region.xml"/>
     </map:aggregate>
  </map:when>
  <map:otherwise>
     <map:aggregate element="lists">
     <map:part src="cocoon:/listdata"/>
     <map:part src="some.xml"/>
     <map:part src="all.xml"/>
     </map:aggregate>
</map:otherwise>
</map:select>

This is what I would love :)
******************************
<map:match pattern="mypipe/*">
     <map:aggregate element="lists">
     <map:part src="cocoon:/listdata"/>
     <map:part src="some.xml"/>

 <map:select type="parameter">
 <map:parameter name="parameter-selector-test" value="{1}"/>
<map:when test="europe">
     <map:part src="europe.xml"/>
</map:when>
<map:when test="region">
     <map:part src="region.xml"/>
</map:when>
<map:otherwise>
     <map:part src="all.xml"/>
</map:otherwise>
</map:select>

     </map:aggregate>




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


Re: Sitemap : Selector inside an Aggregation

Posted by Jean-Christophe Kermagoret <jc...@babelobjects.com>.
Hi,
You could use a resource with a parameter for the region.

The resource would look like this :
<map:resource name="region">
    <map:aggregate element="lists">
      <map:part src="cocoon:/listdata"/>
      <map:part src="some.xml"/>
      <map:part src="{region}.xml"/>
    </map:aggregate>
</map:resource>

and your call will look like this

<map:call resource="region">
     <map:parameter name="region" value="europe"/>
</map:call>

Another way is to use flowscript to write a controller for your business 
logic.

HTH

oceatoon a écrit :
> Hi everyone
> Well the selector not being accepted inside an aggregation, I managed to
> obtain the requested result by pulling the seletion out of the aggregation
> and into a pipeline, and then calling it cocoon:/ in the agreggation. :)
> Works for me 
> If this isn't appropriate use, or if could add overhead please don't
> hesitate in saying so. I wouldn't know what an impact this structure might
> have on performance .
> Regards
> Tibor
> 
> 
> oceatoon wrote:
> 
> 
>>Hi everyone
>>
>>I would like to have a map:select (Request parameter selector) inside my
>>aggregation section , is this possible in some way ?
>>I manage to put it outside but offcourse this makes me duplicate a bunch
>>of map:parts that are common to all the selections.
>>This would really clean up my code, any ideas ?
>>
>>Thanks for the thoughts
>>Tibor
>>
>>This is what I have
>>*******************
>><map:match pattern="mypipe/*">
>> <map:select type="parameter">
>> <map:parameter name="parameter-selector-test" value="{1}"/>
>>  <map:when test="europe">
>>     <map:aggregate element="lists">
>>     <map:part src="cocoon:/listdata"/>
>>     <map:part src="some.xml"/>
>>     <map:part src="europe.xml"/>
>>     </map:aggregate>
>>  </map:when>
>><map:when test="region">
>>     <map:aggregate element="lists">
>>     <map:part src="cocoon:/listdata"/>
>>     <map:part src="some.xml"/>
>>     <map:part src="region.xml"/>
>>     </map:aggregate>
>>  </map:when>
>>  <map:otherwise>
>>     <map:aggregate element="lists">
>>     <map:part src="cocoon:/listdata"/>
>>     <map:part src="some.xml"/>
>>     <map:part src="all.xml"/>
>>     </map:aggregate>
>></map:otherwise>
>></map:select>
>>
>>This is what I would love :)
>>******************************
>><map:match pattern="mypipe/*">
>>     <map:aggregate element="lists">
>>     <map:part src="cocoon:/listdata"/>
>>     <map:part src="some.xml"/>
>>
>> <map:select type="parameter">
>> <map:parameter name="parameter-selector-test" value="{1}"/>
>><map:when test="europe">
>>     <map:part src="europe.xml"/>
>></map:when>
>><map:when test="region">
>>     <map:part src="region.xml"/>
>></map:when>
>><map:otherwise>
>>     <map:part src="all.xml"/>
>></map:otherwise>
>></map:select>
>>
>>     </map:aggregate>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com



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


Re: Sitemap : Selector inside an Aggregation

Posted by oceatoon <t....@systheo.com>.
Hi everyone
Well the selector not being accepted inside an aggregation, I managed to
obtain the requested result by pulling the seletion out of the aggregation
and into a pipeline, and then calling it cocoon:/ in the agreggation. :)
Works for me 
If this isn't appropriate use, or if could add overhead please don't
hesitate in saying so. I wouldn't know what an impact this structure might
have on performance .
Regards
Tibor


oceatoon wrote:

> Hi everyone
> 
> I would like to have a map:select (Request parameter selector) inside my
> aggregation section , is this possible in some way ?
> I manage to put it outside but offcourse this makes me duplicate a bunch
> of map:parts that are common to all the selections.
> This would really clean up my code, any ideas ?
> 
> Thanks for the thoughts
> Tibor
> 
> This is what I have
> *******************
> <map:match pattern="mypipe/*">
>  <map:select type="parameter">
>  <map:parameter name="parameter-selector-test" value="{1}"/>
>   <map:when test="europe">
>      <map:aggregate element="lists">
>      <map:part src="cocoon:/listdata"/>
>      <map:part src="some.xml"/>
>      <map:part src="europe.xml"/>
>      </map:aggregate>
>   </map:when>
> <map:when test="region">
>      <map:aggregate element="lists">
>      <map:part src="cocoon:/listdata"/>
>      <map:part src="some.xml"/>
>      <map:part src="region.xml"/>
>      </map:aggregate>
>   </map:when>
>   <map:otherwise>
>      <map:aggregate element="lists">
>      <map:part src="cocoon:/listdata"/>
>      <map:part src="some.xml"/>
>      <map:part src="all.xml"/>
>      </map:aggregate>
> </map:otherwise>
> </map:select>
> 
> This is what I would love :)
> ******************************
> <map:match pattern="mypipe/*">
>      <map:aggregate element="lists">
>      <map:part src="cocoon:/listdata"/>
>      <map:part src="some.xml"/>
> 
>  <map:select type="parameter">
>  <map:parameter name="parameter-selector-test" value="{1}"/>
> <map:when test="europe">
>      <map:part src="europe.xml"/>
> </map:when>
> <map:when test="region">
>      <map:part src="region.xml"/>
> </map:when>
> <map:otherwise>
>      <map:part src="all.xml"/>
> </map:otherwise>
> </map:select>
> 
>      </map:aggregate>



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