> From: Vincent Massol <[email protected]> > > > I've posted a snippet: > > http://code.xwiki.org/xwiki/bin/view/Snippets/GenericXMLapiSnippet >
I see you've moved it to: http://code.xwiki.org/xwiki/bin/view/Snippets/GenericXMLApiSnippet > In case you didn't know about it, all xwiki pages can be viewed as XML > right [..] > The snippet looks cool but it's quite hard to understand what it does. I know, but I wanted to provide client with a simple to use API that allows them to browse and retrieve the data. The content produced by ?xpage=xml is too rich :) I'll document the snippet > the first problem is that is seems like this API can deliver protected > data > > It's already blocked by the permission system and for password fields you > shouldn't be able to see the value. That's what I thought. But have a look at: http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/XWiki/YishayMor vs. http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/api/genericXML?xpage=rdf&targetClass=XWiki.XWikiUsers&targetObject=XWiki.YishayMor > > Here is the corrupted class: > > http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/Cases/CaseClass > > I've never seen that :) Something is indeed deeply broken since the > rendering is failing to display but I don't know why. The problem started when I renamed a property to ".unused". I thought I could then add something like: #if (!"$propertyName.startsWith(".")) to hide unused properties. I think what happened is this: The class definition is stored (or processed) in XML, and having a property name starting with '.' confuses the parser. For example, http://patternlanguagenetwork.myxwiki.org/xwiki/bin/view/api/genericXML?xpage=rdf&targetClass=Cases.CaseClass&targetObject=&fields=Name provokes this: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getDocument' in class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3202 in 3: Exception while reading document Cases.Woodforthetrees Wrapped Exception: Error number 3202 in 3: Exception while reading document Cases.CaseClass Wrapped Exception: Error number 2002 in 2: Error parsing xml ___________________________ Yishay Mor, Researcher, London Knowledge Lab http://www.lkl.ac.uk/people/mor.html http://www.google.com/calendar/embed?src=yishaym%40gmail.com +44-20-78378888 x5737 _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
