-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.x-dev' into 2.x-stable
- Loading branch information
Showing
16 changed files
with
366 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
69 changes: 69 additions & 0 deletions
69
...tion/src/main/java/uk/ac/ebi/spot/goci/curation/controller/SplitSubmissionController.java
This file contains 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,69 @@ | ||
package uk.ac.ebi.spot.goci.curation.controller; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.Model; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import uk.ac.ebi.spot.goci.curation.service.deposition.DepositionSubmissionService; | ||
import uk.ac.ebi.spot.goci.curation.service.deposition.SubmissionImportProgressService; | ||
import uk.ac.ebi.spot.goci.model.deposition.Submission; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Controller | ||
public class SplitSubmissionController { | ||
|
||
private final DepositionSubmissionService submissionService; | ||
|
||
private final SubmissionImportProgressService submissionImportProgressService; | ||
|
||
private Logger log = LoggerFactory.getLogger(getClass()); | ||
|
||
protected Logger getLog() { | ||
return log; | ||
} | ||
|
||
@Value("${deposition.ingest.uri}") | ||
private String depositionIngestURL; | ||
|
||
public SplitSubmissionController(@Autowired DepositionSubmissionService submissionService, | ||
SubmissionImportProgressService submissionImportProgressService) { | ||
this.submissionService = submissionService; | ||
this.submissionImportProgressService = submissionImportProgressService; | ||
} | ||
|
||
@RequestMapping(value = "/imported_submissions", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) | ||
public String importedSubmissionsPage(Model model) { | ||
Map<String, Submission> submissionList = submissionService.getSubmissionsByStatus("CURATION_COMPLETE"); | ||
model.addAttribute("submissions", submissionList.values()); | ||
return "view_submissions"; | ||
} | ||
|
||
@RequestMapping(value = "/in_progress_submissions", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) | ||
public String inProgressSubmissionsPage(Model model) { | ||
List<String> submissionIds = submissionImportProgressService.getSubmissions(); | ||
Map<String, Submission> submissionList = submissionService.getSubmissionsById(submissionIds); | ||
model.addAttribute("submissions", submissionList.values()); | ||
return "view_submissions"; | ||
} | ||
|
||
@RequestMapping(value = "/failed_submissions", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) | ||
public String failedSubmissionsPage(Model model) { | ||
Map<String, Submission> submissionList = submissionService.getSubmissionsByStatus("IMPORT_FAILED"); | ||
model.addAttribute("submissions", submissionList.values()); | ||
return "view_submissions"; | ||
} | ||
|
||
@RequestMapping(value = "/other_submissions", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET) | ||
public String otherSubmissionsPage(Model model) { | ||
Map<String, Submission> submissionList = submissionService.getOtherSubmissions(); | ||
model.addAttribute("submissions", submissionList.values()); | ||
return "view_submissions"; | ||
} | ||
} |
This file contains 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 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 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
20 changes: 20 additions & 0 deletions
20
...aces/goci-curation/src/main/resources/templates/fragments/submission_navigation_tabs.html
This file contains 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,20 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org" | ||
xmlns="http://www.w3.org/1999/xhtml"> | ||
|
||
<body th:fragment="tabs"> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<ul class="nav nav-tabs"> | ||
<li><a th:href="@{/submissions}">Ready to import</a></li> | ||
<li><a th:href="@{/in_progress_submissions}">In progress</a></li> | ||
<li><a th:href="@{/failed_submissions}">Import failed</a></li> | ||
<li><a th:href="@{/imported_submissions}">Imported</a></li> | ||
<li><a th:href="@{/other_submissions}">Other</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
<br/> | ||
</body> | ||
</html> |
This file contains 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 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
Oops, something went wrong.