Coverage Report - org.kuali.student.r2.lum.course.service.CourseService
 
Classes in this File Line Coverage Branch Coverage Complexity
CourseService
N/A
N/A
1
 
 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.common.exceptions.IllegalVersionSequencingException;
 22  
 import org.kuali.student.r2.common.dto.ContextInfo;
 23  
 import org.kuali.student.r2.common.dto.StatusInfo;
 24  
 import org.kuali.student.r2.common.dto.ValidationResultInfo;
 25  
 import org.kuali.student.r2.common.exceptions.AlreadyExistsException;
 26  
 
 27  
 import org.kuali.student.r2.common.exceptions.DataValidationErrorException;
 28  
 import org.kuali.student.r2.common.exceptions.DependentObjectsExistException;
 29  
 import org.kuali.student.r2.common.exceptions.DoesNotExistException;
 30  
 import org.kuali.student.r2.common.exceptions.InvalidParameterException;
 31  
 import org.kuali.student.r2.common.exceptions.MissingParameterException;
 32  
 import org.kuali.student.r2.common.exceptions.OperationFailedException;
 33  
 import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
 34  
 import org.kuali.student.r2.common.exceptions.VersionMismatchException;
 35  
 import org.kuali.student.r2.common.util.constants.CourseServiceConstants;
 36  
 import org.kuali.student.r2.core.statement.dto.StatementTreeViewInfo;
 37  
 import org.kuali.student.r2.lum.course.dto.ActivityInfo;
 38  
 import org.kuali.student.r2.lum.course.dto.CourseInfo;
 39  
 import org.kuali.student.r2.lum.course.dto.FormatInfo;
 40  
 import org.kuali.student.r2.lum.course.dto.LoDisplayInfo;
 41  
 
 42  
 
 43  
 
 44  
 /**
 45  
  * The Program Service allows for the creation and management of courses.
 46  
  * 
 47  
  * @author Kuali Student Team (sambitpa@kuali.org)
 48  
  */
 49  
 @WebService(name = "CourseService", targetNamespace = CourseServiceConstants.NAMESPACE)
 50  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 51  
 public interface CourseService {
 52  
     /**
 53  
      * Retrieves a Course
 54  
      * 
 55  
      * @param courseId Unique Id of the Course. Maps to cluId
 56  
      * @return the created course
 57  
      * @throws DoesNotExistException Course does not exist
 58  
      * @throws InvalidParameterException invalid course
 59  
      * @throws MissingParameterException missing Course
 60  
      * @throws OperationFailedException unable to complete request
 61  
      * @throws PermissionDeniedException authorization failure
 62  
      */
 63  
     public CourseInfo getCourse(@WebParam(name = "courseId") String courseId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException,
 64  
             MissingParameterException, OperationFailedException, PermissionDeniedException;
 65  
 
 66  
     /**
 67  
      * Retrieves a list of courses by Ids
 68  
      * 
 69  
      * @param courseIds
 70  
      * @param contextInfo
 71  
      * @return
 72  
      * @throws DoesNotExistException
 73  
      * @throws InvalidParameterException
 74  
      * @throws MissingParameterException
 75  
      * @throws OperationFailedException
 76  
      * @throws PermissionDeniedException
 77  
      */
 78  
     public List<CourseInfo> getCoursesByIds(@WebParam(name = "courseIds") List<String> courseIds, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException,
 79  
             InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
 80  
 
 81  
     /**
 82  
      * Searches for courses based on the criteria and returns a list of Comment
 83  
      * identifiers which match the search criteria.
 84  
      * 
 85  
      * @param criteria the search criteria
 86  
      * @param contextInfo Context information containing the principalId and
 87  
      *            locale information about the caller of service operation
 88  
      * @return list of Comment Ids
 89  
      * @throws InvalidParameterException invalid parameter
 90  
      * @throws MissingParameterException criteria, contextInfo not specified
 91  
      * @throws OperationFailedException unable to complete request
 92  
      * @throws PermissionDeniedException authorization failure
 93  
      */
 94  
     public List<String> searchForCourseIds(@WebParam(name = "criteria") QueryByCriteria criteria, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException,
 95  
             MissingParameterException, OperationFailedException, PermissionDeniedException;
 96  
 
 97  
     /**
 98  
      * Searches for courses based on the criteria and returns a list of Comments
 99  
      * which match the search criteria.
 100  
      * 
 101  
      * @param criteria the search criteria
 102  
      * @param contextInfo Context information containing the principalId and
 103  
      *            locale information about the caller of service operation
 104  
      * @return list of Comment information
 105  
      * @throws InvalidParameterException invalid parameter
 106  
      * @throws MissingParameterException criteria, contextInfo not specified
 107  
      * @throws OperationFailedException unable to complete request
 108  
      * @throws PermissionDeniedException authorization failure
 109  
      */
 110  
     public List<CourseInfo> searchForCourses(@WebParam(name = "criteria") QueryByCriteria criteria, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException,
 111  
             MissingParameterException, OperationFailedException, PermissionDeniedException;
 112  
 
 113  
     /**
 114  
      * Creates a Course
 115  
      * 
 116  
      * @param courseInfo courseInfo
 117  
      * @return the created course
 118  
      * @throws DataValidationErrorException One or more values invalid for this
 119  
      *             operation
 120  
      * @throws InvalidParameterException invalid course
 121  
      * @throws MissingParameterException missing Course
 122  
      * @throws OperationFailedException unable to complete request
 123  
      * @throws PermissionDeniedException authorization failure
 124  
      * @throws VersionMismatchException
 125  
      * @throws DependentObjectsExistException
 126  
      */
 127  
     public CourseInfo createCourse(@WebParam(name = "courseInfo") CourseInfo courseInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException,
 128  
             InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException;
 129  
 
 130  
     /**
 131  
      * Updates a Course.
 132  
      * 
 133  
      * @param courseInfo courseInfo
 134  
      * @param courseId
 135  
      * @return updated Course
 136  
      * @throws DataValidationErrorException One or more values invalid for this
 137  
      *             operation
 138  
      * @throws DoesNotExistException course not found
 139  
      * @throws InvalidParameterException invalid course
 140  
      * @throws MissingParameterException missing course
 141  
      * @throws VersionMismatchException The action was attempted on an out of
 142  
      *             date version.
 143  
      * @throws OperationFailedException unable to complete request
 144  
      * @throws PermissionDeniedException authorization failure
 145  
      */
 146  
     public CourseInfo updateCourse(@WebParam(name = "courseId") String courseId, @WebParam(name = "courseInfo") CourseInfo courseInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo)
 147  
             throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, VersionMismatchException, OperationFailedException,
 148  
             PermissionDeniedException;
 149  
 
 150  
     /**
 151  
      * Deletes a Course.
 152  
      * 
 153  
      * @param courseId identifier for Course.Maps to cluId
 154  
      * @return status of the operation (success or failure)
 155  
      * @throws DoesNotExistException Course does not exist
 156  
      * @throws InvalidParameterException invalid courseId
 157  
      * @throws MissingParameterException invalid courseId
 158  
      * @throws OperationFailedException unable to complete request
 159  
      * @throws PermissionDeniedException authorization failure
 160  
      */
 161  
     public StatusInfo deleteCourse(@WebParam(name = "courseId") String courseId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException,
 162  
             MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException, DataValidationErrorException, AlreadyExistsException;
 163  
 
 164  
     /**
 165  
      * Validates a course based on its dictionary
 166  
      * 
 167  
      * @param validationType identifier of the extent of validation
 168  
      * @param courseInfo Course to be validated
 169  
      * @return results from performing the validation
 170  
      * @throws DoesNotExistException Course does not exist
 171  
      * @throws InvalidParameterException invalid courseId
 172  
      * @throws MissingParameterException invalid courseId
 173  
      * @throws OperationFailedException unable to complete request
 174  
      */
 175  
     public List<ValidationResultInfo> validateCourse(String validationType, CourseInfo courseInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException,
 176  
             InvalidParameterException, MissingParameterException, OperationFailedException;
 177  
 
 178  
     /**
 179  
      * Retrieves the formats for a Course.
 180  
      * 
 181  
      * @param courseId Unique Id of the Course. Maps to cluId
 182  
      * @return a list of format info Structures
 183  
      * @throws DoesNotExistException Course does not exist
 184  
      * @throws InvalidParameterException invalid courseId
 185  
      * @throws MissingParameterException invalid courseId
 186  
      * @throws OperationFailedException unable to complete request
 187  
      * @throws PermissionDeniedException authorization failure
 188  
      */
 189  
     public List<FormatInfo> getCourseFormatsByCourse(@WebParam(name = "courseId") String courseId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException,
 190  
             InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
 191  
 
 192  
     /**
 193  
      * Retrieves the Activities for a Course.
 194  
      * 
 195  
      * @param formatId Unique Id of the Format. Maps to cluId
 196  
      * @return a list of activity info Structures
 197  
      * @throws DoesNotExistException Format does not exist
 198  
      * @throws InvalidParameterException invalid format
 199  
      * @throws MissingParameterException missing Format
 200  
      * @throws OperationFailedException unable to complete request
 201  
      * @throws PermissionDeniedException authorization failure
 202  
      */
 203  
     public List<ActivityInfo> getCourseActivitiesByCourseFormat(@WebParam(name = "formatId") String formatId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException,
 204  
             InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
 205  
 
 206  
     /**
 207  
      * Retrieves the Learning Objectives for a Course.
 208  
      * 
 209  
      * @param courseId Unique Id of the Course. Maps to cluId
 210  
      * @return a list of LoDisplay info Structures
 211  
      * @throws DoesNotExistException Course does not exist
 212  
      * @throws InvalidParameterException invalid courseId
 213  
      * @throws MissingParameterException invalid courseId
 214  
      * @throws OperationFailedException unable to complete request
 215  
      * @throws PermissionDeniedException authorization failure
 216  
      */
 217  
     public List<LoDisplayInfo> getCourseLearningObjectivesByCourse(@WebParam(name = "courseId") String courseId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException,
 218  
             InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException;
 219  
 
 220  
     /**
 221  
      * Retrieves the Statements of a Course.
 222  
      * 
 223  
      * @param courseId Unique Id of the Course. Maps to cluId
 224  
      * @param nlUsageTypeKey Natural language usage type key (context)
 225  
      * @param language Translation language e.g en, es, gr
 226  
      * @return a list of Statement tree Structures
 227  
      * @throws DoesNotExistException Course does not exist
 228  
      * @throws InvalidParameterException invalid courseId
 229  
      * @throws MissingParameterException invalid courseId
 230  
      * @throws OperationFailedException unable to complete request
 231  
      * @throws PermissionDeniedException authorization failure
 232  
      */
 233  
     public List<StatementTreeViewInfo> getCourseStatements(@WebParam(name = "courseId") String courseId, @WebParam(name = "nlUsageTypeKey") String nlUsageTypeKey,
 234  
             @WebParam(name = "language") String language, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException,
 235  
             OperationFailedException, PermissionDeniedException;
 236  
 
 237  
     /**
 238  
      * Creates the Statement for a Course.
 239  
      * 
 240  
      * @param courseId Unique Id of the Course. Maps to cluId
 241  
      * @param statementTreeViewInfoList a Statementree Structures
 242  
      * @return created Statementree Structures
 243  
      * @throws DoesNotExistException Course does not exist
 244  
      * @throws InvalidParameterException invalid courseId
 245  
      * @throws MissingParameterException invalid courseId
 246  
      * @throws OperationFailedException unable to complete request
 247  
      * @throws PermissionDeniedException authorization failure
 248  
      * @throws DataValidationErrorException
 249  
      */
 250  
     public StatementTreeViewInfo createCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo,
 251  
             @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException,
 252  
             PermissionDeniedException, DataValidationErrorException;
 253  
 
 254  
     /**
 255  
      * Updates the Statement for a Course.
 256  
      * 
 257  
      * @param courseId Unique Id of the Course. Maps to cluId
 258  
      * @param statementId
 259  
      * @param statementTreeViewInfoList a Statementree Structures
 260  
      * @return updated Statementree Structures
 261  
      * @throws DoesNotExistException Course does not exist
 262  
      * @throws InvalidParameterException invalid courseId
 263  
      * @throws MissingParameterException invalid courseId
 264  
      * @throws OperationFailedException unable to complete request
 265  
      * @throws PermissionDeniedException authorization failure
 266  
      * @throws VersionMismatchException
 267  
      * @throws DataValidationErrorException
 268  
      */
 269  
     public StatementTreeViewInfo updateCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeId") String statementId,
 270  
             @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException,
 271  
             InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DataValidationErrorException, VersionMismatchException;
 272  
 
 273  
     /**
 274  
      * Delete the Statement for a Course.
 275  
      * 
 276  
      * @param courseId Unique Id of the Course. Maps to cluId
 277  
      * @param statementTreeViewInfoList a Statementree Structures
 278  
      * @return status of the operation (success or failure)
 279  
      * @throws DoesNotExistException Course does not exist
 280  
      * @throws InvalidParameterException invalid courseId
 281  
      * @throws MissingParameterException invalid courseId
 282  
      * @throws OperationFailedException unable to complete request
 283  
      * @throws PermissionDeniedException authorization failure
 284  
      */
 285  
     public StatusInfo deleteCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo,
 286  
             @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException,
 287  
             PermissionDeniedException;
 288  
 
 289  
     /**
 290  
      * Validates the Statement for a Course.
 291  
      * 
 292  
      * @param courseId Unique Id of the Course. Maps to cluId
 293  
      * @param statementTreeViewInfoList a Statementree Structures
 294  
      * @return results from performing the validation
 295  
      * @throws DoesNotExistException Course or StementTreeView does not exist
 296  
      * @throws InvalidParameterException invalid courseId or stratement tree
 297  
      *             view Id
 298  
      * @throws MissingParameterException invalid courseId or statement tree view
 299  
      *             Id
 300  
      * @throws OperationFailedException unable to complete request
 301  
      */
 302  
     public List<ValidationResultInfo> validateCourseStatement(@WebParam(name = "courseId") String courseId, @WebParam(name = "statementTreeViewInfo") StatementTreeViewInfo statementTreeViewInfo,
 303  
             @WebParam(name = "contextInfo") ContextInfo contextInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException;
 304  
 
 305  
     /**
 306  
      * Creates a new Course version based on the current course
 307  
      * 
 308  
      * @param courseId identifier for the Course to be versioned
 309  
      * @param versionComment comment for the current version
 310  
      * @return the new versioned Course information
 311  
      * @throws DataValidationErrorException One or more values invalid for this
 312  
      *             operation
 313  
      * @throws DoesNotExistException courseId not found
 314  
      * @throws InvalidParameterException invalid courseId
 315  
      * @throws MissingParameterException missing courseId
 316  
      * @throws OperationFailedException unable to complete request
 317  
      * @throws PermissionDeniedException authorization failure
 318  
      * @throws VersionMismatchException The action was attempted on an out of
 319  
      *             date version
 320  
      */
 321  
     public CourseInfo createNewCourseVersion(@WebParam(name = "courseId") String courseId, @WebParam(name = "versionComment") String versionComment,
 322  
             @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException,
 323  
             OperationFailedException, PermissionDeniedException, VersionMismatchException;
 324  
 
 325  
     /**
 326  
      * Sets a specific version of the Course as current. The sequence number
 327  
      * must be greater than the existing current Course version. This will
 328  
      * truncate the current version's end date to the currentVersionStart param.
 329  
      * If a Course exists which is set to become current in the future, that
 330  
      * course's currentVersionStart and CurrentVersionEnd will be nullified. The
 331  
      * currentVersionStart must be in the future to prevent changing historic
 332  
      * data.
 333  
      * 
 334  
      * @param courseVersionId Version Specific Id of the Course
 335  
      * @param currentVersionStart Date when this course becomes current. Must be
 336  
      *            in the future and be after the most current course's start
 337  
      *            date.
 338  
      * @return status of the operation
 339  
      * @throws DoesNotExistException courseVersionId not found
 340  
      * @throws InvalidParameterException invalid courseVersionId, previousState,
 341  
      *             newState
 342  
      * @throws MissingParameterException missing courseVersionId, previousState,
 343  
      *             newState
 344  
      * @throws IllegalVersionSequencingException a Course with higher sequence
 345  
      *             number from the one provided is marked current
 346  
      * @throws OperationFailedException unable to complete request
 347  
      * @throws PermissionDeniedException authorization failure
 348  
      */
 349  
     public StatusInfo setCurrentCourseVersion(@WebParam(name = "courseVersionId") String courseVersionId, @WebParam(name = "currentVersionStart") Date currentVersionStart,
 350  
             @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, IllegalVersionSequencingException,
 351  
             OperationFailedException, PermissionDeniedException;
 352  
 
 353  
 }