Interface CourseRegistrationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CourseRegistrationBatchAdminSession
This session creates, updates, and deletes CourseRegistrat
ions. The data for create and update is provided by the consumer via the
form object. OsidForms are requested for each create or update and
may not be reused.
Create and update operations differ in their usage. To create a
CourseRegistra tion, a CourseRegistratio nForm is requested using
getCourseRegistrationFormForCre ate() specifying the desired
registration, course offering, resource, and record Types or none
if no record Types are needed. The returned
CourseRegistratio nForm will indicate that it is to be used with a create
operation and can be used to examine metdata or validate data prior to
creation. Once the CourseRegistratio nForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each CourseRegistratio nForm
corresponds to an attempted transaction.
For updates, CourseRegistration Forms are requested to the
CourseRegistr ation Id that is to be updated using
getCourseRegistrationFormForUpda te(). Similarly, the
CourseRegistratio nForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
CourseRegistratio nForm can only be used once for a successful update and
cannot be reused.
The delete operations delete CourseRegistrat ions. To unmap a
CourseRegistr ation from the current CourseCatalog , the
CourseRegistrationCourseCatalogAssignmentSe ssion should be used.
These delete operations attempt to remove the CourseRegistr ation
itself thus removing it from all known CourseCatalog catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasCourseRegistration(Id courseRegistrationId, Id aliasId) Adds anIdto aCourseRegistration for the purpose of creating compatibility.booleanTests if this user can createCourseRegistrations.booleancanCreateCourseRegistrationWithRecordTypes(Type[] courseRegistrationRecordTypes) Tests if this user can create a singleCourseRegistration using the desired record types.booleanTests if this user can deleteCourseRegistrations.booleanTests if this user can manageIdaliases forCourseRegistrations A return of true does not guarantee successful authorization.booleanTests if this user can updateCourseRegistrations.createCourseRegistration(CourseRegistrationForm courseRegistrationForm) Creates a newCourseRegistration.voiddeleteCourseRegistration(Id courseRegistrationId) Deletes aCourseRegistration.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCourseRegistrationFormForCreate(Id courseOfferingId, Id resourceId, Type[] courseRegistrationRecordTypes) Gets the course registration form for creating new course registrations.getCourseRegistrationFormForUpdate(Id courseRegistrationId) Gets the course registration form for updating an existing course registration.voidupdateCourseRegistration(CourseRegistrationForm courseRegistrationForm) Updates an existing course registration.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateCourseRegistrations
boolean canCreateCourseRegistrations()Tests if this user can createCourseRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCourseRegistration will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifCourseRegistrationcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCourseRegistrationWithRecordTypes
Tests if this user can create a singleCourseRegistration using the desired record types. WhileCourseRegistrationManager.getCourseRegistrationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCourseRegistration. Providing an empty array tests if aCourseRegistration can be created with no records.- Parameters:
courseRegistrationRecordTypes- array of course registration record types- Returns:
trueifCourseRegistrationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-courseRegistrationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCourseRegistrationFormForCreate
CourseRegistrationForm getCourseRegistrationFormForCreate(Id courseOfferingId, Id resourceId, Type[] courseRegistrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course registration form for creating new course registrations. A new form should be requested for each create transaction.- Parameters:
courseOfferingId- the Id for aCourseOfferingresourceId- the Id for aResourcecourseRegistrationRecordTypes- array of course registration record types- Returns:
- the course registration form
- Throws:
NotFoundException-courseOfferingIdorresourceIdis not foundNullArgumentException-courseOfferingId, resourceId, orcourseRegistrationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCourseRegistration
CourseRegistration createCourseRegistration(CourseRegistrationForm courseRegistrationForm) throws OperationFailedException, PermissionDeniedException Creates a newCourseRegistration.- Parameters:
courseRegistrationForm- the form for thisCourseRegistration- Returns:
- the new
CourseRegistration - Throws:
IllegalStateException-courseRegistrationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-courseRegistrationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-courseRegistrationFormdid not originate fromgetCourseRegistrationFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCourseRegistrations
boolean canUpdateCourseRegistrations()Tests if this user can updateCourseRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCourseRegistration will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifCourseRegistrationmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCourseRegistrationFormForUpdate
CourseRegistrationForm getCourseRegistrationFormForUpdate(Id courseRegistrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course registration form for updating an existing course registration. A new course registration form should be requested for each update transaction.- Parameters:
courseRegistrationId- theIdof theCourseRegistration- Returns:
- the course registration form
- Throws:
NotFoundException-courseRegistrationIdis not foundNullArgumentException-courseRegistrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCourseRegistration
void updateCourseRegistration(CourseRegistrationForm courseRegistrationForm) throws OperationFailedException, PermissionDeniedException Updates an existing course registration.- Parameters:
courseRegistrationForm- the form containing the elements to be updated- Throws:
IllegalStateException-courseRegistrationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-courseRegistrationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-courseRegistrationFormdid not originate fromgetCourseRegistrationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCourseRegistrations
boolean canDeleteCourseRegistrations()Tests if this user can deleteCourseRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCourseRegistration will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifCourseRegistrationdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCourseRegistration
void deleteCourseRegistration(Id courseRegistrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCourseRegistration.- Parameters:
courseRegistrationId- theIdof theCourseRegistrationto remove- Throws:
NotFoundException-courseRegistrationIdnot foundNullArgumentException-courseRegistrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCourseRegistrationAliases
boolean canManageCourseRegistrationAliases()Tests if this user can manageIdaliases forCourseRegistrations A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED.This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifCourseRegistrationaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCourseRegistration
void aliasCourseRegistration(Id courseRegistrationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCourseRegistration for the purpose of creating compatibility. The primaryIdof theCourseRegistration is determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another course registration, it is reassigned to the given course registrationId.- Parameters:
courseRegistrationId- theIdof aCourseRegistrationaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-courseRegistrationIdnot foundNullArgumentException-courseRegistrationIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-