Hi JV,

On Oct 3, 2007, at 4:00 PM, Jean-Vincent Drean wrote:

> The snippet on xwiki.org :
> http://www.xwiki.org/xwiki/bin/view/Code/PaginateSearch

Is it the same as http://www.xwiki.org/xwiki/bin/view/Code/ 
PagedViewLinksMacro or is it different?

At very first glance they seem related.

Thanks
-Vincent

> 2007/10/3, Jean-Vincent Drean <[EMAIL PROTECTED]>:
>> Hi,
>>
>> It's a recurrent need but AFAIK we don't have any generic solution.
>> I've made a 5' snippet, hope it will be useful.
>>
>> This snippet requires programming rights ($xwiki.xWiki.search) so
>> you'll have to make sure that simple users can't edit this page.
>>
>> -----------------------------------------------8<-------------------- 
>> -----------------------------------------------
>> #macro(paginedSearch $query $currentPage $resultsPerPage)
>> #set ($start = $resultsPerPage * $currentPage)
>> #set ($resultsnb = $xwiki.xWiki.search("select count(doc) from
>> XWikiDocument doc ${query}", $context.context).get(0))
>> #if ($resultsnb > $resultsPerPage)
>>   #set ($pagesnb = $resultsnb / $resultsPerPage)
>>   #foreach ($pagenb in [0..$pagesnb])
>>     [$pagenb>$doc.fullName?page=$pagenb]
>>   #end
>> #end
>> #set ($list = $xwiki.searchDocuments($query, $resultsPerPage,  
>> $start))
>> #foreach ($item in $list)
>>   * $item
>> #end
>> #end
>>
>> #if ($request.page)
>>   #set ($desiredStart = $xwiki.parseInt($request.page))
>> #else
>>   #set ($desiredStart = 0)
>> #end
>>
>> #paginedSearch("where 1=1" $desiredStart 5)
>> -----------------------------------------------8<-------------------- 
>> -----------------------------------------------
>>
>> 2007/10/3, goldring, richard <[EMAIL PROTECTED]>:
>>> Anyone?
>>>
>>>
>>> Hi all,
>>>
>>> Does anyone know how to generate a list of links to wiki pages  
>>> that meet a
>>> set of defined features i.e. filter and sort (features defined on  
>>> the
>>> objects or tags on those pages)? Perhaps like the Google search,  
>>> list the
>>> first 20 or 30 pages and have a next/previous, 1, 2, 3, etc  
>>> buttons to list
>>> the next selections of page links (to cope with the display of  
>>> large numbers
>>> of page links).
>>>
>>> If anyones got any code snipits to get me started then that would  
>>> be really
>>> useful - thanks.
>>>
>>> The idea is perhaps to explore how to use XWiki to semi  
>>> automatically
>>> generate pages to record tasks or issues, and then to list those  
>>> pages
>>> (tasks/issues) according to say the status or owners of those  
>>> tasks/issues.
>>> For tasks I'm thinking XWiki might be used to help guide users  
>>> through
>>> business processes and semi-automatically document they have  
>>> followed those
>>> processes (for CMMI) so they can be simply audited. Documents  
>>> generated
>>> through users following the tasks/processes can then be generated  
>>> from
>>> templates and stored within the wiki. If anyone else has any  
>>> ideas/code that
>>> could help perhaps realise this then let me know!
>>>
>>> Regards,
>>>
>>> Richard Goldring
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to