public interface ModuleAdminSession extends OsidSession
This session creates, updates, and deletes Modules.
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
Module,
a ModuleForm
is requested using
getModuleFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned ModuleForm
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 ModuleForm
is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each ModuleForm
corresponds to an attempted transaction.
For updates, ModuleForms
are requested to the
ModuleForm
Id
that is to be updated using
getModuleFormForUpdate().
Similarly, the ModuleForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ModuleForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Modules.
To unmap a
Module
from the current CourseCatalog,
the
ModuleCourseCatalogAssignmentSession
should be used. These delete
operations attempt to remove the Module
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 |
aliasModule(Id moduleId,
Id aliasId)
Adds an
Id to a Module for the purpose
of creating compatibility. |
boolean |
canCreateModules()
Tests if this user can create modules.
|
boolean |
canCreateModuleWithRecordTypes(Type[] moduleRecordTypes)
Tests if this user can create a single
Module using the
desired record types. |
boolean |
canDeleteModules()
Tests if this user can delete modules.
|
boolean |
canManageModuleAliases()
Tests if this user can manage
Id aliases for
Modules. |
boolean |
canSequenceModules()
Tests if this user can order
Modules. |
boolean |
canUpdateModules()
Tests if this user can update modules.
|
Module |
createModule(ModuleForm moduleForm)
Creates a new
Module. |
void |
deleteModule(Id moduleId)
Deletes a
Module. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
ModuleForm |
getModuleFormForCreate(Id syllabusId,
Type[] moduleRecordTypes)
Gets the module form for creating new modules.
|
ModuleForm |
getModuleFormForUpdate(Id moduleId)
Gets the module form for updating an existing module.
|
void |
moveModuleAhead(Id moduleId,
Id syllabusId,
Id referenceId)
Reorders modules in a syllabus by moving the specified module in front
of a reference module.
|
void |
moveModuleBehind(Id moduleId,
Id syllabusId,
Id referenceId)
Reorders modules in a syllabus by moving the specified module behind a
reference module.
|
void |
orderModules(Id[] moduleIds,
Id syllabusId)
Reorders a set of modules in a syllabus.
|
void |
updateModule(ModuleForm moduleForm)
Updates an existing module.
|
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 canCreateModules()
Module
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 Module
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateModuleWithRecordTypes(Type[] moduleRecordTypes)
Module
using the
desired record types. While
CourseSyllabusManager.getModuleRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Module.
Providing
an empty array tests if a Module
can be created with no
records.moduleRecordTypes
- array of module record types true
if Module
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- moduleRecordTypes
is null
mandatory
- This method must be implemented. ModuleForm getModuleFormForCreate(Id syllabusId, Type[] moduleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
syllabusId
- a syllabus Id
moduleRecordTypes
- array of module record typesNotFoundException
- syllabusId
is not
foundNullArgumentException
- syllabusId
or
moduleRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Module createModule(ModuleForm moduleForm) throws OperationFailedException, PermissionDeniedException
Module.
moduleForm
- the form for this Module
Module
IllegalStateException
- moduleForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- moduleForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- moduleForm
did
not originate from getModuleFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateModules()
Module
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 Module
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. ModuleForm getModuleFormForUpdate(Id moduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
moduleId
- the Id
of the Module
NotFoundException
- moduleId
is not
foundNullArgumentException
- moduleId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateModule(ModuleForm moduleForm) throws OperationFailedException, PermissionDeniedException
moduleForm
- the form containing the elements to be updatedIllegalStateException
- moduleForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- moduleForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- moduleForm
did
not originate from getModuleFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteModules()
Module
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 Module
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteModule(Id moduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Module.
moduleId
- the Id
of the Module
to
removeNotFoundException
- moduleId
not foundNullArgumentException
- moduleId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageModuleAliases()
Id
aliases for
Modules.
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 Module
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasModule(Id moduleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Module
for the purpose
of creating compatibility. The primary Id
of the
Module
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another module, it is reassigned to the given
module Id.
moduleId
- the Id
of a Module
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- moduleId
not foundNullArgumentException
- moduleId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canSequenceModules()
Modules.
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 sequencing operations to an
unauthorized user. false
if Module
ordering is not
authorized, true
otherwisemandatory
- This method must be implemented. void moveModuleAhead(Id moduleId, Id syllabusId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
moduleId
- the Id
of a Module
syllabusId
- the Id
of a Syllabus
referenceId
- the reference module Id
NotFoundException
- moduleId, syllabusId,
or referenceId
not found or,
moduleId
or referenceId
not related to
syllabusId
NullArgumentException
- moduleId, syllabusId,
or referenceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void moveModuleBehind(Id moduleId, Id syllabusId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
moduleId
- the Id
of a Module
syllabusId
- the Id
of a Syllabus
referenceId
- the reference module Id
NotFoundException
- moduleId, syllabusId,
or referenceId
not found or,
moduleId
or referenceId
not related to
syllabusId
NullArgumentException
- moduleId, syllabusId,
or referenceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void orderModules(Id[] moduleIds, Id syllabusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
moduleIds
- the Ids
for a set of Modules
syllabusId
- the Id
of a Syllabus
NotFoundException
- moduleId
not found
or, a moduleId
not related to syllabusId
NullArgumentException
- moduleIds
or
syllabusId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.