예제 #1
0
 public final Set<scrum.server.project.Project> getProjects() {
   if (projectsCache == null) {
     projectsCache = new HashSet<scrum.server.project.Project>();
     for (Impediment e : getEntities()) {
       if (e.isProjectSet()) projectsCache.add(e.getProject());
     }
   }
   return projectsCache;
 }
예제 #2
0
 public final Set<Integer> getNumbers() {
   if (numbersCache == null) {
     numbersCache = new HashSet<Integer>();
     for (Impediment e : getEntities()) {
       numbersCache.add(e.getNumber());
     }
   }
   return numbersCache;
 }
예제 #3
0
 public final Set<java.lang.String> getSolutions() {
   if (solutionsCache == null) {
     solutionsCache = new HashSet<java.lang.String>();
     for (Impediment e : getEntities()) {
       if (e.isSolutionSet()) solutionsCache.add(e.getSolution());
     }
   }
   return solutionsCache;
 }
예제 #4
0
 public final Set<java.lang.String> getDescriptions() {
   if (descriptionsCache == null) {
     descriptionsCache = new HashSet<java.lang.String>();
     for (Impediment e : getEntities()) {
       if (e.isDescriptionSet()) descriptionsCache.add(e.getDescription());
     }
   }
   return descriptionsCache;
 }
예제 #5
0
 public final Set<ilarkesto.core.time.Date> getDates() {
   if (datesCache == null) {
     datesCache = new HashSet<ilarkesto.core.time.Date>();
     for (Impediment e : getEntities()) {
       if (e.isDateSet()) datesCache.add(e.getDate());
     }
   }
   return datesCache;
 }
예제 #6
0
 public final Set<java.lang.String> getLabels() {
   if (labelsCache == null) {
     labelsCache = new HashSet<java.lang.String>();
     for (Impediment e : getEntities()) {
       if (e.isLabelSet()) labelsCache.add(e.getLabel());
     }
   }
   return labelsCache;
 }
예제 #7
0
 private void onImpedimentChanged(
     GwtConversation conversation, Impediment impediment, Map properties) {
   User currentUser = conversation.getSession().getUser();
   if (properties.containsKey("closed")) {
     if (impediment.isClosed()) {
       impediment.setDate(Date.today());
       postProjectEvent(
           conversation,
           currentUser.getName() + " closed " + impediment.getReferenceAndLabel(),
           impediment);
     } else {
       postProjectEvent(
           conversation,
           currentUser.getName() + " reopened " + impediment.getReferenceAndLabel(),
           impediment);
     }
   }
 }
예제 #8
0
파일: Project.java 프로젝트: sjaddow/kunagi
  public void addTestImpediments() {
    Impediment imp = null;

    // no documentation
    imp =
        impedimentDao.postImpediment(
            this, Date.randomPast(5), "There is no documentation. Seriously.", false);
    imp.setDescription("Someone promised that, I remember. Where is it?");

    // no daily scrums
    imp =
        impedimentDao.postImpediment(this, Date.randomPast(5), "Daily Scrums are not daily", true);
    imp.setDescription(
        "\"Daily Scrums\" are supposed to be daily. That's why they are called DAILY Scrums.");
    imp.setSolution(
        "Fixed time and place to 09.00 p. m. at Starbucks every morning (except weekdays, weekends and holydays).");

    // no coffee
    imp =
        impedimentDao.postImpediment(this, Date.randomPast(5), "There is no coffee machine", false);
  }
예제 #9
0
 public boolean test(Impediment e) {
   return value == e.isClosed();
 }
예제 #10
0
 public boolean test(Impediment e) {
   return e.isSolution(value);
 }
예제 #11
0
 public boolean test(Impediment e) {
   return e.isDescription(value);
 }
예제 #12
0
 public boolean test(Impediment e) {
   return e.isDate(value);
 }
예제 #13
0
 public boolean test(Impediment e) {
   return e.isLabel(value);
 }
예제 #14
0
 public boolean test(Impediment e) {
   return e.isNumber(value);
 }
예제 #15
0
 public boolean test(Impediment e) {
   return e.isProject(value);
 }
예제 #16
0
  @Override
  public void onCreateEntity(GwtConversation conversation, String type, Map properties) {
    String id = (String) properties.get("id");
    if (id == null) throw new NullPointerException("id == null");

    ADao dao = getDaoService().getDaoByName(type);
    AEntity entity = dao.newEntityInstance(id);
    entity.updateProperties(properties);
    User currentUser = conversation.getSession().getUser();
    Project currentProject = conversation.getProject();

    if (entity instanceof Numbered) {
      ((Numbered) entity).updateNumber();
    }

    if (entity instanceof Project) {
      Project project = (Project) entity;
      project.addParticipant(currentUser);
      project.addAdmin(currentUser);
      project.addProductOwner(currentUser);
      project.addScrumMaster(currentUser);
      project.addTeamMember(currentUser);
    }

    if (entity instanceof Comment) {
      Comment comment = (Comment) entity;
      comment.setDateAndTime(DateAndTime.now());
      postProjectEvent(
          conversation,
          comment.getAuthor().getName() + " commented on " + comment.getParent(),
          comment.getParent());
      currentProject.updateHomepage(comment.getParent(), true);
    }

    if (entity instanceof ChatMessage) {
      ChatMessage chatMessage = (ChatMessage) entity;
      chatMessage.setDateAndTime(DateAndTime.now());
    }

    if (entity instanceof Impediment) {
      Impediment impediment = (Impediment) entity;
      impediment.setDate(Date.today());
    }

    if (entity instanceof Issue) {
      Issue issue = (Issue) entity;
      issue.setDate(DateAndTime.now());
      issue.setCreator(currentUser);
    }

    if (entity instanceof Task) {
      Task task = (Task) entity;
      Requirement requirement = task.getRequirement();
      requirement.setRejectDate(null);
      requirement.setClosed(false);
      sendToClients(conversation, requirement);
    }

    if (entity instanceof BlogEntry) {
      BlogEntry blogEntry = (BlogEntry) entity;
      blogEntry.setDateAndTime(DateAndTime.now());
      blogEntry.addAuthor(currentUser);
    }

    if (entity instanceof Change) {
      Change change = (Change) entity;
      change.setDateAndTime(DateAndTime.now());
      change.setUser(currentUser);
    }

    if (!(entity instanceof Transient)) dao.saveEntity(entity);

    sendToClients(conversation, entity);

    if (entity instanceof Requirement) {
      Requirement requirement = (Requirement) entity;
      Requirement epic = requirement.getEpic();
      String value = null;
      if (epic != null) {
        value = epic.getReferenceAndLabel();
        Change change =
            changeDao.postChange(epic, currentUser, "@split", null, requirement.getReference());
        conversation.sendToClient(change);
      }
      Change change = changeDao.postChange(requirement, currentUser, "@created", null, value);
      conversation.sendToClient(change);
    }

    if (entity instanceof Task
        || entity instanceof Wikipage
        || entity instanceof Risk
        || entity instanceof Impediment
        || entity instanceof Issue
        || entity instanceof BlogEntry) {
      Change change = changeDao.postChange(entity, currentUser, "@created", null, null);
      conversation.sendToClient(change);
    }

    if (currentUser != null && currentProject != null) {
      ProjectUserConfig config = currentProject.getUserConfig(currentUser);
      config.touch();
      sendToClients(conversation, config);
    }
  }