use of org.olat.core.commons.services.commentAndRating.CommentAndRatingService in project openolat by klemens.
the class FeedManagerImpl method deleteItem.
@Override
public Feed deleteItem(Item item) {
Feed feed = item.getFeed();
// delete the item from the database
itemDAO.removeItem(item);
// delete the item container from the file system
feedFileStorage.deleteItemContainer(item);
// delete comments and ratings
CommentAndRatingService commentAndRatingService = CoreSpringFactory.getImpl(CommentAndRatingService.class);
commentAndRatingService.deleteAll(feed, item.getGuid());
// reload the Feed
Feed reloadedFeed = feedDAO.loadFeed(feed.getKey());
// or from an external source.
if (!hasItems(reloadedFeed)) {
// set undefined
reloadedFeed.setExternal(null);
}
reloadedFeed.setLastModified(new Date());
reloadedFeed = feedDAO.updateFeed(reloadedFeed);
return reloadedFeed;
}
Aggregations