+1. I think these are useful for other applications, too.
Alexandru Cismaru wrote:
Hello.
Currently I'm working at a Firefox extension for XWiki and I ran into some
troubles because I can't obtain all the information I need from the current
RESTful API. I've talked with Sergiu and Marta and they told me that I
shouldn't use workarounds and an extension of RESTful API would be more
appropiate.
It would be useful to add:
- a new element for every tag element from tags resource, representing
the number of documents tagged with that tag;
TagPlugin.getDocumentsWithTag
- a new element for every space element from spaces
resource,
representing the number of documents in that space;
XWiki.getSpaceDocsName
- two new resources: users and user. The
information made available for
every user could be: username, first name, last name, profile url, avatar,
last modified page;
User properties can be removed by direct object manipulation:
xwiki.getDocument(username).getObject("XWiki.XWikiUsers").get("first_name").getValue()
xwiki.getDocument(username).getAttachmentURL(xwiki.getDocument(username).getObject("XWiki.XWikiUsers").get("avatar").getValue())
xwiki.searchDocuments(" where doc.author = '" + username + "' order
by
doc.date desc", 1, 0) (but using a parameterized query instead of string
concatenation).
- a new element for every page containing the type
of the last
modification (comment adding, atachment adding, content modification).
I'm not so sure about this. There are many special cases which should be
treated separately. We could make the edit comment more powerful, since
it already contains this information.
About the users resource, one thing we should consider is privacy. Is
publishing usernames OK? Does it introduce security issues? We should
make sure that this resource is easy to disable.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/