|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.student.lum.course.service.impl.CourseServiceImpl
@Transactional(readOnly=true, noRollbackFor=DoesNotExistException.class, rollbackFor=java.lang.Throwable.class) public class CourseServiceImpl
CourseServiceImpl implements CourseService Interface by mapping DTOs in CourseInfo to underlying entity DTOs like CluInfo and CluCluRelationInfo. For Credits, there are three credit types that are set with a combination of type and dynamic attributes To set a variable(range) credit option, set the ResultComponentInfo type to CourseAssemblerConstants.COURSE_RESULT_COMP_TYPE_CREDIT_VARIABLE and add the dynamic attributes CourseAssemblerConstants.COURSE_RESULT_COMP_ATTR_MIN_CREDIT_VALUE and CourseAssemblerConstants.COURSE_RESULT_COMP_ATTR_MAX_CREDIT_VALUE with respective credit min and max values. To set a fixed credit option, set the ResultComponentInfo type to CourseAssemblerConstants.COURSE_RESULT_COMP_TYPE_CREDIT_FIXED and add the dynamic attribute CourseAssemblerConstants.COURSE_RESULT_COMP_ATTR_FIXED_CREDIT_VALUE with the fixed credit value To Set multiple credit options, set the ResultComponentInfo type to CourseAssemblerConstants.COURSE_RESULT_COMP_TYPE_CREDIT_MULTIPLE and add each credit as a numeric ResultValue on the ResultComponentInfo for each credit you desire
Field Summary | |
---|---|
private CourseAssembler |
courseAssembler
|
private BusinessServiceMethodInvoker |
courseServiceMethodInvoker
|
private DictionaryService |
dictionaryServiceDelegate
|
(package private) static Logger |
LOG
|
private LuService |
luService
|
private StatementService |
statementService
|
private ValidatorFactory |
validatorFactory
|
Constructor Summary | |
---|---|
CourseServiceImpl()
|
Method Summary | |
---|---|
private void |
checkForMissingParameter(Object param,
String paramName)
Check for missing parameter and throw localized exception if missing |
private void |
clearStatementTreeViewIds(List<StatementTreeViewInfo> statementTreeViews)
|
private void |
clearStatementTreeViewIdsRecursively(StatementTreeViewInfo statementTreeView)
|
CourseInfo |
createCourse(CourseInfo courseInfo)
Creates a Course |
StatementTreeViewInfo |
createCourseStatement(String courseId,
StatementTreeViewInfo statementTreeViewInfo)
Creates the Statement for a Course. |
CourseInfo |
createNewCourseVersion(String versionIndCourseId,
String versionComment)
Creates a new Course version based on the current course |
StatusInfo |
deleteCourse(String courseId)
Deletes a Course. |
StatusInfo |
deleteCourseStatement(String courseId,
StatementTreeViewInfo statementTreeViewInfo)
Delete the Statement for a Course. |
private RefStatementRelationInfo |
findStatementReference(String courseId,
StatementTreeViewInfo statementTreeViewInfo)
|
CourseInfo |
getCourse(String courseId)
Retrieves a Course |
List<ActivityInfo> |
getCourseActivities(String formatId)
Retrieves the Activities for a Course. |
CourseAssembler |
getCourseAssembler()
|
List<FormatInfo> |
getCourseFormats(String courseId)
Retrieves the formats for a Course. |
List<LoDisplayInfo> |
getCourseLos(String courseId)
Retrieves the Los for a Course. |
BusinessServiceMethodInvoker |
getCourseServiceMethodInvoker()
|
List<StatementTreeViewInfo> |
getCourseStatements(String courseId,
String nlUsageTypeKey,
String language)
Retrieves the Statements of a Course. |
VersionDisplayInfo |
getCurrentVersion(String refObjectTypeURI,
String refObjectId)
Retrieves current version associated with the objectId. |
VersionDisplayInfo |
getCurrentVersionOnDate(String refObjectTypeURI,
String refObjectId,
Date date)
Retrieves the current version associated with the objectId on a given date. |
DictionaryService |
getDictionaryServiceDelegate()
|
VersionDisplayInfo |
getFirstVersion(String refObjectTypeURI,
String refObjectId)
Retrieves first version associated with the objectId. |
VersionDisplayInfo |
getLatestVersion(String refObjectTypeURI,
String refObjectId)
Retrieves latest version associated with the objectId. |
LuService |
getLuService()
|
ObjectStructureDefinition |
getObjectStructure(String objectTypeKey)
|
List<String> |
getObjectTypes()
|
StatementService |
getStatementService()
|
ValidatorFactory |
getValidatorFactory()
|
VersionDisplayInfo |
getVersionBySequenceNumber(String refObjectTypeURI,
String refObjectId,
Long sequence)
Retrieves the version associated with the objectId and the sequence number. |
List<VersionDisplayInfo> |
getVersions(String refObjectTypeURI,
String refObjectId)
Retrieves list of version associated with the objectId. |
List<VersionDisplayInfo> |
getVersionsInDateRange(String refObjectTypeURI,
String refObjectId,
Date from,
Date to)
Retrieves the current version associated with the objectId on a given date. |
private CourseInfo |
processCourseInfo(CourseInfo courseInfo,
BaseDTOAssemblyNode.NodeOperation operation)
|
private void |
resetIds(CourseInfo course)
|
private void |
resetLoRecursively(LoDisplayInfo lo)
|
void |
setCourseAssembler(CourseAssembler courseAssembler)
|
void |
setCourseServiceMethodInvoker(BusinessServiceMethodInvoker courseServiceMethodInvoker)
|
StatusInfo |
setCurrentCourseVersion(String courseVersionId,
Date currentVersionStart)
Sets a specific version of the Course as current. |
void |
setDictionaryServiceDelegate(DictionaryService dictionaryServiceDelegate)
|
void |
setLuService(LuService luService)
|
void |
setStatementService(StatementService statementService)
|
void |
setValidatorFactory(ValidatorFactory validatorFactory)
|
CourseInfo |
updateCourse(CourseInfo courseInfo)
Updates a Course. |
StatementTreeViewInfo |
updateCourseStatement(String courseId,
StatementTreeViewInfo statementTreeViewInfo)
Updates the Statement for a Course. |
List<ValidationResultInfo> |
validateCourse(String validationType,
CourseInfo courseInfo)
Validates a course based on its dictionary |
List<ValidationResultInfo> |
validateCourseStatement(String courseId,
StatementTreeViewInfo statementTreeViewInfo)
Validates the Statement for a Course. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final Logger LOG
private LuService luService
private CourseAssembler courseAssembler
private BusinessServiceMethodInvoker courseServiceMethodInvoker
private DictionaryService dictionaryServiceDelegate
private ValidatorFactory validatorFactory
private StatementService statementService
Constructor Detail |
---|
public CourseServiceImpl()
Method Detail |
---|
@Transactional(readOnly=false) public CourseInfo createCourse(CourseInfo courseInfo) throws AlreadyExistsException, DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException, DoesNotExistException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException
CourseService
createCourse
in interface CourseService
courseInfo
- courseInfo
AlreadyExistsException
- The Course already exists
DataValidationErrorException
- One or more values invalid for this operation
InvalidParameterException
- invalid course
MissingParameterException
- missing Course
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure
VersionMismatchException
DoesNotExistException
CircularRelationshipException
DependentObjectsExistException
UnsupportedActionException
@Transactional(readOnly=false) public CourseInfo updateCourse(CourseInfo courseInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, VersionMismatchException, OperationFailedException, PermissionDeniedException, AlreadyExistsException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException, UnsupportedOperationException, CircularReferenceException
CourseService
updateCourse
in interface CourseService
courseInfo
- courseInfo
DataValidationErrorException
- One or more values invalid for this operation
DoesNotExistException
- course not found
InvalidParameterException
- invalid course
MissingParameterException
- missing course
VersionMismatchException
- The action was attempted on an out of date version.
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure
AlreadyExistsException
CircularRelationshipException
DependentObjectsExistException
UnsupportedActionException
UnsupportedOperationException
CircularReferenceException
@Transactional(readOnly=false) public StatusInfo deleteCourse(String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException, DataValidationErrorException, AlreadyExistsException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException, UnsupportedOperationException, CircularReferenceException
CourseService
deleteCourse
in interface CourseService
courseId
- identifier for Course.Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure
VersionMismatchException
DataValidationErrorException
AlreadyExistsException
CircularRelationshipException
DependentObjectsExistException
UnsupportedActionException
UnsupportedOperationException
CircularReferenceException
public CourseInfo getCourse(String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
CourseService
getCourse
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid course
MissingParameterException
- missing Course
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<ActivityInfo> getCourseActivities(String formatId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
CourseService
getCourseActivities
in interface CourseService
formatId
- Unique Id of the Format. Maps to cluId
DoesNotExistException
- Format does not exist
InvalidParameterException
- invalid format
MissingParameterException
- missing Format
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<FormatInfo> getCourseFormats(String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
CourseService
getCourseFormats
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<LoDisplayInfo> getCourseLos(String courseId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
CourseService
getCourseLos
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<StatementTreeViewInfo> getCourseStatements(String courseId, String nlUsageTypeKey, String language) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
CourseService
getCourseStatements
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluIdnlUsageTypeKey
- Natural language usage type key (context)language
- Translation language e.g en, es, gr
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<ValidationResultInfo> validateCourse(String validationType, CourseInfo courseInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException
CourseService
validateCourse
in interface CourseService
validationType
- identifier of the extent of validationcourseInfo
- Course to be validated
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request@Transactional(readOnly=false) public StatementTreeViewInfo createCourseStatement(String courseId, StatementTreeViewInfo statementTreeViewInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DataValidationErrorException
CourseService
createCourseStatement
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure
DataValidationErrorException
@Transactional(readOnly=false) public StatusInfo deleteCourseStatement(String courseId, StatementTreeViewInfo statementTreeViewInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
CourseService
deleteCourseStatement
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure@Transactional(readOnly=false) public StatementTreeViewInfo updateCourseStatement(String courseId, StatementTreeViewInfo statementTreeViewInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DataValidationErrorException, CircularReferenceException, VersionMismatchException
CourseService
updateCourseStatement
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
DoesNotExistException
- Course does not exist
InvalidParameterException
- invalid courseId
MissingParameterException
- invalid courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure
DataValidationErrorException
CircularReferenceException
VersionMismatchException
public List<ValidationResultInfo> validateCourseStatement(String courseId, StatementTreeViewInfo statementTreeViewInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException
CourseService
validateCourseStatement
in interface CourseService
courseId
- Unique Id of the Course. Maps to cluId
InvalidParameterException
- invalid courseId or stratement tree view Id
MissingParameterException
- invalid courseId or statement tree view Id
OperationFailedException
- unable to complete requestpublic ObjectStructureDefinition getObjectStructure(String objectTypeKey)
getObjectStructure
in interface DictionaryService
public List<String> getObjectTypes()
getObjectTypes
in interface DictionaryService
public CourseAssembler getCourseAssembler()
public void setCourseAssembler(CourseAssembler courseAssembler)
public BusinessServiceMethodInvoker getCourseServiceMethodInvoker()
public void setCourseServiceMethodInvoker(BusinessServiceMethodInvoker courseServiceMethodInvoker)
public DictionaryService getDictionaryServiceDelegate()
public void setDictionaryServiceDelegate(DictionaryService dictionaryServiceDelegate)
private CourseInfo processCourseInfo(CourseInfo courseInfo, BaseDTOAssemblyNode.NodeOperation operation) throws AssemblyException, OperationFailedException, VersionMismatchException, PermissionDeniedException, MissingParameterException, InvalidParameterException, DoesNotExistException, DataValidationErrorException, AlreadyExistsException, CircularRelationshipException, DependentObjectsExistException, UnsupportedActionException, UnsupportedOperationException, CircularReferenceException
AssemblyException
OperationFailedException
VersionMismatchException
PermissionDeniedException
MissingParameterException
InvalidParameterException
DoesNotExistException
DataValidationErrorException
AlreadyExistsException
CircularRelationshipException
DependentObjectsExistException
UnsupportedActionException
UnsupportedOperationException
CircularReferenceException
public ValidatorFactory getValidatorFactory()
public void setValidatorFactory(ValidatorFactory validatorFactory)
public LuService getLuService()
public void setLuService(LuService luService)
public StatementService getStatementService()
public void setStatementService(StatementService statementService)
@Transactional(readOnly=false) public CourseInfo createNewCourseVersion(String versionIndCourseId, String versionComment) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException
CourseService
createNewCourseVersion
in interface CourseService
versionIndCourseId
- identifier for the Course to be versionedversionComment
- comment for the current version
DataValidationErrorException
- One or more values invalid for this operation
DoesNotExistException
- courseId not found
InvalidParameterException
- invalid courseId
MissingParameterException
- missing courseId
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failure
VersionMismatchException
- The action was attempted on an out of date versionprivate void clearStatementTreeViewIds(List<StatementTreeViewInfo> statementTreeViews) throws OperationFailedException
OperationFailedException
private void clearStatementTreeViewIdsRecursively(StatementTreeViewInfo statementTreeView) throws OperationFailedException
OperationFailedException
private void resetIds(CourseInfo course)
private void resetLoRecursively(LoDisplayInfo lo)
@Transactional(readOnly=false) public StatusInfo setCurrentCourseVersion(String courseVersionId, Date currentVersionStart) throws DoesNotExistException, InvalidParameterException, MissingParameterException, IllegalVersionSequencingException, OperationFailedException, PermissionDeniedException
CourseService
setCurrentCourseVersion
in interface CourseService
courseVersionId
- Version Specific Id of the CoursecurrentVersionStart
- Date when this course becomes current. Must be in the future and be after the most current course's start date.
DoesNotExistException
- courseVersionId not found
InvalidParameterException
- invalid courseVersionId, previousState, newState
MissingParameterException
- missing courseVersionId, previousState, newState
IllegalVersionSequencingException
- a Course with higher sequence number from the one provided is marked current
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic VersionDisplayInfo getCurrentVersion(String refObjectTypeURI, String refObjectId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getCurrentVersion
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Id
DoesNotExistException
- specified refObjectId, refObjectTypeURI not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI
MissingParameterException
- refObjectId, refObjectTypeURI not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic VersionDisplayInfo getCurrentVersionOnDate(String refObjectTypeURI, String refObjectId, Date date) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getCurrentVersionOnDate
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Iddate
- date
DoesNotExistException
- specified refObjectId, refObjectTypeURI not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI, date
MissingParameterException
- refObjectId, refObjectTypeURI, date not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic VersionDisplayInfo getFirstVersion(String refObjectTypeURI, String refObjectId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getFirstVersion
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Id
DoesNotExistException
- specified refObjectId, refObjectTypeURI not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI
MissingParameterException
- refObjectId, refObjectTypeURI not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic VersionDisplayInfo getLatestVersion(String refObjectTypeURI, String refObjectId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getLatestVersion
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Id
DoesNotExistException
- specified refObjectId, refObjectTypeURI not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI
MissingParameterException
- refObjectId, refObjectTypeURI not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic VersionDisplayInfo getVersionBySequenceNumber(String refObjectTypeURI, String refObjectId, Long sequence) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getVersionBySequenceNumber
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Idsequence
- sequence number
DoesNotExistException
- specified refObjectId, refObjectTypeURI, sequence not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI, sequence
MissingParameterException
- refObjectId, refObjectTypeURI, sequence not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<VersionDisplayInfo> getVersions(String refObjectTypeURI, String refObjectId) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getVersions
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Id
DoesNotExistException
- specified refObjectId, refObjectTypeURI not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI
MissingParameterException
- refObjectId, refObjectTypeURI not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failurepublic List<VersionDisplayInfo> getVersionsInDateRange(String refObjectTypeURI, String refObjectId, Date from, Date to) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException
VersionManagementService
getVersionsInDateRange
in interface VersionManagementService
refObjectTypeURI
- reference object type URIrefObjectId
- reference object Idfrom
- from dateto
- to date
DoesNotExistException
- specified refObjectId, refObjectTypeURI not found
InvalidParameterException
- invalid refObjectId, refObjectTypeURI, date
MissingParameterException
- refObjectId, refObjectTypeURI, date not specified
OperationFailedException
- unable to complete request
PermissionDeniedException
- authorization failureprivate void checkForMissingParameter(Object param, String paramName) throws MissingParameterException
param
- parameter
- name
MissingParameterException
private RefStatementRelationInfo findStatementReference(String courseId, StatementTreeViewInfo statementTreeViewInfo) throws InvalidParameterException, MissingParameterException, OperationFailedException, DoesNotExistException
courseId
- statementTreeViewInfo
-
InvalidParameterException
MissingParameterException
OperationFailedException
DoesNotExistException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |