예제 #1
0
  public ActionForward createPersistedGroup(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    IViewState viewState = RenderUtils.getViewState("createGroup");
    if (viewState != null) {
      PersistentGroupMembersBean bean =
          (PersistentGroupMembersBean) viewState.getMetaObject().getObject();
      if (bean.getIstId() != null) {
        bean.getPeople().add(bean.getIstId());
      }
      if (bean.getPeople().isEmpty()) {
        addActionMessage(request, "accessGroupManagement.empty");
        return mapping.findForward("createPersistedGroup");
      }
      CreatePersistentGroup.run(bean.getUnit(), bean.getName(), bean.getPeople(), bean.getType());
    }

    return configureGroups(mapping, form, request, response);
  }
예제 #2
0
  public ActionForward editPersistedGroup(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {

    IViewState viewState = RenderUtils.getViewState("editGroup");
    if (viewState != null) {
      try {
        PersistentGroupMembersBean bean =
            (PersistentGroupMembersBean) viewState.getMetaObject().getObject();
        if (bean.getIstId() != null) {
          bean.getPeople().add(bean.getIstId());
        }
        EditPersistentGroup.run(bean.getGroup(), bean.getName(), bean.getPeople(), bean.getUnit());
      } catch (DomainException e) {
        addActionMessage(request, e.getMessage());
      }
    }
    return configureGroups(mapping, form, request, response);
  }