use of org.olat.core.commons.services.notifications.PublisherData in project openolat by klemens.
the class InfoSubscriptionManagerImpl method getInfoPublisherData.
@Override
public PublisherData getInfoPublisherData(OLATResourceable resource, String businessPath) {
String resId = resource.getResourceableId() == null ? "0" : resource.getResourceableId().toString();
PublisherData publisherData = new PublisherData(PUBLISHER_TYPE, resId, businessPath);
return publisherData;
}
use of org.olat.core.commons.services.notifications.PublisherData in project openolat by klemens.
the class CertificatesManagerImpl method getPublisherData.
@Override
public PublisherData getPublisherData(ICourse course, String businessPath) {
String data = String.valueOf(course.getCourseEnvironment().getCourseResourceableId());
PublisherData pData = new PublisherData(ORES_CERTIFICATE, data, businessPath);
return pData;
}
use of org.olat.core.commons.services.notifications.PublisherData in project openolat by klemens.
the class MailManagerImpl method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
VFSContainer root = mailModule.getRootForAttachments();
attachmentStorage = new FileStorage(root);
PublisherData pdata = getPublisherData();
SubscriptionContext scontext = getSubscriptionContext();
notificationsManager.getOrCreatePublisher(scontext, pdata);
Properties p = null;
try {
velocityEngine = new VelocityEngine();
p = new Properties();
p.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
p.setProperty(RuntimeConstants.RESOURCE_MANAGER_CACHE_CLASS, "org.olat.core.gui.render.velocity.InfinispanResourceCache");
p.setProperty("runtime.log.logsystem.log4j.category", "syslog");
velocityEngine.init(p);
} catch (Exception e) {
throw new RuntimeException("config error " + p.toString());
}
}
use of org.olat.core.commons.services.notifications.PublisherData in project openolat by klemens.
the class MailManagerImpl method subscribe.
@Override
public void subscribe(Identity identity) {
PublisherData data = getPublisherData();
SubscriptionContext context = getSubscriptionContext();
if (context != null) {
notificationsManager.subscribe(identity, context, data);
}
}
use of org.olat.core.commons.services.notifications.PublisherData in project openolat by klemens.
the class WeeklyCalendarController method getContextualSubscriptionController.
private ContextualSubscriptionController getContextualSubscriptionController(UserRequest ureq, KalendarRenderWrapper kalendarRenderWrapper, SubscriptionContext context) {
String businessPath = getWindowControl().getBusinessControl().getAsString();
if ((caller.equals(CalendarController.CALLER_COURSE) || caller.equals(CalendarManager.TYPE_COURSE))) {
Long courseId = kalendarRenderWrapper.getLinkProvider().getControler().getCourseId();
PublisherData pdata = new PublisherData(OresHelper.calculateTypeName(CalendarManager.class), String.valueOf(courseId), businessPath);
return new ContextualSubscriptionController(ureq, getWindowControl(), context, pdata);
}
if ((caller.equals(CalendarController.CALLER_COLLAB) || caller.equals(CalendarManager.TYPE_GROUP))) {
BusinessGroup businessGroup = calendarNotificationsManager.getBusinessGroup(kalendarRenderWrapper);
if (businessGroup != null) {
PublisherData pdata = new PublisherData(OresHelper.calculateTypeName(CalendarManager.class), String.valueOf(businessGroup.getResourceableId()), businessPath);
return new ContextualSubscriptionController(ureq, getWindowControl(), context, pdata);
}
}
return null;
}
Aggregations