1
2
3
4
5 package com.hack23.cia.web.controller.user;
6
7 import com.hack23.cia.service.api.application.ApplicationManager;
8 import com.hack23.cia.service.api.user.CommitteeReportRequest;
9 import com.hack23.cia.service.api.user.CommitteeReportResponse;
10 import com.hack23.cia.web.action.user.CommitteeReportAction;
11 import com.hack23.cia.web.viewfactory.api.common.ModelAndView;
12 import com.hack23.cia.web.viewfactory.api.common.ViewFactoryService;
13 import com.hack23.cia.web.viewfactory.api.user.CommitteeReportModelAndView;
14 import com.hack23.cia.web.viewfactory.api.user.CommitteeReportModelAndView.CommitteeReportViewSpecification;
15
16 /***
17 * The Class CommitteeReportActionHandler.
18 */
19 public class CommitteeReportActionHandler
20 extends
21 AbstractUserActionHandler<CommitteeReportAction, CommitteeReportRequest, CommitteeReportResponse> {
22
23 /***
24 * Instantiates a new committee report action handler.
25 *
26 * @param viewFactoryService the view factory service
27 * @param applicationManager the application manager
28 */
29 public CommitteeReportActionHandler(
30 final ViewFactoryService viewFactoryService,
31 final ApplicationManager applicationManager) {
32 super(viewFactoryService, applicationManager);
33 }
34
35
36
37
38
39
40
41 @Override
42 public final CommitteeReportRequest createServiceRequest(
43 final CommitteeReportAction action) {
44 return new CommitteeReportRequest(getUserStateService()
45 .getUserSessionId(), action.getCommitteeReportId());
46 }
47
48
49
50
51
52
53 @SuppressWarnings("unchecked")
54 @Override
55 public final Class getSupportedAction() {
56 return CommitteeReportAction.class;
57 }
58
59
60
61
62
63
64
65
66 @Override
67 public final ModelAndView handleSuccessResponse(
68 final CommitteeReportAction action,
69 final CommitteeReportResponse response) {
70 return new CommitteeReportModelAndView(response.getUserSessionDTO(),
71 action, CommitteeReportViewSpecification.CommitteeReportView,
72 response.getCommitteeReport());
73 }
74
75 }