diff --git a/web/src/main/java/org/cbioportal/web/StudyViewController.java b/web/src/main/java/org/cbioportal/web/StudyViewController.java index 6f3fa9070e5..1c39c58b524 100644 --- a/web/src/main/java/org/cbioportal/web/StudyViewController.java +++ b/web/src/main/java/org/cbioportal/web/StudyViewController.java @@ -100,31 +100,6 @@ private void init() { @Autowired private ClinicalEventService clinicalEventService; - - @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @RequestMapping(value = "/clinical-data-counts/fetch", method = RequestMethod.POST, - consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation("Fetch clinical data counts by study view filter") - public ResponseEntity> fetchClinicalDataCounts( - @ApiParam(required = true, value = "Clinical data count filter") - @Valid @RequestBody(required = false) ClinicalDataCountFilter clinicalDataCountFilter, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface - @RequestAttribute(required = false, value = "involvedCancerStudies") Collection involvedCancerStudies, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface. this attribute is needed for the @PreAuthorize tag above. - @Valid @RequestAttribute(required = false, value = "interceptedClinicalDataCountFilter") ClinicalDataCountFilter interceptedClinicalDataCountFilter) { - - List attributes = interceptedClinicalDataCountFilter.getAttributes(); - StudyViewFilter studyViewFilter = interceptedClinicalDataCountFilter.getStudyViewFilter(); - - if (attributes.size() == 1) { - studyViewFilterUtil.removeSelfFromFilter(attributes.get(0).getAttributeId(), studyViewFilter); - } - boolean singleStudyUnfiltered = studyViewFilterUtil.isSingleStudyUnfiltered(studyViewFilter); - List result = - instance.cachedClinicalDataCounts(interceptedClinicalDataCountFilter,singleStudyUnfiltered); - return new ResponseEntity<>(result, HttpStatus.OK); - - } @Cacheable( cacheResolver = "staticRepositoryCacheOneResolver", @@ -153,28 +128,6 @@ public List cachedClinicalDataCounts( return result; } - @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @RequestMapping(value = "/clinical-data-bin-counts/fetch", method = RequestMethod.POST, - consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation("Fetch clinical data bin counts by study view filter") - public ResponseEntity> fetchClinicalDataBinCounts( - @ApiParam("Method for data binning") - @RequestParam(defaultValue = "DYNAMIC") DataBinMethod dataBinMethod, - @ApiParam(required = true, value = "Clinical data bin count filter") - @Valid @RequestBody(required = false) ClinicalDataBinCountFilter clinicalDataBinCountFilter, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface - @RequestAttribute(required = false, value = "involvedCancerStudies") Collection involvedCancerStudies, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface. this attribute is needed for the @PreAuthorize tag above. - @Valid @RequestAttribute(required = false, value = "interceptedClinicalDataBinCountFilter") ClinicalDataBinCountFilter interceptedClinicalDataBinCountFilter - ) { - StudyViewFilter studyViewFilter = clinicalDataBinUtil.removeSelfFromFilter(interceptedClinicalDataBinCountFilter); - boolean singleStudyUnfiltered = studyViewFilterUtil.isSingleStudyUnfiltered(studyViewFilter); - List clinicalDataBins = - instance.cachableFetchClinicalDataBinCounts(dataBinMethod, interceptedClinicalDataBinCountFilter, singleStudyUnfiltered); - - return new ResponseEntity<>(clinicalDataBins, HttpStatus.OK); - } - @Cacheable( cacheResolver = "staticRepositoryCacheOneResolver", condition = "@cacheEnabledConfig.getEnabled() && #singleStudyUnfiltered" @@ -191,23 +144,6 @@ public List cachableFetchClinicalDataBinCounts( false ); } - - @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @RequestMapping(value = "/mutated-genes/fetch", method = RequestMethod.POST, - consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation("Fetch mutated genes by study view filter") - public ResponseEntity> fetchMutatedGenes( - @ApiParam(required = true, value = "Study view filter") - @Valid @RequestBody(required = false) StudyViewFilter studyViewFilter, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface - @RequestAttribute(required = false, value = "involvedCancerStudies") Collection involvedCancerStudies, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface. this attribute is needed for the @PreAuthorize tag above. - @Valid @RequestAttribute(required = false, value = "interceptedStudyViewFilter") StudyViewFilter interceptedStudyViewFilter - ) throws StudyNotFoundException { - boolean singleStudyUnfiltered = studyViewFilterUtil.isSingleStudyUnfiltered(interceptedStudyViewFilter); - List alterationCountByGenes = instance.cachedFetchMutatedGenes(interceptedStudyViewFilter, singleStudyUnfiltered); - return new ResponseEntity<>(alterationCountByGenes, HttpStatus.OK); - } @Cacheable( cacheResolver = "staticRepositoryCacheOneResolver", @@ -304,33 +240,6 @@ public List cacheableFetchCNAGenes(StudyViewFilter interc return copyNumberCountByGenes; } - @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @RequestMapping(value = "/filtered-samples/fetch", method = RequestMethod.POST, - consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ApiOperation("Fetch sample IDs by study view filter") - public ResponseEntity> fetchFilteredSamples( - @ApiParam("Whether to negate the study view filters") - @RequestParam(defaultValue = "false") Boolean negateFilters, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface - @RequestAttribute(required = false, value = "involvedCancerStudies") Collection involvedCancerStudies, - @ApiIgnore // prevent reference to this attribute in the swagger-ui interface. this attribute is needed for the @PreAuthorize tag above. - @Valid @RequestAttribute(required = false, value = "interceptedStudyViewFilter") StudyViewFilter interceptedStudyViewFilter, - @ApiParam(required = true, value = "Study view filter") - @Valid @RequestBody(required = false) StudyViewFilter studyViewFilter) { - - List studyIds = new ArrayList<>(); - List sampleIds = new ArrayList<>(); - - studyViewFilterUtil.extractStudyAndSampleIds( - studyViewFilterApplier.apply(interceptedStudyViewFilter, negateFilters), studyIds, sampleIds); - - List result = new ArrayList<>(); - if (!sampleIds.isEmpty()) { - result = sampleService.fetchSamples(studyIds, sampleIds, Projection.ID.name()); - } - return new ResponseEntity<>(result, HttpStatus.OK); - } - @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") @RequestMapping(value = "/molecular-profile-sample-counts/fetch", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) diff --git a/web/src/main/java/org/cbioportal/web/columnstore/StudyViewColumnStoreController.java b/web/src/main/java/org/cbioportal/web/columnstore/StudyViewColumnStoreController.java index 220171affd1..e2b4bb75c15 100644 --- a/web/src/main/java/org/cbioportal/web/columnstore/StudyViewColumnStoreController.java +++ b/web/src/main/java/org/cbioportal/web/columnstore/StudyViewColumnStoreController.java @@ -44,16 +44,14 @@ @Validated @Api(tags = "Study View Column Store") public class StudyViewColumnStoreController { - - private static final String COLUMN_STORE_ENDPOINT_PREFIX="/column-store"; - + @Autowired private StudyViewService studyViewService; @Autowired private ClinicalDataBinUtil clinicalDataBinUtil; @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @PostMapping(value = "/column-store/filtered-samples/fetch", + @PostMapping(value = "/filtered-samples/fetch", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation("Fetch sample IDs by study view filter") public ResponseEntity> fetchFilteredSamples( @@ -72,7 +70,7 @@ public ResponseEntity> fetchFilteredSamples( } @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @PostMapping(value = "/column-store/mutated-genes/fetch", + @PostMapping(value = "/mutated-genes/fetch", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation("Fetch mutated genes by study view filter") public ResponseEntity> fetchMutatedGenes( @@ -98,7 +96,7 @@ public ResponseEntity> fetchMutatedGenes( } @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @PostMapping(value = "/column-store/clinical-data-counts/fetch", + @PostMapping(value = "/clinical-data-counts/fetch", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation("Fetch clinical data counts by study view filter") public ResponseEntity> fetchClinicalDataCounts( @@ -124,7 +122,7 @@ public ResponseEntity> fetchClinicalDataCounts( } @PreAuthorize("hasPermission(#involvedCancerStudies, 'Collection', T(org.cbioportal.utils.security.AccessLevel).READ)") - @RequestMapping(value = "/column-store/clinical-data-bin-counts/fetch", method = RequestMethod.POST, + @RequestMapping(value = "/clinical-data-bin-counts/fetch", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation("Fetch clinical data bin counts by study view filter") public ResponseEntity> fetchClinicalDataBinCounts(