Dear manager of "+ scope +",
this email message was automatically generated by " + portalbasicurl +" to inform you that ");
+ body.append("
");
+ body.append(""+name + " " + lastname +" has left to the following environment: ");
+ body.append("
");
+ body.append("" + scope+"");
+ body.append("
");
+ body.append("
");
+ body.append("Username: " + username);
+ body.append("
");
+ body.append("e-mail: " + currUser.getEmailAddress());
+ 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 + "] - unregistration from VRE", body.toString()); + + mailToAdmin.sendEmail(); + } + + + private String readGatewayName() { + //get the portles to look for from the property file + Properties props = new Properties(); + String gatewayLabel = "gCube Gateway"; + + try { + String propertyfile = System.getenv("CATALINA_HOME")+"/conf/gcube-data.properties"; + File propsFile = new File(propertyfile); + FileInputStream fis = new FileInputStream(propsFile); + props.load( fis); + //set the gateway label in the session + gatewayLabel = props.getProperty("portalinstancename"); + } + //catch exception in case properties file does not exist + catch(IOException e) { + _log.warn("$CATALINA_HOME/conf/gcube-data.properties not found, Returning gateway name: " + gatewayLabel); + } + + return gatewayLabel; + } }