use of org.olat.portfolio.model.notification.EPNotification in project OpenOLAT by OpenOLAT.
the class EPNotificationManager method getPageSubscriptionListItem.
public List<SubscriptionListItem> getPageSubscriptionListItem(Long mapKey, String rootBusinessPath, Date compareDate, Translator translator) {
List<EPStructureElementNotification> notifications = getPageNotifications(mapKey, compareDate);
List<SubscriptionListItem> items = new ArrayList<SubscriptionListItem>();
for (EPNotification notification : notifications) {
SubscriptionListItem item = null;
String[] title = new String[] { StringHelper.escapeHtml(notification.getTitle()) };
if ("page".equals(notification.getType())) {
String bPath = rootBusinessPath + "[EPPage:" + notification.getPageKey() + "]";
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(bPath);
item = new SubscriptionListItem(translator.translate("li.newpage", title), linkUrl, bPath, notification.getCreationDate(), "o_ep_icon_page");
item.setUserObject(notification.getPageKey());
} else {
String bPath = rootBusinessPath;
if (notification.getPageKey() != null) {
bPath = rootBusinessPath + "[EPPage:" + notification.getPageKey() + "]";
}
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(bPath);
item = new SubscriptionListItem(translator.translate("li.newstruct", title), linkUrl, bPath, notification.getCreationDate(), "o_ep_icon_struct");
item.setUserObject(notification.getPageKey());
}
if (item != null) {
items.add(item);
}
}
return items;
}
use of org.olat.portfolio.model.notification.EPNotification in project openolat by klemens.
the class EPNotificationManager method getPageSubscriptionListItem.
public List<SubscriptionListItem> getPageSubscriptionListItem(Long mapKey, String rootBusinessPath, Date compareDate, Translator translator) {
List<EPStructureElementNotification> notifications = getPageNotifications(mapKey, compareDate);
List<SubscriptionListItem> items = new ArrayList<SubscriptionListItem>();
for (EPNotification notification : notifications) {
SubscriptionListItem item = null;
String[] title = new String[] { StringHelper.escapeHtml(notification.getTitle()) };
if ("page".equals(notification.getType())) {
String bPath = rootBusinessPath + "[EPPage:" + notification.getPageKey() + "]";
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(bPath);
item = new SubscriptionListItem(translator.translate("li.newpage", title), linkUrl, bPath, notification.getCreationDate(), "o_ep_icon_page");
item.setUserObject(notification.getPageKey());
} else {
String bPath = rootBusinessPath;
if (notification.getPageKey() != null) {
bPath = rootBusinessPath + "[EPPage:" + notification.getPageKey() + "]";
}
String linkUrl = BusinessControlFactory.getInstance().getURLFromBusinessPathString(bPath);
item = new SubscriptionListItem(translator.translate("li.newstruct", title), linkUrl, bPath, notification.getCreationDate(), "o_ep_icon_struct");
item.setUserObject(notification.getPageKey());
}
if (item != null) {
items.add(item);
}
}
return items;
}
Aggregations