private List<Map<String, Long>> getPackages( User user, HttpServletRequest request, String sessionSetLabel) { List<Map<String, Long>> packs; Set<String> set = SessionSetHelper.lookupAndBind(request, sessionSetLabel); packs = toList(set); return packs; }
private List<PackageListItem> getDataResult(HttpServletRequest request) { RequestContext requestContext = new RequestContext(request); Long sid = requestContext.getRequiredParam("sid"); Set<String> data = SessionSetHelper.lookupAndBind(request, getDecl(sid)); List<PackageListItem> items = new LinkedList<PackageListItem>(); for (String key : data) { items.add(PackageListItem.parse(key)); } return items; }
/** * Callback for the Subscribe to channels button, it attempts to subscribe to the channels * containing the Packages. * * @param mapping ActionMapping * @param formIn ActionForm * @param request HttpServletRequest * @param response HttpServletResponse * @return ActionForward */ public ActionForward subscribeToChannels( ActionMapping mapping, ActionForm formIn, HttpServletRequest request, HttpServletResponse response) { RequestContext requestContext = new RequestContext(request); Long sid = requestContext.getRequiredParam("sid"); Set<String> pkgIdCombos = SessionSetHelper.lookupAndBind(request, getDecl(requestContext, sid)); Map params = new HashMap(); params.put("sid", sid); syncToVictim(requestContext, sid, pkgIdCombos, ProfileManager.OPTION_SUBSCRIBE); return getStrutsDelegate().forwardParams(mapping.findForward("showprofile"), params); }
/** {@inheritDoc} */ protected DataResult getDataResult(User user, ActionForm formIn, HttpServletRequest request) { RequestContext requestContext = new RequestContext(request); Long sid = requestContext.getRequiredParam("sid"); Set<String> pkgIdCombos = SessionSetHelper.lookupAndBind(request, getDecl(requestContext, sid)); if (isProfileSync(requestContext)) { Long prid = requestContext.getRequiredParam("prid"); return ProfileManager.getMissingProfilePackages( requestContext.getCurrentUser(), sid, prid, pkgIdCombos, null); } else if (isSystemSync(requestContext)) { Long sid1 = requestContext.getRequiredParam("sid_1"); return ProfileManager.getMissingSystemPackages( requestContext.getCurrentUser(), sid, sid1, pkgIdCombos, null); } return null; }