Interface WorkOfficeAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface WorkOfficeAssignmentSession extends OsidSession

This session provides methods to re-assign Works to Office mappings. A Work may appear in multiple Offices and removing the last reference to a Work is the equivalent of deleting it. Each Office may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignWorks

      boolean canAssignWorks()
      Tests if this user can alter work/office 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.
    • canAssignWorksToOffice

      boolean canAssignWorksToOffice(Id officeId)
      Tests if this user can alter work/office 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:
      officeId - the Id of the Office
      Returns:
      false if workflow is not authorized, true otherwise
      Throws:
      NullArgumentException - officeId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableOfficeIds

      IdList getAssignableOfficeIds(Id officeId) throws OperationFailedException
      Gets a list of offices including and under the given office node in which any work can be assigned.
      Parameters:
      officeId - the Id of the Office
      Returns:
      list of assignable office Ids
      Throws:
      NullArgumentException - officeId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableOfficeIdsForWork

      IdList getAssignableOfficeIdsForWork(Id officeId, Id workId) throws OperationFailedException
      Gets a list of offices including and under the given office node in which a specific work can be assigned.
      Parameters:
      officeId - the Id of the Office
      workId - the Id of the Work
      Returns:
      list of assignable office Ids
      Throws:
      NullArgumentException - officeId or workId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignWorkToOffice

      Adds an existing Work to an Office .
      Parameters:
      workId - the Id of the Work
      officeId - the Id of the Office
      Throws:
      AlreadyExistsException - workId is already assigned to officeId
      NotFoundException - workId or officeId not found
      NullArgumentException - workId or officeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignWorkFromOffice

      void unassignWorkFromOffice(Id workId, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Work from an Office .
      Parameters:
      workId - the Id of the Work
      officeId - the Id of the Office
      Throws:
      NotFoundException - workId or officeId not found or workId not assigned to officeId
      NullArgumentException - workId or officeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignWorkToOffice

      void reassignWorkToOffice(Id workId, Id fromOfficeId, Id toOfficeId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Work from one Office to another. Mappings to other Offices are unaffected.
      Parameters:
      workId - the Id of the Work
      fromOfficeId - the Id of the current Office
      toOfficeId - the Id of the destination Office
      Throws:
      AlreadyExistsException - workId , already assigned to toOfficeId
      NotFoundException - workId fromOfficeId , or toOfficeId not found or workId not mapped to fromOfficeId
      NullArgumentException - workId, fromOfficeId , or toOfficeId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.