Interface ProgramEntryAdminSession

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

public interface ProgramEntryAdminSession extends OsidSession

This session creates, updates, and deletes ProgramEntries . 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 ProgramEntry , a ProgramEntryForm is requested using getProgramEntryFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned ProgramEntryForm 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 ProgramEntryForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each ProgramEntryForm corresponds to an attempted transaction.

For updates, ProgramEntryForms are requested to the ProgramEntry Id that is to be updated using getProgramEntryFormForUpdate() . Similarly, the ProgramEntryForm has metadata about the data that can be updated and it can perform validation before submitting the update. The ProgramEntryForm can only be used once for a successful update and cannot be reused.

The delete operations delete ProgramEntries . To unmap a ProgramEntry from the current CourseCatalog , the ProgramEntryCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the ProgramEntry 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.
    • canCreateProgramEntries

      boolean canCreateProgramEntries()
      Tests if this user can create ProgramEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a ProgramEntry 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 ProgramEntry creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateProgramEntryWithRecordTypes

      boolean canCreateProgramEntryWithRecordTypes(Type[] programEntryRecordTypes)
      Tests if this user can create a single Porgram using the desired record types. While CourseChronicleManager.getProgramEntryRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific ProgramEntry . Providing an empty array tests if a ProgramEntry can be created with no records.
      Parameters:
      programEntryRecordTypes - array of program entry record types
      Returns:
      true if ProgramEntry creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - programEntryRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getProgramEntryFormForCreate

      ProgramEntryForm getProgramEntryFormForCreate(Id programId, Id resourceId, Type[] programEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the program entry form for creating new program entries. A new form should be requested for each create transaction.
      Parameters:
      programId - the Id of a Program
      resourceId - the Id of a student
      programEntryRecordTypes - array of program entry record types
      Returns:
      the program entry form
      Throws:
      NotFoundException - programId or resourceId is not found
      NullArgumentException - programId, resourceId , or programEntryRecordTypes 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.
    • createProgramEntry

      Creates a new ProgramEntry .
      Parameters:
      programEntryForm - the form for this ProgramEntry
      Returns:
      the new ProgramEntry
      Throws:
      IllegalStateException - programEntryForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - programEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - programEntryForm did not originate from getProgramEntryFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateProgramEntries

      boolean canUpdateProgramEntries()
      Tests if this user can update ProgramEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a ProgramEntry 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 ProgramEntry modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getProgramEntryFormForUpdate

      ProgramEntryForm getProgramEntryFormForUpdate(Id programEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the program entry form for updating an existing program entry. A new program entry form should be requested for each update transaction.
      Parameters:
      programEntryId - the Id of the ProgramEntry
      Returns:
      the program entry form
      Throws:
      NotFoundException - programEntryId is not found
      NullArgumentException - programEntryId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateProgramEntry

      void updateProgramEntry(ProgramEntryForm programEntryForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing program entry.
      Parameters:
      programEntryForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - programEntryForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - programEntryForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - programEntryForm did not originate from getProgramEntryFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteProgramEntries

      boolean canDeleteProgramEntries()
      Tests if this user can delete ProgramEntries . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a ProgramEntry 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 ProgramEntry deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteProgramEntry

      boolean canDeleteProgramEntry(Id programEntryId)
      Tests if this user can delete a specified ProgramEntry . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting the ProgramEntry will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer a delete operation to an unauthorized user for this program entry.
      Parameters:
      programEntryId - the Id of the ProgramEntry
      Returns:
      false if deletion of this ProgramEntry is not authorized, true otherwise
      Throws:
      NullArgumentException - programEntryId is null
      Compliance:
      mandatory - This method must be implemented.
      Notes:
      If - the {@code programEntryId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
    • deleteProgramEntry

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

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

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