protected void deleteFeeds(ActionRequest actionRequest) throws Exception {
    long groupId = ParamUtil.getLong(actionRequest, "groupId");

    String[] deleteFeedIds = StringUtil.split(ParamUtil.getString(actionRequest, "deleteFeedIds"));

    for (int i = 0; i < deleteFeedIds.length; i++) {
      JournalFeedServiceUtil.deleteFeed(groupId, deleteFeedIds[i]);
    }
  }
  public static void getFeed(HttpServletRequest request) throws Exception {
    long groupId = ParamUtil.getLong(request, "groupId");
    String feedId = ParamUtil.getString(request, "feedId");

    JournalFeed feed = null;

    if (Validator.isNotNull(feedId)) {
      feed = JournalFeedServiceUtil.getFeed(groupId, feedId);
    }

    request.setAttribute(WebKeys.JOURNAL_FEED, feed);
  }
  protected void updateFeed(ActionRequest actionRequest) throws Exception {
    String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

    long groupId = ParamUtil.getLong(actionRequest, "groupId");

    String feedId = ParamUtil.getString(actionRequest, "feedId");
    boolean autoFeedId = ParamUtil.getBoolean(actionRequest, "autoFeedId");

    String name = ParamUtil.getString(actionRequest, "name");
    String description = ParamUtil.getString(actionRequest, "description");
    String type = ParamUtil.getString(actionRequest, "type");
    String structureId = ParamUtil.getString(actionRequest, "structureId");
    String templateId = ParamUtil.getString(actionRequest, "templateId");
    String rendererTemplateId = ParamUtil.getString(actionRequest, "rendererTemplateId");
    int delta = ParamUtil.getInteger(actionRequest, "delta");
    String orderByCol = ParamUtil.getString(actionRequest, "orderByCol");
    String orderByType = ParamUtil.getString(actionRequest, "orderByType");
    String targetLayoutFriendlyUrl = ParamUtil.getString(actionRequest, "targetLayoutFriendlyUrl");
    String targetPortletId = ParamUtil.getString(actionRequest, "targetPortletId");
    String contentField = ParamUtil.getString(actionRequest, "contentField");

    String feedType = RSSUtil.TYPE_DEFAULT;
    double feedVersion = RSSUtil.VERSION_DEFAULT;

    String feedTypeAndVersion = ParamUtil.getString(actionRequest, "feedTypeAndVersion");

    if (Validator.isNotNull(feedTypeAndVersion)) {
      String[] parts = feedTypeAndVersion.split(StringPool.COLON);

      try {
        feedType = parts[0];
        feedVersion = GetterUtil.getDouble(parts[1]);
      } catch (Exception e) {
      }
    } else {
      feedType = ParamUtil.getString(actionRequest, "feedType", feedType);
      feedVersion = ParamUtil.getDouble(actionRequest, "feedVersion", feedVersion);
    }

    ServiceContext serviceContext =
        ServiceContextFactory.getInstance(JournalFeed.class.getName(), actionRequest);

    if (cmd.equals(Constants.ADD)) {

      // Add feed

      JournalFeedServiceUtil.addFeed(
          groupId,
          feedId,
          autoFeedId,
          name,
          description,
          type,
          structureId,
          templateId,
          rendererTemplateId,
          delta,
          orderByCol,
          orderByType,
          targetLayoutFriendlyUrl,
          targetPortletId,
          contentField,
          feedType,
          feedVersion,
          serviceContext);
    } else {

      // Update feed

      JournalFeedServiceUtil.updateFeed(
          groupId,
          feedId,
          name,
          description,
          type,
          structureId,
          templateId,
          rendererTemplateId,
          delta,
          orderByCol,
          orderByType,
          targetLayoutFriendlyUrl,
          targetPortletId,
          contentField,
          feedType,
          feedVersion,
          serviceContext);
    }
  }