You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Hargreaves <pd...@totalise.co.uk> on 2001/05/28 20:19:01 UTC

[C2] Parameters to control Aggregation

Hi Folks,

I would like to aggregate two xsp sources where transformation of the 
first source determines the name of the second source. Is this possible, 
please?

Peter

P.S. I'm running jdk1.3.1, tomcat3.2.1, c2.0a6.


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

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


Re: [C2] Parameters to control Aggregation

Posted by Peter Hargreaves <pd...@hargre.fsnet.co.uk>.
giacomo wrote:

> On Tue, 29 May 2001, Peter Hargreaves wrote:
> 
>> OK, I'll explain.
>> 
>> This is my 'menu.xsp' structure (it's xsp because I intend to add
>> dynamic content later on):
>> 
>> <xsp:page ...>
>>   <menu>
>>    <item longname="Cocoon" name="cocoon" default="sample">
>>     ...
>>     <item longname="Sample forms" name="sample" default="manage">
>>      <item longname="Manage employees" name="manage">
>>       <content src="forms/employee"/>
>>      </item>
>>      <item longname="Insert department" name="insdept">
>>       <content src="forms/add-department"/>
>>      </item>
>>     </item>
>>     ...
>>    </item>
>>   </menu>
>> </xsp:page>
>> 
>> When my user requests 'menu.xsp?select=cocoon/sample/manage'
>> I would like to aggregate 'menu.xsp' (as above) with 'forms/employee'.
>> When my user requests 'menu.xsp?select=cocoon/sample/insdept'
>> I would like to aggregate 'menu.xsp' (as above) with 'forms/add-department'.
> 
Conceptually, I'm trying to separate:
1) My hierarchical menu structure (user level)
2) My hierarchical url  structure (http level) and
3) My hierarchical file structure (os level),

My 'menu.xsl' maps menu selections to urls.
e.g. 'cocoon/sample/manage' maps to 'forms/employee'
The Cocoon 'sitemap.xml' maps urls to the file structure.
e.g. 'forms/employee' maps to 'docs/samples/forms/employee.xml'

> You should control aggregation in your sitemap not in your
> programs/xsp. Why don't you do it the other way around?
> 
>   <map:match="menu-employee">
>     <map:aggregate ...>
>       <map:part src="menu"/>
>       <map:part src="forms/employee"/>
>     </map:aggregate>
>   </map:match>
> 
> Giacomo

When I do it this way (with a variation of the above), my url must specify both the page url 'forms/employee' and the menu selection 'cocoon/sample/manage' (The menu.xsl needs to know which items to highlight when rendered). So I end up with a url something like the following: forms/employeexxxmenu.xsp?select=cocoon/sample/manage  using the following sitemap:

  <map:match pattern="**.xxx*">
    <map:aggregate ...>
      <map:part src="{2}"/>
      <map:part src="{1}"/>
    </map:aggregate>
  </map:match>

I've had this method working very nicely but the url is complicated. I'm also looking for a solution which I can use recursively. I would like for instance to be able to do menu.xsp?select=cocoon/sample/menu2.
In other words, the menu contains a selected page which might be another menu which contains another selected page etc. I can't use the above solution recursively because it relies on recursively replacing the 'select' parameter.:-(

Are there any aggregation enhancements planned that might help me?
Although I devised the above scheme intending to implement it with aggregation (then got stuck), I am now considering implementing it using frames and menubars generated by cocoon from menu.xml - looks promising!

Conceptually, I'm trying to separate:
1) my hierarchical menu structures (user level)
2) my hierarchical url structures and
3) my hierarchical file structures (os level),

My 'menu.xsl' maps menu selections to urls.
e.g. 'cocoon/sample/manage' maps to 'forms/employee'
The Cocoon 'sitemap.xml' maps urls to the file structure.
e.g. 'forms/employee' maps to 'docs/samples/forms/employee.xml'

Peter

>> I don't seem to be able to do this because aggregation doesn't provide a
>> way for my first aggregated page to determine which is the second
>> aggregated page. Or does it?
>> 
>> If I use <cinclude:include ...> where I have <content...> in menu.xsp
>> then I seem to get all the pages of my site included before my
>> subsequent stylesheet removes the unwanted ones. Not an economic approach!
>> 
>> If I use the sitemap approach to aggregation, I need to pass
>> 'forms/add-department' from my first aggregated page (menu.xsp) to the
>> sitemap so that it can be used as the second aggregated page.
>> 
>> I hope the above helps for any enhancements to aggregation (removing the
>> v), or have I missed something? Any comments/work-arounds on the above
>> would be appreciated.
>> 
>> Many thanks,
>> Peter.
>> 
>> P.S. I would also like to pass parameters from aggregated page to the
>> next aggregated page.
>> 
>> giacomo wrote:
>> 
>>> On Mon, 28 May 2001, Peter Hargreaves wrote:
>>> 
>>>> Hi Folks,
>>>> 
>>>> I would like to aggregate two xsp sources where transformation of the
>>>> first source determines the name of the second source. Is this possible,
>>>> please?
>>> 
>>> 
>>> Can you be more specific else I'd guess: no.
>>> 
>>> Giacomo
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> Please check that your question has not already been answered in the
>>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>> 
>>> To unsubscribe, e-mail: <co...@xml.apache.org>
>>> For additional commands, e-mail: <co...@xml.apache.org>
>>> 
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> Please check that your question has not already been answered in the
>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>> 
>> To unsubscribe, e-mail: <co...@xml.apache.org>
>> For additional commands, e-mail: <co...@xml.apache.org>
>> 
>> 
>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 
> 
> 


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

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


