WebUser user = SessionUtils.getWebUser(request.getSession());
WebUserPreferences preferences = user.getWebPreferences();
String forwardStr = RetCodeConstants.SUCCESS_URL;
if (pForm.isRemoveClicked()) {
AlertsPortletPreferences alertPrefs = preferences.getAlertsPortletPreferences();
for (Integer doomedResourceId : pForm.getIds()) {
alertPrefs.removeResource(doomedResourceId);
}
preferences.setAlertsPortletPreferences(alertPrefs);
forwardStr = "review";
} else if (pForm.isOkClicked()) {
AlertsPortletPreferences alertPrefs = preferences.getAlertsPortletPreferences();
int[] savedResourceIds = alertPrefs.asArray();
alertPrefs = pForm.getAlertsPortletPreferences();
alertPrefs.setResource(ArrayUtils.wrapInList(savedResourceIds));
preferences.setAlertsPortletPreferences(alertPrefs);
}
if (!pForm.isDisplayOnDash()) {
DashboardUtils.removePortlet(user, pForm.getPortletName());