Пример #1
0
  /**
   * Update project open/close state
   *
   * @param projectId
   * @param authUser
   * @param state
   */
  public void updateProjectState(
      final Long projectId, final AuthUser authUser, final boolean state) {

    try {
      ProjectMember projectMember = findProjectMember(projectId, authUser);
      if (projectMember != null) {
        projectMember.setProjectOpen(state);
        em.persist(projectMember);
      }
    } catch (UCMException e) {
      logger.error("Error occurred persisting projectMember {}", e.getMessage());
    }
  }
Пример #2
0
  /**
   * Update the project member state
   *
   * @param projectId
   * @param node
   * @param state
   */
  public void updateProjectMemberState(
      final Long projectId, final AuthUser authUser, final String node, final boolean state)
      throws UCMException {

    logger.debug("updateProjectMemberState {} {}", node, state);
    try {
      ProjectMember projectMember = findProjectMember(projectId, authUser);

      if (projectMember != null) {
        if ("Test Plan".equals(node)) {
          projectMember.setTestPlanCollapsed(state);
        } else if ("Use Cases".equals(node)) {
          projectMember.setUseCasesCollapsed(state);
        } else if ("Requirement Specifications".equals(node)) {
          projectMember.setRequirementsCollapsed(state);
        } else if ("Project Management".equals(node)) {
          projectMember.setProjectManagementCollapsed(state);
        } else if ("Project Estimation".equals(node)) {
          projectMember.setProjectEstimationCollapsed(state);
        } else if ("Test Sets".equals(node)) {
          projectMember.setTestSetsCollapsed(state);
        }

        em.persist(projectMember);
      }
    } catch (Exception e) {
      logger.error("Error occurred persisting projectMember {}", e.getMessage());
      throw new UCMException(e.getMessage());
    }
  }