Class ProjectSamplesAjaxController


  • @RestController
    @RequestMapping("/ajax/projects/{projectId}/samples")
    public class ProjectSamplesAjaxController
    extends java.lang.Object
    AJAX Controller for handling asynchronous requests for project samples.
    • Method Detail

      • validateNewSampleName

        @RequestMapping("/add-sample/validate")
        public org.springframework.http.ResponseEntity<SampleNameValidationResponse> validateNewSampleName​(@RequestParam
                                                                                                           java.lang.String name,
                                                                                                           @PathVariable
                                                                                                           long projectId,
                                                                                                           java.util.Locale locale)
        Ensure a potential sample name meets criteria
        Parameters:
        name - to evaluate
        projectId - current project identifier
        locale - current users locale
        Returns:
        result of validating the name. Error status returned if name does not meet criteria.
      • createSampleInProject

        @PostMapping("/add-sample")
        public org.springframework.http.ResponseEntity<AjaxResponse> createSampleInProject​(@RequestBody
                                                                                           CreateSampleRequest request,
                                                                                           @PathVariable
                                                                                           long projectId,
                                                                                           java.util.Locale locale)
        Create a new sample within a project
        Parameters:
        request - Details about the sample
        projectId - current project identifier
        locale - current users locale
        Returns:
        result of creating the project
      • updateSampleInProject

        @PatchMapping("/add-sample/{sampleId}")
        public org.springframework.http.ResponseEntity<AjaxResponse> updateSampleInProject​(@RequestBody
                                                                                           UpdateSampleRequest request,
                                                                                           @PathVariable
                                                                                           long sampleId,
                                                                                           java.util.Locale locale)
        Update a sample within a project
        Parameters:
        request - Details about the sample
        sampleId - sample identifier
        locale - current users locale
        Returns:
        result of creating the project
      • getPagedProjectSamples

        @PostMapping("")
        public org.springframework.http.ResponseEntity<AntTableResponse<ProjectSampleTableItem>> getPagedProjectSamples​(@PathVariable
                                                                                                                        java.lang.Long projectId,
                                                                                                                        @RequestBody
                                                                                                                        ProjectSamplesTableRequest request,
                                                                                                                        java.util.Locale locale)
        Returns a Page of samples for a project based on the information in the ProjectSamplesTableRequest
        Parameters:
        projectId - Identifier for the current project
        request - Information about the current state of the project samples table.
        locale - Current users locale
        Returns:
        The Page of samples
      • getMinimalSampleDetailsForFilteredProject

        @PostMapping("/ids")
        public org.springframework.http.ResponseEntity<java.util.List<ProjectCartSample>> getMinimalSampleDetailsForFilteredProject​(@PathVariable
                                                                                                                                    java.lang.Long projectId,
                                                                                                                                    @RequestBody
                                                                                                                                    ProjectSamplesTableRequest request)
        Get a list of all samples in the current project and associated project that have been filtered, return a minimal representation of them.
        Parameters:
        projectId - Identifier for the current project
        request - Details about the state of the filters
        Returns:
        list of minimal samples
      • mergeSamples

        @PostMapping("/merge")
        public org.springframework.http.ResponseEntity<AjaxResponse> mergeSamples​(@PathVariable
                                                                                  java.lang.Long projectId,
                                                                                  @RequestBody
                                                                                  MergeRequest request,
                                                                                  java.util.Locale locale)
        Merge 1 or more samples into another sample.
        Parameters:
        projectId - Identifier for the current project
        request - All information about the samples to merge
        locale - current users locale information
        Returns:
        result of the merge
      • removeSamplesFromProject

        @DeleteMapping("/remove")
        public org.springframework.http.ResponseEntity<AjaxResponse> removeSamplesFromProject​(@PathVariable
                                                                                              long projectId,
                                                                                              @RequestBody
                                                                                              RemoveSamplesRequest request)
        Remove 1 or more samples from a project.
        Parameters:
        projectId - Identifier for the project
        request - All information about the samples to remove
        Returns:
        result of the removal
      • downloadSamples

        @PostMapping("/download")
        public org.springframework.http.ResponseEntity<org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody> downloadSamples​(@PathVariable
                                                                                                                                                    long projectId,
                                                                                                                                                    @RequestBody
                                                                                                                                                    DownloadRequest request,
                                                                                                                                                    javax.servlet.http.HttpServletResponse response)
        Download a zipped file containing sequencing reads for a list of samples.
        Parameters:
        projectId - Identifier for a project
        request - Details about the download request including a list of sample identifiers
        response - HttpServletResponse
        Returns:
        Zipped file of sequence files
      • downloadSamplesSpreadsheet

        @PostMapping("/export")
        public void downloadSamplesSpreadsheet​(@PathVariable
                                               long projectId,
                                               @RequestParam
                                               java.lang.String type,
                                               @RequestBody
                                               ProjectSamplesTableRequest request,
                                               javax.servlet.http.HttpServletResponse response,
                                               java.util.Locale locale)
                                        throws java.io.IOException
        Export the current state of the Project Samples table as either a CSV or Excel file.
        Parameters:
        projectId - Identifier for the current project
        type - Type of file to export (CSV or Excel)
        request - Current state of the samples table
        response - HttpServletResponse
        locale - current users Locale
        Throws:
        java.io.IOException - Thrown if issue export the file
      • shareSamplesWithProject

        @PostMapping("/share")
        public org.springframework.http.ResponseEntity<AjaxResponse> shareSamplesWithProject​(@RequestBody
                                                                                             ShareSamplesRequest request,
                                                                                             java.util.Locale locale)
        Share / Move samples between projects
        Parameters:
        request - ShareSamplesRequest details about the samples to share
        locale - current users Locale
        Returns:
        Outcome of the share/move
      • getFilesForSamples

        @GetMapping("/files")
        public SampleFilesResponse getFilesForSamples​(@RequestParam
                                                      java.util.List<java.lang.Long> ids,
                                                      @PathVariable
                                                      java.lang.Long projectId)
        Get the set of files for samples by the sample identifiers
        Parameters:
        ids - List of identifiers for the samples to get files for.
        projectId - The project the samples belong to
        Returns:
        SampleFilesResponse a map of sample identifier and their corresponding files
      • validateSampleNames

        @PostMapping("/validate")
        public org.springframework.http.ResponseEntity<AjaxResponse> validateSampleNames​(@PathVariable
                                                                                         java.lang.Long projectId,
                                                                                         @RequestBody
                                                                                         ValidateSampleNamesRequest request)
        Validate a list of samples names
        Parameters:
        projectId - project identifier
        request - ValidateSampleNamesRequest details about the sample names to validate
        Returns:
        a list of validated sample names