@Override
  protected long getActivitySetId(long activityId) {
    try {
      SocialActivitySet activitySet = null;

      SocialActivity activity = SocialActivityLocalServiceUtil.getActivity(activityId);

      if (activity.getType() == SocialActivityKeyConstants.DL_ADD_FILE_ENTRY) {

        activitySet =
            SocialActivitySetLocalServiceUtil.getUserActivitySet(
                activity.getGroupId(), activity.getUserId(),
                activity.getClassNameId(), activity.getType());
      } else if (activity.getType() == SocialActivityKeyConstants.DL_UPDATE_FILE_ENTRY) {

        activitySet =
            SocialActivitySetLocalServiceUtil.getClassActivitySet(
                activity.getUserId(), activity.getClassNameId(),
                activity.getClassPK(), activity.getType());
      }

      if ((activitySet != null) && !isExpired(activitySet, false)) {
        return activitySet.getActivitySetId();
      }
    } catch (Exception e) {
    }

    return 0;
  }
  public Activity doGetActivity(
      UserId userId,
      GroupId groupId,
      String appId,
      Set<String> fields,
      String activityId,
      SecurityToken securityToken)
      throws Exception {

    ThemeDisplay themeDisplay = getThemeDisplay(securityToken);

    long activityIdLong = GetterUtil.getLong(activityId);

    SocialActivity socialActivity = SocialActivityLocalServiceUtil.getActivity(activityIdLong);

    return getActivity(themeDisplay, socialActivity);
  }