use of org.olat.commons.info.InfoMessage in project openolat by klemens.
the class InfoMessagesWebService method getInfoMessageWebservice.
@Path("{infoMessageKey}")
public InfoMessageWebService getInfoMessageWebservice(@PathParam("infoMessageKey") Long infoMessageKey) {
InfoMessageFrontendManager messageManager = CoreSpringFactory.getImpl(InfoMessageFrontendManager.class);
InfoMessage msg = messageManager.loadInfoMessage(infoMessageKey);
return new InfoMessageWebService(msg);
}
use of org.olat.commons.info.InfoMessage in project openolat by klemens.
the class InfoMessageFrontendManagerImpl method updateInfoMessagesOfIdentity.
@Override
public void updateInfoMessagesOfIdentity(BusinessGroupRef businessGroup, IdentityRef identity) {
List<InfoMessage> infoMessages = infoMessageManager.loadInfoMessagesOfIdentity(businessGroup, identity);
for (InfoMessage infoMessage : infoMessages) {
Identity author = infoMessage.getAuthor();
if (author != null && author.getKey().equals(identity.getKey())) {
((InfoMessageImpl) infoMessage).setAuthor(null);
}
Identity modifier = infoMessage.getModifier();
if (modifier != null && modifier.getKey().equals(identity.getKey())) {
infoMessage.setModifier(null);
}
infoMessageManager.saveInfoMessage(infoMessage);
}
}
use of org.olat.commons.info.InfoMessage in project openolat by klemens.
the class InfoMessageManagerImpl method loadInfoMessageByResource.
@Override
public List<InfoMessage> loadInfoMessageByResource(OLATResourceable ores, String subPath, String businessPath, Date after, Date before, int firstResult, int maxResults) {
DBQuery query = queryInfoMessageByResource(ores, subPath, businessPath, after, before, false);
if (firstResult >= 0) {
query.setFirstResult(firstResult);
}
if (maxResults > 0) {
query.setMaxResults(maxResults);
}
@SuppressWarnings("unchecked") List<InfoMessage> msgs = query.list();
return msgs;
}
use of org.olat.commons.info.InfoMessage 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