[xwiki-users] Parent Column in the Livetable
Hello Community, I am trying to add a column that reference the doc parent but I am facing some difficult. I have tried to input the doc.space but It not worked: {{velocity}} {{box}} #set ($discard = $services.localization.use('document', 'FileManager.FileManagerTranslations')) #set ($columnsProperties = { 'doc.space': {"type":"list"}, 'category': {"type":"text","size":10,"link":"view"}, 'doc.name': {"type":"text","size":10,"link":"view"}, '_attachments': {"sortable":false,"filterable":false,"html":true}, '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"] } }) #set ($options = { 'className': 'FileManager.FileManagerClass', 'resultPage': 'FileManager.FileManagerLiveTableResults', 'translationPrefix': 'filemanager.livetable.', 'tagCloud': true, 'rowCount': 15, 'maxPages': 10, 'selectedColumn': 'category', 'defaultOrder': 'asc' }) ## Add the filter by selected tags #if($request.tag) #set ($discard = $options.put('selectedTags',["${request.tag}"])) #end ## #set ($columns = ['doc.space','category','doc.name', '_attachments', '_actions']) #livetable('filemanager' $columns $columnsProperties $options) {{/box}} {{/velocity}} Any tip? thanks Grupo Energisa Danilo Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately.
Parent column is not supported by default, but it's quite easy to implement it: (1) $columnsProperties need to contain: 'doc.parent': {"type":"text","size":10,"link":"field"}, (2) $columns needs to contain 'doc.parent' obviously (3) Have a custom live table results page that calls the default results page and then adjusts the JSON before it is serialized: #set ($rowDoc = $xwiki.getDocument($row.doc_fullName)) #if ("$!rowDoc.parent" != '') #set ($parentDoc = $xwiki.getDocument($rowDoc.parent)) #set ($row.doc_parent = $parentDoc.plainTitle) #set ($row.doc_parent_url = $parentDoc.getURL()) #end Or, if you're lazy, you can edit XWiki.LiveTableResultsMacros, the gridresult_buildRowJSON Velocity macro precisely. Hope this helps, Marius On Wed, Jul 2, 2014 at 10:17 PM, Danilo Amaral de Oliveira <[email protected]> wrote:
Hello Community,
I am trying to add a column that reference the doc parent but I am facing some difficult. I have tried to input the doc.space but It not worked:
{{velocity}} {{box}} #set ($discard = $services.localization.use('document', 'FileManager.FileManagerTranslations')) #set ($columnsProperties = { 'doc.space': {"type":"list"}, 'category': {"type":"text","size":10,"link":"view"}, 'doc.name': {"type":"text","size":10,"link":"view"}, '_attachments': {"sortable":false,"filterable":false,"html":true}, '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"] } }) #set ($options = { 'className': 'FileManager.FileManagerClass', 'resultPage': 'FileManager.FileManagerLiveTableResults', 'translationPrefix': 'filemanager.livetable.', 'tagCloud': true, 'rowCount': 15, 'maxPages': 10, 'selectedColumn': 'category', 'defaultOrder': 'asc' }) ## Add the filter by selected tags #if($request.tag) #set ($discard = $options.put('selectedTags',["${request.tag}"])) #end ## #set ($columns = ['doc.space','category','doc.name', '_attachments', '_actions']) #livetable('filemanager' $columns $columnsProperties $options) {{/box}} {{/velocity}}
Any tip?
thanks
Grupo Energisa Danilo Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478
Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Danilo Amaral de Oliveira -
Marius Dumitru Florea