Search in sources :

Example 6 with DepositionSubmission

use of uk.ac.ebi.spot.goci.model.deposition.DepositionSubmission in project goci by EBISPOT.

the class DepositionPublicationServiceImpl method retrieveSubmission.

@Override
public DepositionSubmission retrieveSubmission(String id) {
    log.info("Retrieving submission using id [{}]", id);
    DepositionSubmission submission = null;
    Map<String, String> params = new HashMap<>();
    params.put("submissionID", id);
    String url = depositionIngestUri + "/submissions/{submissionID}";
    try {
        String response = template.getForObject(url, String.class, params);
        submission = template.getForObject(url, DepositionSubmission.class, params);
    } catch (HttpClientErrorException e) {
        System.out.println(e.getMessage());
    }
    return submission;
}
Also used : DepositionSubmission(uk.ac.ebi.spot.goci.model.deposition.DepositionSubmission) HttpClientErrorException(org.springframework.web.client.HttpClientErrorException) HashMap(java.util.HashMap)

Aggregations

DepositionSubmission (uk.ac.ebi.spot.goci.model.deposition.DepositionSubmission)6 Submission (uk.ac.ebi.spot.goci.model.deposition.Submission)4 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 HashMap (java.util.HashMap)2 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 ArrayList (java.util.ArrayList)1 TreeMap (java.util.TreeMap)1 Async (org.springframework.scheduling.annotation.Async)1 Transactional (org.springframework.transaction.annotation.Transactional)1 HttpClientErrorException (org.springframework.web.client.HttpClientErrorException)1 SecureUser (uk.ac.ebi.spot.goci.model.SecureUser)1 DepositionAssociationDto (uk.ac.ebi.spot.goci.model.deposition.DepositionAssociationDto)1 DepositionAuthor (uk.ac.ebi.spot.goci.model.deposition.DepositionAuthor)1 DepositionStudyDto (uk.ac.ebi.spot.goci.model.deposition.DepositionStudyDto)1 SubmissionImportProgress (uk.ac.ebi.spot.goci.model.deposition.SubmissionImportProgress)1