Clover Coverage Report - KS LUM Program 1.1.0-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
40   173   22   1.9
0   139   0.55   21
21     1.05  
1    
 
  StatementDataService       Line # 27 40 0% 22 61 0% 0.0
 
No Tests
 
1    package org.kuali.student.lum.program.server;
2   
3    import java.util.ArrayList;
4    import java.util.List;
5   
6    import org.apache.log4j.Logger;
7    import org.kuali.student.common.ui.client.widgets.rules.ReqComponentInfoUi;
8    import org.kuali.student.core.dictionary.old.dto.ObjectStructure;
9    import org.kuali.student.core.exceptions.DoesNotExistException;
10    import org.kuali.student.core.search.dto.SearchCriteriaTypeInfo;
11    import org.kuali.student.core.search.dto.SearchRequest;
12    import org.kuali.student.core.search.dto.SearchResult;
13    import org.kuali.student.core.search.dto.SearchResultTypeInfo;
14    import org.kuali.student.core.search.dto.SearchTypeInfo;
15    import org.kuali.student.core.statement.dto.ReqComponentInfo;
16    import org.kuali.student.core.statement.dto.ReqComponentTypeInfo;
17    import org.kuali.student.core.statement.dto.StatementTreeViewInfo;
18    import org.kuali.student.core.statement.dto.StatementTypeInfo;
19    import org.kuali.student.core.statement.service.StatementService;
20    import org.kuali.student.core.versionmanagement.dto.VersionDisplayInfo;
21    import org.kuali.student.lum.lu.dto.CluInfo;
22    import org.kuali.student.lum.lu.service.LuService;
23    import org.kuali.student.lum.program.client.rpc.StatementRpcService;
24    import org.springframework.transaction.annotation.Transactional;
25   
26    @Transactional(readOnly=true,noRollbackFor={DoesNotExistException.class},rollbackFor={Throwable.class})
 
