Skip to content

Commit

Permalink
Merge pull request #32 from KPMP/KPMP-5588_show_multiple_dois
Browse files Browse the repository at this point in the history
KPMP-5588: allow multiple dois for single file
  • Loading branch information
rlreamy authored Sep 25, 2024
2 parents 0f5e1e1 + 327c2f3 commit d5771d9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public RepositoryDatasetDisplay(RepositoryFileDataset repositoryFile) {
if(shouldAdd(repositoryFile.getSex())){
sex.add(repositoryFile.getSex());
}
if(shouldAdd(repositoryFile.getDoi())){
doi.add(repositoryFile.getDoi());
if(shouldAdd(repositoryFile.getId().getDoi())){
doi.add(repositoryFile.getId().getDoi());
}
if(shouldAdd(repositoryFile.getProtocol())){
protocol.add(repositoryFile.getProtocol());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public List<RepositoryDatasetDisplay> getRepositoryDataset() throws Exception {
displayFile.addProtocol(repositoryDataset.getProtocol());
displayFile.addTissueSource(repositoryDataset.getTissueSource());
displayFile.addExperimentalStrategy(repositoryDataset.getId().getExperimentalStrategy());
displayFile.addDoi(repositoryDataset.getId().getDoi());
displayFile.addWorkflowType(repositoryDataset.getWorkflowType());
displayFile.setAccess(repositoryDataset.getAccess());
displayFiles.put(repositoryDataset.getId().getDlFileId(), displayFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class RepositoryFileDataset {
private String tissueType;
private String ageBinned;
private String sex;
private String doi;
private String access;
private String platform;
private String dataCategory;
Expand Down Expand Up @@ -68,16 +67,6 @@ public void setSex(String sex) {
this.sex = sex;
}

@Nullable

public String getDoi() {
return doi;
}

public void setDoi(String doi) {
this.doi = doi;
}

public String getAccess() {
return access;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class RepositoryFileDatasetId implements Serializable{
private String dlFileId;
private String redcapId;
private String experimentalStrategy;
private String doi;

@Column(name = "dl_file_id")
public String getDlFileId() {
Expand All @@ -34,4 +35,14 @@ public String getExperimentalStrategy() {
public void setExperimentalStrategy(String experimentalStrategy) {
this.experimentalStrategy = experimentalStrategy;
}

public String getDoi() {
return this.doi;
}

public void setDoi(String doi) {
if (doi != null && !doi.isEmpty()){
this.doi = doi;
}
}
}
1 change: 0 additions & 1 deletion src/test/java/org/kpmp/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public void testGetRepositoryDataset() throws Exception {
repositoryFileDataset.setDataCategory("data_category");
repositoryFileDataset.setDataFormat(".xlsx");
repositoryFileDataset.setDataType("dataType");
repositoryFileDataset.setDoi("doi");
repositoryFileDataset.setFileName("Filename.xlsx");
repositoryFileDataset.setFileSize(size);
repositoryFileDataset.setPackageId("package_id");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ public void setSex() {
assertEquals("sex", repositoryDataset.getSex());
}

@Test
public void setDoi() {
repositoryDataset.setDoi("doi_text");
assertEquals("doi_text", repositoryDataset.getDoi());
}

@Test
public void setAccess() {
repositoryDataset.setAccess("open");
Expand Down

0 comments on commit d5771d9

Please sign in to comment.