use of org.olat.commons.info.InfoMessageFrontendManager in project openolat by klemens.
the class InfoCourseNode method cleanupOnDelete.
@Override
public /**
* is called when deleting this node, clean up info-messages and subscriptions!
*/
void cleanupOnDelete(ICourse course) {
super.cleanupOnDelete(course);
// delete infoMessages and subscriptions (OLAT-6171)
String resSubpath = getIdent();
InfoMessageFrontendManager infoService = CoreSpringFactory.getImpl(InfoMessageFrontendManager.class);
List<InfoMessage> messages = infoService.loadInfoMessageByResource(course, resSubpath, null, null, null, 0, 0);
for (InfoMessage im : messages) {
infoService.deleteInfoMessage(im);
}
final SubscriptionContext subscriptionContext = CourseModule.createTechnicalSubscriptionContext(course.getCourseEnvironment(), this);
NotificationsManager notifManagar = NotificationsManager.getInstance();
notifManagar.delete(subscriptionContext);
super.cleanupOnDelete(course);
}
Aggregations