* org.apache.struts.action.ActionForm,
* javax.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse)
*/
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
GroupManager groupManager = new GroupManager(locale,session);
UserSetManager userSetManager = new UserSetManager(locale,session);
UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
if (!userSetEnterOrEditForm.isConfirmationPending()){
String idParameter = req.getParameter("id");
long id = Long.valueOf(idParameter);
UserSet userSet = userSetManager.getUserSet(id);
if (userSet == null){
throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound", id));
}
checkAccessRights(req,userSet.getGroup());
userSetEnterOrEditForm.setOriginalId(id);
userSetEnterOrEditForm.setId(id);
userSetEnterOrEditForm.setDescription(userSet.getDescription());
userSetEnterOrEditForm.setHidden(userSet.getHidden()==1?true:false);
userSetEnterOrEditForm.setUserSetName(req.isUserInRole(UserManagerBase.ADMINISTRATOR) ? userSet.getName() : getResources(req).getMessage(locale, "um.Copy") + ": " + userSet.getName());
Group group = userSet.getGroup();
userSetEnterOrEditForm.setGroupId(group.getId());
userSetEnterOrEditForm.setGroupname(group.getGroupname());
Group[] groups = groupManager.getGroups();
req.getSession().setAttribute("groups", groups); // must be in session, because the form may be redisplayed on validation errors
}
return mapping.findForward("edit");
}