On Fri, Sep 5, 2008 at 1:17 AM, Sergiu Dumitriu <sergiu(a)xwiki.com> wrote:
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.
+1, a very common need indeed.
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.
+1.
You're talking about a temporary hack, do you have in mind any better
solution with our current model or are you refering to a new "system"
tagging feature that we could implement in the future model component
?
FYI I was planning to implement this and hidden spaces (as a
XWikiPreferences property, yep this one is a hack ;) in 1.7.
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.
+1.
JV.