this.context = context;
this._statusValueRepository = context.getBean(StatusValueRepository.class);
this.language = context.getLanguage();
GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
SettingManager sm = gc.getBean(SettingManager.class);
siteName = sm.getSiteName();
host = sm.getValue("system/feedback/mailServer/host");
port = sm.getValue("system/feedback/mailServer/port");
from = sm.getValue("system/feedback/email");
username = sm.getValue("system/feedback/mailServer/username");
password = sm.getValue("system/feedback/mailServer/password");
useSSL = sm.getValueAsBool("system/feedback/mailServer/ssl");
if (host == null || host.length() == 0) {
context.error("Mail server host not configure");
emailNotes = false;
}
if (port == null || port.length() == 0) {
context.error("Mail server port not configured, email notifications won't be sent.");
emailNotes = false;
}
if (from == null || from.length() == 0) {
context.error("Mail feedback address not configured, email notifications won't be sent.");
emailNotes = false;
}
fromDescr = siteName + LangUtils.translate(context, "statusTitle").get(this.language);
session = context.getUserSession();
replyTo = session.getEmailAddr();
if (replyTo != null) {
replyToDescr = session.getName() + " " + session.getSurname();
} else {
replyTo = from;
replyToDescr = fromDescr;
}
dm = gc.getBean(DataManager.class);
siteUrl = context.getBean(SettingManager.class).getSiteURL(context);
}