Skip to content

Commit

Permalink
improve ingest notifications (in-app and email) #8096
Browse files Browse the repository at this point in the history
Note that when you upload a mix of files that go through ingest
and some succeed and some fail, the failure message is sent.
  • Loading branch information
pdurbin committed Dec 13, 2021
1 parent 9a497be commit 94c834d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/MailServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ public String getMessageTextBasedOnNotification(UserNotification userNotificatio
systemConfig.getDataverseSiteUrl(),
dataset.getGlobalIdString(),
dataset.getDisplayName(),
systemConfig.getGuidesBaseUrl(),
systemConfig.getGuidesVersion(),
comment
));

Expand All @@ -598,6 +600,8 @@ public String getMessageTextBasedOnNotification(UserNotification userNotificatio
systemConfig.getDataverseSiteUrl(),
dataset.getGlobalIdString(),
dataset.getDisplayName(),
systemConfig.getGuidesBaseUrl(),
systemConfig.getGuidesVersion(),
comment
));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import edu.harvard.iq.dataverse.*;
import edu.harvard.iq.dataverse.authorization.AuthenticationServiceBean;
import edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser;
import edu.harvard.iq.dataverse.util.BundleUtil;

import java.sql.Timestamp;
import java.time.Instant;
Expand Down Expand Up @@ -99,7 +100,7 @@ public void onMessage(Message message) {
sbIngestedFiles.append(String.format("<li>%s</li>", datafile.getCurrentName()));
} else {
logger.warning("Error occurred during ingest job for file id " + datafile_id + "!");
sbIngestedFiles.append(String.format("<li>%s (Error)</li>", datafile.getCurrentName()));
sbIngestedFiles.append(String.format("<li>%s (" + BundleUtil.getStringFromBundle("messages.error") + ")</li>", datafile.getCurrentName()));
ingestWithErrors = true;
}

