// Getting the http request
ActionRequestImpl reqImpl = (ActionRequestImpl) req;
HttpServletRequest httpReq = reqImpl.getHttpServletRequest();
String cmd = req.getParameter(com.liferay.portal.util.Constants.CMD);
UserManagerListSearchForm searchForm = (UserManagerListSearchForm) form;
_retrieveProperties(req, res, config, form);
req.setAttribute(WebKeys.MAILING_LIST_VIEW, new ArrayList());
if (com.liferay.portal.util.Constants.VIEW.equals(cmd)) {
// viewing user filter
try {
_getUserFilter(form, req, res);
req.setAttribute(WebKeys.USER_FILTER_LIST_INODE, searchForm.getUserFilterListInode());
req.setAttribute(WebKeys.USER_FILTER_LIST_TITLE, searchForm.getUserFilterTitle());
req.setAttribute(WebKeys.USERMANAGERLISTFORM, form);
searchForm = (UserManagerListSearchForm) form;
ViewUserManagerListAction._doSearch(searchForm, req, res);
String referrer = req.getParameter("referrer");
if (UtilMethods.isSet(referrer)) {
res.sendRedirect(SecurityUtils.stripReferer(httpReq, referrer));
} else {
setForward(req, "portlet.ext.userfilter.edit_userfilter");
return;
}
} catch (Exception e) {
SessionMessages.add(req, "error", "message.userfilter.error.getting");
_handleException(e, req);
}
}
else if ("deleteUserFilter".equals(cmd)) {
// deleting user filter
try {
_deleteUserFilter(form, req, res);
String redirect = req.getParameter("redirect");
redirect = URLDecoder.decode(redirect, "UTF-8");
_sendToReferral(req, res, redirect);
return;
} catch (Exception e) {
SessionMessages.add(req, "error", "message.userfilter.error.deleting_user_filter");
_handleException(e, req);
}
}
else if (com.liferay.portal.util.Constants.SAVE.equals(cmd)) {
// Save / Update user filter
try {
_save(form, req, res);
_getUserFilter(form, req, res);
req.setAttribute(WebKeys.USER_FILTER_LIST_INODE, searchForm.getUserFilterListInode());
req.setAttribute(WebKeys.USER_FILTER_LIST_TITLE, searchForm.getUserFilterTitle());
req.setAttribute(WebKeys.USERMANAGERLISTFORM, form);
searchForm = (UserManagerListSearchForm) form;
ViewUserManagerListAction._doSearch(searchForm, req, res);
String referrer = req.getParameter("referrer");
if (UtilMethods.isSet(referrer)) {
res.sendRedirect(SecurityUtils.stripReferer(httpReq, referrer));
} else {
setForward(req, "portlet.ext.userfilter.edit_userfilter");
return;
}
} catch (Exception e) {
SessionMessages.add(req, "error", "message.userfilter.error.creating");
_handleException(e, req);
}
}
else if (com.liferay.portal.util.Constants.SEARCH.equals(cmd)) {
// Searching
try {
ViewUserManagerListAction._doSearch(searchForm, req, res);
req.setAttribute(WebKeys.USER_FILTER_LIST_INODE, searchForm.getUserFilterListInode());
req.setAttribute(WebKeys.USER_FILTER_LIST_TITLE, searchForm.getUserFilterTitle());
req.setAttribute(WebKeys.USERMANAGERLISTFORM, form);
setForward(req, "portlet.ext.userfilter.edit_userfilter");
return;
} catch (Exception e) {
SessionMessages.add(req, "error", "message.userfilter.error.deleting_user");
_handleException(e, req);
}
}
else if (com.liferay.portal.util.Constants.DELETE.equals(cmd)) {
// Deleting user
try {
_delete(form, req, res);
if (UtilMethods.isSet(req.getParameter("returnPath"))) {
setForward(req, SecurityUtils.stripReferer(httpReq, req.getParameter("returnPath")));
}
else {
_getUserFilter(form, req, res);
req.setAttribute(WebKeys.USER_FILTER_LIST_INODE, searchForm.getUserFilterListInode());
req.setAttribute(WebKeys.USER_FILTER_LIST_TITLE, searchForm.getUserFilterTitle());
req.setAttribute(WebKeys.USERMANAGERLISTFORM, form);
searchForm = (UserManagerListSearchForm) form;
}
ViewUserManagerListAction._doSearch(searchForm, req, res);
req.setAttribute(WebKeys.USERMANAGERLISTFORM, form);
String referrer = req.getParameter("referrer");
if (UtilMethods.isSet(referrer)) {
res.sendRedirect(SecurityUtils.stripReferer(httpReq, referrer));
} else {
setForward(req, "portlet.ext.userfilter.edit_userfilter");
return;
}
} catch (Exception e) {
SessionMessages.add(req, "error", "message.userfilter.error.deleting_user");
_handleException(e, req);
}
}
else if (com.liferay.portal.util.Constants.EDIT.equals(cmd)) {
_getUserFilter(form, req, res);
req.setAttribute(WebKeys.USER_FILTER_LIST_INODE, searchForm.getUserFilterListInode());
req.setAttribute(WebKeys.USER_FILTER_LIST_TITLE, searchForm.getUserFilterTitle());
searchForm = (UserManagerListSearchForm) form;
ViewUserManagerListAction._doSearch(searchForm, req, res);
req.setAttribute(WebKeys.USERMANAGERLISTFORM, form);
setForward(req, "portlet.ext.userfilter.edit_userfilter");