/** * Sends all notifications to the responsible users.<p> * * @return a string listing all responsibles that a notification was sent to * * @throws CmsException if something goes wrong */ public String notifyResponsibles() throws CmsException { Iterator notifications = filterConfirmedResources(getContentNotifications()).iterator(); if (notifications.hasNext()) { StringBuffer result = new StringBuffer(Messages.get().getBundle().key(Messages.LOG_NOTIFICATIONS_SENT_TO_0)); result.append(' '); while (notifications.hasNext()) { CmsContentNotification contentNotification = (CmsContentNotification)notifications.next(); result.append(contentNotification.getResponsible().getName()); if (notifications.hasNext()) { result.append(", "); } try { contentNotification.send(); } catch (EmailException e) { LOG.error(e.getLocalizedMessage(), e); } } return result.toString(); } else { return Messages.get().getBundle().key(Messages.LOG_NO_NOTIFICATIONS_SENT_0); } }
/** * @see org.opencms.notification.A_CmsNotification#generateHtmlMsg() */ @Override protected String generateHtmlMsg() { StringBuffer buffer = new StringBuffer(); // add warnings to the notification if (m_report.hasWarning()) { buffer.append("<b>"); buffer.append(Messages.get().getBundle().key(Messages.GUI_PUBLISH_WARNING_HEADER_0)); buffer.append("</b><br/>\n"); appendList(buffer, m_report.getWarnings()); buffer.append("<br/>\n"); } // add errors to the notification if (m_report.hasError()) { buffer.append("<b>"); buffer.append(Messages.get().getBundle().key(Messages.GUI_PUBLISH_ERROR_HEADER_0)); buffer.append("</b><br/>\n"); appendList(buffer, m_report.getErrors()); buffer.append("<br/>\n"); } return buffer.toString(); }
/** * @see org.opencms.notification.A_CmsNotification#generateHtmlMsg() */ @Override protected String generateHtmlMsg() { StringBuffer buffer = new StringBuffer(); CmsMessages messages = Messages.get().getBundle(getLocale()); // add warnings to the notification if (m_report.hasWarning()) { buffer.append("<b>"); buffer.append(messages.key(Messages.GUI_PUBLISH_WARNING_HEADER_0)); buffer.append("</b><br/>\n"); appendList(buffer, m_report.getWarnings()); buffer.append("<br/>\n"); } // add errors to the notification if (m_report.hasError()) { buffer.append("<b>"); buffer.append(messages.key(Messages.GUI_PUBLISH_ERROR_HEADER_0)); buffer.append("</b><br/>\n"); appendList(buffer, m_report.getErrors()); buffer.append("<br/>\n"); } return buffer.toString(); }
/** * Sends all notifications to the responsible users.<p> * * @return a string listing all responsibles that a notification was sent to * * @throws CmsException if something goes wrong */ public String notifyResponsibles() throws CmsException { Iterator<CmsContentNotification> notifications = filterConfirmedResources(getContentNotifications()).iterator(); if (notifications.hasNext()) { StringBuffer result = new StringBuffer( Messages.get().getBundle().key(Messages.LOG_NOTIFICATIONS_SENT_TO_0)); result.append(' '); while (notifications.hasNext()) { CmsContentNotification contentNotification = notifications.next(); result.append(contentNotification.getResponsible().getName()); if (notifications.hasNext()) { result.append(", "); } try { contentNotification.send(); } catch (EmailException e) { LOG.error(e.getLocalizedMessage(), e); } } return result.toString(); } else { return Messages.get().getBundle().key(Messages.LOG_NO_NOTIFICATIONS_SENT_0); } }
m_messages = Messages.get().getBundle(getLocale());
m_messages = Messages.get().getBundle(getLocale());
LOG.error(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_NO_ADDRESS_1, m_receiver.getName())); return null; LOG.info(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_SEND_1, m_receiver.getEmail())); String mailCharset = Messages.get().getBundle(m_locale).key(Messages.GUI_MAIL_CHARSET_0); if (!CmsMessages.isUnknownKey(mailCharset)) { setCharset(mailCharset); LOG.error(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_SEND_ERROR_0), e); } catch (MessagingException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_SEND_ERROR_0), e);
LOG.error(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_NO_ADDRESS_1, m_receiver.getName())); return null; LOG.info(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_SEND_1, m_receiver.getEmail())); LOG.error(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_SEND_ERROR_0), e); } catch (MessagingException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_NOTIFICATION_SEND_ERROR_0), e);
org.opencms.module.Messages.get(), org.opencms.monitor.Messages.get(), org.opencms.notification.Messages.get(), org.opencms.publish.Messages.get(), org.opencms.relations.Messages.get(),
org.opencms.module.Messages.get(), org.opencms.monitor.Messages.get(), org.opencms.notification.Messages.get(), org.opencms.publish.Messages.get(), org.opencms.relations.Messages.get(),