Re: [C2] Parameters to control Aggregation

Posted by giacomo <gi...@apache.org>.
On Tue, 29 May 2001, Peter Hargreaves wrote:

> OK, I'll explain.
>
> This is my 'menu.xsp' structure (it's xsp because I intend to add
> dynamic content later on):
>
> <xsp:page ...>
>   <menu>
>    <item longname="Cocoon" name="cocoon" default="sample">
>     ...
>     <item longname="Sample forms" name="sample" default="manage">
>      <item longname="Manage employees" name="manage">
>       <content src="forms/employee"/>
>      </item>
>      <item longname="Insert department" name="insdept">
>       <content src="forms/add-department"/>
>      </item>
>     </item>
>     ...
>    </item>
>   </menu>
> </xsp:page>
>
> When my user requests 'menu.xsp?select=cocoon/sample/manage'
> I would like to aggregate 'menu.xsp' (as above) with 'forms/employee'.
> When my user requests 'menu.xsp?select=cocoon/sample/insdept'
> I would like to aggregate 'menu.xsp' (as above) with 'forms/add-department'.

You should control aggregation in your sitemap not in your
programs/xsp. Why don't you do it the other way around?

  <map:match="menu-employee">
    <map:aggregate ...>
      <map:part src="menu"/>
      <map:part src="forms/employee"/>
    </map:aggregate>
  </map:match>

Giacomo

>
> I don't seem to be able to do this because aggregation doesn't provide a
> way for my first aggregated page to determine which is the second
> aggregated page. Or does it?
>
> If I use <cinclude:include ...> where I have <content...> in menu.xsp
> then I seem to get all the pages of my site included before my
> subsequent stylesheet removes the unwanted ones. Not an economic approach!
>
> If I use the sitemap approach to aggregation, I need to pass
> 'forms/add-department' from my first aggregated page (menu.xsp) to the
> sitemap so that it can be used as the second aggregated page.
>
> I hope the above helps for any enhancements to aggregation (removing the
> v), or have I missed something? Any comments/work-arounds on the above
> would be appreciated.
>
> Many thanks,
> Peter.
>
> P.S. I would also like to pass parameters from aggregated page to the
> next aggregated page.
>
> giacomo wrote:
>
> > On Mon, 28 May 2001, Peter Hargreaves wrote:
> >
> >> Hi Folks,
> >>
> >> I would like to aggregate two xsp sources where transformation of the
> >> first source determines the name of the second source. Is this possible,
> >> please?
> >
> >
> > Can you be more specific else I'd guess: no.
> >
> > Giacomo
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
>
>


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

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


Re: [C2] Parameters to control Aggregation

Posted by Peter Hargreaves <pd...@hargre.fsnet.co.uk>.
OK, I'll explain.

This is my 'menu.xsp' structure (it's xsp because I intend to add 
dynamic content later on):

<xsp:page ...>
  <menu>
   <item longname="Cocoon" name="cocoon" default="sample">
    ...
    <item longname="Sample forms" name="sample" default="manage">
     <item longname="Manage employees" name="manage">
      <content src="forms/employee"/>
     </item>
     <item longname="Insert department" name="insdept">
      <content src="forms/add-department"/>
     </item>
    </item>
    ...
   </item>
  </menu>
</xsp:page>

When my user requests 'menu.xsp?select=cocoon/sample/manage'
I would like to aggregate 'menu.xsp' (as above) with 'forms/employee'.
When my user requests 'menu.xsp?select=cocoon/sample/insdept'
I would like to aggregate 'menu.xsp' (as above) with 'forms/add-department'.

I don't seem to be able to do this because aggregation doesn't provide a 
way for my first aggregated page to determine which is the second 
aggregated page. Or does it?

If I use <cinclude:include ...> where I have <content...> in menu.xsp 
then I seem to get all the pages of my site included before my 
subsequent stylesheet removes the unwanted ones. Not an economic approach!

If I use the sitemap approach to aggregation, I need to pass 
'forms/add-department' from my first aggregated page (menu.xsp) to the 
sitemap so that it can be used as the second aggregated page.

I hope the above helps for any enhancements to aggregation (removing the 
v), or have I missed something? Any comments/work-arounds on the above 
would be appreciated.

Many thanks,
Peter.

P.S. I would also like to pass parameters from aggregated page to the 
next aggregated page.

giacomo wrote:

> On Mon, 28 May 2001, Peter Hargreaves wrote:
> 
>> Hi Folks,
>> 
>> I would like to aggregate two xsp sources where transformation of the
>> first source determines the name of the second source. Is this possible,
>> please?
> 
> 
> Can you be more specific else I'd guess: no.
> 
> Giacomo
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 
> 
> 


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

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


Re: [C2] Parameters to control Aggregation

Posted by giacomo <gi...@apache.org>.
On Mon, 28 May 2001, Peter Hargreaves wrote:

> Hi Folks,
>
> I would like to aggregate two xsp sources where transformation of the
> first source determines the name of the second source. Is this possible,
> please?

Can you be more specific else I'd guess: no.

Giacomo


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

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