@Transactional public void removeFromWhatsNext(User user, Story story) throws IllegalArgumentException { WhatsNextStoryEntry entry = whatsNextStoryEntryDAO.getWhatsNextStoryEntryFor(user, story); if (entry != null) { whatsNextStoryEntryDAO.remove(entry); } }
@Transactional public StoryTO rankUnderStoryOnWhatsNext(User user, Story story, Story upperStory) throws IllegalArgumentException { WhatsNextStoryEntry entry = whatsNextStoryEntryDAO.getWhatsNextStoryEntryFor(user, story); if (entry == null) { entry = addToWhatsNext(user, story); } WhatsNextStoryEntry upperEntry = null; if (upperStory != null) { upperEntry = whatsNextStoryEntryDAO.getWhatsNextStoryEntryFor(user, upperStory); } return rankUnderStoryOnWhatsNext(entry, upperEntry); }
@Transactional public WhatsNextStoryEntry addToWhatsNext(User user, Story story) { WhatsNextStoryEntry entry = new WhatsNextStoryEntry(); entry.setStory(story); entry.setUser(user); whatsNextStoryEntryDAO.store(entry); storyBusiness.addResponsible(story, user); doRankToBottomOnWhatsNext(entry); return entry; }
public Collection<StoryTO> getQueuedStoriesForUser(User user) { Collection<WhatsNextStoryEntry> entries = whatsNextStoryEntryDAO.getWhatsNextStoryEntriesFor(user); Collection<StoryTO> returned = new ArrayList<StoryTO>(); for (WhatsNextStoryEntry entry : entries) { StoryTO item = transferObjectBusiness.constructQueuedStoryTO(entry); returned.add(item); } return returned; }
public void removeStoryFromWorkQueues(Story story) { whatsNextStoryEntryDAO.removeAllByStory(story); }
@Transactional public StoryTO rankToBottomOnWhatsNext(User user, Story story) throws IllegalArgumentException { return rankToBottomOnWhatsNext(whatsNextStoryEntryDAO.getWhatsNextStoryEntryFor(user, story)); }
@Transactional private void doRankToBottomOnWhatsNext(WhatsNextStoryEntry entry) throws IllegalArgumentException { rankingBusiness.rankToBottom(entry, whatsNextStoryEntryDAO.getLastStoryInRank(entry.getUser())); }