I thought the JavaDoc is pretty clear:
...
#foreach ($name in $xwiki.searchDocuments($where, 10, 0, $parameters))
...
Hope this helps,
Marius
On Sun, Jul 7, 2013 at 12:14 PM, Belkhiria Hamza Yazid
<yoshipepperoni(a)gmail.com> wrote:
Hi,
I want to add maxResults (for example 10) parameter to this snippet below
but i am not sure how to do it
any ideas ?
Thanks
{{velocity}}
#macro(createDocumentTree $document $depth $level)
#if ($depth > 0)
#set ($translated = $document.getTranslatedDocument())
#set ($name = $translated.getName())
#set ($fullName = $translated.getFullName())
#set ($prefixedFullName = $translated.getPrefixedFullName())
#set ($where = "where doc.parent = ? or doc.parent = ? or doc.parent = ?
order by doc.name")
#set ($parameters = [$name, $fullName, $prefixedFullName])
#if ($name == 'WebHome')
#set ($space = $document.getSpace())
#set ($where = "where doc.space = ? and (doc.parent = '' or doc.parent
= ? or doc.parent = ? or doc.parent = ?) and doc.name != 'WebHome' order by
doc.name")
#set ($parameters = [$space, $name, $fullName, $prefixedFullName])
#end
#foreach ($name in $xwiki.searchDocuments($where, $parameters))
#if ($xwiki.getDocument($name))
#set ($document = $xwiki.getDocument($name))
#set ($translated = $document.getTranslatedDocument())
#set ($prefixed = $translated.getPrefixedFullName())
#set ($title = $translated.getPlainTitle())
${stringtool.repeat('*', $level)} [[$title>>$prefixed]]
#set ($depth = $depth - 1)
#set ($level = $level + 1)
#createDocumentTree($document $depth $level)
#set ($depth = $depth + 1)
#set ($level = $level - 1)
#end
#end
#end
#end
#createDocumentTree($doc 5 1)
{{/velocity}}
On 25 June 2013 07:51, Marius Dumitru Florea <mariusdumitru.florea(a)xwiki.com
wrote:
> On Mon, Jun 24, 2013 at 12:29 PM, Belkhiria Hamza Yazid
> <yoshipepperoni(a)gmail.com
wrote:
> > Good morning,
> >
> >
> > This snippet is awesome
> > I am asking if there is a way to make it show only the 10 first results
> > (alphabetic for example or just any limited set)
> > and add a link "show full list" that would redirect you to another
page
> > with the classic snippet with complete list
> >
> > Does that make any sense ?
>
> Sure, see
>
http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/or…
> .
>
> Hope this helps,
> Marius
>
> >
> >
> > Best Regards,
> >
> > --
> > *BHY*
> > _______________________________________________
> > users mailing list
> > users(a)xwiki.org
> >
http://lists.xwiki.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users(a)xwiki.org
>
http://lists.xwiki.org/mailman/listinfo/users
>
--
*BHY*
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users