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