Skip to content

Commit

Permalink
Added File Downloader disclaimer #2654
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Oct 20, 2015
1 parent 583ace0 commit cebbf98
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ notification.generic.objectDeleted=The dataverse, dataset, or file for this noti
notification.access.granted.dataverse=You have been granted the {0} role for <a href="/dataverse/{1}" title="{2}">{2}</a>.
notification.access.granted.dataset=You have been granted the {0} role for <a href="/dataset.xhtml?persistentId={1}" title="{2}">{2}</a>.
notification.access.granted.datafile=You have been granted the {0} role for file in <a href="/dataset.xhtml?persistentId={1}" title="{2}">{2}</a>.
notification.access.granted.fileDownloader.additionalDataverse= You now have access to all restricted and unrestricted files in this dataverse.
notification.access.granted.fileDownloader.additionalDataset= You now have access to all restricted and unrestricted files in this dataset.
notification.access.revoked.dataverse=You have been removed from a role in <a href="/dataverse/{1}" title="{2}">{2}</a>.
notification.access.revoked.dataset=You have been removed from a role in <a href="/dataset.xhtml?persistentId={1}" title="{2}">{2}</a>.
notification.access.revoked.datafile=You have been removed from a role in <a href="/dataset.xhtml?persistentId={1}" title="{2}">{2}</a>.
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/MailServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ private String getMessageTextBasedOnNotification(UserNotification userNotificati
pattern = ResourceBundle.getBundle("Bundle").getString("notification.email.assignRole");
String[] paramArrayAssignRole = {joinedRoleNames, dvObjTypeStr, dvObj.getDisplayName(), dvObjURL};
messageText += MessageFormat.format(pattern, paramArrayAssignRole);
if (joinedRoleNames.contains("File Downloader")){
if (dvObjTypeStr.equals("dataset")){
messageText += ResourceBundle.getBundle("Bundle").getString("notification.access.granted.fileDownloader.additionalDataset");
}
if (dvObjTypeStr.equals("dataverse")){
messageText += ResourceBundle.getBundle("Bundle").getString("notification.access.granted.fileDownloader.additionalDataverse");
}
}
return messageText;
case REVOKEROLE:
dvObj = (DvObject) targetObject;
Expand Down
9 changes: 8 additions & 1 deletion src/main/webapp/dataverseuser.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@
<f:param value="#{item.theObject.getAlias()}"/>
<f:param value="#{item.theObject.getDisplayName()}"/>
</h:outputFormat>
<ui:fragment rendered="#{item.roleString == 'File Downloader'}">
<h:outputText value="#{bundle['notification.access.granted.fileDownloader.additionalDataverse']}" />
</ui:fragment>
</ui:fragment>
<ui:fragment rendered="#{item.theObject.isInstanceofDataset()}">
<f:param value="#{item.roleString}"/>
Expand All @@ -221,7 +224,10 @@
<f:param value="#{item.roleString}"/>
<f:param value="#{item.theObject.getGlobalId()}"/>
<f:param value="#{item.theObject.getDisplayName()}"/>
</h:outputFormat>
</h:outputFormat>
<ui:fragment rendered="#{item.roleString == 'File Downloader'}">
<h:outputText value="#{bundle['notification.access.granted.fileDownloader.additionalDataset']}" />
</ui:fragment>
</ui:fragment>
<ui:fragment rendered="#{item.theObject.isInstanceofDataFile()}">
<f:param value="#{item.roleString}"/>
Expand All @@ -232,6 +238,7 @@
<f:param value="#{item.theObject.getOwner().getDisplayName()}"/>
</h:outputFormat>
</ui:fragment>

</ui:fragment>
<ui:fragment rendered="#{item.type == 'REVOKEROLE'}">
<ui:fragment rendered="#{item.theObject.isInstanceofDataverse()}">
Expand Down

0 comments on commit cebbf98

Please sign in to comment.