Interface TodoChecklistAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface TodoChecklistAssignmentSession extends OsidSession

This session provides methods to re-assign Todos to Checklists . A Todo may map to multiple Checklists and removing the last reference to a Todo is the equivalent of deleting it. Each Checklist may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Todo to another Checklist is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignTodos

      boolean canAssignTodos()
      Tests if this user can alter todo/checklist mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignTodosToChecklist

      boolean canAssignTodosToChecklist(Id checklistId)
      Tests if this user can alter todo/checklist mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      checklistId - the Id of the Checklist
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - checklistId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableChecklistIds

      IdList getAssignableChecklistIds(Id checklistId) throws OperationFailedException
      Gets a list of checklists including and under the given checklist node in which any todo can be assigned.
      Parameters:
      checklistId - the Id of the Checklist
      Returns:
      list of assignable checklist Ids
      Throws:
      NullArgumentException - checklistId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableChecklistIdsForTodo

      IdList getAssignableChecklistIdsForTodo(Id checklistId, Id todoId) throws OperationFailedException
      Gets a list of checklists including and under the given checklist node in which a specific todo can be assigned.
      Parameters:
      checklistId - the Id of the Checklist
      todoId - the Id of the Todo
      Returns:
      list of assignable checklist Ids
      Throws:
      NullArgumentException - checklistId or todoId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignTodoToChecklist

      void assignTodoToChecklist(Id todoId, Id checklistId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Todo to a Checklist .
      Parameters:
      todoId - the Id of the Todo
      checklistId - the Id of the Checklist
      Throws:
      AlreadyExistsException - todoId is already assigned to checklistId
      NotFoundException - todoId or checklistId not found
      NullArgumentException - todoId or checklistId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignTodoFromChecklist

      void unassignTodoFromChecklist(Id todoId, Id checklistId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Todo from a Checklist .
      Parameters:
      todoId - the Id of the Todo
      checklistId - the Id of the Checklist
      Throws:
      NotFoundException - todoId or checklistId not found or todoId is not assigned to checklistId
      NullArgumentException - todoId or checklistId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignTodoToChecklist

      void reassignTodoToChecklist(Id todoId, Id fromChecklistId, Id toChecklistId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Todo from one Checklist to another. Mappings to other Checklists are unaffected.
      Parameters:
      todoId - the Id of the Todo
      fromChecklistId - the Id of the current Checklist
      toChecklistId - the Id of the destination Checklist
      Throws:
      AlreadyExistsException - todoId already assigned to toChecklistId
      NotFoundException - todoId, fromChecklistId , or toChecklistId not found or todoId not mapped to fromChecklistId
      NullArgumentException - todoId, fromChecklistId , or toChecklistId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.