/**
  * This method is called when the "Unsubscribe from Channel" button is clicked in the
  * Channel Systems page. Unsubscribes the specified systems from the channel.
  *
  * @param form Action form object.
  * @param req The servlet request object
  * @param elementIn The checked element in the set
  * @param userIn logged in user
  * @return true
  */
 public Boolean unsubscribeSystems(
     ActionForm form, HttpServletRequest req, RhnSetElement elementIn, User userIn) {
   ConfigChannel channel = ConfigActionHelper.getChannel(req);
   Server s = ServerFactory.lookupById(elementIn.getElement());
   s.unsubscribe(channel);
   ServerFactory.save(s);
   return Boolean.TRUE;
 }
 /**
  * @param mapping ActionMapping
  * @param formIn ActionForm
  * @param request ServletRequest
  * @param response ServletResponse
  * @return The ActionForward to go to next.
  */
 public ActionForward processUnsubscribe(
     ActionMapping mapping,
     ActionForm formIn,
     HttpServletRequest request,
     HttpServletResponse response) {
   Map params = makeParamMap(formIn, request);
   operateOnSelectedSet(mapping, formIn, request, response, "unsubscribeSystems");
   RequestContext requestContext = new RequestContext(request);
   ConfigActionHelper.clearRhnSets(requestContext.getCurrentUser());
   return getStrutsDelegate().forwardParams(mapping.findForward("success"), params);
 }
Ejemplo n.º 3
0
 /**
  * Returns a i18ned string holding info on the Number of Files & Directories this is used in
  * Config Channel Subscriptions page
  *
  * @return a i18n'ed string..
  */
 public String getFilesAndDirsDisplayString() {
   int files = 0, dirs = 0, symlinks = 0;
   if (filesOnlyCount != null) {
     files = filesOnlyCount.intValue();
   }
   if (dirsOnlyCount != null) {
     dirs = dirsOnlyCount.intValue();
   }
   if (symlinksOnlyCount != null) {
     symlinks = symlinksOnlyCount.intValue();
   }
   ConfigFileCount count = ConfigFileCount.create(files, dirs, symlinks);
   return ConfigActionHelper.makeFileCountsMessage(count, null, false, false);
 }
 /** {@inheritDoc} */
 protected void processParamMap(
     ActionForm formIn, HttpServletRequest requestIn, Map<String, Object> paramsIn) {
   ConfigChannel cc = ConfigActionHelper.getChannel(requestIn);
   ConfigActionHelper.processParamMap(cc, paramsIn);
 }
 /** {@inheritDoc} */
 protected DataResult getDataResult(User u, ActionForm formIn, HttpServletRequest request) {
   RequestContext ctx = new RequestContext(request);
   ConfigChannel cc = ConfigActionHelper.getChannel(ctx.getRequest());
   DataResult dr = ConfigurationManager.getInstance().listSystemInfoForChannel(u, cc, null);
   return dr;
 }