Class UIProjectsService


  • @Component
    public class UIProjectsService
    extends java.lang.Object
    A utility class for formatting responses for the project members page UI.
    • Method Detail

      • createProject

        public java.lang.Long createProject​(CreateProjectRequest request)
                                     throws EntityExistsException,
                                            javax.validation.ConstraintViolationException
        Create a new project based on a request sent by the UI.
        Parameters:
        request - CreateProjectRequest containing (at the very least) the name for the project
        Returns:
        the identifier for the newly created project
        Throws:
        EntityExistsException - if the project already exists.
        javax.validation.ConstraintViolationException - if there was a constraint violation with the parameters passed.
      • getProjectRoles

        public java.util.List<Role> getProjectRoles​(java.util.Locale locale)
        Get a list of all roles available on a project
        Parameters:
        locale - - Locale
        Returns:
        list of roles and their internationalized strings
      • getPagedProjects

        public TableResponse getPagedProjects​(TableRequest tableRequest,
                                              java.lang.Boolean isAdmin)
        Get the table contents for the projects listing table based on the user and table request.
        Parameters:
        tableRequest - - TableRequest
        isAdmin - - whether this is the full administration table or a user listing.
        Returns:
        TableResponse with the current list of projects
      • updateProjectDetails

        public java.lang.String updateProjectDetails​(java.lang.Long projectId,
                                                     UpdateProjectAttributeRequest request,
                                                     java.util.Locale locale)
                                              throws UpdateException
        Update a field within the project details.
        Parameters:
        projectId - Long identifier for the project
        request - UpdateProjectAttributeRequest details about which field to update
        locale - Locale for the currently logged in user
        Returns:
        String explaining to the user the results of the update.
        Throws:
        UpdateException - thrown if the update cannot be performed
      • updateProcessingPriority

        public java.lang.String updateProcessingPriority​(java.lang.Long projectId,
                                                         AnalysisSubmission.Priority priority,
                                                         java.util.Locale locale)
                                                  throws UpdateException
        Update the priority for a projects automated pipelines.
        Parameters:
        projectId - Identifier for a project
        priority - updated AnalysisSubmission.Priority for running automated workflows
        locale - currently logged in users locale
        Returns:
        Message to user about the status of the priority update
        Throws:
        UpdateException - thrown if the update cannot be performed
      • updateProcessingCoverage

        public java.lang.String updateProcessingCoverage​(Coverage coverage,
                                                         java.lang.Long projectId,
                                                         java.util.Locale locale)
                                                  throws UpdateException
        Update the minimum, maximum coverage or genome size for a project.
        Parameters:
        coverage - Details about the update to either the minimum/maximum coverage or genome size
        projectId - identifier for a Project
        locale - Currently logged in users locale
        Returns:
        message to the user about the result of the update
        Throws:
        UpdateException - thrown if there was an error updated the coverage.
      • deleteProject

        public void deleteProject​(java.lang.Long projectId)
                           throws EntityNotFoundException
        Delete a project
        Parameters:
        projectId - identifier for the project to delete
        Throws:
        EntityNotFoundException - thrown if the identifier does not exist in the database
      • getPotentialProjectsToShareTo

        public java.util.List<Project> getPotentialProjectsToShareTo​(long currentId)
        Get a list of projects that the user can share sample to.
        Parameters:
        currentId - Current project identifier
        Returns:
        List of Projects