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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasPlan(Id planId,
Id aliasId)
Adds an
Id to a Plan for the purpose of
creating compatibility. |
boolean |
canCreatePlans()
Tests if this user can create plans.
|
boolean |
canCreatePlanWithRecordTypes(Type[] planRecordTypes)
Tests if this user can create a single
Plan using the
desired record types. |
boolean |
canDeletePlans()
Tests if this user can delete plans.
|
boolean |
canManagePlanAliases()
Tests if this user can manage
Id aliases for
Plans. |
boolean |
canUpdatePlans()
Tests if this user can update plans.
|
Plan |
createPlan(PlanForm planForm)
Creates a new
Plan. |
void |
deletePlan(Id planId)
Deletes a
Plan. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
PlanForm |
getPlanFormForCreate(Id syllabusId,
Id courseOfferingId,
Type[] planRecordTypes)
Gets the plan form for creating new plans.
|
PlanForm |
getPlanFormForUpdate(Id planId)
Gets the plan form for updating an existing plan.
|
void |
updatePlan(PlanForm planForm)
Updates an existing plan.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getCourseCatalogId()
CourseCatalog Id associated
with this session. CourseCatalog Id associated with this
sessionmandatory - This method must be implemented. CourseCatalog getCourseCatalog() throws OperationFailedException, PermissionDeniedException
CourseCatalog associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreatePlans()
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. false if Plan creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreatePlanWithRecordTypes(Type[] planRecordTypes)
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.planRecordTypes - array of plan record types true if Plan creation using the
specified record Types is supported,
false otherwiseNullArgumentException - planRecordTypes
is null mandatory - This method must be implemented. PlanForm getPlanFormForCreate(Id syllabusId, Id courseOfferingId, Type[] planRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
syllabusId - a syllabus Id courseOfferingId - a course offering Id planRecordTypes - array of plan record typesNotFoundException - syllabusId or
courseOfferingId is not foundNullArgumentException - syllabusId,
courseOfferingId, or planRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Plan createPlan(PlanForm planForm) throws OperationFailedException, PermissionDeniedException
Plan. planForm - the form for this Plan Plan IllegalStateException - planForm already
used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - planForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - planForm did not
originate from getPlanFormForCreate() mandatory - This method must be implemented. boolean canUpdatePlans()
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. false if Plan modification is
not authorized, true otherwisemandatory - This method must be implemented. PlanForm getPlanFormForUpdate(Id planId) throws NotFoundException, OperationFailedException, PermissionDeniedException
planId - the Id of the Plan NotFoundException - planId is not foundNullArgumentException - planId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updatePlan(PlanForm planForm) throws OperationFailedException, PermissionDeniedException
planForm - the form containing the elements to be updatedIllegalStateException - planForm already
used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - planForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - planForm did not
originate from getPlanFormForUpdate() mandatory - This method must be implemented. boolean canDeletePlans()
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. false if Plan deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deletePlan(Id planId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Plan. planId - the Id of the Plan to
removeNotFoundException - planId not foundNullArgumentException - planId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManagePlanAliases()
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. false if Plan aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasPlan(Id planId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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. planId - the Id of a Plan aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - planId not foundNullArgumentException - planId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.