1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.module.cg.document.service.impl;
17
18 import java.util.ArrayList;
19 import java.util.Arrays;
20 import java.util.HashMap;
21 import java.util.List;
22 import java.util.Map;
23
24 import org.kuali.ole.module.cg.CGPropertyConstants;
25 import org.kuali.ole.module.cg.businessobject.ResearchRiskType;
26 import org.kuali.ole.module.cg.document.service.RoutingFormResearchRiskService;
27 import org.kuali.ole.sys.OLEPropertyConstants;
28 import org.kuali.rice.krad.service.BusinessObjectService;
29
30 public class RoutingFormResearchRiskServiceImpl implements RoutingFormResearchRiskService {
31
32 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(RoutingFormResearchRiskServiceImpl.class);
33
34 private BusinessObjectService businessObjectService;
35
36
37
38
39
40
41
42
43 protected List<ResearchRiskType> getAllResearchRiskTypes() {
44 return getResearchRiskTypes(new String[0]);
45 }
46
47
48
49
50 public List<ResearchRiskType> getResearchRiskTypes(String[] exceptCodes) {
51 Map criteria = new HashMap();
52 criteria.put(OLEPropertyConstants.ACTIVE, true);
53 List<ResearchRiskType> allActiveResearchRiskTypes = (List<ResearchRiskType>) this.businessObjectService.findMatchingOrderBy(ResearchRiskType.class, criteria, CGPropertyConstants.RESEARCH_RISK_TYPE_SORT_NUMBER, true);
54
55 List<String> exceptCodesList = Arrays.asList(exceptCodes);
56 List<ResearchRiskType> result = new ArrayList<ResearchRiskType>();
57 for (ResearchRiskType type : allActiveResearchRiskTypes) {
58 if (!exceptCodesList.contains(type.getResearchRiskTypeCode())) {
59 result.add(type);
60 }
61 }
62 return result;
63 }
64
65
66
67
68
69
70 public void setBusinessObjectService(BusinessObjectService businessObjectService) {
71 this.businessObjectService = businessObjectService;
72 }
73 }