Interface AwardEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AwardEntryBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAwardEntry(Id awardEntryId, Id aliasId) Adds anIdto anAwardEntryfor the purpose of creating compatibility.booleanTests if this user can createAwardEntries.booleancanCreateAwardEntryWithRecordTypes(Type[] awardEntryRecordTypes) Tests if this user can create a singlePorgramusing the desired record types.booleanTests if this user can deleteAwardEntries.booleanTests if this user can manageIdaliases forAwardEntries.booleanTests if this user can updateAwardEntries.createAwardEntry(AwardEntryForm awardEntryForm) Creates a newAwardEntry.voiddeleteAwardEntry(Id awardEntryId) Deletes anAwardEntry.getAwardEntryFormForCreate(Id awardId, Id resourceId, Type[] awardEntryRecordTypes) Gets the award entry form for creating new award entries.getAwardEntryFormForUpdate(Id awardEntryId) Gets the award entry form for updating an existing award entry.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.voidupdateAwardEntry(AwardEntryForm awardEntryForm) Updates an existing award entry.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAwardEntries
boolean canCreateAwardEntries()Tests if this user can createAwardEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAwardEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifAwardEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAwardEntryWithRecordTypes
Tests if this user can create a singlePorgramusing the desired record types. WhileCourseChronicleManager.getAwardEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAwardEntry. Providing an empty array tests if anAwardEntrycan be created with no records.- Parameters:
awardEntryRecordTypes- array of award entry record types- Returns:
trueifAwardEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-awardEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAwardEntryFormForCreate
AwardEntryForm getAwardEntryFormForCreate(Id awardId, Id resourceId, Type[] awardEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the award entry form for creating new award entries. A new form should be requested for each create transaction.- Parameters:
awardId- an awardIdresourceId- a studentIdawardEntryRecordTypes- array of award entry record types- Returns:
- the award entry form
- Throws:
NotFoundException-awardIdorresourceIdis not foundNullArgumentException-awardId, resourceId, orawardEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAwardEntry
AwardEntry createAwardEntry(AwardEntryForm awardEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newAwardEntry.- Parameters:
awardEntryForm- the form for thisAwardEntry- Returns:
- the new
AwardEntry - Throws:
IllegalStateException-awardEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-awardEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-awardEntryFormdid not originate fromgetAwardEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAwardEntries
boolean canUpdateAwardEntries()Tests if this user can updateAwardEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAwardEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifAwardEntrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAwardEntryFormForUpdate
AwardEntryForm getAwardEntryFormForUpdate(Id awardEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the award entry form for updating an existing award entry. A new award entry form should be requested for each update transaction.- Parameters:
awardEntryId- theIdof theAwardEntry- Returns:
- the award entry form
- Throws:
NotFoundException-awardEntryIdis not foundNullArgumentException-awardEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAwardEntry
void updateAwardEntry(AwardEntryForm awardEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing award entry.- Parameters:
awardEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-awardEntryFormalready used in an update transactionInvalidArgumentException-awardEntryIdis not foundNullArgumentException-awardEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-awardEntryFormdid not originate fromgetAwardEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAwardEntries
boolean canDeleteAwardEntries()Tests if this user can deleteAwardEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAwardEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifAwardEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAwardEntry
void deleteAwardEntry(Id awardEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAwardEntry.- Parameters:
awardEntryId- theIdof theAwardEntryto remove- Throws:
NotFoundException-awardEntryIdnot foundNullArgumentException-awardEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAwardEntryAliases
boolean canManageAwardEntryAliases()Tests if this user can manageIdaliases forAwardEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifAwardEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAwardEntry
void aliasAwardEntry(Id awardEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAwardEntryfor the purpose of creating compatibility. The primaryIdof theAwardEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another award entry, it is reassigned to the given award entryId.- Parameters:
awardEntryId- theIdof anAwardEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-awardEntryIdnot foundNullArgumentException-awardEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-