-
Notifications
You must be signed in to change notification settings - Fork 2
Submit endpoint4 #1050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Submit endpoint4 #1050
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b2797f3
started on submit endpoint, refactoring now
danielfang97 1684dbd
added collectionservice as a service class to help with submit
danielfang97 10d5b60
removed collectionChoices, added JsonUtil, and moved some other methods
danielfang97 249a2a2
moved readSbol function into sbolservice
danielfang97 16e260d
updated to 3.4.13 for spring boot to use RestClient
danielfang97 f7e3c3f
moved attachment part of submit to attachmentservice
danielfang97 f7aa50a
Merge branch 'main' into submitEndpoint4
danielfang97 10a67e9
missing a comma throwing an error
danielfang97 0eb63b1
missing imports in submit controller
danielfang97 2a7f76b
Merge branch 'main' into submitEndpoint4
danielfang97 8bc18f6
got sboltestrunner running
danielfang97 6fa1bfb
fixed an issue with the jar file when running sboltestrunner on github
danielfang97 bea16bc
removed a tag that caused the test to fail
danielfang97 e2dabe1
fixed an issue where the change log said there was a file diff in tes…
danielfang97 167f6a5
added a rewriter to download so that prefixes match (may revert)
danielfang97 2148bca
applied same fix as search refactor branch for admin graphs
danielfang97 777f6c2
added python installs to sbolsuite test script
danielfang97 dc96ac5
fixed an issue with some unique prefixes messing up the rewriter
danielfang97 9794730
Merge branch 'main' into submitEndpoint4
danielfang97 914bb8e
Merge branch 'main' into submitEndpoint4
danielfang97 a4a2ac5
fixed some issues that arose due to merge conflicts
danielfang97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
backend/src/main/java/com/synbiohub/sbh3/controllers/ExposeController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package com.synbiohub.sbh3.controllers; | ||
|
|
||
| import com.synbiohub.sbh3.submit.SubmitExposeRegistry; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.core.io.FileSystemResource; | ||
| import org.springframework.core.io.Resource; | ||
| import org.springframework.http.HttpHeaders; | ||
| import org.springframework.http.MediaType; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| import java.net.URLConnection; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
|
|
||
| @RestController | ||
| @RequiredArgsConstructor | ||
| public class ExposeController { | ||
|
|
||
| private final SubmitExposeRegistry exposeRegistry; | ||
|
|
||
| @GetMapping("/expose/{token}") | ||
| public ResponseEntity<Resource> exposeFile(@PathVariable String token) { | ||
| Path file = exposeRegistry.resolve(token); | ||
| if (file == null || !Files.isRegularFile(file)) { | ||
| return ResponseEntity.notFound().build(); | ||
| } | ||
| String filename = file.getFileName().toString(); | ||
| String contentType = URLConnection.guessContentTypeFromName(filename); | ||
| MediaType mediaType = contentType != null | ||
| ? MediaType.parseMediaType(contentType) | ||
| : MediaType.APPLICATION_OCTET_STREAM; | ||
| return ResponseEntity.ok() | ||
| .header(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + filename + "\"") | ||
| .contentType(mediaType) | ||
| .body(new FileSystemResource(file)); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
backend/src/main/java/com/synbiohub/sbh3/dto/SubmissionDTO.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
backend/src/main/java/com/synbiohub/sbh3/dto/SubmitFileFormat.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.synbiohub.sbh3.dto; | ||
|
|
||
| public enum SubmitFileFormat { | ||
| SBOL, GENBANK, FASTA, GFF3, ATTACHMENT | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this file for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for helping with submit plugins. The plugin needs access to the file that it is trying to convert. So, this gives the plugin a link to download the file. After it's downloaded, SynBioHub deletes the link.