added dataset url into the email for the group administrators

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@134320 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-11-17 13:39:00 +00:00
parent 9e1c853f33
commit aa347fe109
2 changed files with 8 additions and 3 deletions

View File

@ -340,6 +340,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
new AssociationToGroupAndNotifyThread(
toCreate.getGroups(),
toCreate.getChosenProfile(),
datasetUrl,
datasetId,
toCreate.getTitle(),
aslSession.getUserFullName(),

View File

@ -27,7 +27,9 @@ public class AssociationToGroupAndNotifyThread extends Thread {
private static final Logger logger = LoggerFactory.getLogger(AssociationToGroupAndNotifyThread.class);
private static final String PRODUCT_ASSOCIATED_TO_GROUP_SUBJECT = "Product $PRODUCT added to group $GROUP";
private static final String PRODUCT_ASSOCIATED_TO_GROUP_BODY = "Dear user,'\n'a new product named $TITLE has been just published to the Data Catalogue group $GROUP by $USER_FULLNAME.";
private static final String PRODUCT_ASSOCIATED_TO_GROUP_BODY = "Dear user,<br> a new product named $TITLE has been "
+ "just published and added to the group $GROUP by $USER_FULLNAME.<br>"
+ "You can find it here $DATASET_URL";
private String groupTitle;
private String datasetId;
@ -38,6 +40,7 @@ public class AssociationToGroupAndNotifyThread extends Thread {
private String organization;
private List<GroupBean> groups;
private HttpServletRequest request;
private String datasetUrl;
/**
* @param list
@ -46,7 +49,7 @@ public class AssociationToGroupAndNotifyThread extends Thread {
* @param username
* @param catalogue
*/
public AssociationToGroupAndNotifyThread(List<GroupBean> groups, String groupTitle, String datasetId, String datasetTitle, String userFullName,
public AssociationToGroupAndNotifyThread(List<GroupBean> groups, String groupTitle, String datasetUrl, String datasetId, String datasetTitle, String userFullName,
String username, DataCatalogue catalogue, String organization, HttpServletRequest request) {
this.request = request;
this.groups = groups;
@ -57,6 +60,7 @@ public class AssociationToGroupAndNotifyThread extends Thread {
this.organization = organization;
this.datasetTitle = datasetTitle;
this.userFullName = userFullName;
this.datasetUrl = datasetUrl;
}
@Override
@ -156,7 +160,7 @@ public class AssociationToGroupAndNotifyThread extends Thread {
EmailNotification mailToSend = new EmailNotification(
adminsEmails,
PRODUCT_ASSOCIATED_TO_GROUP_SUBJECT.replace("$TITLE", datasetTitle).replace("$GROUP", groupTitle),
PRODUCT_ASSOCIATED_TO_GROUP_BODY.replace("$TITLE", datasetTitle).replace("$GROUP", groupTitle).replace("$USER_FULLNAME", userFullName),
PRODUCT_ASSOCIATED_TO_GROUP_BODY.replace("$TITLE", datasetTitle).replace("$GROUP", groupTitle).replace("$USER_FULLNAME", userFullName).replace("$DATASET_URL", datasetUrl),
request);
mailToSend.sendEmail();