1 package org.kuali.ole.deliver.controller;
2
3 import org.apache.log4j.Logger;
4 import org.kuali.ole.deliver.bo.OleCirculationDesk;
5
6 import org.kuali.ole.deliver.service.OleDeliverRequestDocumentHelperServiceImpl;
7 import org.kuali.ole.krad.OleInquiryController;
8 import org.kuali.rice.krad.web.form.InquiryForm;
9 import org.kuali.rice.krad.web.form.UifFormBase;
10 import org.springframework.stereotype.Controller;
11 import org.springframework.validation.BindingResult;
12 import org.springframework.web.bind.annotation.ModelAttribute;
13 import org.springframework.web.bind.annotation.RequestMapping;
14 import org.springframework.web.bind.annotation.RequestMethod;
15 import org.springframework.web.servlet.ModelAndView;
16
17 import javax.servlet.http.HttpServletRequest;
18 import javax.servlet.http.HttpServletResponse;
19 import java.util.ArrayList;
20
21
22
23
24 @Controller
25 @RequestMapping(value = "/oleCirculationDeskInquiry")
26 public class OLECirculationDeskInquiryController extends OleInquiryController {
27
28 private static final Logger LOG = Logger.getLogger(OlePatronDocumentInquiryController.class);
29 @RequestMapping(method = RequestMethod.POST, params = "methodToCall=generateOnHoldNotices")
30 public ModelAndView generateOnHoldNotices(@ModelAttribute("KualiForm") UifFormBase uifForm, BindingResult result,
31 HttpServletRequest request, HttpServletResponse response) {
32
33 InquiryForm form = (InquiryForm) uifForm;
34 OleDeliverRequestDocumentHelperServiceImpl oleDeliverRequestDocumentHelperService = new OleDeliverRequestDocumentHelperServiceImpl();
35 OleCirculationDesk oleCirculationDesk = (OleCirculationDesk)form.getDataObject();
36 try{
37 oleDeliverRequestDocumentHelperService.generateOnHoldNoticesBasedOnPickupLocation(oleCirculationDesk.getCirculationDeskId());
38 }catch (Exception e) {
39 LOG.error("While fetching loan records error occured" + e);
40 }
41 return getUIFModelAndView(form);
42 }
43 }