Expand All @@ -118,7 +119,7 @@ public void onMessage(Message message) {

ingestWithErrors = true;

sbIngestedFiles.append(String.format("<li>%s (Error)</li>", datafile.getCurrentName()));
sbIngestedFiles.append(String.format("<li>%s (" + BundleUtil.getStringFromBundle("messages.error") + ")</li>", datafile.getCurrentName()));

datafile.SetIngestProblem();
IngestReport errorReport = new IngestReport();
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ notification.workflowFailed=An external workflow run on {0} in {1} has failed. C
notification.workflowSucceeded=An external workflow run on {0} in {1} has succeeded. Check your email and/or view the Dataset page which may have additional details.
notification.statusUpdated=The status of dataset {0} has been updated to {1}.

notification.ingestCompleted=Dataset <a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a> ingest has successfully finished.
notification.ingestCompletedWithErrors=Dataset <a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a> ingest has finished with errors.
notification.ingestCompleted=Dataset <a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a> has one or more tabular files that completed the <a href="{2}/{3}/user/dataset-management.html#tabular-data-files" title="Tabular Data Files - Dataverse User Guide" target="_blank" rel="noopener">tabular ingest process</a> and are available in archival formats.
notification.ingestCompletedWithErrors=Dataset <a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a> has one or more tabular files that are available but are not supported for <a href="{2}/{3}/user/dataset-management.html#tabular-data-files" title="Tabular Data Files- Dataverse User Guide" target="_blank" rel="noopener">tabular ingest</a>.
notification.generic.objectDeleted=The dataverse, dataset, or file for this notification has been deleted.
notification.access.granted.dataverse=You have been granted the {0} role for {1}.
notification.access.granted.dataset=You have been granted the {0} role for {1}.
Expand All @@ -230,8 +230,8 @@ notification.access.revoked.dataverse=You have been removed from a role in {0}.
notification.access.revoked.dataset=You have been removed from a role in {0}.
notification.access.revoked.datafile=You have been removed from a role in {0}.
notification.checksumfail=One or more files in your upload failed checksum validation for dataset <a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a>. Please re-run the upload script. If the problem persists, please contact support.
notification.ingest.completed=Dataset <a href="{0}/dataset.xhtml?persistentId={1}" title="{2}">{2}</a> ingest process has successfully finished.<br><br>Ingested files:{3}<br>
notification.ingest.completedwitherrors=Dataset <a href="{0}/dataset.xhtml?persistentId={1}" title="{2}">{2}</a> ingest process has finished with errors.<br><br>Ingested files:{3}<br>
notification.ingest.completed=Your Dataset <a href="{0}/dataset.xhtml?persistentId={1}" title="{2}">{2}</a> has one or more tabular files that completed the <a href="{3}/{4}/user/dataset-management.html#tabular-data-files" title="Tabular Data Files - Dataverse User Guide" target="_blank" rel="noopener">tabular ingest process</a>. These file(s) are available for download in multiple formats for enhanced archival purposes. The file type extensions of ingested files have been changed to ".tab". Files are available to download in original or archival format. Please see the <a href="{3}/{4}/user/dataset-management.html#tabular-data-files" title="Tabular Data Files - Dataverse User Guide" target="_blank" rel="noopener">guides for more information about ingest</a> and Dataverse support for tabular files.<br><br>File(s) with completed ingest:{5}
notification.ingest.completedwitherrors=Your Dataset <a href="{0}/dataset.xhtml?persistentId={1}" title="{2}">{2}</a> has one or more tabular files that are available but not supported for <a href="{3}/{4}/user/dataset-management.html#tabular-data-files" title="Tabular Data Files - Dataverse User Guide" target="_blank" rel="noopener">tabular ingest</a>. These file(s) are available for download, but do not have additional archival features. Please see the <a href="{3}/{4}/user/dataset-management.html#tabular-data-files" title="Tabular Data Files - Dataverse User Guide" target="_blank" rel="noopener">guides for more information about ingest</a> and Dataverse support for tabular files.<br><br>File(s) for which ingest was attempted:{5}
notification.mail.import.filesystem=Dataset {2} ({0}/dataset.xhtml?persistentId={1}) has been successfully uploaded and verified.
notification.import.filesystem=Dataset <a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a> has been successfully uploaded and verified.
notification.import.checksum=<a href="/dataset.xhtml?persistentId={0}" title="{1}">{1}</a>, dataset had file checksums added via a batch job.
Expand Down Expand Up @@ -706,8 +706,8 @@ notification.email.create.account.subject={0}: Your account has been created
notification.email.assign.role.subject={0}: You have been assigned a role
notification.email.revoke.role.subject={0}: Your role has been revoked
notification.email.verifyEmail.subject={0}: Verify your email address
notification.email.ingestCompleted.subject={0}: Your ingest has successfully finished!
notification.email.ingestCompletedWithErrors.subject={0}: Your ingest has finished with errors!
notification.email.ingestCompleted.subject={0}: Dataset status
notification.email.ingestCompletedWithErrors.subject={0}: Dataset status
notification.email.greeting=Hello, \n
notification.email.greeting.html=Hello, <br>
# Bundle file editors, please note that "notification.email.welcome" is used in a unit test
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/dataverseuser.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,17 @@
<h:outputFormat value="#{bundle['notification.ingestCompleted']}" escape="false">
<f:param value="#{item.theObject.getGlobalId()}"/>
<f:param value="#{item.theObject.getDisplayName()}"/>
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{settingsWrapper.guidesVersion}"/>
</h:outputFormat>
</ui:fragment>
<ui:fragment rendered="#{item.type == 'INGESTCOMPLETEDWITHERRORS'}">
<i class="icon-dataset text-icon-inline text-muted"></i>
<h:outputFormat value="#{bundle['notification.ingestCompletedWithErrors']}" escape="false">
<f:param value="#{item.theObject.getGlobalId()}"/>
<f:param value="#{item.theObject.getDisplayName()}"/>
<f:param value="#{settingsWrapper.guidesBaseUrl}"/>
<f:param value="#{settingsWrapper.guidesVersion}"/>
</h:outputFormat>
</ui:fragment>
<ui:fragment rendered="#{item.type == 'WORKFLOW_FAILURE'}">
Expand Down

0 comments on commit 94c834d

Please sign in to comment.