Interface ProjectAdminSession

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

public interface ProjectAdminSession extends OsidSession

This session creates, updates, and deletes Projects . 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 Project , a ProjectForm is requested using getProjectFormForCreate() specifying the desired building and record Types or none if no record Types are needed. The returned ProjectForm 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 ProjectForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each ProjectForm corresponds to an attempted transaction.

For updates, ProjectForms are requested to the Project Id that is to be updated using getProjectFormForUpdate() . Similarly, the ProjectForm has metadata about the data that can be updated and it can perform validation before submitting the update. The ProjectForm can only be used once for a successful update and cannot be reused.

The delete operations delete Projects . To unmap a Project from the current Campus , the ProjectCampusAssignmentSession should be used. These delete operations attempt to remove the Project itself thus removing it from all known Campus catalogs.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getCampusId

      Id getCampusId()
      Gets the Campus Id associated with this session.
      Returns:
      the Campus Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCampus

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

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

      boolean canCreateProjectWithRecordTypes(Type[] projectRecordTypes)
      Tests if this user can create a single Project using the desired record types. While RoomConstructionManager.getProjectRecordTypes() can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specific Project . Providing an empty array tests if a Project can be created with no records.
      Parameters:
      projectRecordTypes - array of project record types
      Returns:
      true if Project creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - projectRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getProjectFormForCreate

      ProjectForm getProjectFormForCreate(Id buildingId, Type[] projectRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the project form for creating new projects. A new form should be requested for each create transaction.
      Parameters:
      buildingId - the Id of the building
      projectRecordTypes - array of project record types
      Returns:
      the project form
      Throws:
      NotFoundException - buildngId is not found
      NullArgumentException - buildngId or projectRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get from for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createProject

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

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

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

      void updateProject(ProjectForm projectForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing project.
      Parameters:
      projectForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - projectForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - projectForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - projectForm did not originate from getProjectFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteProjects

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

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

      boolean canManageProjectAliases()
      Tests if this user can manage Id aliases for Projects . 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 Project aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasProject

      Adds an Id to a Project for the purpose of creating compatibility. The primary Id of the Project is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another project, it is reassigned to the given project Id .
      Parameters:
      projectId - the Id of a Project
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - projectId not found
      NullArgumentException - projectId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.