Hi all,
While implementing XWIKI-1264
<http://jira.xwiki.org/jira/browse/XWIKI-1264>(Transform the AllDocs
page into an index with A-Z links to show docs by
letter) I faced the following problem :
I wanted to show letter links only for relevant letters (for the user not
being faced with empty result for letters that has no document related). But
how to search for distinct letters from the wiki ?
1- we use $xwiki.search("select distinct substring(doc.name, 1, 1) from
XWikiDocument as doc where 1=1")
but then, the document depends on a privileged API, if someone without
programming right edit and saves it, it breaks.
2- we implement a method like "getDocumentsIndex()" in the XWiki API
but as Vincent says, it's not really generic, it applies only on this case.
3- we call a groovy script that holds privileged API calls (possibly the
whole wiki privileged calls)
but, it's not really clean either, and it's too bad we have to maintain two
docs for a small script like the AllDocs one.
As for now we found none of this option good enough, there will be all
letters proposed... with the possibility the users faces an empty result
page.
What do you think? Are there any other option ?
I think this problem leads to the more generic problem of how to handle
privileged calls in the default wiki.
Jerome.