27    public class StatementDataService implements StatementRpcService{
28    final static Logger LOG = Logger.getLogger(StatementDataService.class);
29   
30   
31    private StatementService statementService;
32    private LuService luService;
33   
34    private static final long serialVersionUID = 822326113643828855L;
 
35  0 toggle @Override
36    public List<StatementTypeInfo> getStatementTypesForStatementTypeForCourse(String statementTypeKey) throws Exception {
37   
38  0 List<StatementTypeInfo> allStatementTypes = new ArrayList<StatementTypeInfo>();
39   
40  0 List<String> topStatementTypes = statementService.getStatementTypesForStatementType(statementTypeKey);
41   
42    // loop through top statement types like enrollment eligibility and credit constraints
43  0 for (String topStatementType : topStatementTypes) {
44  0 allStatementTypes.add(statementService.getStatementType(topStatementType));
45  0 List<String> subStatementTypeNames = statementService.getStatementTypesForStatementType(topStatementType);
46   
47    // loop through statement types belonging to the top statement types
48  0 for (String subStatementTypeName : subStatementTypeNames) {
49  0 allStatementTypes.add(statementService.getStatementType(subStatementTypeName));
50    }
51    }
52   
53  0 return allStatementTypes;
54    }
55   
 
56  0 toggle @Override
57    public List<StatementTypeInfo> getStatementTypesForStatementType(String statementTypeKey) throws Exception {
58  0 List<String> statementTypeNames = statementService.getStatementTypesForStatementType(statementTypeKey);
59  0 List<StatementTypeInfo> statementTypes = new ArrayList<StatementTypeInfo>();
60  0 for (String statementTypeName : statementTypeNames) {
61  0 statementTypes.add(statementService.getStatementType(statementTypeName));
62    }
63  0 return statementTypes;
64    }
 
65  0 toggle @Override
66    public List<ReqComponentTypeInfo> getReqComponentTypesForStatementType(String luStatementTypeKey) throws Exception {
67   
68  0 List<ReqComponentTypeInfo> reqComponentTypeInfoList;
69  0 try {
70  0 reqComponentTypeInfoList = statementService.getReqComponentTypesForStatementType(luStatementTypeKey);
71    } catch (Exception ex) {
72  0 LOG.error(ex);
73  0 throw new Exception("Unable to find Requirement Component Types based on LU Statement Type Key:" + luStatementTypeKey, ex);
74    }
75   
76  0 return reqComponentTypeInfoList;
77    }
78   
 
79  0 toggle @Override
80    public String translateStatementTreeViewToNL(StatementTreeViewInfo statementTreeViewInfo, String nlUsageTypeKey, String language) throws Exception {
81  0 return statementService.translateStatementTreeViewToNL(statementTreeViewInfo, nlUsageTypeKey, language);
82    }
83   
 
84  0 toggle @Override
85    public String translateReqComponentToNL(ReqComponentInfo reqComponentInfo, String nlUsageTypeKey, String language) throws Exception {
86  0 return statementService.translateReqComponentToNL(reqComponentInfo, nlUsageTypeKey, language);
87    }
88   
 
89  0 toggle @Override
90    public List<String> translateReqComponentToNLs(ReqComponentInfoUi reqComponentInfo, String[] nlUsageTypeKeys, String language) throws Exception {
91  0 List<String> nls = new ArrayList<String>(nlUsageTypeKeys.length);
92  0 for (String typeKey : nlUsageTypeKeys) {
93  0 nls.add(statementService.translateReqComponentToNL(reqComponentInfo, typeKey, language));
94    }
95  0 return nls;
96    }
97   
 
98  0 toggle @Override
99    public CluInfo getClu(String cluId) throws Exception {
100  0 return luService.getClu(cluId);
101    }
102   
 
103  0 toggle @Override
104    public VersionDisplayInfo getCurrentVersion(String refObjectTypeURI, String refObjectId) throws Exception {
105  0 return luService.getCurrentVersion(refObjectTypeURI, refObjectId);
106    }
107   
 
108  0 toggle public void setStatementService(StatementService statementService) {
109  0 this.statementService = statementService;
110    }
111   
 
112  0 toggle public void setLuService(LuService luService) {
113  0 this.luService = luService;
114    }
115   
 
116  0 toggle @Override
117    public List<String> getObjectTypes() {
118  0 throw new UnsupportedOperationException();
119    }
120   
 
121  0 toggle @Override
122    public ObjectStructure getObjectStructure(String objectTypeKey) {
123  0 throw new UnsupportedOperationException();
124    }
125   
 
126  0 toggle @Override
127    public List<SearchTypeInfo> getSearchTypes() {
128  0 throw new UnsupportedOperationException();
129    }
130   
 
131  0 toggle @Override
132    public SearchTypeInfo getSearchType(String searchTypeKey) {
133  0 throw new UnsupportedOperationException();
134    }
135   
 
136  0 toggle @Override
137    public List<SearchTypeInfo> getSearchTypesByResult(
138    String searchResultTypeKey) {
139  0 throw new UnsupportedOperationException();
140    }
141   
 
142  0 toggle @Override
143    public List<SearchTypeInfo> getSearchTypesByCriteria(
144    String searchCriteriaTypeKey) {
145  0 throw new UnsupportedOperationException();
146    }
147   
 
148  0 toggle @Override
149    public List<SearchResultTypeInfo> getSearchResultTypes() {
150  0 throw new UnsupportedOperationException();
151    }
152   
 
153  0 toggle @Override
154    public SearchResultTypeInfo getSearchResultType(String searchResultTypeKey) {
155  0 throw new UnsupportedOperationException();
156    }
157   
 
158  0 toggle @Override
159    public List<SearchCriteriaTypeInfo> getSearchCriteriaTypes() {
160  0 throw new UnsupportedOperationException();
161    }
162   
 
163  0 toggle @Override
164    public SearchCriteriaTypeInfo getSearchCriteriaType(
165    String searchCriteriaTypeKey) {
166  0 throw new UnsupportedOperationException();
167    }
168   
 
169  0 toggle @Override
170    public SearchResult search(SearchRequest searchRequest) {
171  0 throw new UnsupportedOperationException();
172    }
173    }