1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.lookup;
17
18 import org.kuali.rice.krad.util.KRADConstants;
19 import org.kuali.rice.krad.web.controller.UifControllerBase;
20 import org.kuali.rice.krad.web.form.UifFormBase;
21 import org.kuali.rice.krad.web.service.CollectionControllerService;
22 import org.kuali.rice.krad.web.service.ControllerService;
23 import org.springframework.beans.factory.annotation.Autowired;
24 import org.springframework.beans.factory.annotation.Qualifier;
25 import org.springframework.stereotype.Controller;
26 import org.springframework.web.bind.annotation.RequestMapping;
27 import org.springframework.web.bind.annotation.RequestMethod;
28 import org.springframework.web.servlet.ModelAndView;
29 import org.springframework.web.servlet.mvc.support.RedirectAttributes;
30
31
32
33
34
35
36 @Controller
37 @RequestMapping(value = KRADConstants.ControllerMappings.LOOKUP)
38 public class LookupController extends UifControllerBase {
39
40
41
42
43 @Override
44 protected LookupForm createInitialForm() {
45 return new LookupForm();
46 }
47
48
49
50
51 @RequestMapping(params = "methodToCall=search")
52 public ModelAndView search(LookupForm lookupForm) {
53 return getControllerService().search(lookupForm);
54 }
55
56
57
58
59 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=clearValues")
60 public ModelAndView clearValues(LookupForm lookupForm) {
61 return getControllerService().clearValues(lookupForm);
62 }
63
64
65
66
67 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=selectAllPages")
68 public ModelAndView selectAllPages(LookupForm lookupForm) {
69 return getControllerService().selectAllPages(lookupForm);
70 }
71
72
73
74
75 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=deselectAllPages")
76 public ModelAndView deselectAllPages(LookupForm lookupForm) {
77 return getControllerService().deselectAllPages(lookupForm);
78 }
79
80
81
82
83 @Override
84 @RequestMapping(params = "methodToCall=retrieveCollectionPage")
85 public ModelAndView retrieveCollectionPage(UifFormBase form) {
86 return getCollectionControllerService().retrieveCollectionPage(form);
87 }
88
89
90
91
92 @Override
93 @RequestMapping(method = RequestMethod.GET, params = "methodToCall=tableJsonRetrieval")
94 public ModelAndView tableJsonRetrieval(UifFormBase form) {
95 return getCollectionControllerService().tableJsonRetrieval(form);
96 }
97
98
99
100
101
102 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=returnSelected")
103 public String returnSelected(LookupForm lookupForm, final RedirectAttributes redirectAttributes) {
104 return getControllerService().returnSelected(lookupForm, redirectAttributes);
105 }
106
107 @Override
108 protected LookupControllerService getControllerService() {
109 return (LookupControllerService) super.getControllerService();
110 }
111
112 @Override
113 @Autowired
114 @Qualifier("lookupControllerService")
115 public void setControllerService(ControllerService controllerService) {
116 super.setControllerService(controllerService);
117 }
118
119 @Override
120 @Autowired
121 @Qualifier("lookupCollectionControllerService")
122 public void setCollectionControllerService(CollectionControllerService collectionControllerService) {
123 super.setCollectionControllerService(collectionControllerService);
124 }
125
126 }