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 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
24
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
28
29 public class OleRequestorServiceImpl implements OleRequestorService {
30 private static Logger LOG = Logger.getLogger(OleRequestorServiceImpl.class);
31
32 private BusinessObjectService businessObjectService;
33
34
35
36
37
38 public void saveRequestor(OleRequestor oleRequestor) {
39 oleRequestor.setActive(true);
40 KRADServiceLocatorWeb.getLegacyDataAdapter().save(oleRequestor);
41 }
42
43
44
45
46 public void saveRequestorType(OleRequestorType oleRequestorType) {
47 KRADServiceLocatorWeb.getLegacyDataAdapter().save(oleRequestorType);
48 }
49
50
51
52
53 public OleRequestor getRequestorDetails(String requestorId) {
54 Map keys = new HashMap();
55 keys.put("requestorId", requestorId);
56 return (OleRequestor) KRADServiceLocatorWeb.getLegacyDataAdapter().findByPrimaryKey(OleRequestor.class, keys);
57 }
58
59
60
61
62 public OleRequestorType getRequestorTypeDetails(String requestorType) {
63 Map keys = new HashMap();
64 keys.put("requestorType", requestorType);
65 return (OleRequestorType) KRADServiceLocatorWeb.getLegacyDataAdapter().findByPrimaryKey(OleRequestorType.class, keys);
66 }
67
68
69
70
71 public List<OleRequestorType> getRequestorTypeList(String requestorType) {
72 if (LOG.isDebugEnabled())
73 LOG.debug("Entering getRequestorTypeList for requestorType:" + requestorType);
74 Map criteria = new HashMap();
75 criteria.put("requestorType", requestorType);
76 List<OleRequestorType> requestorTypeList = (List) KRADServiceLocatorWeb.getLegacyDataAdapter().findMatching(OleRequestorType.class, criteria);
77 LOG.debug("Exiting getRequestorTypeList.");
78 return requestorTypeList;
79 }
80
81 public BusinessObjectService getBusinessObjectService() {
82 return businessObjectService;
83 }
84
85 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
86 this.businessObjectService = businessObjectService;
87 }
88 }