From d0374fc4ea5100f82b1cbbe8568def438620f704 Mon Sep 17 00:00:00 2001 From: Allan England Date: Wed, 27 Nov 2024 09:36:16 +0000 Subject: [PATCH 1/2] Create submitted proposal synopsis definition --- .../json/SubmittedProposalSynopsis.java | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java diff --git a/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java b/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java new file mode 100644 index 0000000..6e10ab9 --- /dev/null +++ b/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java @@ -0,0 +1,61 @@ +package org.orph2020.pst.common.json; + +/* + Ancillary class to contain more information about submitted proposals than the ObjectIdentifier class + basically the equivalent thing for submitted proposals as ProposalSynopsis is for source proposals. + */ + +import org.ivoa.dm.proposal.prop.AbstractProposal; +import org.ivoa.dm.proposal.prop.ProposalKind; + + +public class SubmittedProposalSynopsis { + + //code / db id + public long code; + + //title + public String title; + + //summary + public String summary; + + //kind (of observation - see enum) + public ProposalKind kind; + + //source proposal id + public long sourceProposalId; + + //cycle id - the observing cycle it's been submitted to. + public long cycleId; + + //The current review status + public String reviewStatus; + + + public SubmittedProposalSynopsis(long code, String title, String summary, ProposalKind kind, long sourceProposalId, long cycleId, String reviewStatus) + { + this.code = code; + this.title = title; + this.summary = summary; + this.kind = kind; + this.sourceProposalId = sourceProposalId; + this.cycleId = cycleId; + this.reviewStatus = reviewStatus; + } + + + public SubmittedProposalSynopsis(AbstractProposal submittedProposal) + { + this.code = submittedProposal.getId(); + this.title = submittedProposal.getTitle(); + this.summary = submittedProposal.getSummary(); + this.kind = submittedProposal.getKind(); + this.sourceProposalId = submittedProposal.getRelatedProposals().get(0).getId(); + //TODO: Populate cycleID and reviewStatus + this.reviewStatus = "UNKNOWN"; + } + + public SubmittedProposalSynopsis() {} + +} From bca0ea6ebd50a5d2b5f93eea8be381e6d8e53330 Mon Sep 17 00:00:00 2001 From: Allan England Date: Wed, 27 Nov 2024 14:45:35 +0000 Subject: [PATCH 2/2] Add submission date to submitted proposal synopsis --- .../pst/common/json/SubmittedProposalSynopsis.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java b/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java index 6e10ab9..0280055 100644 --- a/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java +++ b/src/main/java/org/orph2020/pst/common/json/SubmittedProposalSynopsis.java @@ -8,6 +8,8 @@ import org.ivoa.dm.proposal.prop.AbstractProposal; import org.ivoa.dm.proposal.prop.ProposalKind; +import java.util.Date; + public class SubmittedProposalSynopsis { @@ -29,11 +31,14 @@ public class SubmittedProposalSynopsis { //cycle id - the observing cycle it's been submitted to. public long cycleId; + //submission date + public Date submissionDate; + //The current review status public String reviewStatus; - public SubmittedProposalSynopsis(long code, String title, String summary, ProposalKind kind, long sourceProposalId, long cycleId, String reviewStatus) + public SubmittedProposalSynopsis(long code, String title, String summary, ProposalKind kind, long sourceProposalId, long cycleId, Date submissionDate, String reviewStatus) { this.code = code; this.title = title; @@ -41,6 +46,7 @@ public SubmittedProposalSynopsis(long code, String title, String summary, Propos this.kind = kind; this.sourceProposalId = sourceProposalId; this.cycleId = cycleId; + this.submissionDate = submissionDate; this.reviewStatus = reviewStatus; } @@ -51,7 +57,8 @@ public SubmittedProposalSynopsis(AbstractProposal submittedProposal) this.title = submittedProposal.getTitle(); this.summary = submittedProposal.getSummary(); this.kind = submittedProposal.getKind(); - this.sourceProposalId = submittedProposal.getRelatedProposals().get(0).getId(); + if(!submittedProposal.getRelatedProposals().isEmpty()) + this.sourceProposalId = submittedProposal.getRelatedProposals().get(0).getId(); //TODO: Populate cycleID and reviewStatus this.reviewStatus = "UNKNOWN"; }