1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.rice.kew.stats.web; |
18 | |
|
19 | |
import java.util.Map; |
20 | |
|
21 | |
import javax.servlet.http.HttpServletRequest; |
22 | |
import javax.servlet.http.HttpServletResponse; |
23 | |
|
24 | |
import org.apache.struts.action.ActionForm; |
25 | |
import org.apache.struts.action.ActionForward; |
26 | |
import org.apache.struts.action.ActionMapping; |
27 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
28 | |
import org.kuali.rice.kew.stats.Stats; |
29 | |
import org.kuali.rice.kew.stats.service.StatsService; |
30 | |
import org.kuali.rice.kew.web.KewKualiAction; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | 0 | public class StatsAction extends KewKualiAction { |
42 | |
|
43 | |
@Override |
44 | |
public ActionForward execute(ActionMapping mapping, ActionForm form, |
45 | |
HttpServletRequest request, HttpServletResponse response) |
46 | |
throws Exception { |
47 | 0 | initForm(mapping, request, form); |
48 | 0 | return super.execute(mapping, form, request, response); |
49 | |
} |
50 | |
|
51 | |
public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { |
52 | |
|
53 | 0 | StatsForm statForm = (StatsForm) form; |
54 | |
|
55 | 0 | statForm.determineBeginDate(); |
56 | 0 | statForm.determineEndDate(); |
57 | |
|
58 | 0 | StatsService statsService = this.getStatsService(); |
59 | 0 | statsService.NumUsersReport(statForm.getStats()); |
60 | 0 | statsService.DocumentsRoutedReport(statForm.getStats(), statForm.getBeginningDate(), statForm.getEndingDate()); |
61 | 0 | statsService.NumActiveItemsReport(statForm.getStats()); |
62 | 0 | statsService.NumberOfDocTypesReport(statForm.getStats()); |
63 | 0 | statsService.NumInitiatedDocsByDocTypeReport(statForm.getStats()); |
64 | |
|
65 | 0 | return mapping.findForward("basic"); |
66 | |
|
67 | |
} |
68 | |
|
69 | |
public void initForm(ActionMapping mapping, HttpServletRequest request, ActionForm form) { |
70 | 0 | StatsForm statForm = (StatsForm) form; |
71 | 0 | Map dropDownMap = statForm.makePerUnitOfTimeDropDownMap(); |
72 | 0 | request.setAttribute("timeUnitDropDown", dropDownMap); |
73 | 0 | statForm.validateDates(); |
74 | 0 | } |
75 | |
|
76 | |
public StatsService getStatsService() { |
77 | 0 | return (StatsService) KEWServiceLocator.getService(KEWServiceLocator.STATS_SERVICE); |
78 | |
} |
79 | |
|
80 | |
} |