Interface ActivityRegistrationAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
ActivityRegistrationBatchAdminSession

public interface ActivityRegistrationAdminSession extends OsidSession

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 Details

    • getCourseCatalogId

      Id getCourseCatalogId()
      Gets the CourseCatalog Id associated with this session.
      Returns:
      the CourseCatalog Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCourseCatalog

      Gets the CourseCatalog associated with this session.
      Returns:
      the course catalog
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateActivityRegistrations

      boolean canCreateActivityRegistrations()
      Tests if this user can create ActivityRegistrations . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an ActivityRegistration will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if ActivityRegistration creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateActivityRegistrationWithRecordTypes

      boolean canCreateActivityRegistrationWithRecordTypes(Type[] activityRegistrationRecordTypes)
      Tests if this user can create a single ActivityRegistration using the desired record types. While CourseRegistrationManager.getActivityRegistrationRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific ActivityRegistration . Providing an empty array tests if an ActivityRegistration can be created with no records.
      Parameters:
      activityRegistrationRecordTypes - array of activity registration record types
      Returns:
      true if ActivityRegistration creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - activityRegistrationRecordTypes is null
      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 - the Id for a CourseRegistration
      activityId - the Id for an Activity
      resourceId - the Id for a Resource
      activityRegistrationRecordTypes - array of activity registration record types
      Returns:
      the activity registration form
      Throws:
      NotFoundException - courseRegistrationId, activityId , or resourceId is not found
      NullArgumentException - courseRegistrationId, activityId, resourceId , or activityRegistrationRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - 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 new ActivityRegistration .
      Parameters:
      activityRegistrationForm - the form for this ActivityRegistration
      Returns:
      the new ActivityRegistration
      Throws:
      IllegalStateException - activityRegistrationForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - activityRegistrationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - activityRegistrationForm did not originate from getActivityRegistrationFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateActivityRegistrations

      boolean canUpdateActivityRegistrations()
      Tests if this user can update ActivityRegistrations . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an ActivityRegistration will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if ActivityRegistration modification is not authorized, true otherwise
      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 - the Id of the ActivityRegistration
      Returns:
      the activity registration form
      Throws:
      NotFoundException - activityRegistrationId is not found
      NullArgumentException - activityRegistrationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - activityRegistrationForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - activityRegistrationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - activityRegistrationForm did not originate from getActivityRegistrationFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteActivityRegistrations

      boolean canDeleteActivityRegistrations()
      Tests if this user can delete ActivityRegistrations . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an ActivityRegistration will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if ActivityRegistration deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteActivityRegistration

      void deleteActivityRegistration(Id activityRegistrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes an ActivityRegistration .
      Parameters:
      activityRegistrationId - the Id of the ActivityRegistration to remove
      Throws:
      NotFoundException - activityRegistrationId not found
      NullArgumentException - activityRegistrationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageActivityRegistrationAliases

      boolean canManageActivityRegistrationAliases()
      Tests if this user can manage Id aliases for ActivityRegistrations . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if ActivityRegistration aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasActivityRegistration

      void aliasActivityRegistration(Id activityRegistrationId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to an ActivityRegistration for the purpose of creating compatibility. The primary Id of the ActivityRegistration is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another activity registration, it is reassigned to the given activity registration Id .
      Parameters:
      activityRegistrationId - the Id of an ActivityRegistration
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - activityRegistrationId not found
      NullArgumentException - activityRegistrationId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.