diff --git a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventcvm/controllers/AdverseEventCvmController.java b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventcvm/controllers/AdverseEventCvmController.java index 8f2b64d..6553ac3 100644 --- a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventcvm/controllers/AdverseEventCvmController.java +++ b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventcvm/controllers/AdverseEventCvmController.java @@ -103,6 +103,7 @@ protected Stream filterStream(Stream stream, b return stream; } + /* @PreAuthorize("isAuthenticated()") @GetGsrsRestApiMapping("/export/{etagId}/{format}") public ResponseEntity createExport(@PathVariable("etagId") String etagId, @@ -114,35 +115,6 @@ public ResponseEntity createExport(@PathVariable("etagId") String etagId HttpServletRequest request ) throws Exception { - /* - Optional etagObj = this.eTagRepository.findByEtag(etagId); - boolean publicOnly = publicOnlyObj == null ? true : publicOnlyObj; - if (!etagObj.isPresent()) { - return new ResponseEntity("could not find etag with Id " + etagId, this.gsrsControllerConfiguration.getHttpStatusFor(HttpStatus.BAD_REQUEST, parameters)); - } else { - ExportMetaData emd = new ExportMetaData(etagId, ((ETag) etagObj.get()).uri, "admin", publicOnly, format); - Stream mstream = new EtagExportGenerator(entityManager, transactionManager, HttpRequestHolder.fromRequest(request)).generateExportFrom(getEntityService().getContext(), etagObj.get()).get(); - - Stream effectivelyFinalStream = this.filterStream(mstream, publicOnly, parameters); - - if (fileName != null) { - emd.setDisplayFilename(fileName); - System.out.println("FILE NAME: " + fileName); - } - - ExportProcess p = this.exportService.createExport(emd, () -> { - return effectivelyFinalStream; - }); - p.run(this.taskExecutor, (out) -> { - return (Exporter) Unchecked.uncheck(() -> { - - return this.getExporterFor(format, out, publicOnly, parameters); - }); - }); - return new ResponseEntity(p.getMetaData(), HttpStatus.OK); - } - } - */ Optional etagObj = eTagRepository.findByEtag(etagId); @@ -185,6 +157,7 @@ private Exporter getExporterFor(String extension, OutputStream return factory.createNewExporter(pos, params); } } + */ public Optional injectSubstanceDetails(Optional application) { diff --git a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventdme/controllers/AdverseEventDmeController.java b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventdme/controllers/AdverseEventDmeController.java index 4edafba..a3977a6 100644 --- a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventdme/controllers/AdverseEventDmeController.java +++ b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventdme/controllers/AdverseEventDmeController.java @@ -104,6 +104,7 @@ protected Stream filterStream(Stream stream, b return stream; } + /* @PreAuthorize("isAuthenticated()") @GetGsrsRestApiMapping("/export/{etagId}/{format}") public ResponseEntity createExport(@PathVariable("etagId") String etagId, @@ -115,34 +116,6 @@ public ResponseEntity createExport(@PathVariable("etagId") String etagId HttpServletRequest request ) throws Exception { - /* - Optional etagObj = this.eTagRepository.findByEtag(etagId); - boolean publicOnly = publicOnlyObj == null ? true : publicOnlyObj; - if (!etagObj.isPresent()) { - return new ResponseEntity("could not find etag with Id " + etagId, this.gsrsControllerConfiguration.getHttpStatusFor(HttpStatus.BAD_REQUEST, parameters)); - } else { - ExportMetaData emd = new ExportMetaData(etagId, ((ETag) etagObj.get()).uri, "admin", publicOnly, format); - Stream mstream = new EtagExportGenerator(entityManager, transactionManager, HttpRequestHolder.fromRequest(request)).generateExportFrom(getEntityService().getContext(), etagObj.get()).get(); - - Stream effectivelyFinalStream = this.filterStream(mstream, publicOnly, parameters); - - if (fileName != null) { - emd.setDisplayFilename(fileName); - } - - ExportProcess p = this.exportService.createExport(emd, () -> { - return effectivelyFinalStream; - }); - p.run(this.taskExecutor, (out) -> { - return (Exporter) Unchecked.uncheck(() -> { - - return this.getExporterFor(format, out, publicOnly, parameters); - }); - }); - return new ResponseEntity(p.getMetaData(), HttpStatus.OK); - } - } - */ Optional etagObj = eTagRepository.findByEtag(etagId); @@ -185,6 +158,7 @@ private Exporter getExporterFor(String extension, OutputStream return factory.createNewExporter(pos, params); } } + */ public Optional injectSubstanceDetails(Optional application) { diff --git a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventpt/controllers/AdverseEventPtController.java b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventpt/controllers/AdverseEventPtController.java index ac02575..1f442fb 100644 --- a/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventpt/controllers/AdverseEventPtController.java +++ b/gsrs-module-adverse-events-spring-boot-autoconfigure/src/main/java/gov/hhs/gsrs/adverseevents/adverseeventpt/controllers/AdverseEventPtController.java @@ -103,6 +103,7 @@ protected Stream filterStream(Stream stream, boo return stream; } + /* @PreAuthorize("isAuthenticated()") @GetGsrsRestApiMapping("/export/{etagId}/{format}") public ResponseEntity createExport(@PathVariable("etagId") String etagId, @@ -114,34 +115,7 @@ public ResponseEntity createExport(@PathVariable("etagId") String etagId HttpServletRequest request ) throws Exception { - /* - Optional etagObj = this.eTagRepository.findByEtag(etagId); - boolean publicOnly = publicOnlyObj == null ? true : publicOnlyObj; - if (!etagObj.isPresent()) { - return new ResponseEntity("could not find etag with Id " + etagId, this.gsrsControllerConfiguration.getHttpStatusFor(HttpStatus.BAD_REQUEST, parameters)); - } else { - ExportMetaData emd = new ExportMetaData(etagId, ((ETag) etagObj.get()).uri, "admin", publicOnly, format); - Stream mstream = new EtagExportGenerator(entityManager, transactionManager, HttpRequestHolder.fromRequest(request)).generateExportFrom(getEntityService().getContext(), etagObj.get()).get(); - - Stream effectivelyFinalStream = this.filterStream(mstream, publicOnly, parameters); - - if (fileName != null) { - emd.setDisplayFilename(fileName); - } - - ExportProcess p = this.exportService.createExport(emd, () -> { - return effectivelyFinalStream; - }); - p.run(this.taskExecutor, (out) -> { - return (Exporter) Unchecked.uncheck(() -> { - - return this.getExporterFor(format, out, publicOnly, parameters); - }); - }); - return new ResponseEntity(p.getMetaData(), HttpStatus.OK); - } - */ Optional etagObj = eTagRepository.findByEtag(etagId); boolean publicOnly = publicOnlyObj==null? true: publicOnlyObj; @@ -183,6 +157,7 @@ private Exporter getExporterFor(String extension, OutputStream p return factory.createNewExporter(pos, params); } } + */ @GetGsrsRestApiMapping("/faersdashboard/{name}") public ResponseEntity findFaersDashboardRecordByName(@PathVariable("name") String name) throws Exception {