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