[xwiki-users] Filter document list by parent and tag
Hi everyone, I need to create a livetable for documents having a specific parent and tag. For example: Document A -> Has a parent document called "procedure" and "Server01" tag Document B -> Has a parent document called "procedure" and "Server02" tag Document "Server01" -> Should show a livetable with a filter for "Parent=procedure and tag=Server01 (same as Doc.name) Document "Server02" -> Should show a livetable with a filter for "Parent=procedure and tag=Server02 (same as Doc.name) I know I can create a new Document macro and filter by "Parent" and "Space", but I also need to filter by tag. XWQL may help but I need to show result as a link to the document. Any guess or example to follow? Any advice will be appreciated! Thanks!
Checkout the 'extraParams' parameter of the live table http://extensions.xwiki.org/xwiki/bin/view/Extension/Livetable+Macro#HParame... . I managed to filter the rows (documents) by parent and tag with this: #set ($options = { 'className': 'Space.SomeClass', ... 'extraParams': '&parent=Space.Procedure&tag=Server01' }) Hope this helps, Marius On Thu, Sep 18, 2014 at 11:06 PM, Jaume Giribert Peraire <[email protected]> wrote:
Hi everyone,
I need to create a livetable for documents having a specific parent and tag. For example:
Document A -> Has a parent document called "procedure" and "Server01" tag Document B -> Has a parent document called "procedure" and "Server02" tag
Document "Server01" -> Should show a livetable with a filter for "Parent=procedure and tag=Server01 (same as Doc.name) Document "Server02" -> Should show a livetable with a filter for "Parent=procedure and tag=Server02 (same as Doc.name)
I know I can create a new Document macro and filter by "Parent" and "Space", but I also need to filter by tag. XWQL may help but I need to show result as a link to the document.
Any guess or example to follow? Any advice will be appreciated!
Thanks! _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi Marius, Thanks! That works perfectly. For anyone who needs it, here is the final code: {{velocity}} #set($collist = ['doc.name', 'doc.space', 'doc.date', 'doc.author']) #set($colprops = { 'doc.name' : { 'type' : 'text' , 'size' : 30, 'link' : 'view' }, 'doc.space' : { 'type' : 'text', 'link' : 'space' }, 'doc.date' : { 'type' : 'date' }, 'doc.author' : { 'type' : 'text', 'link' : 'author' } }) #set($options = { 'translationPrefix' : 'xe.index.', 'rowCount' : 15, 'description' : 'Table list with parent procedure and tag Server01.', 'extraParams': '&parent=Document.procedure&tag=Server01' }) #livetable('docs' $collist $colprops $options) {{/velocity}} 2014-09-18 22:06 GMT+02:00 Jaume Giribert Peraire <[email protected]> :
Hi everyone,
I need to create a livetable for documents having a specific parent and tag. For example:
Document A -> Has a parent document called "procedure" and "Server01" tag Document B -> Has a parent document called "procedure" and "Server02" tag
Document "Server01" -> Should show a livetable with a filter for "Parent=procedure and tag=Server01 (same as Doc.name) Document "Server02" -> Should show a livetable with a filter for "Parent=procedure and tag=Server02 (same as Doc.name)
I know I can create a new Document macro and filter by "Parent" and "Space", but I also need to filter by tag. XWQL may help but I need to show result as a link to the document.
Any guess or example to follow? Any advice will be appreciated!
Thanks!
participants (2)
-
Jaume Giribert Peraire -
Marius Dumitru Florea