@Override
  public ActionForward render(
      ActionMapping mapping,
      ActionForm form,
      PortletConfig portletConfig,
      RenderRequest renderRequest,
      RenderResponse renderResponse)
      throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);

    Map<String, List<SocialEquityActionMapping>> equityActionMappingsMap =
        new LinkedHashMap<String, List<SocialEquityActionMapping>>();

    String[] classNames = ResourceActionsUtil.getSocialEquityClassNames();

    Comparator<String> comparator = new ModelResourceComparator(themeDisplay.getLocale());

    Arrays.sort(classNames, comparator);

    for (String className : classNames) {
      List<SocialEquityActionMapping> mergedEquityActionMappings =
          getMergedEquityActionMappings(themeDisplay.getScopeGroupIdOrLiveGroupId(), className);

      equityActionMappingsMap.put(className, mergedEquityActionMappings);
    }

    renderRequest.setAttribute(WebKeys.SOCIAL_EQUITY_ACTION_MAPPINGS_MAP, equityActionMappingsMap);

    return mapping.findForward("portlet.social_equity_admin.view");
  }
  protected void updateSettings(ActionRequest actionRequest) throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

    boolean enabled = ParamUtil.getBoolean(actionRequest, "enabled");

    SocialEquityGroupSettingLocalServiceUtil.updateEquityGroupSetting(
        themeDisplay.getScopeGroupIdOrLiveGroupId(),
        Group.class.getName(),
        SocialEquitySettingConstants.TYPE_INFORMATION,
        enabled);

    SocialEquityGroupSettingLocalServiceUtil.updateEquityGroupSetting(
        themeDisplay.getScopeGroupIdOrLiveGroupId(),
        Group.class.getName(),
        SocialEquitySettingConstants.TYPE_PARTICIPATION,
        enabled);

    String[] classNames = ResourceActionsUtil.getSocialEquityClassNames();

    for (String className : classNames) {
      List<SocialEquityActionMapping> mergedEquityActionMappings =
          getMergedEquityActionMappings(actionRequest, className);

      SocialEquitySettingLocalServiceUtil.updateEquitySettings(
          themeDisplay.getScopeGroupIdOrLiveGroupId(), className, mergedEquityActionMappings);

      enabled = ParamUtil.getBoolean(actionRequest, className + ".enabled");

      SocialEquityGroupSettingLocalServiceUtil.updateEquityGroupSetting(
          themeDisplay.getScopeGroupIdOrLiveGroupId(),
          className,
          SocialEquitySettingConstants.TYPE_INFORMATION,
          enabled);

      SocialEquityGroupSettingLocalServiceUtil.updateEquityGroupSetting(
          themeDisplay.getScopeGroupIdOrLiveGroupId(),
          className,
          SocialEquitySettingConstants.TYPE_PARTICIPATION,
          enabled);
    }
  }
  protected void updateRanks(ActionRequest actionRequest) throws Exception {
    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

    SocialEquityLogLocalServiceUtil.updateRanks(themeDisplay.getScopeGroupIdOrLiveGroupId());
  }