public interface DocetAdminSession extends OsidSession
This session creates, updates, and deletes Docets.
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
Docet,
a DocetForm
is requested using
getDocetFormForCreate()
specifying the desired record Types
or none if no record Types
are needed. The returned
DocetForm
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 DocetForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DocetForm
corresponds to an attempted transaction.
For updates, DocetForms
are requested to the
DocetForm
Id
that is to be updated using
geDocetFormForUpdate().
Similarly, the DocetForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The DocetForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Docet.
To unmap a
Docet
from the current CourseCatalog,
the
DocetCourseCatalogAssignmentSession
should be used. These delete
operations attempt to remove the Docet
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 |
aliasDocet(Id docetId,
Id aliasId)
Adds an
Id to an Docet for the purpose
of creating compatibility. |
boolean |
canCreateDocets()
Tests if this user can create
Docets. |
boolean |
canCreateDocetWithRecordTypes(Type[] docetRecordTypes)
Tests if this user can create a single
Docet using the
desired record types. |
boolean |
canDeleteDocets()
Tests if this user can delete
Docets A return of true
does not guarantee successful authorization. |
boolean |
canManageDocetAliases()
Tests if this user can manage
Id aliases for
Docets. |
boolean |
canSequenceDocets()
Tests if this user can order
Docets. |
boolean |
canUpdateDocets()
Tests if this user can update
Docets. |
Docet |
createDocet(DocetForm docetForm)
Creates a new
Docet. |
void |
deleteDocet(Id docetId)
Deletes an
Docet. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
DocetForm |
getDocetFormForCreate(Id moduleId,
Id activityUnitId,
Type[] docetRecordTypes)
Gets the docet form for creating new docets.
|
DocetForm |
getDocetFormForUpdate(Id docetId)
Gets the docet form for updating an existing docet.
|
void |
moveDocetAhead(Id docetId,
Id moduleId,
Id referenceId)
Reorders docets in a module by moving the specified docet in front of
a reference docet.
|
void |
moveDocetBehind(Id docetId,
Id moduleId,
Id referenceId)
Reorders docets in a module by moving the specified docet behind a
reference docet.
|
void |
orderDocets(Id[] docetIds,
Id moduleId)
Reorders a set of docets in a module.
|
void |
updateDocet(DocetForm docetForm)
Updates an existing docet.
|
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 canCreateDocets()
Docets.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Docet
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 Docet
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateDocetWithRecordTypes(Type[] docetRecordTypes)
Docet
using the
desired record types. While
CourseSyllabusManager.getDocetRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Docet.
Providing
an empty array tests if an Docet
can be created with no
records.docetRecordTypes
- array of docet record types true
if Docet
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- docetRecordTypes
is null
mandatory
- This method must be implemented. DocetForm getDocetFormForCreate(Id moduleId, Id activityUnitId, Type[] docetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
moduleId
- a module Id
activityUnitId
- an activity unit Id
docetRecordTypes
- array of docet record typesNotFoundException
- moduleId
or
activityUnitId
is not foundNullArgumentException
- moduleId,
acticvtyUnitId,
or docetRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Docet createDocet(DocetForm docetForm) throws OperationFailedException, PermissionDeniedException
Docet.
docetForm
- the form for this Docet
Docet
IllegalStateException
- docetForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- docetForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- docetForm
did not
originate from getDocetFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateDocets()
Docets.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Docet
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 Docet
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. DocetForm getDocetFormForUpdate(Id docetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
docetId
- the Id
of the Docet
NotFoundException
- docetId
is not foundNullArgumentException
- docetId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateDocet(DocetForm docetForm) throws OperationFailedException, PermissionDeniedException
docetForm
- the form containing the elements to be updatedIllegalStateException
- docetForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- docetForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- docetForm
did not
originate from getDocetFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteDocets()
Docets
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Docet
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 Docet
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteDocet(Id docetId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Docet.
docetId
- the Id
of the Docet
to
removeNotFoundException
- docetId
not foundNullArgumentException
- docetId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageDocetAliases()
Id
aliases for
Docets.
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 Docet
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasDocet(Id docetId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Docet
for the purpose
of creating compatibility. The primary Id
of the
Docet
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another docet, it is reassigned to the given docet
Id.
docetId
- the Id
of an Docet
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- docetId
not foundNullArgumentException
- docetId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canSequenceDocets()
Docets.
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 Docet
ordering is not
authorized, true
otherwisemandatory
- This method must be implemented. void moveDocetAhead(Id docetId, Id moduleId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
docetId
- the Id
of a Docet
moduleId
- the Id
of a Module
referenceId
- the reference docet Id
NotFoundException
- docetId, moduleId,
or referenceId
not found or, docetId
or referenceId
not related to
moduleId
NullArgumentException
- docetId, moduleId,
or referenceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void moveDocetBehind(Id docetId, Id moduleId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
docetId
- the Id
of a Docet
moduleId
- the Id
of a Module
referenceId
- the reference docet Id
NotFoundException
- docetId, moduleId,
or referenceId
not found or, docetId
or referenceId
not related to
moduleId
NullArgumentException
- docetId, moduleId
or referenceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void orderDocets(Id[] docetIds, Id moduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
docetIds
- the Ids
for a set of Docets
moduleId
- the Id
of a Module
NotFoundException
- docetId
not found
or, a docetId
not related to moduleId
NullArgumentException
- docetIds
or
moduleId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.