Skip to content

Commit

Permalink
Merge pull request #561 from overture-stack/rc/3.1.0
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
rtisma authored Dec 10, 2019
2 parents a47ccb6 + c58317c commit 746dff6
Show file tree
Hide file tree
Showing 37 changed files with 505 additions and 385 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<groupId>bio.overture</groupId>
<artifactId>song</artifactId>
<packaging>pom</packaging>
<version>3.0.1</version>
<version>3.1.0</version>
<modules>
<module>song-core</module>
<module>song-java-sdk</module>
Expand Down
6 changes: 3 additions & 3 deletions song-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -35,12 +35,12 @@
<dependency>
<groupId>bio.overture</groupId>
<artifactId>song-java-sdk</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>bio.overture</groupId>
<artifactId>song-core</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</dependency>

<!-- CLI -->
Expand Down
2 changes: 1 addition & 1 deletion song-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
@AllArgsConstructor
public class FileUpdateResponse {
private FileUpdateTypes fileUpdateType;
private AnalysisStates originalAnalysisState;
private boolean unpublishedAnalysis;
@Deprecated private AnalysisStates originalAnalysisState;
@Deprecated private boolean unpublishedAnalysis;
private String message;
private FileDTO originalFile;
}
2 changes: 1 addition & 1 deletion song-java-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions song-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>song</artifactId>
<groupId>bio.overture</groupId>
<version>3.0.1</version>
<version>3.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -37,7 +37,7 @@
<dependency>
<groupId>bio.overture</groupId>
<artifactId>song-core</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
</dependency>

<!-- Spring -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

