Interface PlanAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PlanAdminSession extends OsidSession

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

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

The delete operations delete Plans . To unmap a Plan from the current CourseCatalog , the PlanCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Plan 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.
    • canCreatePlans

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

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

      PlanForm getPlanFormForCreate(Id syllabusId, Id courseOfferingId, Type[] planRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the plan form for creating new plans. A new form should be requested for each create transaction.
      Parameters:
      syllabusId - a syllabus Id
      courseOfferingId - a course offering Id
      planRecordTypes - array of plan record types
      Returns:
      the plan form
      Throws:
      NotFoundException - syllabusId or courseOfferingId is not found
      NullArgumentException - syllabusId, courseOfferingId , or planRecordTypes 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.
    • createPlan

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

      boolean canUpdatePlans()
      Tests if this user can update plans. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Plan will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Plan modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getPlanFormForUpdate

      Gets the plan form for updating an existing plan. A new plan form should be requested for each update transaction.
      Parameters:
      planId - the Id of the Plan
      Returns:
      the plan form
      Throws:
      NotFoundException - planId is not found
      NullArgumentException - planId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updatePlan

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

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

      Deletes a Plan .
      Parameters:
      planId - the Id of the Plan to remove
      Throws:
      NotFoundException - planId not found
      NullArgumentException - planId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManagePlanAliases

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

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