Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 26cc3b5

Browse files
author
Tim Sowers
committed
Update Limited Approval Notification; (DOECODE-1090)
1 parent 2526716 commit 26cc3b5

File tree

2 files changed

+37
-11
lines changed

2 files changed

+37
-11
lines changed

src/main/java/gov/osti/services/Metadata.java

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ public class Metadata {
197197
private static String ARCHIVER_URL = DoeServletContextListener.getConfigurationProperty("archiver.url");
198198
// get the SITE URL base for applications
199199
private static String SITE_URL = DoeServletContextListener.getConfigurationProperty("site.url");
200+
// get the SITE URL base for applications
201+
private static String SRC_REGISTRATION_URL = DoeServletContextListener.getConfigurationProperty("src.registration.url");
200202
// get Program Manager info
201203
private static String PM_NAME = DoeServletContextListener.getConfigurationProperty("project.manager.name");
202204
private static String PM_EMAIL = DoeServletContextListener.getConfigurationProperty("project.manager.email");
@@ -4150,6 +4152,8 @@ private static void sendApprovalNotification(DOECodeMetadata md) {
41504152
if (!Status.Approved.equals(md.getWorkflowStatus()))
41514153
return;
41524154

4155+
boolean is_limited = md.getIsLimited();
4156+
41534157
try {
41544158
// get the OWNER information
41554159
User owner = UserServices.findUserByEmail(md.getOwner());
@@ -4194,13 +4198,22 @@ private static void sendApprovalNotification(DOECodeMetadata md) {
41944198
.append(owner.getLastName())
41954199
.append(":");
41964200

4197-
msg.append("<P>Thank you -- your ").append(lastApprovalFor).append(" project, DOE CODE ID: <a href=\"")
4198-
.append(SITE_URL)
4199-
.append("/biblio/")
4200-
.append(codeId)
4201-
.append("\">")
4202-
.append(codeId)
4203-
.append("</a>,");
4201+
msg.append("<P>Thank you -- your ").append(lastApprovalFor).append(" project, DOE CODE ID: ");
4202+
4203+
if (is_limited) {
4204+
msg.append(codeId);
4205+
}
4206+
else {
4207+
msg.append("<a href=\"")
4208+
.append(SITE_URL)
4209+
.append("/biblio/")
4210+
.append(codeId)
4211+
.append("\">")
4212+
.append(codeId)
4213+
.append("</a>");
4214+
}
4215+
4216+
msg.append(",");
42044217

42054218
if (showDoiUrl) {
42064219
String doiUrlPrefix = "https://doi.org/";
@@ -4213,10 +4226,20 @@ private static void sendApprovalNotification(DOECodeMetadata md) {
42134226
.append(doiUrlPrefix + doi)
42144227
.append("</a>,");
42154228
}
4216-
4217-
msg.append(" has been approved. It is now <a href=\"")
4218-
.append(SITE_URL)
4219-
.append("\">searchable</a> in DOE CODE by, for example, title or CODE ID #.</P>");
4229+
4230+
msg.append(" has been approved. ");
4231+
4232+
if (is_limited) {
4233+
msg.append("It is now discoverable in Science Research Connection (SRC). For access to SRC, you must register <a href=\"")
4234+
.append(SRC_REGISTRATION_URL)
4235+
.append("\">here</a>.");
4236+
}
4237+
else {
4238+
msg.append("It is now <a href=\"")
4239+
.append(SITE_URL)
4240+
.append("\">searchable</a> in DOE CODE by, for example, title or CODE ID #.");
4241+
}
4242+
msg.append("</P>");
42204243

42214244
// OMIT the following for BUSINESS TYPE software, or last ANNOUNCED software
42224245
if (!DOECodeMetadata.Type.B.equals(md.getSoftwareType()) && !lastApprovalFor.equalsIgnoreCase("announced")) {

src/main/resources/doecode.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ api.host = ${serviceapi.host}
1515
# Site base URL
1616
site.url = ${site.url}
1717

18+
# SRC registration URL
19+
src.registration.url = ${src.registration.url}
20+
1821
# EMAIL information
1922
email.host = ${email.host}
2023
email.from = ${email.from}

0 commit comments

Comments
 (0)