コード例 #1
0
 @Transactional
 public void removeFromWhatsNext(User user, Story story) throws IllegalArgumentException {
   WhatsNextStoryEntry entry = whatsNextStoryEntryDAO.getWhatsNextStoryEntryFor(user, story);
   if (entry != null) {
     whatsNextStoryEntryDAO.remove(entry);
   }
 }
コード例 #2
0
  @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);
  }
コード例 #3
0
 @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;
 }
コード例 #4
0
  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;
  }
コード例 #5
0
 public void removeStoryFromWorkQueues(Story story) {
   whatsNextStoryEntryDAO.removeAllByStory(story);
 }
コード例 #6
0
 @Transactional
 public StoryTO rankToBottomOnWhatsNext(User user, Story story) throws IllegalArgumentException {
   return rankToBottomOnWhatsNext(whatsNextStoryEntryDAO.getWhatsNextStoryEntryFor(user, story));
 }
コード例 #7
0
 @Transactional
 private void doRankToBottomOnWhatsNext(WhatsNextStoryEntry entry)
     throws IllegalArgumentException {
   rankingBusiness.rankToBottom(entry, whatsNextStoryEntryDAO.getLastStoryInRank(entry.getUser()));
 }