public interface TodoAdminSession extends OsidSession
This session creates, updates, and deletes Todos. 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 an
Todo, an TodoForm is requested using
getTodoFormForCreate() specifying the desired record Types
or none if no record Types are needed. The returned
TodoForm 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 TodoForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each TodoForm corresponds
to an attempted transaction.
For updates, TodoForms are requested to the Todo
Id that is to be updated using
getTodoFormForUpdate(). Similarly, the TodoForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The TodoForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Todos. To unmap an
Todo from the current Checklist, the
TodoChecklistAssignmentSession should be used. These delete
operations attempt to remove the Bid itself thus removing
it from all known Checklist 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 |
addDependency(Id dependentTodoId,
Id dependencyTodoId)
Adds a todo as a dependency for another todo.
|
void |
aliasTodo(Id todoId,
Id aliasId)
Adds an
Id to a Todo for the purpose of
creating compatibility. |
boolean |
canCreateTodos()
Tests if this user can create todos.
|
boolean |
canCreateTodoWithRecordTypes(Type[] todoRecordTypes)
Tests if this user can create a single
Todo using the
desired record types. |
boolean |
canDeleteTodos()
Tests if this user can delete todos.
|
boolean |
canManageDependencies()
Tests if this user can manage todo dependencies
. |
boolean |
canManageTodoAliases()
Tests if this user can manage
Id aliases for
Comnents. |
boolean |
canUpdateTodos()
Tests if this user can update todos.
|
Todo |
createTodo(TodoForm todoForm)
Creates a new
Todo. |
void |
deleteTodo(Id todoId)
Deletes a
Todo. |
Checklist |
getChecklist()
Gets the
Checklist associated with this session. |
Id |
getChecklistId()
Gets the
Checklist Id associated with
this session. |
TodoForm |
getTodoFormForCreate(Type[] todoRecordTypes)
Gets the todo form for creating new todos.
|
TodoForm |
getTodoFormForUpdate(Id todoId)
Gets the todo form for updating an existing todo.
|
void |
removeDependency(Id dependentTodoId,
Id dependencyTodoId)
Removes a todo as a dependency from another todo.
|
void |
updateTodo(TodoForm todoForm)
Updates an existing todo.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getChecklistId()
Checklist Id associated with
this session. Checklist Id associated with this sessionmandatory - This method must be implemented. Checklist getChecklist() throws OperationFailedException, PermissionDeniedException
Checklist associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateTodos()
Todo 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 Todo creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateTodoWithRecordTypes(Type[] todoRecordTypes)
Todo using the
desired record types. While
ChecklistManager.getTodoRecordTypes() can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Todo. Providing an
empty array tests if a Todo can be created with no
records.todoRecordTypes - array of todo record types true if Todo creation using the
specified record Types is supported,
false otherwiseNullArgumentException - todoRecordTypes
is null mandatory - This method must be implemented. TodoForm getTodoFormForCreate(Type[] todoRecordTypes) throws OperationFailedException, PermissionDeniedException
todoRecordTypes - array of todo record typesNullArgumentException - todoRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Todo createTodo(TodoForm todoForm) throws OperationFailedException, PermissionDeniedException
Todo. todoForm - the form for this Todo Todo IllegalStateException - todoForm already
used for a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - todoForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - todoForm did not
originate from getTodoFormForCreate() mandatory - This method must be implemented. boolean canUpdateTodos()
Todo 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 Todo modification is
not authorized, true otherwisemandatory - This method must be implemented. TodoForm getTodoFormForUpdate(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
todoId - the Id of the Todo NotFoundException - todoId is not foundNullArgumentException - todoId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateTodo(TodoForm todoForm) throws OperationFailedException, PermissionDeniedException
todoForm - the form containing the elements to be updatedIllegalStateException - todoForm already
used for an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - todoId or
todoForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - todoForm did not
originate from getTodoFormForUpdate() mandatory - This method must be implemented. boolean canDeleteTodos()
Todo 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 Todo deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteTodo(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Todo. todoId - the Id of the Todo to
removeNotFoundException - todoId not foundNullArgumentException - todoId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageTodoAliases()
Id aliases for
Comnents. 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 Todo aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasTodo(Id todoId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Todo for the purpose of
creating compatibility. The primary Id of the
Todo is determined by the provider. The new Id
performs as an alias to the primary Id. If the alias is
a pointer to another todo, it is reassigned to the given todo
Id. todoId - the Id of a Todo aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - todoId not foundNullArgumentException - todoId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageDependencies()
. 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 Todo aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void addDependency(Id dependentTodoId, Id dependencyTodoId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
dependentTodoId - the Id of the dependency
Todo dependencyTodoId - the Id of the Todo
dependencyAlreadyExistsException - dependentTodoId
is already dependent upon dependencyTodoId or
vice-versaNotFoundException - dependentTodoId or
dependencyTodoId is not foundNullArgumentException - dependentTodoId
or dependencyTodoId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void removeDependency(Id dependentTodoId, Id dependencyTodoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
dependentTodoId - the Id of the dependency
Todo dependencyTodoId - the Id of the Todo
dependencyNotFoundException - dependentTodoId or
dependencyTodoId is not found, or
dependentTodoId not dependent upon
dependencyTodoId NullArgumentException - dependentTodoId
or dependencyTodoId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.