001 /* 002 * Copyright 2009 The Kuali Foundation Licensed under the Educational Community License, Version 1.0 (the "License"); you may 003 * not use this file except in compliance with the License. You may obtain a copy of the License at 004 * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law or agreed to in writing, software 005 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 006 * express or implied. See the License for the specific language governing permissions and limitations under the License. 007 */ 008 package org.kuali.student.lum.course.service; 009 010 import java.util.Date; 011 import java.util.List; 012 013 import javax.jws.WebParam; 014 import javax.jws.WebService; 015 import javax.jws.soap.SOAPBinding; 016 017 import org.kuali.student.common.dictionary.service.DictionaryService; 018 import org.kuali.student.common.dto.StatusInfo; 019 import org.kuali.student.common.exceptions.AlreadyExistsException; 020 import org.kuali.student.common.exceptions.CircularReferenceException; 021 import org.kuali.student.common.exceptions.CircularRelationshipException; 022 import org.kuali.student.common.exceptions.DataValidationErrorException; 023 import org.kuali.student.common.exceptions.DependentObjectsExistException; 024 import org.kuali.student.common.exceptions.DoesNotExistException; 025 import org.kuali.student.common.exceptions.IllegalVersionSequencingException; 026 import org.kuali.student.common.exceptions.InvalidParameterException; 027 import org.kuali.student.common.exceptions.MissingParameterException; 028 import org.kuali.student.common.exceptions.OperationFailedException; 029 import org.kuali.student.common.exceptions.PermissionDeniedException; 030 import org.kuali.student.common.exceptions.UnsupportedActionException; 031 import org.kuali.student.common.exceptions.VersionMismatchException; 032 import org.kuali.student.common.validation.dto.ValidationResultInfo; 033 import org.kuali.student.common.versionmanagement.service.VersionManagementService; 034 import org.kuali.student.core.statement.dto.StatementTreeViewInfo; 035 import org.kuali.student.lum.course.dto.ActivityInfo; 036 import org.kuali.student.lum.course.dto.CourseInfo; 037 import org.kuali.student.lum.course.dto.FormatInfo; 038 import org.kuali.student.lum.course.dto.LoDisplayInfo; 039 040 /** 041 * @Author KSContractMojo 042 * @Author Kamal 043 * @Since Tue May 18 11:30:50 PDT 2010 044 * @See <a href="https://test.kuali.org/confluence/display/KULSTU/Course+Service">CourseService</> 045 */ 046 @WebService(name = "CourseService", targetNamespace = CourseServiceConstants.COURSE_NAMESPACE) 047 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) 048 public interface CourseService extends DictionaryService, VersionManagementService { 049 /** 050 * Retrieves a Course 051 * 052 * @param courseId 053 * Unique Id of the Course. Maps to cluId 054 * @return the created course 055 * @throws DoesNotExistException 056 * Course does not exist 057 * @throws InvalidParameterException 058 * invalid course 059 * @throws MissingParameterException 060 * missing Course 061 * @throws OperationFailedException 062 * unable to complete request 063 * @throws PermissionDeniedException 064 * authorization failure 065 */ 066 public CourseInfo getCourse(@WebParam(name = "courseId") String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; 067 068 /** 069 * Retrieves the formats for a Course. 070 * 071 * @param courseId 072 * Unique Id of the Course. Maps to cluId 073 * @return a list of format info Structures 074 * @throws DoesNotExistException 075 * Course does not exist 076 * @throws InvalidParameterException 077 * invalid courseId 078 * @throws MissingParameterException 079 * invalid courseId 080 * @throws OperationFailedException 081 * unable to complete request 082 * @throws PermissionDeniedException 083 * authorization failure 084 */ 085 public List<FormatInfo> getCourseFormats(@WebParam(name = "courseId") String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; 086 087 /** 088 * Retrieves the Activities for a Course. 089 * 090 * @param formatId 091 * Unique Id of the Format. Maps to cluId 092 * @return a list of activity info Structures 093 * @throws DoesNotExistException 094 * Format does not exist 095 * @throws InvalidParameterException 096 * invalid format 097 * @throws MissingParameterException 098 * missing Format 099 * @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 }