Interface ProgramEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProgramEntryBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasProgramEntry(Id programEntryId, Id aliasId) Adds anIdto aProgramEntryfor the purpose of creating compatibility.booleanTests if this user can createProgramEntries.booleancanCreateProgramEntryWithRecordTypes(Type[] programEntryRecordTypes) Tests if this user can create a singlePorgramusing the desired record types.booleanTests if this user can deleteProgramEntries.booleancanDeleteProgramEntry(Id programEntryId) Tests if this user can delete a specifiedProgramEntry.booleanTests if this user can manageIdaliases forProgramEntries.booleanTests if this user can updateProgramEntries.createProgramEntry(ProgramEntryForm programEntryForm) Creates a newProgramEntry.voiddeleteProgramEntry(Id programEntryId) Deletes aProgramEntry.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getProgramEntryFormForCreate(Id programId, Id resourceId, Type[] programEntryRecordTypes) Gets the program entry form for creating new program entries.getProgramEntryFormForUpdate(Id programEntryId) Gets the program entry form for updating an existing program entry.voidupdateProgramEntry(ProgramEntryForm programEntryForm) Updates an existing program 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.
-
canCreateProgramEntries
boolean canCreateProgramEntries()Tests if this user can createProgramEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProgramEntrywill 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:
falseifProgramEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProgramEntryWithRecordTypes
Tests if this user can create a singlePorgramusing the desired record types. WhileCourseChronicleManager.getProgramEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProgramEntry. Providing an empty array tests if aProgramEntrycan be created with no records.- Parameters:
programEntryRecordTypes- array of program entry record types- Returns:
trueifProgramEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-programEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProgramEntryFormForCreate
ProgramEntryForm getProgramEntryFormForCreate(Id programId, Id resourceId, Type[] programEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the program entry form for creating new program entries. A new form should be requested for each create transaction.- Parameters:
programId- theIdof aProgramresourceId- theIdof a studentprogramEntryRecordTypes- array of program entry record types- Returns:
- the program entry form
- Throws:
NotFoundException-programIdorresourceIdis not foundNullArgumentException-programId, resourceId, orprogramEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createProgramEntry
ProgramEntry createProgramEntry(ProgramEntryForm programEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newProgramEntry.- Parameters:
programEntryForm- the form for thisProgramEntry- Returns:
- the new
ProgramEntry - Throws:
IllegalStateException-programEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-programEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-programEntryFormdid not originate fromgetProgramEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProgramEntries
boolean canUpdateProgramEntries()Tests if this user can updateProgramEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProgramEntrywill 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:
falseifProgramEntrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProgramEntryFormForUpdate
ProgramEntryForm getProgramEntryFormForUpdate(Id programEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the program entry form for updating an existing program entry. A new program entry form should be requested for each update transaction.- Parameters:
programEntryId- theIdof theProgramEntry- Returns:
- the program entry form
- Throws:
NotFoundException-programEntryIdis not foundNullArgumentException-programEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProgramEntry
void updateProgramEntry(ProgramEntryForm programEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing program entry.- Parameters:
programEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-programEntryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-programEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-programEntryFormdid not originate fromgetProgramEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProgramEntries
boolean canDeleteProgramEntries()Tests if this user can deleteProgramEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProgramEntrywill 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:
falseifProgramEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canDeleteProgramEntry
Tests if this user can delete a specifiedProgramEntry. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting theProgramEntrywill result in aPERMISSION_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.- Parameters:
programEntryId- theIdof theProgramEntry- Returns:
falseif deletion of thisProgramEntryis not authorized,trueotherwise- Throws:
NullArgumentException-programEntryIdisnull- Compliance:
mandatory- This method must be implemented.- Notes:
If- the {@code programEntryId} is not found, then it is acceptable to return false to indicate the lack of a delete available.
-
deleteProgramEntry
void deleteProgramEntry(Id programEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProgramEntry.- Parameters:
programEntryId- theIdof theProgramEntryto remove- Throws:
NotFoundException-programEntryIdnot foundNullArgumentException-programEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProgramEntryAliases
boolean canManageProgramEntryAliases()Tests if this user can manageIdaliases forProgramEntries. 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:
falseifProgramEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProgramEntry
void aliasProgramEntry(Id programEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProgramEntryfor the purpose of creating compatibility. The primaryIdof theProgramEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another program entry, it is reassigned to the given program entryId.- Parameters:
programEntryId- theIdof aProgramEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-programEntryIdnot foundNullArgumentException-programEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-