Hi Ricardo, On Sun, Feb 19, 2012 at 12:25 PM, <[email protected]> wrote:
Hi all!
First of all, please, allow me to thank again all XWiki Team for this great framework! It could be it happens that on Sunday I'm prone to purple prose, but I do think I'll feel the same tomorrow morning! :-)
Now, some doubts here...
I'm not able to understand how filtering does work in Livetable Macro. For instance, I get a JSON file including a number of results following a modified getgroupmembers.vm. Here the line of getgroupmembers getting members column
"member" : "$mdoc.getTranslatedDocument().title #if($hasAdmin || $isAdvancedUser) (#if($wikiname != 'local')$wikiname:#end$m)#end",
and one of the items in the JSON file...
{ "fullname" : "XWiki.XWikiIDISC04", "prettyname" : "XWikiIDISC04 (XWiki.XWikiIDISC04)", "wikiname" : "local", "memberurl" : "/bin/XWiki/XWikiIDISC04", "docurl" : "/bin/XWiki/XWikiIDISArealNeurology", "grayed" : "false", "doc_viewable" : "true", "doc_hasadmin" : "${xwiki.hasAccessLevel('admin', $context.user, $doc)}", "member" : "Neurobiology (XWiki.XWikiIDISC04)", "member_url" : "/bin/XWiki/XWikiIDISC04", "doc_delete_url" : "/bin/XWiki/XWikiIDISArealNeurology?xpage=deletegroupmember&fullname=XWiki.XWikiIDISC04&ajax=true" }
The Livetable Macro instance showing group membership reads...
#set($columnOptions = { "member" : {'link': 'auto', 'type': 'text', 'displayName': 'Research groups'},
But if I use strings content in $mdoc.getTranslatedDocument().title, I get no results in the filtered database. only strings in $m (showing the fullname of the document) work fine. You could check this behaviour on your own here...
http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISArealNeurology
With Firebug (or any other browser tool that catches XmlHttpRequests) you can see that when you filter the live table (e.g. type 'logy') a request like this is made: http://atrium_km.idisantiago.es/bin/XWiki/XWikiIDISArealNeurology?xpage=getg... Notice 'member=logy' which specifies the filter. Now if you search getgroupmembers.vm for '$request.member' (that's how request parameters are accessed) you'll see why group members are filtered by their document name and not by their document title. You can find the rights manager source code here https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwik... . Unfortunately it doesn't have a method to retrieve group member matched by their document title so you'll have to write this code by yourself (either directly in getgroupmembers.vm or in a script service http://platform.xwiki.org/xwiki/bin/view/DevGuide/WritingComponents#HFromwik... ) Hope this helps, Marius
Please, why? How could I use $mdoc.getTranslatedDocument().title to filter the list?
Thank you for your help!!!
-- Ricardo Rodríguez Research Management and Promotion Technician Health Research Institute of Santiago de Compostela (IDIS) http://www.idisantiago.es
Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.
Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.
See more languages: http://www.sergas.es/aviso_confidencialidad.htm _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users