Interface ActivityRegistrationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ActivityRegistrationBatchAdminSession
This session creates, updates, and deletes
ActivityRegistrations . 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 an
ActivityRegistration , an ActivityRegistrationForm is
requested using getRegistrationFormForCreate() specifying the
registration, activity, student, and desired record Types or none
if no record Types are needed. The returned
ActivityRegistrationForm 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 ActivityRegistrationForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each
ActivityRegistrationForm corresponds to an attempted transaction.
For updates, ActivityRegistrationForms are requested to the
ActivityRegistrationForm Id that is to be updated using
getActivityRegistrationFormForUpdate() . Similarly, the
ActivityRegistrationForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
ActivityRegistrationForm can only be used once for a successful update
and cannot be reused.
The delete operations delete ActivityRegistrations . To unmap
an ActivityRegistration from the current CourseCatalog ,
the ActivityRegistrationCourseCatalogAssignmentSession should be
used. These delete operations attempt to remove the
ActivityRegistrationForm 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 TypeMethodDescriptionvoidaliasActivityRegistration(Id activityRegistrationId, Id aliasId) Adds anIdto anActivityRegistrationfor the purpose of creating compatibility.booleanTests if this user can createActivityRegistrations.booleancanCreateActivityRegistrationWithRecordTypes(Type[] activityRegistrationRecordTypes) Tests if this user can create a singleActivityRegistrationusing the desired record types.booleanTests if this user can deleteActivityRegistrations.booleanTests if this user can manageIdaliases forActivityRegistrations.booleanTests if this user can updateActivityRegistrations.createActivityRegistration(ActivityRegistrationForm activityRegistrationForm) Creates a newActivityRegistration.voiddeleteActivityRegistration(Id activityRegistrationId) Deletes anActivityRegistration.getActivityRegistrationFormForCreate(Id courseRegistrationId, Id activityId, Id resourceId, Type[] activityRegistrationRecordTypes) Gets the course form for creating new activity registrations.getActivityRegistrationFormForUpdate(Id activityRegistrationId) Gets the activity registration form for updating an existing activity registration.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.voidupdateActivityRegistration(ActivityRegistrationForm activityRegistrationForm) Updates an existing activity 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.
-
canCreateActivityRegistrations
boolean canCreateActivityRegistrations()Tests if this user can createActivityRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anActivityRegistrationwill 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:
falseifActivityRegistrationcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateActivityRegistrationWithRecordTypes
Tests if this user can create a singleActivityRegistrationusing the desired record types. WhileCourseRegistrationManager.getActivityRegistrationRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificActivityRegistration. Providing an empty array tests if anActivityRegistrationcan be created with no records.- Parameters:
activityRegistrationRecordTypes- array of activity registration record types- Returns:
trueifActivityRegistrationcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-activityRegistrationRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getActivityRegistrationFormForCreate
ActivityRegistrationForm getActivityRegistrationFormForCreate(Id courseRegistrationId, Id activityId, Id resourceId, Type[] activityRegistrationRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course form for creating new activity registrations. A new form should be requested for each create transaction.- Parameters:
courseRegistrationId- theIdfor aCourseRegistrationactivityId- theIdfor anActivityresourceId- theIdfor aResourceactivityRegistrationRecordTypes- array of activity registration record types- Returns:
- the activity registration form
- Throws:
NotFoundException-courseRegistrationId, activityId, orresourceIdis not foundNullArgumentException-courseRegistrationId, activityId, resourceId, oractivityRegistrationRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested recod types- Compliance:
mandatory- This method must be implemented.
-
createActivityRegistration
ActivityRegistration createActivityRegistration(ActivityRegistrationForm activityRegistrationForm) throws OperationFailedException, PermissionDeniedException Creates a newActivityRegistration.- Parameters:
activityRegistrationForm- the form for thisActivityRegistration- Returns:
- the new
ActivityRegistration - Throws:
IllegalStateException-activityRegistrationFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-activityRegistrationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-activityRegistrationFormdid not originate fromgetActivityRegistrationFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateActivityRegistrations
boolean canUpdateActivityRegistrations()Tests if this user can updateActivityRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anActivityRegistrationwill 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:
falseifActivityRegistrationmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getActivityRegistrationFormForUpdate
ActivityRegistrationForm getActivityRegistrationFormForUpdate(Id activityRegistrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the activity registration form for updating an existing activity registration. A new activity registration form should be requested for each update transaction.- Parameters:
activityRegistrationId- theIdof theActivityRegistration- Returns:
- the activity registration form
- Throws:
NotFoundException-activityRegistrationIdis not foundNullArgumentException-activityRegistrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateActivityRegistration
void updateActivityRegistration(ActivityRegistrationForm activityRegistrationForm) throws OperationFailedException, PermissionDeniedException Updates an existing activity registration.- Parameters:
activityRegistrationForm- the form containing the elements to be updated- Throws:
IllegalStateException-activityRegistrationFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-activityRegistrationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-activityRegistrationFormdid not originate fromgetActivityRegistrationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteActivityRegistrations
boolean canDeleteActivityRegistrations()Tests if this user can deleteActivityRegistrations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anActivityRegistrationwill 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:
falseifActivityRegistrationdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteActivityRegistration
void deleteActivityRegistration(Id activityRegistrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anActivityRegistration.- Parameters:
activityRegistrationId- theIdof theActivityRegistrationto remove- Throws:
NotFoundException-activityRegistrationIdnot foundNullArgumentException-activityRegistrationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageActivityRegistrationAliases
boolean canManageActivityRegistrationAliases()Tests if this user can manageIdaliases forActivityRegistrations. 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:
falseifActivityRegistrationaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasActivityRegistration
void aliasActivityRegistration(Id activityRegistrationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anActivityRegistrationfor the purpose of creating compatibility. The primaryIdof theActivityRegistrationis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another activity registration, it is reassigned to the given activity registrationId.- Parameters:
activityRegistrationId- theIdof anActivityRegistrationaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-activityRegistrationIdnot foundNullArgumentException-activityRegistrationIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-