1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.maintenance;
17
18 import org.kuali.rice.krad.document.DocumentControllerBase;
19 import org.kuali.rice.krad.util.KRADConstants;
20 import org.kuali.rice.krad.web.form.MaintenanceDocumentForm;
21 import org.kuali.rice.krad.web.service.ControllerService;
22 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.beans.factory.annotation.Qualifier;
24 import org.springframework.stereotype.Controller;
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.HttpServletResponse;
30
31
32
33
34
35
36 @Controller
37 @RequestMapping(value = KRADConstants.ControllerMappings.MAINTENANCE)
38 public class MaintenanceDocumentController extends DocumentControllerBase {
39
40
41
42
43 @Override
44 protected MaintenanceDocumentForm createInitialForm() {
45 return new MaintenanceDocumentForm();
46 }
47
48
49
50
51 @RequestMapping(params = "methodToCall=" + KRADConstants.Maintenance.METHOD_TO_CALL_EDIT)
52 public ModelAndView setupMaintenanceEdit(MaintenanceDocumentForm form) {
53 return getControllerService().setupMaintenanceEdit(form);
54 }
55
56
57
58
59 @RequestMapping(params = "methodToCall=" + KRADConstants.Maintenance.METHOD_TO_CALL_COPY)
60 public ModelAndView setupMaintenanceCopy(MaintenanceDocumentForm form) {
61 return getControllerService().setupMaintenanceCopy(form);
62 }
63
64
65
66
67 @RequestMapping(params = "methodToCall=" + KRADConstants.Maintenance.METHOD_TO_CALL_NEW_WITH_EXISTING)
68 public ModelAndView setupMaintenanceNewWithExisting(MaintenanceDocumentForm form) {
69 return getControllerService().setupMaintenanceNewWithExisting(form);
70 }
71
72
73
74
75 @RequestMapping(params = "methodToCall=" + KRADConstants.Maintenance.METHOD_TO_CALL_DELETE)
76 public ModelAndView maintenanceDelete(MaintenanceDocumentForm form) {
77 return getControllerService().setupMaintenanceDelete(form);
78 }
79
80
81
82
83
84 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=downloadDataObjectAttachment")
85 public ModelAndView downloadDataObjectAttachment(MaintenanceDocumentForm form, HttpServletResponse response) {
86 getControllerService().downloadDataObjectAttachment(form, response);
87
88 return null;
89 }
90
91 @Override
92 protected MaintenanceDocumentControllerService getControllerService() {
93 return (MaintenanceDocumentControllerService) super.getControllerService();
94 }
95
96 @Override
97 @Autowired
98 @Qualifier("maintenanceDocumentControllerService")
99 public void setControllerService(ControllerService controllerService) {
100 super.setControllerService(controllerService);
101 }
102
103 }