Interface TodoAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
TodoBatchAdminSession

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.

  • Method Details

    • getChecklistId

      Id getChecklistId()
      Gets the Checklist Id associated with this session.
      Returns:
      the Checklist Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getChecklist

      Gets the Checklist associated with this session.
      Returns:
      the checklist
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateTodos

      boolean canCreateTodos()
      Tests if this user can create todos. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a 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.
      Returns:
      false if Todo creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateTodoWithRecordTypes

      boolean canCreateTodoWithRecordTypes(Type[] todoRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      todoRecordTypes - array of todo record types
      Returns:
      true if Todo creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - todoRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getTodoFormForCreate

      TodoForm getTodoFormForCreate(Type[] todoRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the todo form for creating new todos. A new form should be requested for each create transaction.
      Parameters:
      todoRecordTypes - array of todo record types
      Returns:
      the todo form
      Throws:
      NullArgumentException - todoRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createTodo

      Creates a new Todo .
      Parameters:
      todoForm - the form for this Todo
      Returns:
      the new Todo
      Throws:
      IllegalStateException - todoForm already used for a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - todoForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - todoForm did not originate from getTodoFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateTodos

      boolean canUpdateTodos()
      Tests if this user can update todos. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a 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.
      Returns:
      false if Todo modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getTodoFormForUpdate

      Gets the todo form for updating an existing todo. A new todo form should be requested for each update transaction.
      Parameters:
      todoId - the Id of the Todo
      Returns:
      the todo form
      Throws:
      NotFoundException - todoId is not found
      NullArgumentException - todoId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateTodo

      void updateTodo(TodoForm todoForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing todo.
      Parameters:
      todoForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - todoForm already used for an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - todoId or todoForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - todoForm did not originate from getTodoFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteTodos

      boolean canDeleteTodos()
      Tests if this user can delete todos. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an 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.
      Returns:
      false if Todo deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteTodo

      Deletes a Todo .
      Parameters:
      todoId - the Id of the Todo to remove
      Throws:
      NotFoundException - todoId not found
      NullArgumentException - todoId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageTodoAliases

      boolean canManageTodoAliases()
      Tests if this user can manage 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.
      Returns:
      false if Todo aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasTodo

      Adds an 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 .
      Parameters:
      todoId - the Id of a Todo
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - todoId not found
      NullArgumentException - todoId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.