/** {@inheritDoc} */ @Override public ActionForward handleDispatch( ListSessionSetHelper helper, ActionMapping mapping, ActionForm formIn, HttpServletRequest request, HttpServletResponse response) { RequestContext context = new RequestContext(request); ActivationKey key = context.lookupAndBindActivationKey(); ConfigChannelListProcessor proc = new ConfigChannelListProcessor(); Set<String> set = helper.getSet(); for (String id : set) { Long ccid = Long.valueOf(id); ConfigChannel cc = ConfigurationFactory.lookupConfigChannelById(ccid); proc.remove(key.getConfigChannelsFor(context.getCurrentUser()), cc); } getStrutsDelegate() .saveMessage( "config_channels_to_unsubscribe.unsubscribe.success", new String[] {String.valueOf(set.size())}, request); Map<String, Object> params = new HashMap<String, Object>(); params.put(RequestContext.TOKEN_ID, key.getToken().getId().toString()); StrutsDelegate strutsDelegate = getStrutsDelegate(); return strutsDelegate.forwardParams(mapping.findForward("success"), params); }
/** {@inheritDoc} */ public List getResult(RequestContext context) { ConfigurationManager cm = ConfigurationManager.getInstance(); return cm.listGlobalChannelsForActivationKey( context.lookupAndBindActivationKey(), context.getCurrentUser()); }