throw new ServletException("Unexpected object for document database: "+obj.getClass().getName());
}
}
// Mail Delivery
UserMailNotificationImpl userMailNotification = null;
{
Object obj = context.getAttribute(MailDelivery.ConfigAttributeName_MailDelivery);
if( null == obj ){
throw new ServletException("Mail delivery is not specified ("+MailDelivery.ConfigAttributeName_MailDelivery+")");
}
if( obj instanceof MailDelivery ){
MailDelivery mailDelivery = (MailDelivery)obj;
userMailNotification = new UserMailNotificationImpl(mailDelivery);
} else {
throw new ServletException("Unexpected object for mail delivery: "+obj.getClass().getName());
}
// Load e-mail templates
{
MailMessageGenerator template = new UserCreationGenerator();
CouchDbTemplateMailMessageGenerator couchTemplate = new CouchDbTemplateMailMessageGenerator(
documentDb,
"org.nunaliit.email_template.user_creation",
template
);
userMailNotification.setUserCreationGenerator(couchTemplate);
}
{
MailMessageGenerator template = new PasswordRecoveryGenerator();
CouchDbTemplateMailMessageGenerator couchTemplate = new CouchDbTemplateMailMessageGenerator(
documentDb,
"org.nunaliit.email_template.password_recovery",
template
);
userMailNotification.setPasswordRecoveryGenerator(couchTemplate);
}
{
MailMessageGenerator template = new PasswordReminderGenerator();
CouchDbTemplateMailMessageGenerator couchTemplate = new CouchDbTemplateMailMessageGenerator(
documentDb,
"org.nunaliit.email_template.password_reminder",
template
);
userMailNotification.setPasswordReminderGenerator(couchTemplate);
}
}
// Server Key
{