[ http://jira.xwiki.org/jira/browse/XWIKI-1845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_19670 ]
Vincent Massol commented on XWIKI-1845: --------------------------------------- Hi Marius, I've done a quick and light review: 1) I think the Java API should group together methods. For example the following could all be grouped in a single method: getTopPages getYearTopPages getMonthTopPages getWeekTopPages getDayTopPages The method would be: getTopPages(String action, Scope scope, Period period), where Scope is a Java class to specify the scope which can be: current wiki, a given space, a virtual wiki wikis, a subset of wikis. Period is a period: week, month, day, all, etc. Of course the Velocity API would need to have 2 additional methods: createScope() and createPeriod() since it's not possible to create Java objects in Velocity. BTW this would mean we could probably move getPeriodAsInt() in the Period class. It would also shield us from Joda Time which I prefer so that our interface doesn't have to change in the future. 2) public DocumentStats getCurrentMonthXWikiStats(String action) How is that different from getTopPages()? 3) public java.util.Collection getRecentActions(String action, int size) How is that different getActivity()? 4) In XWikiStatsServices there were the following existing methods: public DocumentStats getDocTotalStats(String docname, String action, XWikiContext context); public DocumentStats getDocMonthStats(String docname, String action, Date month, XWikiContext context); public DocumentStats getDocDayStats(String docname, String action, Date day, XWikiContext context); public List getRefMonthStats(String docName, Date month, XWikiContext context) throws XWikiException; public Collection getRecentActions(String action, int size, XWikiContext context); It looks to me these could be removed if you implemented point 1) above. For example, Scope could also be as simple as a single page and thus getTopPages() would be enough to replace getDocTotalStats, getDocMonthStats and getDocDayStats. Same for the other methods. 5) I'd prefer to rename your method like this: * getTopPages() --> getDocumentStatistics() * getTopContributors() --> getVisitorStatistics() I think the TopPages/TopContributors names are too restrictive and they only correspond to some of the information you can get out of these methods. 6) I'm not sure how getActivity() is different from getVisitorStaistics() for example. WDYT? Maybe we could talk over skype to finalize this? Thanks -Vincent > Create improved Statistics API > ------------------------------ > > Key: XWIKI-1845 > URL: http://jira.xwiki.org/jira/browse/XWIKI-1845 > Project: XWiki Platform > Issue Type: Improvement > Components: Statistics > Affects Versions: 1.2 M1 > Environment: any > Reporter: Marius Dumitru Florea > Assigned To: Marius Dumitru Florea > Fix For: 1.2 M2 > > Attachments: xe-140.diff.txt > > > Improve the Statistics Application in order to allow the retrieval of the > most viewed pages, the most edited pages and the best contributors. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.xwiki.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira _______________________________________________ notifications mailing list notifications@xwiki.org http://lists.xwiki.org/mailman/listinfo/notifications