public SocialActivitySet addActivitySet(long activityId) throws PortalException, SystemException { // Activity set SocialActivity activity = socialActivityPersistence.findByPrimaryKey(activityId); long activitySetId = counterLocalService.increment(); SocialActivitySet activitySet = socialActivitySetPersistence.create(activitySetId); activitySet.setGroupId(activity.getGroupId()); activitySet.setCompanyId(activity.getCompanyId()); activitySet.setUserId(activity.getUserId()); activitySet.setCreateDate(activity.getCreateDate()); activitySet.setModifiedDate(activity.getCreateDate()); activitySet.setClassName(activity.getClassName()); activitySet.setClassPK(activity.getClassPK()); activitySet.setType(activity.getType()); activitySet.setActivityCount(1); socialActivitySetPersistence.update(activitySet); // Activity activity.setActivitySetId(activitySetId); socialActivityPersistence.update(activity); return activitySet; }
protected void importSocialActivity(SocialActivity socialActivity, long calendarBookingId) throws SystemException { addSocialActivity( counterLocalService.increment(SocialActivity.class.getName()), socialActivity.getGroupId(), socialActivity.getCompanyId(), socialActivity.getUserId(), socialActivity.getCreateDate(), socialActivity.getMirrorActivityId(), classNameLocalService.getClassNameId(CalendarBooking.class), calendarBookingId, socialActivity.getType(), socialActivity.getExtraData(), socialActivity.getReceiverUserId()); }