import bio.overture.song.server.model.dto.GenericMessage;
import bio.overture.song.server.model.entity.Study;
import bio.overture.song.server.model.entity.composites.StudyWithDonors;
import bio.overture.song.server.service.StudyService;
Expand Down Expand Up @@ -78,7 +79,7 @@ public List<String> findAllStudies() {
consumes = {APPLICATION_JSON_VALUE, APPLICATION_JSON_UTF8_VALUE})
@PreAuthorize("@studySecurity.authorize(authentication, #studyId)")
@ResponseBody
public String saveStudy(
public GenericMessage saveStudy(
@PathVariable("studyId") String studyId,
@RequestHeader(value = AUTHORIZATION, required = false) final String accessToken,
@RequestBody Study study) {
Expand All @@ -89,6 +90,6 @@ public String saveStudy(
"The studyId in the URL '%s' should match the studyId '%s' in the payload",
studyId,
study.getStudyId());
return studyService.saveStudy(study);
return new GenericMessage(studyService.saveStudy(study));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package bio.overture.song.server.model.dto;

import lombok.NonNull;
import lombok.Value;

@Value
public class GenericMessage {
@NonNull private final String message;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018. Ontario Institute for Cancer Research
* Copyright (c) 2018 - 2019. Ontario Institute for Cancer Research
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand All @@ -17,8 +17,6 @@

package bio.overture.song.server.model.entity;

import static bio.overture.song.server.model.enums.Constants.DONOR_GENDER;
import static bio.overture.song.server.model.enums.Constants.validate;
import static bio.overture.song.server.model.enums.TableNames.DONOR;

import bio.overture.song.core.model.Metadata;
Expand All @@ -30,18 +28,20 @@
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@Entity
@Table(name = DONOR)
@Data
@Builder
@RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonPropertyOrder({
Expand All @@ -68,23 +68,6 @@ public class Donor extends Metadata {
@Column(name = TableAttributeNames.GENDER, nullable = true)
private String donorGender;

// NOTE: Since the donorGender field is validated upon setting it, using Lomboks default Builder
// when
// the @AllArgsConstructor is used will by pass the validation since the Builder uses the All Arg
// Constructor.
// By using the setter inside the constructor, the building of a Donor will always be validated
public Donor(String donorId, String studyId, String donorSubmitterId, String donorGender) {
this.donorId = donorId;
this.studyId = studyId;
this.donorSubmitterId = donorSubmitterId;
setDonorGender(donorGender);
}

public void setDonorGender(String gender) {
validate(DONOR_GENDER, gender);
this.donorGender = gender;
}

public void setWithDonor(@NonNull Donor donorUpdate) {
setDonorSubmitterId(donorUpdate.getDonorSubmitterId());
setDonorGender(donorUpdate.getDonorGender());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package bio.overture.song.server.model.entity;

import static bio.overture.song.core.model.enums.AccessTypes.resolveAccessType;

import bio.overture.song.core.model.File;
import bio.overture.song.core.model.FileData;
import bio.overture.song.core.model.Metadata;
Expand All @@ -32,18 +30,20 @@
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@Entity
@Table(name = TableNames.FILE)
@Data
@Builder
@RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
Expand Down Expand Up @@ -74,38 +74,19 @@ public class FileEntity extends Metadata implements Serializable, FileData, File
@Column(name = TableAttributeNames.ACCESS, nullable = false)
private String fileAccess;

public FileEntity(
String objectId,
String studyId,
String analysisId,
String fileName,
Long fileSize,
String fileType,
String fileMd5sum,
String fileAccess) {
this.objectId = objectId;
this.studyId = studyId;
this.analysisId = analysisId;
this.fileName = fileName;
this.fileSize = fileSize;
setFileType(fileType);
this.fileMd5sum = fileMd5sum;
setFileAccess(fileAccess);
public void setFileType(@NonNull String fileType) {
this.fileType = fileType;
}

public void setFileType(FileTypes type) {
public void setFileType(@NonNull FileTypes type) {
this.fileType = type.toString();
}

public void setFileType(String type) {
setFileType(FileTypes.resolveFileType(type));
public void setFileAccess(@NonNull String fileAccess) {
this.fileAccess = fileAccess;
}

public void setFileAccess(@NonNull AccessTypes access) {
this.fileAccess = access.toString();
}

public void setFileAccess(@NonNull String access) {
setFileAccess(resolveAccessType(access));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018. Ontario Institute for Cancer Research
* Copyright (c) 2018 - 2019. Ontario Institute for Cancer Research
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand All @@ -17,9 +17,6 @@

package bio.overture.song.server.model.entity;

import static bio.overture.song.server.model.enums.Constants.SAMPLE_TYPE;
import static bio.overture.song.server.model.enums.Constants.validate;

import bio.overture.song.core.model.Metadata;
import bio.overture.song.server.model.enums.TableAttributeNames;
import bio.overture.song.server.model.enums.TableNames;
Expand All @@ -28,18 +25,20 @@
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@Entity
@Table(name = TableNames.SAMPLE)
@Data
@Builder
@RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.ALWAYS)
Expand All @@ -58,18 +57,6 @@ public class Sample extends Metadata {
@Column(name = TableAttributeNames.TYPE, nullable = false)
private String sampleType;

public Sample(String sampleId, String specimenId, String sampleSubmitterId, String sampleType) {
this.sampleId = sampleId;
this.specimenId = specimenId;
this.sampleSubmitterId = sampleSubmitterId;
setSampleType(sampleType);
}

public void setSampleType(String type) {
validate(SAMPLE_TYPE, type);
sampleType = type;
}

public void setWithSample(@NonNull Sample u) {
setSampleId(u.getSampleId());
setSampleSubmitterId(u.getSampleSubmitterId());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018. Ontario Institute for Cancer Research
* Copyright (c) 2018-2019. Ontario Institute for Cancer Research
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand All @@ -17,10 +17,6 @@

package bio.overture.song.server.model.entity;

import static bio.overture.song.server.model.enums.Constants.SPECIMEN_CLASS;
import static bio.overture.song.server.model.enums.Constants.SPECIMEN_TYPE;
import static bio.overture.song.server.model.enums.Constants.validate;

import bio.overture.song.core.model.Metadata;
import bio.overture.song.server.model.enums.TableAttributeNames;
import bio.overture.song.server.model.enums.TableNames;
Expand All @@ -29,18 +25,20 @@
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@Entity
@Table(name = TableNames.SPECIMEN)
@Data
@Builder
@RequiredArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
Expand All @@ -62,29 +60,6 @@ public class Specimen extends Metadata {
@Column(name = TableAttributeNames.TYPE, nullable = false)
private String specimenType;

public Specimen(
String specimenId,
String donorId,
String specimenSubmitterId,
String specimenClass,
String specimenType) {
this.specimenId = specimenId;
this.donorId = donorId;
this.specimenSubmitterId = specimenSubmitterId;
setSpecimenClass(specimenClass);
setSpecimenType(specimenType);
}

public void setSpecimenClass(String specimenClass) {
validate(SPECIMEN_CLASS, specimenClass);
this.specimenClass = specimenClass;
}

public void setSpecimenType(String type) {
validate(SPECIMEN_TYPE, type);
specimenType = type;
}

public void setWithSpecimen(@NonNull Specimen specimenUpdate) {
setSpecimenSubmitterId(specimenUpdate.getSpecimenSubmitterId());
setDonorId(specimenUpdate.getDonorId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public static class UriTemplateProperties {
private String donor;
private String specimen;
private String sample;
private String file;
}

@Getter
Expand Down
Loading

0 comments on commit 746dff6

Please sign in to comment.