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.
Modifier and Type | Method and Description |
---|---|
void |
aliasProgramEntry(Id programEntryId,
Id aliasId)
Adds an
Id to a ProgramEntry for the
purpose of creating compatibility. |
boolean |
canCreateProgramEntries()
Tests if this user can create
ProgramEntries. |
boolean |
canCreateProgramEntryWithRecordTypes(Type[] programEntryRecordTypes)
Tests if this user can create a single
Porgram using
the desired record types. |
boolean |
canDeleteProgramEntries()
Tests if this user can delete
ProgramEntries. |
boolean |
canDeleteProgramEntry(Id programEntryId)
Tests if this user can delete a specified
ProgramEntry. |
boolean |
canManageProgramEntryAliases()
Tests if this user can manage
Id aliases for
ProgramEntries. |
boolean |
canUpdateProgramEntries()
Tests if this user can update
ProgramEntries. |
ProgramEntry |
createProgramEntry(ProgramEntryForm programEntryForm)
Creates a new
ProgramEntry. |
void |
deleteProgramEntry(Id programEntryId)
Deletes a
ProgramEntry. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
ProgramEntryForm |
getProgramEntryFormForCreate(Id programId,
Id resourceId,
Type[] programEntryRecordTypes)
Gets the program entry form for creating new program entries.
|
ProgramEntryForm |
getProgramEntryFormForUpdate(Id programEntryId)
Gets the program entry form for updating an existing program entry.
|
void |
updateProgramEntry(ProgramEntryForm programEntryForm)
Updates an existing program entry.
|
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 canCreateProgramEntries()
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. false
if ProgramEntry
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProgramEntryWithRecordTypes(Type[] programEntryRecordTypes)
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.programEntryRecordTypes
- array of program entry record types true
if ProgramEntry
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- programEntryRecordTypes
is null
mandatory
- This method must be implemented. ProgramEntryForm getProgramEntryFormForCreate(Id programId, Id resourceId, Type[] programEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
programId
- the Id
of a Program
resourceId
- the Id
of a studentprogramEntryRecordTypes
- array of program entry record typesNotFoundException
- programId
or
resourceId
is not foundNullArgumentException
- programId, resourceId
, or programEntryRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. ProgramEntry createProgramEntry(ProgramEntryForm programEntryForm) throws OperationFailedException, PermissionDeniedException
ProgramEntry.
programEntryForm
- the form for this ProgramEntry
ProgramEntry
IllegalStateException
- programEntryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- programEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- programEntryForm
did not originate from getProgramEntryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProgramEntries()
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. false
if ProgramEntry
modification is not authorized, true
otherwisemandatory
- This method must be implemented. ProgramEntryForm getProgramEntryFormForUpdate(Id programEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
programEntryId
- the Id
of the
ProgramEntry
NotFoundException
- programEntryId
is
not foundNullArgumentException
- programEntryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateProgramEntry(ProgramEntryForm programEntryForm) throws OperationFailedException, PermissionDeniedException
programEntryForm
- the form containing the elements to be
updatedIllegalStateException
- programEntryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- programEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- programEntryForm
did not originate from getProgramEntryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProgramEntries()
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. false
if ProgramEntry
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canDeleteProgramEntry(Id programEntryId)
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.programEntryId
- the Id
of the
ProgramEntry
false
if deletion of this ProgramEntry
is not authorized, true
otherwiseNullArgumentException
- programEntryId
is null
mandatory
- This method must be implemented. If
- the programEntryId
is not found, then it is
acceptable to return false to indicate the lack of a delete
available. void deleteProgramEntry(Id programEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ProgramEntry.
programEntryId
- the Id
of the
ProgramEntry
to removeNotFoundException
- programEntryId
not
foundNullArgumentException
- programEntryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProgramEntryAliases()
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. false
if ProgramEntry
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasProgramEntry(Id programEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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.
programEntryId
- the Id
of a ProgramEntry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- programEntryId
not
foundNullArgumentException
- programEntryId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.