Dear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that ");
+ body.append("
");
+ body.append(""+name + " " + lastname +" has requested access to the following environment: ");
+ body.append("
");
+ body.append("" + scope+"");
+ body.append("
");
+ body.append("
");
+ body.append("Username: " + username);
+ body.append("
");
+ body.append("e-mail: " + currUser.getEmail());
+ body.append("
"); + body.append("The request is annotated with the following text: " + optionalMessage); + body.append("
"); + body.append("");
+ body.append("You are kindly asked to manage such request by either approving or rejecting it through the user management " +
+ "facilities available at ");
+ body.append("
" + portalbasicurl);
+ body.append("
"); + body.append("WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain"+ + " information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. " + + "If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message."); + body.append("
"); + + String[] allMails = new String[adminEmails.size()]; + + adminEmails.toArray(allMails); + + EmailNotification mailToAdmin = new EmailNotification(PortalContext.getConfiguration().getSenderEmail(), allMails , "[" + gatewayName + "] - Join Request", body.toString()); + + mailToAdmin.sendEmail(); + } + + /** + * + * @param scope . + * @param optionalMessage . + */ + public static void notifyUserSelfRegistration(String username, VO rootVO, String scope, String portalbasicurl, String gatewayName) throws Exception { + + ArrayListDear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that ");
+ body.append("
");
+ body.append(""+name + " " + lastname +" has self registered to the following environment: ");
+ body.append("
");
+ body.append("" + scope+"");
+ body.append("
");
+ body.append("
");
+ body.append("Username: " + username);
+ body.append("
");
+ body.append("e-mail: " + currUser.getEmail());
+ body.append("
");
+ body.append("
" + portalbasicurl);
+ body.append("
"); + body.append("WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain"+ + " information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. " + + "If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message."); + body.append("
"); + + String[] allMails = new String[adminEmails.size()]; + + adminEmails.toArray(allMails); + + EmailNotification mailToAdmin = new EmailNotification("no-reply@d4science.org", allMails , "[" + gatewayName + "] - Self Registration", body.toString()); + + mailToAdmin.sendEmail(); + } + + + /** + * + * @param scope . + * @param optionalMessage . + */ + public static void notifyUserAcceptedInvite(String username, VO rootVO, String scope, String portalbasicurl, String gatewayName, Invite invite) throws Exception { + + ArrayListDear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that ");
+ body.append("
");
+ body.append(""+name + " " + lastname +" has accepted an invitation to the following environment: ");
+ body.append("
");
+ body.append("" + scope+"");
+ body.append("
");
+ body.append("
");
+ body.append("Username: " + username);
+ body.append("
");
+ body.append("e-mail: " + currUser.getEmail());
+ body.append("
"); + body.append("The invitation was sent by " + invite.getSenderFullName() +" (" + invite.getSenderUserId()+") on " + invite.getTime()+""); + body.append("
"); + body.append(""); + body.append("WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain"+ + " information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. " + + "If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message."); + body.append("
"); + + String[] allMails = new String[adminEmails.size()]; + + adminEmails.toArray(allMails); + + EmailNotification mailToAdmin = new EmailNotification("no-reply@d4science.org", allMails , "[" + gatewayName + "] - Accepted Invitation", body.toString()); + + mailToAdmin.sendEmail(); + } + +} diff --git a/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java b/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java index b563743..57a177d 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/shared/ResearchEnvironment.java @@ -12,7 +12,7 @@ public class ResearchEnvironment implements Serializable { private String imageURL; - private String groupName; + private String infraScope; private String friendlyURL; @@ -23,13 +23,13 @@ public class ResearchEnvironment implements Serializable { } public ResearchEnvironment(String name, String description, - String imageURL, String groupName, String friendlyURL, + String imageURL, String infraScope, String friendlyURL, UserBelonging userBelonging) { super(); this.name = name; this.description = description; this.imageURL = imageURL; - this.groupName = groupName; + this.infraScope = infraScope; this.friendlyURL = friendlyURL; this.userBelonging = userBelonging; } @@ -58,12 +58,12 @@ public class ResearchEnvironment implements Serializable { this.imageURL = imageURL; } - public String getGroupName() { - return groupName; + public String getinfraScope() { + return infraScope; } - public void setGroupName(String groupName) { - this.groupName = groupName; + public void setinfraScope(String infraScope) { + this.infraScope = infraScope; } public String getFriendlyURL() { diff --git a/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java b/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java index 31a8360..947d915 100644 --- a/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java +++ b/src/main/java/org/gcube/portlets/user/joinvre/shared/VO.java @@ -30,9 +30,9 @@ public class VO extends ResearchEnvironment implements Comparable