Manuel Mata napisaĆ(a):
> Hi all.
>
> I'm using cocoon pagination transformer and it works
> nice for elements, but i would like to add the feature
> to my application of choose dinamically the number of
> items in listing, because it is always the same as it
> is defined in pagination rules.
>
> I should use an http parameter for it, I mean 'ip' for
> items per page, and would like to pass it to the
> pagination transformer via the sitemap, just like the
> number of page, but I dont know if this would work. I
> didnt find anything in the docs, even I read that
> pagination rules are inmutable in the cocoon api.
>
> Should this be posible ? Thx for your time.
>
By dynamic you mean that you want to let user choose from *limited* set of
possible values for 'ip', right?
Limited is crucial here. You could just easily generate pagination rules using
other Cocoon pipeline instead of using
static file. This should work well and not harm your performance as long as you
do not break caching.
You should do this:
<map:transform src="cocoon:/pagination-rules?ip={request-param:ip}"
type="paginator">
and have following pipeline:
<map:match pattern="pagination-rules">
<map:generate src="pagination-rules-template.xml" type="jx">
<map:parameters name="ip" value="{request-param:ip}"/>
</map:generate>
<map:serialize type="xml"/>
</map:match>
The problem with this approach is that there is no place where we limit set of
possible values of ip parameter. However,
I hope it will give you starting point.
--
Grzegorz Kossakowski
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]