use of org.opennms.web.admin.groups.parsers.GroupInfo in project opennms by OpenNMS.
the class RemoveGroupDutySchedulesServlet method doPost.
/**
* {@inheritDoc}
*/
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession userSession = request.getSession(true);
Group group = (Group) userSession.getAttribute("group.modifyGroup.jsp");
GroupInfo groupInfo = group.getGroupInfo();
List<DutySchedule> dutySchedules = groupInfo.getDutySchedules();
int dutyCount = WebSecurityUtils.safeParseInt(request.getParameter("dutySchedules"));
for (int i = 0; i < dutyCount; i++) {
String curDuty = request.getParameter("deleteDuty" + i);
if (curDuty != null) {
dutySchedules.remove(i);
}
}
// forward the request for proper display
RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher("/admin/userGroupView/groups/modifyGroup.jsp");
dispatcher.forward(request, response);
}
Aggregations