Category: library-plugins

News and posts from library-plugins category

scm-scheduler-plugin

Posted on 2013-01-03 by Sebastian Sdorra


The scm-scheduler-plugin provides an api for other plugins to execute scheduled
jobs. The plugin is based on the quartz project.

Wiki: https://bitbucket.org/sdorra/scm-manager/wiki/scheduler-plugin


Posted in plugins, library-plugins


scm-mail-plugin

Posted on 2012-12-20 by Sebastian Sdorra


The scm-mail-plugin provides an central api for sending e-mails. This plugin is primarily for use by other plugins.

Wiki: https://bitbucket.org/sdorra/scm-manager/wiki/mail-plugin 

Example:

/**
 *
 * @author Sebastian Sdorra
 */
public class NotificationService
{
  private static final Logger logger = LoggerFactory.getLogger(
    NotificationService.class);
  
  private MailService mailService;

  @Inject
  public NotificationService(MailService mailService)
  {
    this.mailService = mailService;
  }
  
  public void sendNotification() throws MailSendBatchException {
    if ( mailService.isConfigured() ){
      Email mail = new Email();
      mail.setFromAddress("SCM-Administrator", "admin@scm-manager.org");
      mail.addRecipient("Test User", "test.user@scm-manager.org", RecipientType.TO);
      mail.setSubject("SCM-Manager notification");
      mail.setText("Notification from SCM-Manager");
      
      mailService.send(mail);
    } else {
      logger.warn("mail service is not configured");
    }
  }
}

Posted in plugins, library-plugins