示例#1
0
 public Set<SprintDaySnapshot> getExistingSprintDaySnapshots() {
   Set<SprintDaySnapshot> ret = new HashSet<SprintDaySnapshot>();
   for (Sprint sprint : getSprints()) {
     ret.addAll(sprint.getExistingDaySnapshots());
   }
   return ret;
 }
示例#2
0
  @Override
  public void onKickStoryFromSprint(GwtConversation conversation, String storyId) {
    assertProjectSelected(conversation);
    Requirement story = requirementDao.getById(storyId);
    Sprint sprint = story.getSprint();
    User currentUser = conversation.getSession().getUser();

    sprint.kickRequirement(story, currentUser);

    postProjectEvent(
        conversation,
        currentUser.getName() + " kicked " + story.getReferenceAndLabel() + " from current sprint",
        story);

    sendToClients(conversation, story.getTasksInSprint());
    sendToClients(conversation, story);
    sendToClients(conversation, sprint);
    sendToClients(conversation, sprint.getProject());
  }
示例#3
0
  @Override
  public void onPullStoryToSprint(GwtConversation conversation, String storyId) {
    assertProjectSelected(conversation);
    Requirement story = requirementDao.getById(storyId);
    Project project = conversation.getProject();
    Sprint sprint = project.getCurrentSprint();
    User currentUser = conversation.getSession().getUser();

    sprint.pullRequirement(story, currentUser);

    postProjectEvent(
        conversation,
        currentUser.getName() + " pulled " + story.getReferenceAndLabel() + " to current sprint",
        story);

    sendToClients(conversation, sprint);
    sendToClients(conversation, story);
    sendToClients(conversation, story.getTasksInSprint());
  }
示例#4
0
 @Override
 public void onSwitchToNextSprint(GwtConversation conversation) {
   assertProjectSelected(conversation);
   Project project = conversation.getProject();
   Sprint oldSprint = project.getCurrentSprint();
   for (Requirement requirement : oldSprint.getRequirements()) {
     if (!requirement.isClosed()) {
       requirement.setDirty(true);
       sendToClients(conversation, requirement);
     }
   }
   Sprint newSprint = project.switchToNextSprint();
   postProjectEvent(
       conversation, conversation.getSession().getUser() + " switched to next sprint ", newSprint);
   sendToClients(conversation, project.getSprints());
   sendToClients(conversation, project.getSprintReports());
   sendToClients(conversation, project.getRequirements());
   sendToClients(conversation, project.getTasks()); // TODO optimize: no history tasks
   sendToClients(conversation, oldSprint.getReleases());
   sendToClients(conversation, project);
 }
示例#5
0
 @Override
 public void ensureIntegrity() {
   super.ensureIntegrity();
   addParticipants(getAdmins());
   addParticipants(getProductOwners());
   addParticipants(getScrumMasters());
   addParticipants(getTeamMembers());
   if (!isCurrentSprintSet()) {
     Sprint sprint = sprintDao.newEntityInstance();
     sprint.setProject(this);
     sprintDao.saveEntity(sprint);
     setCurrentSprint(sprint);
   }
   if (!isNextSprintSet()) {
     createNextSprint();
   }
   if (!isPunishmentUnitSet()) {
     setPunishmentUnit(Money.EUR);
   }
   if (getPunishmentFactor() == 0) {
     setPunishmentFactor(1);
   }
   if (!isHomepageDirSet()) setAutoUpdateHomepage(false);
 }
示例#6
0
 private void fillSprintBacklog(ContextBuilder context) {
   Sprint sprint = project.getCurrentSprint();
   context.put("label", sprint.getLabel());
   context.put("goal", wiki2html(sprint.getGoal()));
   context.put("begin", sprint.getBegin().toString(Date.FORMAT_LONGMONTH_DAY_YEAR));
   context.put("end", sprint.getEnd().toString(Date.FORMAT_LONGMONTH_DAY_YEAR));
   Release release = sprint.getRelease();
   if (release != null) context.put("release", release.getLabel());
   List<Requirement> requirements = new ArrayList<Requirement>(sprint.getRequirements());
   Collections.sort(requirements, project.getRequirementsOrderComparator());
   for (Requirement requirement : requirements) {
     fillStory(context.addSubContext("stories"), requirement);
   }
 }
示例#7
0
 public Sprint createNextSprint() {
   Sprint sprint = sprintDao.newEntityInstance();
   sprint.setProject(this);
   sprint.setLabel("Next Sprint");
   if (isCurrentSprintSet()) {
     sprint.setBegin(getCurrentSprint().getEnd());
     Integer length = getCurrentSprint().getLengthInDays();
     if (length != null) sprint.setEnd(sprint.getBegin().addDays(length));
   }
   sprintDao.saveEntity(sprint);
   setNextSprint(sprint);
   return sprint;
 }
示例#8
0
 public final boolean isSprint(scrum.server.sprint.Sprint sprint) {
   if (this.sprintId == null && sprint == null) return true;
   return sprint != null && sprint.getId().equals(this.sprintId);
 }
示例#9
0
 public final void setSprint(scrum.server.sprint.Sprint sprint) {
   sprint = prepareSprint(sprint);
   if (isSprint(sprint)) return;
   setSprintId(sprint == null ? null : sprint.getId());
 }
示例#10
0
  public void switchToNextSprint() {
    Sprint oldSprint = getCurrentSprint();
    oldSprint.close();
    oldSprint.setEnd(Date.today());

    getCurrentSprintSnapshot().update();

    Sprint newSprint = getNextSprint();
    if (newSprint == null) newSprint = createNextSprint();
    if (!newSprint.isBeginSet() || newSprint.getBegin().isPast()) newSprint.setBegin(Date.today());
    if (!newSprint.isEndSet() || newSprint.getEnd().isBeforeOrSame(newSprint.getBegin()))
      newSprint.setEnd(newSprint.getBegin().addDays(oldSprint.getLengthInDays()));

    setCurrentSprint(newSprint);
    createNextSprint();

    createSprintSnapshot();

    for (Task task : oldSprint.getTasks()) {
      if (task.isClosed()) {
        taskDao.deleteEntity(task);
      }
    }
  }