Interface CourseRegistrationAdminSession

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

public interface CourseRegistrationAdminSession extends OsidSession

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 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.
    • canCreateCourseRegistrations

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

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

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

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

      void deleteCourseRegistration(Id courseRegistrationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a CourseRegistration .
      Parameters:
      courseRegistrationId - the Id of the CourseRegistration to remove
      Throws:
      NotFoundException - courseRegistrationId not found
      NullArgumentException - courseRegistrationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageCourseRegistrationAliases

      boolean canManageCourseRegistrationAliases()
      Tests if this user can manage Id aliases for CourseRegistra tions 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 CourseRegistration aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasCourseRegistration

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