1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.student.enrollment.lpr.service.impl; |
17 | |
|
18 | |
|
19 | |
import java.util.ArrayList; |
20 | |
import java.util.List; |
21 | |
|
22 | |
import javax.jws.WebService; |
23 | |
|
24 | |
import org.kuali.student.common.dto.ContextInfo; |
25 | |
import org.kuali.student.common.dto.CriteriaInfo; |
26 | |
import org.kuali.student.common.dto.StateInfo; |
27 | |
import org.kuali.student.common.dto.StatusInfo; |
28 | |
import org.kuali.student.common.dto.TypeInfo; |
29 | |
import org.kuali.student.common.dto.TypeTypeRelationInfo; |
30 | |
import org.kuali.student.common.dto.ValidationResultInfo; |
31 | |
import org.kuali.student.common.exceptions.AlreadyExistsException; |
32 | |
import org.kuali.student.common.exceptions.DisabledIdentifierException; |
33 | |
import org.kuali.student.common.exceptions.DoesNotExistException; |
34 | |
import org.kuali.student.common.exceptions.InvalidParameterException; |
35 | |
import org.kuali.student.common.exceptions.MissingParameterException; |
36 | |
import org.kuali.student.common.exceptions.OperationFailedException; |
37 | |
import org.kuali.student.common.exceptions.PermissionDeniedException; |
38 | |
import org.kuali.student.common.exceptions.ReadOnlyException; |
39 | |
import org.kuali.student.datadictionary.dto.DictionaryEntryInfo; |
40 | |
import org.kuali.student.enrollment.lpr.dao.LprDao; |
41 | |
import org.kuali.student.enrollment.lpr.dao.LprStateDao; |
42 | |
import org.kuali.student.enrollment.lpr.dao.LprTypeDao; |
43 | |
import org.kuali.student.enrollment.lpr.dto.LuiPersonRelationInfo; |
44 | |
import org.kuali.student.enrollment.lpr.model.LuiPersonRelationEntity; |
45 | |
import org.kuali.student.enrollment.lpr.model.LuiPersonRelationStateEntity; |
46 | |
import org.kuali.student.enrollment.lpr.service.LuiPersonRelationService; |
47 | |
import org.springframework.transaction.annotation.Transactional; |
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
@WebService(name = "LuiPersonRelationService", serviceName = "LuiPersonRelationService", portName = "LuiPersonRelationService", targetNamespace = "http://student.kuali.org/wsdl/lpr") |
54 | |
@Transactional(readOnly=true,noRollbackFor={DoesNotExistException.class},rollbackFor={Throwable.class}) |
55 | 0 | public class LuiPersonRelationServiceImpl implements LuiPersonRelationService { |
56 | |
|
57 | |
private LprDao lprDao; |
58 | |
private LprStateDao lprStateDao; |
59 | |
private LprTypeDao lprTypeDao; |
60 | |
|
61 | |
|
62 | |
@Override |
63 | |
public List<LuiPersonRelationInfo> findLuiPersonRelationsForLui(String luiId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
64 | 0 | List<LuiPersonRelationEntity> luiPersonRelations = lprDao.getByLuiId(luiId); |
65 | 0 | List<LuiPersonRelationInfo> dtos = new ArrayList<LuiPersonRelationInfo>(); |
66 | 0 | for (LuiPersonRelationEntity entity : luiPersonRelations) { |
67 | 0 | dtos.add(entity.toDto()); |
68 | |
} |
69 | 0 | return dtos; |
70 | |
} |
71 | |
|
72 | |
@Override |
73 | |
public List<String> createBulkRelationshipsForPerson(String personId, |
74 | |
List<String> luiIdList, String relationState, |
75 | |
String luiPersonRelationType, |
76 | |
LuiPersonRelationInfo luiPersonRelationInfo, ContextInfo context) |
77 | |
throws AlreadyExistsException, DoesNotExistException, |
78 | |
DisabledIdentifierException, InvalidParameterException, |
79 | |
MissingParameterException, OperationFailedException, |
80 | |
PermissionDeniedException { |
81 | |
|
82 | 0 | List<String> bulkRelationshipValues = new ArrayList<String>(); |
83 | |
|
84 | 0 | bulkRelationshipValues.add(personId); |
85 | |
|
86 | 0 | System.out.println("Inside core impl for createBulkRelationshipsForPerson"); |
87 | |
|
88 | 0 | return bulkRelationshipValues; |
89 | |
|
90 | |
} |
91 | |
|
92 | |
@Override |
93 | |
public LuiPersonRelationInfo fetchLuiPersonRelation(String luiPersonRelationId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
94 | 0 | LuiPersonRelationEntity lpr = lprDao.find(luiPersonRelationId); |
95 | 0 | return null != lpr ? lpr.toDto() : null; |
96 | |
} |
97 | |
|
98 | |
@Override |
99 | |
public List<LuiPersonRelationInfo> findLuiPersonRelationsByIdList(List<String> luiPersonRelationIdList, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
100 | |
|
101 | 0 | return null; |
102 | |
} |
103 | |
|
104 | |
@Override |
105 | |
public List<String> findLuiIdsRelatedToPerson(String personId, String luiPersonRelationType, String relationState, ContextInfo context) throws DoesNotExistException, DisabledIdentifierException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
106 | |
|
107 | 0 | return null; |
108 | |
} |
109 | |
|
110 | |
@Override |
111 | |
public List<String> findPersonIdsRelatedToLui(String luiId, String luiPersonRelationType, String relationState, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
112 | |
|
113 | 0 | return null; |
114 | |
} |
115 | |
|
116 | |
@Override |
117 | |
public List<LuiPersonRelationInfo> findLuiPersonRelations(String personId, String luiId, ContextInfo context) throws DoesNotExistException, DisabledIdentifierException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
118 | |
|
119 | 0 | return null; |
120 | |
} |
121 | |
|
122 | |
@Override |
123 | |
public List<String> findLuiPersonRelationIds(String personId, String luiId, ContextInfo context) throws DoesNotExistException, DisabledIdentifierException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
124 | |
|
125 | 0 | return null; |
126 | |
} |
127 | |
|
128 | |
@Override |
129 | |
public List<LuiPersonRelationInfo> findLuiPersonRelationsForPerson(String personId, ContextInfo context) throws DoesNotExistException, DisabledIdentifierException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
130 | |
|
131 | 0 | return null; |
132 | |
} |
133 | |
|
134 | |
@Override |
135 | |
public List<String> findLuiPersonRelationIdsForPerson(String personId, ContextInfo context) throws DoesNotExistException, DisabledIdentifierException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
136 | |
|
137 | 0 | return null; |
138 | |
} |
139 | |
|
140 | |
@Override |
141 | |
public List<String> findLuiPersonRelationIdsForLui(String luiId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
142 | |
|
143 | 0 | return null; |
144 | |
} |
145 | |
|
146 | |
@Override |
147 | |
public List<ValidationResultInfo> validateLuiPersonRelation(String validationType, LuiPersonRelationInfo luiPersonRelationInfo, ContextInfo context) |
148 | |
throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
149 | |
|
150 | 0 | return null; |
151 | |
} |
152 | |
|
153 | |
@Override |
154 | |
public List<String> findAllValidLuisForPerson(String personId, String luiPersonRelationType, String relationState, String atpId, ContextInfo context) throws DoesNotExistException, DisabledIdentifierException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
155 | |
|
156 | 0 | return null; |
157 | |
} |
158 | |
|
159 | |
@Override |
160 | |
public List<String> searchForLuiPersonRelationIds(CriteriaInfo criteria, ContextInfo context) throws InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
161 | |
|
162 | 0 | return null; |
163 | |
} |
164 | |
|
165 | |
@Override |
166 | |
@Transactional |
167 | |
public String createLuiPersonRelation(String personId, String luiId, String luiPersonRelationType, LuiPersonRelationInfo luiPersonRelationInfo, ContextInfo context) throws AlreadyExistsException, DoesNotExistException, DisabledIdentifierException, ReadOnlyException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
168 | 0 | LuiPersonRelationEntity lpr = toCluForCreate(luiPersonRelationInfo); |
169 | 0 | lprDao.persist(lpr); |
170 | 0 | return lpr.getId(); |
171 | |
} |
172 | |
|
173 | |
private LuiPersonRelationEntity toCluForCreate(LuiPersonRelationInfo luiPersonRelationInfo) { |
174 | 0 | LuiPersonRelationEntity lpr = new LuiPersonRelationEntity(luiPersonRelationInfo); |
175 | 0 | if (null != luiPersonRelationInfo.getStateKey()) { |
176 | 0 | lpr.setPersonRelationState(lprStateDao.find(luiPersonRelationInfo.getStateKey())); |
177 | |
} |
178 | 0 | if (null != luiPersonRelationInfo.getTypeKey()) { |
179 | 0 | lpr.setPersonRelationType(lprTypeDao.find(luiPersonRelationInfo.getTypeKey())); |
180 | |
} |
181 | |
|
182 | 0 | return lpr; |
183 | |
} |
184 | |
|
185 | |
@Override |
186 | |
public List<String> createBulkRelationshipsForLui(String luiId, List<String> personIdList, String relationState, String luiPersonRelationType, LuiPersonRelationInfo luiPersonRelationInfo, ContextInfo context) throws AlreadyExistsException, DoesNotExistException, DisabledIdentifierException, ReadOnlyException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
187 | |
|
188 | 0 | return null; |
189 | |
} |
190 | |
|
191 | |
@Override |
192 | |
public LuiPersonRelationInfo updateLuiPersonRelation(String luiPersonRelationId, LuiPersonRelationInfo luiPersonRelationInfo, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, ReadOnlyException, OperationFailedException, PermissionDeniedException { |
193 | |
|
194 | 0 | return null; |
195 | |
} |
196 | |
|
197 | |
@Override |
198 | |
public StatusInfo deleteLuiPersonRelation(String luiPersonRelationId, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
199 | |
|
200 | 0 | return null; |
201 | |
} |
202 | |
|
203 | |
@Override |
204 | |
public DictionaryEntryInfo getDataDictionaryEntry(String entryKey, ContextInfo context) throws OperationFailedException, MissingParameterException, PermissionDeniedException, DoesNotExistException { |
205 | |
|
206 | 0 | return null; |
207 | |
} |
208 | |
|
209 | |
@Override |
210 | |
public List<String> getDataDictionaryEntryKeys(ContextInfo context) throws OperationFailedException, MissingParameterException, PermissionDeniedException { |
211 | |
|
212 | 0 | return null; |
213 | |
} |
214 | |
|
215 | |
@Override |
216 | |
public TypeInfo getType(String typeKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
217 | |
|
218 | 0 | return null; |
219 | |
} |
220 | |
|
221 | |
@Override |
222 | |
public List<TypeInfo> getTypesByRefObjectURI(String refObjectURI, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
223 | |
|
224 | 0 | return null; |
225 | |
} |
226 | |
|
227 | |
@Override |
228 | |
public List<TypeInfo> getAllowedTypesForType(String ownerTypeKey, String relatedRefObjectURI, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
229 | |
|
230 | 0 | return null; |
231 | |
} |
232 | |
|
233 | |
@Override |
234 | |
public List<TypeTypeRelationInfo> getTypeRelationsByOwnerType(String ownerTypeKey, String relationTypeKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
235 | |
|
236 | 0 | return null; |
237 | |
} |
238 | |
|
239 | |
public void setLprDao(LprDao lprDao) { |
240 | 0 | this.lprDao = lprDao; |
241 | 0 | } |
242 | |
|
243 | |
public void setLprStateDao(LprStateDao lprStateDao) { |
244 | 0 | this.lprStateDao = lprStateDao; |
245 | 0 | } |
246 | |
|
247 | |
public void setLprTypeDao(LprTypeDao lprTypeDao) { |
248 | 0 | this.lprTypeDao = lprTypeDao; |
249 | 0 | } |
250 | |
|
251 | |
@Override |
252 | |
public List<String> getProcessKeys(String typeKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
253 | |
|
254 | 0 | return null; |
255 | |
} |
256 | |
|
257 | |
@Override |
258 | |
public StateInfo getState(String processKey, String stateKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
259 | 0 | return null; |
260 | |
} |
261 | |
|
262 | |
@Override |
263 | |
public List<StateInfo> getStatesByProcess(String processKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
264 | |
|
265 | 0 | return null; |
266 | |
} |
267 | |
|
268 | |
@Override |
269 | |
public List<StateInfo> getInitialValidStates(String processKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
270 | |
|
271 | 0 | return null; |
272 | |
} |
273 | |
|
274 | |
@Override |
275 | |
public StateInfo getNextHappyState(String processKey, String currentStateKey, ContextInfo context) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
276 | |
|
277 | 0 | return null; |
278 | |
} |
279 | |
} |