Hi James,
On 06/08/2010 05:08 AM, James Cuzella wrote:
I'm trying to create a live table similar to the
"All Docs" one in
Main, but filtered for a specific space (in this case, named
Software).
i've used the Live table snippet for the table page itself:
-------------------------------------------
{{velocity}}
#set($collist = ["doc.name", "doc.space","doc.date",
"doc.author", "_actions"])
#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"},
"_actions" : {"actions":
["copy","delete","rename","rights"]}
})
#set($options = { "resultPage":"XWiki.SofwareTableresults",
"translationPrefix" : "xe.index.",
"rowCount": 15 })
#livetable("allsoftwaredocs" $collist $colprops $options)
{{/velocity}}
-------------------------------------------
And here's the Software table results page:
-------------------------------------------
{{include document="XWiki.LiveTableResultsMacros" /}}
I don't know much about live table but the code below was already
filtering by space if the space name was present on the request (i.e. if
the page was called with space=SomeSpace in the query string). It looks
like you can specify query string parameters using the "extraParams"
live table option (
http://code.xwiki.org/xwiki/bin/view/Macros/LiveTableMacro ). So you
should try using the default data source (XWiki.LiveTableResults) with
extra query string parameters:
#set($options = { "extraParams":"space=Software",
"translationPrefix" : "xe.index.",
"rowCount": 15 })
(of course, this code should be place in the table page, before the call
to livetable macro)
Hope this helps,
Marius
{{velocity}}
#set($extra = "")
#if("$!request.space" != "") #set($extra = "${extra} and
doc.space =
'$request.space'") #end
#if("$!request.orphaned" == "1") #set($extra = "${extra} and
doc.parent='' and doc.name<>'WebHome'") #end
#gridresultwithfilter("$!request.classname",
$request.collist.split(","), "doc.space = 'Software' ",
"${extra}")
{{/velocity}}
-------------------------------------------
As soon as I added the ""doc.space = 'Software' " parameter to
the
gridresultfilter(), it broke the page and gives: "Failed to execute
macro: velocity"
What is the correct way to filter the query?
Thanks,
- James Cuzella
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users