コード例 #1
0
  /** {@inheritDoc} */
  public ActionForward execute(
      ActionMapping mapping,
      ActionForm formIn,
      HttpServletRequest request,
      HttpServletResponse response) {

    RequestContext requestContext = new RequestContext(request);
    StrutsDelegate strutsDelegate = getStrutsDelegate();

    User user = requestContext.getCurrentUser();

    Errata errata = requestContext.lookupErratum();
    DataResult dr = ErrataManager.systemsAffected(user, errata.getId(), null);

    RhnSet set = RhnSetDecl.SYSTEMS_AFFECTED.get(user);
    RhnListSetHelper helper = new RhnListSetHelper(request);

    // if its not submitted
    // ==> this is the first visit to this page
    // clear the 'dirty set'
    if (!requestContext.isSubmitted()) {
      set.clear();
      RhnSetManager.store(set);
    }

    if (request.getParameter(DISPATCH) != null) {
      helper.updateSet(set, LIST_NAME);
      if (!set.isEmpty()) {
        // Send to AffectedSystemsAction to handle submit
        return strutsDelegate.forwardParams(
            mapping.findForward("confirm"), request.getParameterMap());
      }
      RhnHelper.handleEmptySelection(request);
    }

    if (ListTagHelper.getListAction(LIST_NAME, request) != null) {
      helper.execute(set, LIST_NAME, dr);
    }

    // if I have a previous set selections populate data using it
    if (!set.isEmpty()) {
      helper.syncSelections(set, dr);
      ListTagHelper.setSelectedAmount(LIST_NAME, set.size(), request);
    }

    TagHelper.bindElaboratorTo("systemAffectedList", dr.getElaborator(), request);
    ListTagHelper.bindSetDeclTo(LIST_NAME, RhnSetDecl.SYSTEMS_AFFECTED, request);

    request.setAttribute(RequestContext.PAGE_LIST, dr);
    request.setAttribute("set", set);
    request.setAttribute("errata", errata);
    request.setAttribute(
        ListTagHelper.PARENT_URL,
        request.getRequestURI() + "?" + RequestContext.ERRATA_ID + "=" + errata.getId());

    return strutsDelegate.forwardParams(
        mapping.findForward(RhnHelper.DEFAULT_FORWARD), request.getParameterMap());
  }
コード例 #2
0
ファイル: AbstractErrata.java プロジェクト: kidaa30/spacewalk
 /** {@inheritDoc} */
 public void addChannelNotification(Channel channelIn, Date dateIn) {
   ErrataManager.clearErrataChannelNotifications(this, channelIn);
   ErrataManager.addErrataNotification(this, channelIn, dateIn);
 }
コード例 #3
0
ファイル: AbstractErrata.java プロジェクト: kidaa30/spacewalk
 /** {@inheritDoc} */
 public List getNotificationQueue() {
   return ErrataManager.listErrataNotifications(this);
 }
コード例 #4
0
ファイル: AbstractErrata.java プロジェクト: kidaa30/spacewalk
 /** {@inheritDoc} */
 public void addNotification(Date dateIn) {
   ErrataManager.clearErrataNotifications(this);
   for (Channel chan : getChannels()) {
     ErrataManager.addErrataNotification(this, chan, dateIn);
   }
 }