Search in sources :

Example 21 with DiseaseTrait

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

the class OldDiseaseTraitController method viewDiseaseTraitToDelete.

// Delete a disease trait
@RequestMapping(value = "/{diseaseTraitId}/delete", produces = MediaType.TEXT_HTML_VALUE, method = RequestMethod.GET)
public String viewDiseaseTraitToDelete(Model model, @PathVariable Long diseaseTraitId) {
    DiseaseTrait diseaseTraitToView = diseaseTraitRepository.findOne(diseaseTraitId);
    Collection<Study> studiesLinkedToTrait = studyRepository.findByDiseaseTraitId(diseaseTraitId);
    model.addAttribute("studies", studiesLinkedToTrait);
    model.addAttribute("totalStudies", studiesLinkedToTrait.size());
    model.addAttribute("diseaseTrait", diseaseTraitToView);
    return "delete_disease_trait";
}
Also used : Study(uk.ac.ebi.spot.goci.model.Study) DiseaseTrait(uk.ac.ebi.spot.goci.model.DiseaseTrait) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 22 with DiseaseTrait

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

the class DiseaseTraitLogAspect method createDiseaseTraitLogs.

@Around("createDiseaseTrait()")
public Object createDiseaseTraitLogs(ProceedingJoinPoint joinPoint) throws Throwable {
    long start = timeNow();
    List<Object> arguments = Arrays.asList(joinPoint.getArgs());
    log.info("Creating {}: {}", EntityType.DISEASE_TRAIT, arguments);
    DiseaseTrait diseaseTrait = (DiseaseTrait) joinPoint.proceed();
    log.info("{} created: {} in {}s", EntityType.DISEASE_TRAIT, diseaseTrait.getId(), timeNow() - start);
    return diseaseTrait;
}
Also used : DiseaseTrait(uk.ac.ebi.spot.goci.model.DiseaseTrait) Around(org.aspectj.lang.annotation.Around)

Aggregations

DiseaseTrait (uk.ac.ebi.spot.goci.model.DiseaseTrait)22 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 PageRequest (org.springframework.data.domain.PageRequest)4 Pageable (org.springframework.data.domain.Pageable)4 Sort (org.springframework.data.domain.Sort)4 Study (uk.ac.ebi.spot.goci.model.Study)4 ControllerLinkBuilder (org.springframework.hateoas.mvc.ControllerLinkBuilder)2 ResponseEntity (org.springframework.http.ResponseEntity)2 DiseaseTraitDto (uk.ac.ebi.spot.goci.curation.dto.DiseaseTraitDto)2 CsvMapper (com.fasterxml.jackson.dataformat.csv.CsvMapper)1 CsvSchema (com.fasterxml.jackson.dataformat.csv.CsvSchema)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 java.util (java.util)1 ArrayList (java.util.ArrayList)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Collectors (java.util.stream.Collectors)1 CosineDistance (org.apache.commons.text.similarity.CosineDistance)1 LevenshteinDistance (org.apache.commons.text.similarity.LevenshteinDistance)1