public interface GradebookAdminSession extends OsidSession
This session creates, updates, and deletes Gradebooks.
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
Gradebook,
a GradebookForm
is requested using
getGradebookFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed.
The returned GradebookForm
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 GradebookForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
GradebookForm
corresponds to an attempted transaction.
For updates, GradebookForms
are requested to the
Gradebook
Id
that is to be updated using
getGradebookFormForUpdate().
Similarly, the GradebookForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The GradebookForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Gradebooks.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasGradebook(Id gradebookId,
Id aliasId)
Adds an
Id to a Gradebook for the
purpose of creating compatibility. |
boolean |
canCreateGradebooks()
Tests if this user can create
Gradebooks. |
boolean |
canCreateGradebookWithRecordTypes(Type[] gradebookRecordTypes)
Tests if this user can create a single
Gradebook using
the desired record types. |
boolean |
canDeleteGradebooks()
Tests if this user can delete gradebooks.
|
boolean |
canManageGradebookAliases()
Tests if this user can manage
Id aliases for
Gradebooks. |
boolean |
canUpdateGradebooks()
Tests if this user can update
Gradebooks. |
Gradebook |
createGradebook(GradebookForm gradebookForm)
Creates a new
Gradebook. |
void |
deleteGradebook(Id gradebookId)
Deletes a
Gradebook. |
GradebookForm |
getGradebookFormForCreate(Type[] gradebookRecordTypes)
Gets the gradebook form for creating new gradebooks.
|
GradebookForm |
getGradebookFormForUpdate(Id gradebookId)
Gets the gradebook form for updating an existing gradebook.
|
void |
updateGradebook(GradebookForm gradebookForm)
Updates an existing gradebook.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateGradebooks()
Gradebooks.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Gradebook
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false
if Gradebook
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateGradebookWithRecordTypes(Type[] gradebookRecordTypes)
Gradebook
using
the desired record types. While
GradingManager.getGradebookRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Gradebook.
Providing an empty array tests if a Gradebook
can be
created with no records.gradebookRecordTypes
- array of gradebook record types true
if Gradebook
creation using
the specified Types
is supported, false
otherwiseNullArgumentException
- gradebookRecordTypes
is null
mandatory
- This method must be implemented. GradebookForm getGradebookFormForCreate(Type[] gradebookRecordTypes) throws OperationFailedException, PermissionDeniedException
gradebookRecordTypes
- array of gradebook record typesNullArgumentException
- gradebookRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Gradebook createGradebook(GradebookForm gradebookForm) throws OperationFailedException, PermissionDeniedException
Gradebook.
gradebookForm
- the form for this Gradebook
Gradebook
IllegalStateException
- gradebookForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- gradebookForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- gradebookForm
did
not originate from getGradebookFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateGradebooks()
Gradebooks.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Gradebook
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false
if Gradebook
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. GradebookForm getGradebookFormForUpdate(Id gradebookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradebookId
- the Id
of the Gradebook
NotFoundException
- gradebookId
is not
foundNullArgumentException
- gradebookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateGradebook(GradebookForm gradebookForm) throws OperationFailedException, PermissionDeniedException
gradebookForm
- the form containing the elements to be updatedIllegalStateException
- gradebookForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- gradebookForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- gradebookForm did not
originate from getGradebookFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteGradebooks()
Gradebook
will result in a
PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false
if Gradebook
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteGradebook(Id gradebookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Gradebook.
gradebookId
- the Id
of the Gradebook
to removeNotFoundException
- gradebookId
not
foundNullArgumentException
- gradebookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageGradebookAliases()
Id
aliases for
Gradebooks.
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 Gradebook
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasGradebook(Id gradebookId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Gradebook
for the
purpose of creating compatibility. The primary Id
of
the Gradebook
is determined by the provider. The new
Id
performs as an alias to the primary Id
. If the alias is a pointer to another gradebook, it is
reassigned to the given gradebook Id.
gradebookId
- the Id
of a Gradebook
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- gradebookId
not
foundNullArgumentException
- gradebookId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.