1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.select.document.service.impl;
17
18 import org.apache.log4j.Logger;
19 import org.kuali.ole.select.businessobject.OleRequestor;
20 import org.kuali.ole.select.businessobject.OleRequestorType;
21 import org.kuali.ole.select.document.service.OleRequestorService;
22 import org.kuali.rice.krad.service.BusinessObjectService;
23
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27
28 public class OleRequestorServiceImpl implements OleRequestorService {
29 private static Logger LOG = Logger.getLogger(OleRequestorServiceImpl.class);
30
31 private BusinessObjectService businessObjectService;
32
33
34
35
36
37 public void saveRequestor(OleRequestor oleRequestor) {
38 oleRequestor.setActive(true);
39 businessObjectService.save(oleRequestor);
40 }
41
42
43
44
45 public void saveRequestorType(OleRequestorType oleRequestorType) {
46 businessObjectService.save(oleRequestorType);
47 }
48
49
50
51
52 public OleRequestor getRequestorDetails(String requestorId) {
53 Map keys = new HashMap();
54 keys.put("requestorId", requestorId);
55 return (OleRequestor) businessObjectService.findByPrimaryKey(OleRequestor.class, keys);
56 }
57
58
59
60
61 public OleRequestorType getRequestorTypeDetails(String requestorType) {
62 Map keys = new HashMap();
63 keys.put("requestorType", requestorType);
64 return (OleRequestorType) businessObjectService.findByPrimaryKey(OleRequestorType.class, keys);
65 }
66
67
68
69
70 public List<OleRequestorType> getRequestorTypeList(String requestorType) {
71 if (LOG.isDebugEnabled())
72 LOG.debug("Entering getRequestorTypeList for requestorType:" + requestorType);
73 Map criteria = new HashMap();
74 criteria.put("requestorType", requestorType);
75 List<OleRequestorType> requestorTypeList = (List) businessObjectService.findMatching(OleRequestorType.class, criteria);
76 LOG.debug("Exiting getRequestorTypeList.");
77 return requestorTypeList;
78 }
79
80 public BusinessObjectService getBusinessObjectService() {
81 return businessObjectService;
82 }
83
84 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
85 this.businessObjectService = businessObjectService;
86 }
87 }