public void doCreateActivity( UserId userId, GroupId groupId, String appId, Set<String> fields, Activity activity, SecurityToken securityToken) throws Exception { long userIdLong = GetterUtil.getLong(userId.getUserId(securityToken)); String activityAppId = activity.getAppId(); JSONObject extraDataJSONObject = JSONFactoryUtil.createJSONObject(); SerializerUtil.copyProperties(activity, extraDataJSONObject, _ACTIVITY_FIELDS); SocialActivityLocalServiceUtil.addActivity( userIdLong, 0L, Activity.class.getName(), activity.getPostedTime(), activityAppId.hashCode(), extraDataJSONObject.toString(), 0L); }