public String save() { if (currentStory != null) { try { Story merged = doInTransaction( new PersistenceAction<Story>() { public Story execute(EntityManager em) { if (currentStory.isNew()) { em.persist(currentStory); } else if (!em.contains(currentStory)) { return em.merge(currentStory); } return currentStory; } }); if (!currentStory.equals(merged)) { setCurrentStory(merged); int idx = getStoryList().indexOf(currentStory); if (idx != -1) { getStoryList().set(idx, merged); } } sprintManager.getCurrentSprint().addStory(merged); if (!storyList.contains(merged)) { getStoryList().add(merged); } } catch (Exception e) { getLogger(getClass()).log(Level.SEVERE, "Error on try to save Story: " + currentStory, e); addMessage("Error on try to save Story", FacesMessage.SEVERITY_ERROR); return null; } } return "show"; }
public void init() { Sprint currentSprint = sprintManager.getCurrentSprint(); if (currentSprint != null) { Story story = new Story(); story.setSprint(currentSprint); setCurrentStory(story); } }
private String editTask(Task currentTask) { if (currentTask == null) return ""; taskManager.setCurrentTask(currentTask); Story currentStory = storyManager.getCurrentStory(); if (currentStory != currentTask.getStory()) { storyManager.setCurrentStory(currentTask.getStory()); } return "/task/edit"; }
public void init() { Sprint currentSprint = sprintManager.getCurrentSprint(); if (currentSprint != null) { Story story = new Story(); setStoryList(new LinkedList<Story>(currentSprint.getStories())); story.setSprint(currentSprint); setCurrentStory(story); } else { setStoryList(new ArrayList<Story>()); } stories = new ListDataModel<Story>(getStoryList()); }
public void setStory(Story story) { storyManager.setCurrentStory(story); }
public String showTasks() { setCurrentStory(stories.getRowData()); return "showTasks"; }
public String edit() { setCurrentStory(stories.getRowData()); return "edit"; }
public String create() { Story story = new Story(); story.setSprint(sprintManager.getCurrentSprint()); setCurrentStory(story); return "create"; }
public String showTasks(Story story) { setCurrentStory(story); return "showTasks"; }
public String edit(Story story) { setCurrentStory(story); return "edit"; }