use of org.olat.portfolio.model.notification.EPCommentNotification in project OpenOLAT by OpenOLAT.
the class EPNotificationManager method getCommentNotifications.
private List<EPCommentNotification> getCommentNotifications(List<Long> mapKey, Date compareDate) {
if (mapKey == null || mapKey.isEmpty()) {
return Collections.emptyList();
}
StringBuilder sb = new StringBuilder();
sb.append("select notification from ").append(EPCommentNotification.class.getName()).append(" as notification").append(" inner join fetch notification.author").append(" where notification.creationDate>=:currentDate and notification.mapKey in (:mapKey)");
DBQuery query = dbInstance.createQuery(sb.toString());
query.setDate("currentDate", compareDate);
query.setParameterList("mapKey", mapKey);
@SuppressWarnings("unchecked") List<EPCommentNotification> notifications = query.list();
return notifications;
}
use of org.olat.portfolio.model.notification.EPCommentNotification in project openolat by klemens.
the class EPNotificationManager method getCommentNotifications.
public List<SubscriptionListItem> getCommentNotifications(List<Long> mapKey, String rootBusinessPath, Date compareDate, Translator translator) {
List<EPCommentNotification> comments = getCommentNotifications(mapKey, compareDate);
List<SubscriptionListItem> items = new ArrayList<SubscriptionListItem>();
for (EPCommentNotification comment : comments) {
SubscriptionListItem item;
if (comment.getPageKey() == null) {
String[] title = new String[] { comment.getMapTitle(), userManager.getUserDisplayName(comment.getAuthor()) };
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(rootBusinessPath);
item = new SubscriptionListItem(translator.translate("li.newcomment", title), linkUrl, rootBusinessPath, comment.getCreationDate(), "o_info_icon");
} else {
String bPath = rootBusinessPath + "[EPPage:" + comment.getPageKey() + "]";
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(bPath);
String[] title = new String[] { comment.getTitle(), userManager.getUserDisplayName(comment.getAuthor()) };
item = new SubscriptionListItem(translator.translate("li.newcomment", title), linkUrl, bPath, comment.getCreationDate(), "o_info_icon");
item.setUserObject(comment.getPageKey());
}
items.add(item);
}
return items;
}
use of org.olat.portfolio.model.notification.EPCommentNotification in project OpenOLAT by OpenOLAT.
the class EPNotificationManager method getCommentNotifications.
public List<SubscriptionListItem> getCommentNotifications(List<Long> mapKey, String rootBusinessPath, Date compareDate, Translator translator) {
List<EPCommentNotification> comments = getCommentNotifications(mapKey, compareDate);
List<SubscriptionListItem> items = new ArrayList<SubscriptionListItem>();
for (EPCommentNotification comment : comments) {
SubscriptionListItem item;
if (comment.getPageKey() == null) {
String[] title = new String[] { comment.getMapTitle(), userManager.getUserDisplayName(comment.getAuthor()) };
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(rootBusinessPath);
item = new SubscriptionListItem(translator.translate("li.newcomment", title), linkUrl, rootBusinessPath, comment.getCreationDate(), "o_info_icon");
} else {
String bPath = rootBusinessPath + "[EPPage:" + comment.getPageKey() + "]";
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(bPath);
String[] title = new String[] { comment.getTitle(), userManager.getUserDisplayName(comment.getAuthor()) };
item = new SubscriptionListItem(translator.translate("li.newcomment", title), linkUrl, bPath, comment.getCreationDate(), "o_info_icon");
item.setUserObject(comment.getPageKey());
}
items.add(item);
}
return items;
}
use of org.olat.portfolio.model.notification.EPCommentNotification in project openolat by klemens.
the class EPNotificationManager method getCommentNotifications.
private List<EPCommentNotification> getCommentNotifications(List<Long> mapKey, Date compareDate) {
if (mapKey == null || mapKey.isEmpty()) {
return Collections.emptyList();
}
StringBuilder sb = new StringBuilder();
sb.append("select notification from ").append(EPCommentNotification.class.getName()).append(" as notification").append(" inner join fetch notification.author").append(" where notification.creationDate>=:currentDate and notification.mapKey in (:mapKey)");
DBQuery query = dbInstance.createQuery(sb.toString());
query.setDate("currentDate", compareDate);
query.setParameterList("mapKey", mapKey);
@SuppressWarnings("unchecked") List<EPCommentNotification> notifications = query.list();
return notifications;
}
Aggregations