コード例 #1
0
 public void syncBeanData() {
   if (JSFUtils.isPostbackRequired()) {
     projects = projectService.findByMemberAndOwner(getLoggedInMember().getMemberId());
     verifyProjectId();
     verifyTeamId();
     verifySprintId();
     loadIssues();
   }
 }
コード例 #2
0
 @PostConstruct
 public void initial() {
   projects = projectService.findByMemberAndOwner(getLoggedInMember().getMemberId());
   try {
     selectProject(projects.get(0).getProjectId());
   } catch (Exception e) {
     LOGGER.warn(e);
   }
 }
コード例 #3
0
 public void redirectToMeetingPage() {
   String issueIdString = JSFUtils.getRequestParameter("issueId");
   Project project =
       projectService.findProjectOfIssue(
           issueService.findIssueById(Long.parseLong(issueIdString)));
   this.projectId = project.getProjectId();
   this.teamId = Long.parseLong(JSFUtils.getRequestParameter("teamId"));
   this.sprintId = Long.parseLong(JSFUtils.getRequestParameter("sprintId"));
   this.setSelectedParentIssueId(issueIdString);
   try {
     FacesContext.getCurrentInstance().getExternalContext().redirect("meeting");
   } catch (IOException e) {
   }
 }
コード例 #4
0
  /** Redirect to view issue detail page */
  public void toViewIssuePage() {
    this.viewProject = projectService.findProjectOfIssue(this.viewIssue);
    Issue viewedIssue = getViewIssue();
    this.attachmentListByIssue = attachmentService.findAttachmentByIssue(viewedIssue);
    // list all attachment file of User Story
    if (viewedIssue != null && viewedIssue.getUserStory() != null) {
      this.attachmentListByIssue.addAll(
          attachmentService.findAttachmentByUserStory(viewedIssue.getUserStory()));
    }

    JSFUtils.setManagedBeanValue("historyBean.issueId", this.viewIssue.getIssueId());
    String contextPath =
        FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()
            + "/issue/view";
    JSFUtils.redirect(contextPath);
  }
コード例 #5
0
  /** Create new user story with information entered in view, then save it into database */
  public void addUserStory() {
    RequestContext requestContext = RequestContext.getCurrentInstance();

    if (getProjectId() == 0) {
      requestContext.addCallbackParam("success", false);
      return;
    }
    try {
      UserStory us = new UserStory();

      // Remove Control Characters
      us.setName(Utils.standardizeString(userStory.getName()).replaceAll("\\p{Cntrl}", ""));
      us.setDescription(userStory.getDescription().replaceAll("\\p{Cntrl}", ""));

      us.setStatus(UserStory.StatusType.TODO);
      us.setValue(userStory.getValue());
      us.setProject(projectService.findProjectById(getProjectId()));
      us.setRisk(0);
      us.setPriority(UserStory.PriorityType.NONE);
      if (userStoryService.create(us)) {
        saveAttachmentsToDatabase(us);

        resetUserStoryValue();
        setValueForUsList();
        setCreateMode(false);
        requestContext.addCallbackParam("success", true);
        JSFUtils.resloveMethodExpression(
            "#{homeBean.setDefaultHistoryList}", Void.class, new Class<?>[0], new Object[0]);
      } else {
        throw new Exception();
      }
    } catch (Exception e) {
      requestContext.addCallbackParam("success", false);
      LOGGER.error("HomePage addUserStory: " + e);
    }
  }