public interface AwardEntryAdminSession extends OsidSession
This session creates, updates, and deletes AwardEntries.
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 an
AwardEntry,
an AwardEntryForm
is requested
using getAwardEntryFormForCreate()
specifying the desired
record Types
or none if no record Types
are
needed. The returned AwardEntryForm
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 AwardEntryForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
AwardEntryForm
corresponds to an attempted transaction.
For updates, AwardEntryForms
are requested to the
AwardEntry
Id
that is to be updated using
getAwardEntryFormForUpdate().
Similarly, the
AwardEntryForm
has metadata about the data that can be updated and
it can perform validation before submitting the update. The
AwardEntryForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete AwardEntries.
To unmap an
AwardEntryForm
from the current CourseCatalog,
the AwardEntryCourseCatalogAssignmentSession
should
be used. These delete operations attempt to remove the
AwardEntryForm
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 |
aliasAwardEntry(Id awardEntryId,
Id aliasId)
Adds an
Id to an AwardEntry for the
purpose of creating compatibility. |
boolean |
canCreateAwardEntries()
Tests if this user can create
AwardEntries. |
boolean |
canCreateAwardEntryWithRecordTypes(Type[] awardEntryRecordTypes)
Tests if this user can create a single
Porgram using
the desired record types. |
boolean |
canDeleteAwardEntries()
Tests if this user can delete
AwardEntries. |
boolean |
canManageAwardEntryAliases()
Tests if this user can manage
Id aliases for
AwardEntries. |
boolean |
canUpdateAwardEntries()
Tests if this user can update
AwardEntries. |
AwardEntry |
createAwardEntry(AwardEntryForm awardEntryForm)
Creates a new
AwardEntry. |
void |
deleteAwardEntry(Id awardEntryId)
Deletes an
AwardEntry. |
AwardEntryForm |
getAwardEntryFormForCreate(Id awardId,
Id resourceId,
Type[] awardEntryRecordTypes)
Gets the award entry form for creating new award entries.
|
AwardEntryForm |
getAwardEntryFormForUpdate(Id awardEntryId)
Gets the award entry form for updating an existing award entry.
|
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
void |
updateAwardEntry(AwardEntryForm awardEntryForm)
Updates an existing award 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 canCreateAwardEntries()
AwardEntries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an AwardEntry
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 AwardEntry
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateAwardEntryWithRecordTypes(Type[] awardEntryRecordTypes)
Porgram
using
the desired record types. While
CourseChronicleManager.getAwardEntryRecordTypes()
can be used
to examine which records are supported, this method tests which
record(s) are required for creating a specific AwardEntry.
Providing an empty array tests if an AwardEntry
can be created with no records.awardEntryRecordTypes
- array of award entry record types true
if AwardEntry
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- awardEntryRecordTypes
is null
mandatory
- This method must be implemented. AwardEntryForm getAwardEntryFormForCreate(Id awardId, Id resourceId, Type[] awardEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
awardId
- an award Id
resourceId
- a student Id
awardEntryRecordTypes
- array of award entry record typesNotFoundException
- awardId
or
resourceId
is not foundNullArgumentException
- awardId, resourceId
, or awardEntryRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. AwardEntry createAwardEntry(AwardEntryForm awardEntryForm) throws OperationFailedException, PermissionDeniedException
AwardEntry.
awardEntryForm
- the form for this AwardEntry
AwardEntry
IllegalStateException
- awardEntryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- awardEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- awardEntryForm
did not originate from getAwardEntryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateAwardEntries()
AwardEntries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an AwardEntry
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 AwardEntry
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. AwardEntryForm getAwardEntryFormForUpdate(Id awardEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
awardEntryId
- the Id
of the AwardEntry
NotFoundException
- awardEntryId
is not
foundNullArgumentException
- awardEntryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateAwardEntry(AwardEntryForm awardEntryForm) throws OperationFailedException, PermissionDeniedException
awardEntryForm
- the form containing the elements to be updatedIllegalStateException
- awardEntryForm
already used in an update transactionInvalidArgumentException
- awardEntryId
is not foundNullArgumentException
- awardEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- awardEntryForm
did not originate from getAwardEntryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteAwardEntries()
AwardEntries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an AwardEntry
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 AwardEntry
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteAwardEntry(Id awardEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
AwardEntry.
awardEntryId
- the Id
of the AwardEntry
to removeNotFoundException
- awardEntryId
not
foundNullArgumentException
- awardEntryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageAwardEntryAliases()
Id
aliases for
AwardEntries.
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 AwardEntry
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasAwardEntry(Id awardEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an AwardEntry
for the
purpose of creating compatibility. The primary Id
of
the AwardEntry
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another award entry, it is
reassigned to the given award entry Id.
awardEntryId
- the Id
of an AwardEntry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- awardEntryId
not
foundNullArgumentException
- awardEntryId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.