On Jun 5, 2007, at 11:22 AM, Thomas Drevon wrote:
Vincent Massol wrote:
I'm setting up an xwiki instance for use in a school class while
the students are working in groups on different projects. The
teacher wants to be able to keep an eye on what each individual
student is actually contributing, so I'm trying to make a report
that shows:
1. a list of all documents to which a student has contributed
1.1 a list of all versions of this document that the student
changed/updated
Has anyone done anything similar? Right now I'm a bit at a loss,
as it seems I have to run thru all the versions of all the docs
in the entire xwiki. Might there be a better way?
I haven't done this but
maybe you could turn the stats on for your
wiki and use the generated stats to extract the 2 reports you want.
I ended up writing a snippet that checks all the revisions of all
the docs on the wiki. Not pretty, and it won't scale, but works for
my purpose. And in case it will work for someone else, I
contributed it here:
http://www.xwiki.org/xwiki/bin/view/Code/
ChangesByUserSnippet
Thanks for your contributions, they're very cool :)
And maybe somebody even has a suggestion for making it
more efficient?
Have you tried using the statistics apis I mentioned above?
I haven't used them yet so I can't refer you to some code snippet but
they're used on the Admin.Stats page (it'll be empty if you haven't
turned on stats in xwiki.cfg). There are also apis for them in $xwiki
and in $context (you'll need to check the XWiki and Context java
classes though to know more).
Note that we also have a jira issue for refactoring the Admin.Stats
page:
http://jira.xwiki.org/jira/browse/XWIKI-1267
Thanks
-Vincent