private static Logger log = Logger.getLogger(LoadAction.class);
@Override
public EditPanel createPanel(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
UsergroupVO usergroup = (UsergroupVO)attributes.get("usergroup");
List<UserVO> users = (List<UserVO>)attributes.get("users");
List<RoleVO> roles = (List<RoleVO>)attributes.get("roles");
boolean deletable = false;
if(users.isEmpty() && roles.isEmpty())
deletable = true;
EditPanel panel = new EditPanel(Right.ADMINISTRATION_USERGROUP_WRITE, usergroup);
if(usergroup.getId() == null)
panel.setTitle(MessageUtil.message(request, "module.system.usergroup.headLine.create"));
else
{
panel.setTitle(MessageUtil.message(request, "module.system.usergroup.headLine.edit", usergroup.getName()));
panel.setAttribute(DeleteAction.TEXT_TITLE, MessageUtil.message(request, "module.system.usergroup.delete.headLine", usergroup.getName()));
panel.setAttribute(DeleteAction.TEXT_QUESTION, MessageUtil.message(request, "module.system.usergroup.delete.question", usergroup.getName()));
}
panel.addAction(Action.Type.DELETE, "/system/management/usergroup/delete", deletable);
panel.addAction(Action.Type.SAVE, "/system/management/usergroup/save");