Hi devs,

The first proposal is about introducing two $xwiki.countDocuments 
methods, one that accepts a simple hql query, and one that accepts a 
parametrized query and a list of parameter values. These work like 
searchDocuments, but instead of prefixing the query fragment with 
'select doc.fullName from XWikiDocument as doc', it will prefix it with 
'select count(*) from XWikiDOcument as doc'.

This will allow to count documents without using a programming-protected 
query, and without retrieving all the documents and count the results. 
Such a method is needed for paging results, for example.


The second proposal is a temporary hack for hiding documents. The idea 
is to add a new field in the XWikiDocument class, 'hidden', which will 
be automatically used in searchDocuments and countDocuments to filter 
out special documents. This is a workaround until we will be able to tag 
special documents or spaces, and will allow to create special documents 
needed for an application inside the main application's space, instead 
of the generic XWiki space. Such hidden pages won't appear in normal 
search results, the index page or the navigation panel.

To show these documents (for admins, for example) we could add another 
searchDocuments method which accepts a boolean parameter that enables or 
disables the filter on the 'hidden' property.
-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to