View Javadoc
1   package org.kuali.ole.select.controller;
2   
3   import org.kuali.ole.OLEConstants;
4   import org.kuali.ole.select.bo.OLEPOClaimHistory;
5   import org.kuali.ole.select.businessobject.OlePurchaseOrderItem;
6   import org.kuali.ole.select.document.OlePurchaseOrderDocument;
7   import org.kuali.ole.select.form.OLEClaimingSearchForm;
8   import org.kuali.ole.select.service.OLEClaimingSearchService;
9   import org.kuali.rice.krad.service.KRADServiceLocator;
10  import org.kuali.rice.krad.util.GlobalVariables;
11  import org.kuali.rice.krad.web.controller.UifControllerBase;
12  import org.kuali.rice.krad.web.form.UifFormBase;
13  import org.springframework.stereotype.Controller;
14  import org.springframework.validation.BindingResult;
15  import org.springframework.web.bind.annotation.ModelAttribute;
16  import org.springframework.web.bind.annotation.RequestMapping;
17  import org.springframework.web.servlet.ModelAndView;
18  
19  import javax.servlet.http.HttpServletRequest;
20  import javax.servlet.http.HttpServletResponse;
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  /**
25   * Created with IntelliJ IDEA.
26   * User: vivekb
27   * Date: 1/22/14
28   * Time: 3:01 PM
29   * To change this template use File | Settings | File Templates.
30   */
31  @Controller
32  @RequestMapping(value = "/oleClaimingSearchController")
33  public class OLEClaimingSearchController extends UifControllerBase {
34      @Override
35      protected UifFormBase createInitialForm(HttpServletRequest request) {
36          return new OLEClaimingSearchForm();
37      }
38  
39      @RequestMapping(params = "methodToCall=search")
40      public ModelAndView search(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
41                                 HttpServletRequest request, HttpServletResponse response) {
42          OLEClaimingSearchForm oleClaimingSearchForm = (OLEClaimingSearchForm) form;
43          OLEClaimingSearchService oleClaimingSearchService=new OLEClaimingSearchService();
44          oleClaimingSearchForm.setClaimErrorMessage("");
45          oleClaimingSearchService.getClaimResponse(oleClaimingSearchForm);
46          return getUIFModelAndView(oleClaimingSearchForm);
47      }
48  
49      @RequestMapping(params = "methodToCall=clearSearch")
50      public ModelAndView clearSearch(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
51                                 HttpServletRequest request, HttpServletResponse response) {
52          OLEClaimingSearchForm oleClaimingSearchForm = (OLEClaimingSearchForm) form;
53          oleClaimingSearchForm.setVendorName("");
54          oleClaimingSearchForm.setTitle("");
55          oleClaimingSearchForm.setClaimDate(null);
56          oleClaimingSearchForm.setSuccessMsg("");
57          oleClaimingSearchForm.setClaimErrorMessage("");
58          oleClaimingSearchForm.setOleClaimingSearchRecordList(new ArrayList<OLEPOClaimHistory>());
59          return getUIFModelAndView(oleClaimingSearchForm);
60      }
61  
62      @RequestMapping(params = "methodToCall=updateClaimNote")
63      public ModelAndView updateClaimNote(@ModelAttribute("KualiForm") UifFormBase form, BindingResult result,
64                                 HttpServletRequest request, HttpServletResponse response) {
65          OLEClaimingSearchForm oleClaimingSearchForm = (OLEClaimingSearchForm) form;
66          OLEClaimingSearchService oleClaimingSearchService=new OLEClaimingSearchService();
67          oleClaimingSearchService.updateClaimNote(oleClaimingSearchForm);
68          return getUIFModelAndView(oleClaimingSearchForm);
69      }
70  }