diff --git a/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetDisplay.java b/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetDisplay.java index 6b6be67..b7d9949 100644 --- a/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetDisplay.java +++ b/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetDisplay.java @@ -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()); diff --git a/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetService.java b/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetService.java index ae7cf17..faaef86 100644 --- a/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetService.java +++ b/src/main/java/org/kpmp/repositoryDataset/RepositoryDatasetService.java @@ -77,6 +77,7 @@ public List 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); diff --git a/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDataset.java b/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDataset.java index f9ec6cf..f3f36de 100644 --- a/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDataset.java +++ b/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDataset.java @@ -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; @@ -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; } diff --git a/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDatasetId.java b/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDatasetId.java index 4471677..115cc64 100644 --- a/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDatasetId.java +++ b/src/main/java/org/kpmp/repositoryDataset/RepositoryFileDatasetId.java @@ -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() { @@ -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; + } + } } diff --git a/src/test/java/org/kpmp/QueryTest.java b/src/test/java/org/kpmp/QueryTest.java index fed4f4e..9f107e7 100644 --- a/src/test/java/org/kpmp/QueryTest.java +++ b/src/test/java/org/kpmp/QueryTest.java @@ -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"); diff --git a/src/test/java/org/kpmp/repositoryDataset/RepositoryFileDatasetTest.java b/src/test/java/org/kpmp/repositoryDataset/RepositoryFileDatasetTest.java index 93faec1..36d81eb 100644 --- a/src/test/java/org/kpmp/repositoryDataset/RepositoryFileDatasetTest.java +++ b/src/test/java/org/kpmp/repositoryDataset/RepositoryFileDatasetTest.java @@ -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");