I continue with my livetables experimentation ... Found an (ugly) workaround, updating XWiki.LiveTableResultsMacro and adding the following treatment : #set($fieldvalue = $xwiki.getXMLEncoded($fieldvalue)) #set($fielddisplayvalue = $xwiki.getXMLEncoded($fielddisplayvalue)) It's particularly ugly because I do it for all fields. I wanted to filter on $proptype value, but it seems $proptype is always empty (I debugged it in the json). Don't know how it relates, but here is the URL GET to generate the JSON : http://myhost/xwiki/bin/view/XWiki/LiveTableResults?xpage=plain&outputSyntax... I'm not sure it's normal to have url encoded "${propClassName}" as values for subject_class ? With this workaround it works well and display is fine. Jeremie 2010/3/2 Jeremie BOUSQUET <[email protected]>
Hi,
I added a comment on issue http://jira.xwiki.org/jira/browse/XWIKI-4887, because I found another issue that relates, IMO.
New problem is when some StringProperty fields contain character ' " '. In this case, JSON seems to be broken as character is not escaped, as it is in doc_title for example.
Found this in XWiki 2.2.1. I did not re-test the previous issue about carriage-return, though.
If you prefer I can open another issue for this instead of a comment, please let me know,
Jeremie
2010/2/12 Jeremie BOUSQUET <[email protected]>
I checked, and without carriage returns it works, so I created the issue : http://jira.xwiki.org/jira/browse/XWIKI-4887
Thanks again, Jeremie
2010/2/12 Sergiu Dumitriu <[email protected]>
On 02/12/2010 03:05 PM, Jeremie BOUSQUET wrote:
Wow, I'm afraid I understood ...
In fact I read subjects from emails, and it happens that some have ... carriage return inside :( This does not please json validator at all ...
This is also a bug, please report it on jira.xwiki.org
I will correct this and see if it's better. I never though there could be carriage return characters in mails subjects :(
Thanks again, Jeremie
2010/2/12 Jeremie BOUSQUET<[email protected]>
Thanks for the link,
No it does not seem to be happy :
"syntax error, unexpected TINVALID at line 44 Parsing failed"
But I don't understand what's about TINVALID, and there's nothing noticeable for me at line 44 ... So I'm a bit confused ...
BR, Jeremie
2010/2/12 Jerome Velociter<[email protected]>
Hello Jeremie,
On 2/12/10 2:41 PM, Jeremie BOUSQUET wrote: > Hello, > > I still have issues with livetables ... I'm willing to investigate,
but
a > little help would be appreciated :) > > I'm basically wanting to show 2 fields of a custom class of mine. There are > some hundreds of objects of this kind in my wiki. > > So I add the following in a page in 2.0 syntax > > {{velocity}} > #set($collist = [ "subject", "startdate"]) > #set($colprops = { > "subject" : { "type" : "text" , "link":"view", "size" : > 50, "filterable": true, "sortable":true}, > "startdate" : { "type" : "text", "filterable":false, > "sortable":true} > }) > #set($options = { "className":"My.Class", > "tagCloud":true, > "rowCount": 10 }) > > #livetable("myclass" $collist $colprops $options) > {{/velocity}} > > This results in an empty array displayed ... If I filter by typing 3 to 4 > letters of an existing "subject", then SOMETIMES, it displays the related > objects, but not always. Result is identical if I put the velocity part in > 1.0 syntax page. Tried to play and remove most of the fields options, still > the same behaviour. > > I have retrieved the URL that generates the JSON data from the logs, put it > in my browser, and it generates some JSON with 10 elements, as expected. > There was an exception on date formatting though, so I removed the > "startdate" field from the list, but still the same behaviour.
Can you check and make sure the JSON is valid ?
You can use http://www.jsonlint.com/ for example
Thanks, Jerome.
> > How could I investigate this issue ? Do you think it might be related to my > installation ? Because all other livetables in the wiki work well, except > some of them that are linked to custom classes (alldocs works pretty well). > Could it be some special characters in "subject" text ? ('/', '[', ... ?) > > > I'm on xwiki 2.2-RC2, tomcat 6, linux RH4. > > Thanks for help, > Jeremie
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users