Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
CourseService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2009 The Kuali Foundation Licensed under the Educational Community License, Version 1.0 (the "License"); you may | |
3 | * not use this file except in compliance with the License. You may obtain a copy of the License at | |
4 | * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law or agreed to in writing, software | |
5 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | |
6 | * express or implied. See the License for the specific language governing permissions and limitations under the License. | |
7 | */ | |
8 | package org.kuali.student.lum.course.service; | |
9 | ||
10 | import java.util.Date; | |
11 | import java.util.List; | |
12 | ||
13 | import javax.jws.WebParam; | |
14 | import javax.jws.WebService; | |
15 | import javax.jws.soap.SOAPBinding; | |
16 | ||
17 | import org.kuali.student.core.dictionary.service.DictionaryService; | |
18 | import org.kuali.student.core.dto.StatusInfo; | |
19 | import org.kuali.student.core.exceptions.AlreadyExistsException; | |
20 | import org.kuali.student.core.exceptions.CircularReferenceException; | |
21 | import org.kuali.student.core.exceptions.CircularRelationshipException; | |
22 | import org.kuali.student.core.exceptions.DataValidationErrorException; | |
23 | import org.kuali.student.core.exceptions.DependentObjectsExistException; | |
24 | import org.kuali.student.core.exceptions.DoesNotExistException; | |
25 | import org.kuali.student.core.exceptions.IllegalVersionSequencingException; | |
26 | import org.kuali.student.core.exceptions.InvalidParameterException; | |
27 | import org.kuali.student.core.exceptions.MissingParameterException; | |
28 | import org.kuali.student.core.exceptions.OperationFailedException; | |
29 | import org.kuali.student.core.exceptions.PermissionDeniedException; | |
30 | import org.kuali.student.core.exceptions.UnsupportedActionException; | |
31 | import org.kuali.student.core.exceptions.VersionMismatchException; | |
32 | import org.kuali.student.core.statement.dto.StatementTreeViewInfo; | |
33 | import org.kuali.student.core.validation.dto.ValidationResultInfo; | |
34 | import org.kuali.student.core.versionmanagement.service.VersionManagementService; | |
35 | import org.kuali.student.lum.course.dto.ActivityInfo; | |
36 | import org.kuali.student.lum.course.dto.CourseInfo; | |
37 | import org.kuali.student.lum.course.dto.FormatInfo; | |
38 | import org.kuali.student.lum.course.dto.LoDisplayInfo; | |
39 | ||
40 | /** | |
41 | * @Author KSContractMojo | |
42 | * @Author Kamal | |
43 | * @Since Tue May 18 11:30:50 PDT 2010 | |
44 | * @See <a href="https://test.kuali.org/confluence/display/KULSTU/Course+Service">CourseService</> | |
45 | */ | |
46 | @WebService(name = "CourseService", targetNamespace = CourseServiceConstants.COURSE_NAMESPACE) | |
47 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
48 | public interface CourseService extends DictionaryService, VersionManagementService { | |
49 | /** | |
50 | * Retrieves a Course | |
51 | * | |
52 | * @param courseId | |
53 | * Unique Id of the Course. Maps to cluId | |
54 | * @return the created course | |
55 | * @throws DoesNotExistException | |
56 | * Course does not exist | |
57 | * @throws InvalidParameterException | |
58 | * invalid course | |
59 | * @throws MissingParameterException | |
60 | * missing Course | |
61 | * @throws OperationFailedException | |
62 | * unable to complete request | |
63 | * @throws PermissionDeniedException | |
64 | * authorization failure | |
65 | */ | |
66 | public CourseInfo getCourse(@WebParam(name = "courseId") String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
67 | ||
68 | /** | |
69 | * Retrieves the formats for a Course. | |
70 | * | |
71 | * @param courseId | |
72 | * Unique Id of the Course. Maps to cluId | |
73 | * @return a list of format info Structures | |
74 | * @throws DoesNotExistException | |
75 | * Course does not exist | |
76 | * @throws InvalidParameterException | |
77 | * invalid courseId | |
78 | * @throws MissingParameterException | |
79 | * invalid courseId | |
80 | * @throws OperationFailedException | |
81 | * unable to complete request | |
82 | * @throws PermissionDeniedException | |
83 | * authorization failure | |
84 | */ | |
85 | public List<FormatInfo> getCourseFormats(@WebParam(name = "courseId") String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
86 | ||
87 | /** | |
88 | * Retrieves the Activities for a Course. | |
89 | * | |
90 | * @param formatId | |
91 | * Unique Id of the Format. Maps to cluId | |
92 | * @return a list of activity info Structures | |
93 | * @throws DoesNotExistException | |
94 | * Format does not exist | |
95 | * @throws InvalidParameterException | |
96 | * invalid format | |
97 | * @throws MissingParameterException | |
98 | * missing Format | |
99 | * @throws OperationFailedException | |
100 | * unable to complete request | |
101 | * @throws PermissionDeniedException | |
102 | * authorization failure | |
103 | */ | |
104 | public List<ActivityInfo> getCourseActivities(@WebParam(name = "formatId") String formatId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
105 | ||
106 | /** | |
107 | * Retrieves the Los for a Course. | |
108 | * | |
109 | * @param courseId | |
110 | * Unique Id of the Course. Maps to cluId | |
111 | * @return a list of LoDisplay info Structures | |
112 | * @throws DoesNotExistException | |
113 | * Course does not exist | |
114 | * @throws InvalidParameterException | |
115 | * invalid courseId | |
116 | * @throws MissingParameterException | |
117 | * invalid courseId | |
118 | * @throws OperationFailedException | |
119 | * unable to complete request | |
120 | * @throws PermissionDeniedException | |
121 | * authorization failure | |
122 | */ | |
123 | public List<LoDisplayInfo> getCourseLos(@WebParam(name = "courseId") String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
124 | ||
125 | /** | |
126 | * Retrieves the Statements of a Course. | |
127 | * | |
128 | * @param courseId | |
129 | * Unique Id of the Course. Maps to cluId | |
130 | * @param nlUsageTypeKey Natural language usage type key (context) | |
131 | * @param language Translation language e.g en, es, gr | |
132 | * @return a list of Statementree Structures | |
133 | * @throws DoesNotExistException | |
134 | * Course does not exist | |
135 | * @throws InvalidParameterException | |
136 | * invalid courseId | |
137 | * @throws MissingParameterException | |
138 | * invalid courseId | |
139 | * @throws OperationFailedException | |
140 | * unable to complete request | |
141 | * @throws PermissionDeniedException | |
142 | * authorization failure | |
143 | */ | |
144 | public List<StatementTreeViewInfo> getCourseStatements(@WebParam(name = "courseId") String courseId, @WebParam(name="nlUsageTypeKey")String nlUsageTypeKey, @WebParam(name="language")String language) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
145 | ||
146 | /** | |
147 | * Creates a Course | |
148 | * | |
149 | * @param courseInfo | |
150 | * courseInfo | |
151 | * @return the created course | |
152 | * @throws AlreadyExistsException | |
153 | * The Course already exists | |
154 | * @throws DataValidationErrorException | |
155 | * One or more values invalid for this operation | |
156 | * @throws InvalidParameterException | |
157 | * invalid course | |
158 | * @throws MissingParameterException | |
159 | * missing Course | |
160 | * @throws OperationFailedException | |
161 | * unable to complete request | |
162 | * @throws PermissionDeniedException | |
163 | * authorization failure | |
164 | * @throws VersionMismatchException | |
165 | * @throws DependentObjectsExistException | |
166 | * @throws CircularRelationshipException | |
167 | * @throws DoesNotExistException | |
168 | * @throws UnsupportedActionException | |
169 | */ | |
170 | public CourseInfo createCourse(@WebParam(name = "courseInfo") CourseInfo courseInfo) throws AlreadyExistsException, DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException, DoesNotExistException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException; | |
171 | ||
172 | /** | |
173 | * Updates a Course. | |
174 | * | |
175 | * @param courseInfo | |
176 | * courseInfo | |
177 | * @return updated Course | |
178 | * @throws DataValidationErrorException | |
179 | * One or more values invalid for this operation | |
180 | * @throws DoesNotExistException | |
181 | * course not found | |
182 | * @throws InvalidParameterException | |
183 | * invalid course | |
184 | * @throws MissingParameterException | |
185 | * missing course | |
186 | * @throws VersionMismatchException | |
187 | * The action was attempted on an out of date version. | |
188 | * @throws OperationFailedException | |
189 | * unable to complete request | |
190 | * @throws PermissionDeniedException | |
191 | * authorization failure | |
192 | * @throws DependentObjectsExistException | |
193 | * @throws CircularRelationshipException | |
194 | * @throws AlreadyExistsException | |
195 | * @throws UnsupportedActionException | |
196 | * @throws CircularReferenceException | |
197 | * @throws UnsupportedOperationException | |
198 | */ | |
199 | public CourseInfo updateCourse(@WebParam(name = "courseInfo") CourseInfo courseInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, VersionMismatchException, OperationFailedException, PermissionDeniedException, AlreadyExistsException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException, UnsupportedOperationException, CircularReferenceException; | |
200 | ||
201 | /** | |
202 | * Deletes a Course. | |
203 | * | |
204 | * @param courseId | |
205 | * identifier for Course.Maps to cluId | |
206 | * @return status of the operation (success or failure) | |
207 | * @throws DoesNotExistException | |
208 | * Course does not exist | |
209 | * @throws InvalidParameterException | |
210 | * invalid courseId | |
211 | * @throws MissingParameterException | |
212 | * invalid courseId | |
213 | * @throws OperationFailedException | |
214 | * unable to complete request | |
215 | * @throws PermissionDeniedException | |
216 | * authorization failure | |
217 | * @throws VersionMismatchException | |
218 | * @throws DependentObjectsExistException | |
219 | * @throws CircularRelationshipException | |
220 | * @throws AlreadyExistsException | |
221 | * @throws DataValidationErrorException | |
222 | * @throws UnsupportedActionException | |
223 | * @throws CircularReferenceException | |
224 | * @throws UnsupportedOperationException | |
225 | */ | |
226 | public StatusInfo deleteCourse(@WebParam(name = "courseId") String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException, DataValidationErrorException, AlreadyExistsException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException, UnsupportedOperationException, CircularReferenceException; | |
227 | ||
228 | /** | |
229 | * Creates the Statement for a Course. | |
230 | * | |
231 | * @param courseId | |
232 | * Unique Id of the Course. Maps to cluId | |
233 | * @param statementTreeViewInfoList | |
234 | * a Statementree Structures | |
235 | * @return created Statementree Structures | |
236 | * @throws DoesNotExistException | |
237 | * Course does not exist | |
238 | * @throws InvalidParameterException | |
239 | * invalid courseId | |
240 | * @throws MissingParameterException | |
241 | * invalid courseId | |
242 | * @throws OperationFailedException | |
243 | * unable to complete request | |
244 | * @throws PermissionDeniedException | |
245 | * authorization failure | |
246 | * @throws DataValidationErrorException | |
247 | */ | |
248 | public StatementTreeViewInfo createCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DataValidationErrorException; | |
249 | ||
250 | /** | |
251 | * Updates the Statement for a Course. | |
252 | * | |
253 | * @param courseId | |
254 | * Unique Id of the Course. Maps to cluId | |
255 | * @param statementTreeViewInfoList | |
256 | * a Statementree Structures | |
257 | * @return updated Statementree Structures | |
258 | * @throws DoesNotExistException | |
259 | * Course does not exist | |
260 | * @throws InvalidParameterException | |
261 | * invalid courseId | |
262 | * @throws MissingParameterException | |
263 | * invalid courseId | |
264 | * @throws OperationFailedException | |
265 | * unable to complete request | |
266 | * @throws PermissionDeniedException | |
267 | * authorization failure | |
268 | * @throws VersionMismatchException | |
269 | * @throws CircularReferenceException | |
270 | * @throws DataValidationErrorException | |
271 | */ | |
272 | public StatementTreeViewInfo updateCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DataValidationErrorException, CircularReferenceException, VersionMismatchException; | |
273 | ||
274 | /** | |
275 | * Delete the Statement for a Course. | |
276 | * | |
277 | * @param courseId | |
278 | * Unique Id of the Course. Maps to cluId | |
279 | * @param statementTreeViewInfoList | |
280 | * a Statementree Structures | |
281 | * @return status of the operation (success or failure) | |
282 | * @throws DoesNotExistException | |
283 | * Course does not exist | |
284 | * @throws InvalidParameterException | |
285 | * invalid courseId | |
286 | * @throws MissingParameterException | |
287 | * invalid courseId | |
288 | * @throws OperationFailedException | |
289 | * unable to complete request | |
290 | * @throws PermissionDeniedException | |
291 | * authorization failure | |
292 | */ | |
293 | public StatusInfo deleteCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
294 | ||
295 | ||
296 | /** | |
297 | * Validates a course based on its dictionary | |
298 | * | |
299 | * @param validationType | |
300 | * identifier of the extent of validation | |
301 | * @param courseInfo | |
302 | * Course to be validated | |
303 | * @return results from performing the validation | |
304 | * @throws DoesNotExistException | |
305 | * Course does not exist | |
306 | * @throws InvalidParameterException | |
307 | * invalid courseId | |
308 | * @throws MissingParameterException | |
309 | * invalid courseId | |
310 | * @throws OperationFailedException | |
311 | * unable to complete request | |
312 | */ | |
313 | public List<ValidationResultInfo> validateCourse(String validationType, CourseInfo courseInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException; | |
314 | ||
315 | ||
316 | /** | |
317 | * Validates the Statement for a Course. | |
318 | * | |
319 | * @param courseId | |
320 | * Unique Id of the Course. Maps to cluId | |
321 | * @param statementTreeViewInfoList | |
322 | * a Statementree Structures | |
323 | * @return results from performing the validation | |
324 | * @throws DoesNotExistException | |
325 | * Course or StementTreeView does not exist | |
326 | * @throws InvalidParameterException | |
327 | * invalid courseId or stratement tree view Id | |
328 | * @throws MissingParameterException | |
329 | * invalid courseId or statement tree view Id | |
330 | * @throws OperationFailedException | |
331 | * unable to complete request | |
332 | */ | |
333 | public List<ValidationResultInfo> validateCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException; | |
334 | ||
335 | ||
336 | /** | |
337 | * Creates a new Course version based on the current course | |
338 | * @param courseId identifier for the Course to be versioned | |
339 | * @param versionComment comment for the current version | |
340 | * @return the new versioned Course information | |
341 | * @throws DataValidationErrorException One or more values invalid for this operation | |
342 | * @throws DoesNotExistException courseId not found | |
343 | * @throws InvalidParameterException invalid courseId | |
344 | * @throws MissingParameterException missing courseId | |
345 | * @throws OperationFailedException unable to complete request | |
346 | * @throws PermissionDeniedException authorization failure | |
347 | * @throws VersionMismatchException The action was attempted on an out of date version | |
348 | */ | |
349 | public CourseInfo createNewCourseVersion(@WebParam(name="courseId")String courseId, @WebParam(name="versionComment")String versionComment) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException; | |
350 | ||
351 | ||
352 | /** | |
353 | * Sets a specific version of the Course as current. The sequence number must be greater than the existing current Course version. | |
354 | * This will truncate the current version's end date to the currentVersionStart param. | |
355 | * If a Course exists which is set to become current in the future, that course's currentVersionStart and CurrentVersionEnd will be nullified. | |
356 | * The currentVersionStart must be in the future to prevent changing historic data. | |
357 | * @param courseVersionId Version Specific Id of the Course | |
358 | * @param currentVersionStart Date when this course becomes current. Must be in the future and be after the most current course's start date. | |
359 | * @return status of the operation | |
360 | * @throws DoesNotExistException courseVersionId not found | |
361 | * @throws InvalidParameterException invalid courseVersionId, previousState, newState | |
362 | * @throws MissingParameterException missing courseVersionId, previousState, newState | |
363 | * @throws IllegalVersionSequencingException a Course with higher sequence number from the one provided is marked current | |
364 | * @throws OperationFailedException unable to complete request | |
365 | * @throws PermissionDeniedException authorization failure | |
366 | */ | |
367 | public StatusInfo setCurrentCourseVersion(@WebParam(name="courseVersionId")String courseVersionId, @WebParam(name="currentVersionStart")Date currentVersionStart) throws DoesNotExistException, InvalidParameterException, MissingParameterException, IllegalVersionSequencingException, OperationFailedException, PermissionDeniedException; | |
368 | ||
369 | } |