public interface ProgramOfferingAdminSession extends OsidSession
This session creates, updates, and deletes ProgramOfferings.
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
ProgramOffering,
a ProgramOfferingForm
is requested
using getProgramOfferingFormForCreate()
specifying the
desired canonical program, term, and record Types
or none
if no record Types
are needed. The returned
ProgramOfferingForm
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 ProgramOfferingForm
is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each ProgramOfferingForm
corresponds to an attempted transaction.
For updates, ProgramOfferingForms
are requested to the
ProgramOffering
Id
that is to be updated
using getProgramOfferingFormForUpdate().
Similarly, the
ProgramOfferingForm
has metadata about the data that can be
updated and it can perform validation before submitting the update. The
ProgramOfferingForm
can only be used once for a successful
update and cannot be reused.
The delete operations delete ProgramEntries.
To unmap a
ProgramOffering
from the current CourseCatalog,
the ProgramOfferingCourseCatalogAssignmentSession
should be used. These delete operations attempt to remove the
ProgramOffering
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 |
aliasProgramOffering(Id programOfferingId,
Id aliasId)
Adds an
Id to a ProgramOffering for the
purpose of creating compatibility. |
boolean |
canCreateProgramOfferings()
Tests if this user can create
ProgramOfferings. |
boolean |
canCreateProgramOfferingWithRecordTypes(Type[] programOfferingRecordTypes)
Tests if this user can create a single
ProgramOffering
using the desired record types. |
boolean |
canDeleteProgramOfferings()
Tests if this user can delete
ProgramOfferings. |
boolean |
canManageProgramOfferingAliases()
Tests if this user can manage
Id aliases for
ProgramOfferings. |
boolean |
canUpdateProgramOfferings()
Tests if this user can update
ProgramOfferings. |
ProgramOffering |
createProgramOffering(ProgramForm programOfferingForm)
Creates a new
ProgramOffering. |
void |
deleteProgramOffering(Id programOfferingId)
Deletes a
ProgramOffering. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
ProgramOfferingForm |
getProgramOfferingFormForCreate(Id programId,
Id termId,
Type[] programOfferingRecordTypes)
Gets the program offering form for creating new program offerings.
|
ProgramOfferingForm |
getProgramOfferingFormForUpdate(Id programOfferingId)
Gets the program offering form for updating an existing program
offering.
|
void |
updateProgramOffering(ProgramOfferingForm programOfferingForm)
Updates an existing program offering.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id 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 canCreateProgramOfferings()
ProgramOfferings.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known creating a ProgramOffering
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. false
if ProgramOffering
creation is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProgramOfferingWithRecordTypes(Type[] programOfferingRecordTypes)
ProgramOffering
using the desired record types. While
CourseProgramManager.getProgramOfferingRecordTypes()
can be
used to examine which records are supported, this method tests which
record(s) are required for creating a specific ProgramOffering.
Providing an empty array tests if a ProgramOffering
can be created with no records.programOfferingRecordTypes
- array of program offering record
types true
if ProgramOffering
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
-
programOfferingRecordTypes
is null
mandatory
- This method must be implemented. ProgramOfferingForm getProgramOfferingFormForCreate(Id programId, Id termId, Type[] programOfferingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
programId
- the Id
of the associated
Program
termId
- the Id
of the associated Term
programOfferingRecordTypes
- array of program offering record
typesNotFoundException
- programId
or
termId
not foundNullArgumentException
- programId, termId
or programOfferingRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. ProgramOffering createProgramOffering(ProgramForm programOfferingForm) throws OperationFailedException, PermissionDeniedException
ProgramOffering.
programOfferingForm
- the form for this ProgramOffering
ProgramOffering
IllegalStateException
- programOfferingForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- programOfferingForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- programOfferingForm
did not originate from
getProramOfferingFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProgramOfferings()
ProgramOfferings.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known updating a ProgramOffering
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. false
if ProgramOffering
modification is not authorized, true
otherwisemandatory
- This method must be implemented. ProgramOfferingForm getProgramOfferingFormForUpdate(Id programOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
programOfferingId
- the Id
of the
ProgramOffering
NotFoundException
- programOfferingId
is
not foundNullArgumentException
- programOfferingId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateProgramOffering(ProgramOfferingForm programOfferingForm) throws OperationFailedException, PermissionDeniedException
programOfferingForm
- the form containing the elements to be
updatedIllegalStateException
- programOfferingForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- programOfferingForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- programOfferingForm
did not originate from
getProramOfferingFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProgramOfferings()
ProgramOfferings.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting a ProgramOffering
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. false
if ProgramOffering
deletion is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteProgramOffering(Id programOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ProgramOffering.
programOfferingId
- the Id
of the
ProgramOffering
to removeNotFoundException
- programOfferingId
not foundNullArgumentException
- programOfferingId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProgramOfferingAliases()
Id
aliases for
ProgramOfferings.
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 ProgramOffering
aliasing is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasProgramOffering(Id programOfferingId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a ProgramOffering
for the
purpose of creating compatibility. The primary Id
of
the program
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 offering, it is
reassigned to the given program offering Id.
programOfferingId
- the Id
of a
ProgramOffering
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- programOfferingId
not foundNullArgumentException
- programOfferingId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.