1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krad.web.controller; |
17 | |
|
18 | |
import org.kuali.rice.krad.service.KRADServiceLocatorWeb; |
19 | |
import org.kuali.rice.krad.service.KualiExceptionIncidentService; |
20 | |
import org.kuali.rice.krad.web.form.IncidentReportForm; |
21 | |
import org.kuali.rice.krad.web.form.UifFormBase; |
22 | |
import org.springframework.stereotype.Controller; |
23 | |
import org.springframework.validation.BindingResult; |
24 | |
import org.springframework.web.bind.annotation.ModelAttribute; |
25 | |
import org.springframework.web.bind.annotation.RequestMapping; |
26 | |
import org.springframework.web.bind.annotation.RequestMethod; |
27 | |
import org.springframework.web.servlet.ModelAndView; |
28 | |
|
29 | |
import javax.servlet.http.HttpServletRequest; |
30 | |
import javax.servlet.http.HttpServletResponse; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
@Controller |
38 | |
@RequestMapping(value = "/incidentReport") |
39 | 0 | public class IncidentReportController extends UifControllerBase { |
40 | |
|
41 | |
@Override |
42 | |
protected UifFormBase createInitialForm(HttpServletRequest request) { |
43 | 0 | return new IncidentReportForm(); |
44 | |
} |
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
@RequestMapping(method = RequestMethod.POST, params = "methodToCall=submitReport") |
50 | |
public ModelAndView submitReport(@ModelAttribute("KualiForm") UifFormBase uifForm, BindingResult result, |
51 | |
HttpServletRequest request, HttpServletResponse response) throws Exception { |
52 | |
|
53 | 0 | KualiExceptionIncidentService reporterService = KRADServiceLocatorWeb.getKualiExceptionIncidentService(); |
54 | 0 | reporterService.emailReport(((IncidentReportForm) uifForm).createEmailSubject(), |
55 | |
((IncidentReportForm) uifForm).createEmailMessage()); |
56 | |
|
57 | |
|
58 | 0 | return close(uifForm, result, request, response); |
59 | |
} |
60 | |
|
61 | |
} |