public interface GradeSystemAdminSession extends OsidSession
This session creates, updates, and deletes GradeSystems.
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
GradeSystem,
a GradeSystemForm
is requested using
getGradeSystemFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed.
The returned GradeSystemForm
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 GradeSystemForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
GradeSystemForm
corresponds to an attempted transaction.
For updates, GradeSystemForms
are requested to the
GradeSystem
Id
that is to be updated using
getGradeSystemFormForUpdate().
Similarly, the
GradeSystemForm
has metadata about the data that can be updated
and it can perform validation before submitting the update. The
GradeSystemForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete GradeSystems
To unmap a
GradeSystem
from the current Gradebook,
the
GradeSystemGradebookAssignmentSession
should be used. These
delete operations attempt to remove the GradeSystem
itself
thus removing it from all known Gradebook
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 |
aliasGrade(Id gradeId,
Id aliasId)
Adds an
Id to a Grade for the purpose of
creating compatibility. |
void |
aliasGradeSystem(Id gradeSystemId,
Id aliasId)
Adds an
Id to a GradeSystem for the
purpose of creating compatibility. |
boolean |
canCreateGrades(Id gradeSystemId)
Tests if this user can create
Grade s for a
GradeSystem. |
boolean |
canCreateGradeSystems()
Tests if this user can create
GradeSystems. |
boolean |
canCreateGradeSystemWithRecordTypes(Type[] gradeSystemRecordTypes)
Tests if this user can create a single
GradeSystem
using the desired record types. |
boolean |
canCreateGradeWithRecordTypes(Id gradeSystemId,
Type[] gradeRecordTypes)
Tests if this user can create a single
Grade using the
desired record types. |
boolean |
canDeleteGrades(Id gradeSystemId)
Tests if this user can delete grades.
|
boolean |
canDeleteGradeSystems()
Tests if this user can delete grade systems.
|
boolean |
canManageGradeAliases()
Tests if this user can manage
Id aliases for
Grades. |
boolean |
canManageGradeSystemAliases()
Tests if this user can manage
Id aliases for
GradeSystems. |
boolean |
canUpdateGrades(Id gradeSystemId)
Tests if this user can update
Grades. |
boolean |
canUpdateGradeSystems()
Tests if this user can update
GradeSystems. |
Grade |
createGrade(GradeForm gradeForm)
Creates a new
Grade. |
GradeSystem |
createGradeSystem(GradeSystemForm gradeSystemForm)
Creates a new
GradeSystem. |
void |
deleteGrade(Id gradeId)
Deletes a
Grade. |
void |
deleteGradeSystem(Id gradeSystemId)
Deletes a
GradeSystem. |
Gradebook |
getGradebook()
Gets the
Gradebook associated with this session. |
Id |
getGradebookId()
Gets the
Gradebook Id associated with
this session. |
GradeForm |
getGradeFormForCreate(Id gradeSystemId,
Type[] gradeRecordTypes)
Gets the grade form for creating new grades.
|
GradeForm |
getGradeFormForUpdate(Id gradeId)
Gets the grade form for updating an existing grade.
|
GradeSystemForm |
getGradeSystemFormForCreate(Type[] gradeSystemRecordTypes)
Gets the grade system form for creating new grade systems.
|
GradeSystemForm |
getGradeSystemFormForUpdate(Id gradeSystemId)
Gets the grade system form for updating an existing grade system.
|
void |
updateGrade(GradeForm gradeForm)
Updates an existing grade.
|
void |
updateGradeSystem(GradeSystemForm gradeSystemForm)
Updates an existing grade system.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getGradebookId()
Gradebook
Id
associated with
this session. Gradebook Id
associated with this sessionmandatory
- This method must be implemented. Gradebook getGradebook() throws OperationFailedException, PermissionDeniedException
Gradebook
associated with this session. Gradebook
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateGradeSystems()
GradeSystems.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a GradeSystem
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 GradeSystem
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateGradeSystemWithRecordTypes(Type[] gradeSystemRecordTypes)
GradeSystem
using the desired record types. While
GradingManager.getGradeSystemRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific GradeSystem.
Providing an empty array tests if a GradeSystem
can be
created with no records.gradeSystemRecordTypes
- array of grade system types true
if GradeSystem
creation
using the specified Types
is supported,
false
otherwiseNullArgumentException
- gradeSystemRecordTypes
is null
mandatory
- This method must be implemented. GradeSystemForm getGradeSystemFormForCreate(Type[] gradeSystemRecordTypes) throws OperationFailedException, PermissionDeniedException
gradeSystemRecordTypes
- array of grade system typesNullArgumentException
- gradeSystemRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. GradeSystem createGradeSystem(GradeSystemForm gradeSystemForm) throws OperationFailedException, PermissionDeniedException
GradeSystem.
gradeSystemForm
- the form for this GradeSystem
GradeSystem
IllegalStateException
- gradeSystemForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- gradeSystemForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- gradeSystemForm
did not originate from getGradeSystemFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateGradeSystems()
GradeSystems.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a GradeSystem
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 GradeSystem
modification is not authorized, true
otherwisemandatory
- This method must be implemented. GradeSystemForm getGradeSystemFormForUpdate(Id gradeSystemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradeSystemId
- the Id
of the GradeSystem
NotFoundException
- gradeSystemId
is not
foundNullArgumentException
- gradeSystemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateGradeSystem(GradeSystemForm gradeSystemForm) throws OperationFailedException, PermissionDeniedException
gradeSystemForm
- the form containing the elements to be updatedIllegalStateException
- gradeSystemForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- gradeSystemForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- gradeSystemForm
did not originate from getGradeSystemFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteGradeSystems()
GradeSystem
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 GradeSystem
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteGradeSystem(Id gradeSystemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
GradeSystem.
gradeSystemId
- the Id
of the GradeSystem
to removeNotFoundException
- gradeSystemId
not
foundNullArgumentException
- gradeSystemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageGradeSystemAliases()
Id
aliases for
GradeSystems.
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 GradeSystem
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasGradeSystem(Id gradeSystemId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a GradeSystem
for the
purpose of creating compatibility. The primary Id
of
the GradeSystem
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another grade system, it is
reassigned to the given grade system Id.
gradeSystemId
- the Id
of a GradeSystem
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- gradeSystemId
not
foundNullArgumentException
- gradeSystemId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateGrades(Id gradeSystemId)
Grade
s for a
GradeSystem.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known creating a
GradeSystem
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.gradeSystemId
- the Id
of a GradeSystem
false
if Grade
creation is not
authorized, true
otherwiseNullArgumentException
- gradeSystemId
is
null
mandatory
- This method must be implemented. boolean canCreateGradeWithRecordTypes(Id gradeSystemId, Type[] gradeRecordTypes)
Grade
using the
desired record types. While
GradingManager.getGradeRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Grade.
Providing an
empty array tests if a Grade
can be created with no
records.gradeSystemId
- the Id
of a GradeSystem
gradeRecordTypes
- array of grade recod types true
if Grade
creation using the
specified Types
is supported, false
otherwiseNullArgumentException
- gradeSystemId
or
gradeRecordTypes
is null
mandatory
- This method must be implemented. GradeForm getGradeFormForCreate(Id gradeSystemId, Type[] gradeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradeSystemId
- the Id
of a GradeSystem
gradeRecordTypes
- array of grade recod typesNotFoundException
- gradeSystemId
is not
foundNullArgumentException
- gradeSystemId
or
gradeRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Grade createGrade(GradeForm gradeForm) throws OperationFailedException, PermissionDeniedException
Grade.
gradeForm
- the form for this Grade
Grade
IllegalStateException
- gradeForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- gradeForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- gradeForm
did not
originate from getGradeFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateGrades(Id gradeSystemId)
Grades.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Grade
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.gradeSystemId
- the Id
of a GradeSystem
false
if Grade
modification is
not authorized, true
otherwiseNullArgumentException
- gradeSystemId
is
null
mandatory
- This method must be implemented. GradeForm getGradeFormForUpdate(Id gradeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
gradeId
- the Id
of the Grade
NotFoundException
- gradeId
is not foundNullArgumentException
- gradeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateGrade(GradeForm gradeForm) throws OperationFailedException, PermissionDeniedException
gradeForm
- the form containing the elements to be updatedIllegalStateException
- gradeForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- gradeId
or
gradeForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- gradeForm
did not
originate from getGradeFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteGrades(Id gradeSystemId)
Grade
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.gradeSystemId
- the Id
of a GradeSystem
false
if Grade
deletion is not
authorized, true
otherwiseNullArgumentException
- gradeSystemId
is
null
mandatory
- This method must be implemented. void deleteGrade(Id gradeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Grade.
gradeId
- the Id
of the Grade
to
removeNotFoundException
- gradeId
not foundNullArgumentException
- gradeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageGradeAliases()
Id
aliases for
Grades.
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 Grade
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasGrade(Id gradeId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Grade
for the purpose of
creating compatibility. The primary Id
of the
Grade
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another grade, it is reassigned to the given grade
Id.
gradeId
- the Id
of a Grade
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- gradeId
not foundNullArgumentException
- gradeId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.