Search in sources :

Example 1 with GroupInfo

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);
}
Also used : Group(org.opennms.web.admin.groups.parsers.Group) GroupInfo(org.opennms.web.admin.groups.parsers.GroupInfo) HttpSession(javax.servlet.http.HttpSession) DutySchedule(org.opennms.netmgt.config.users.DutySchedule) RequestDispatcher(javax.servlet.RequestDispatcher)

Aggregations

RequestDispatcher (javax.servlet.RequestDispatcher)1 HttpSession (javax.servlet.http.HttpSession)1 DutySchedule (org.opennms.netmgt.config.users.DutySchedule)1 Group (org.opennms.web.admin.groups.parsers.Group)1 GroupInfo (org.opennms.web.admin.groups.parsers.GroupInfo)1