protected void sendNotificationEvent(MemberRequest memberRequest)
      throws PortalException, SystemException {

    JSONObject notificationEventJSONObject = JSONFactoryUtil.createJSONObject();

    notificationEventJSONObject.put("groupId", memberRequest.getGroupId());
    notificationEventJSONObject.put("memberRequestId", memberRequest.getMemberRequestId());
    notificationEventJSONObject.put("portletId", PortletKeys.SO_INVITE_MEMBERS);
    notificationEventJSONObject.put("title", "x-invited-you-to-join-x");
    notificationEventJSONObject.put("userId", memberRequest.getUserId());

    NotificationEvent notificationEvent =
        NotificationEventFactoryUtil.createNotificationEvent(
            System.currentTimeMillis(), PortletKeys.SO_NOTIFICATION, notificationEventJSONObject);

    notificationEvent.setDeliveryRequired(0);

    ChannelHubManagerUtil.sendNotificationEvent(
        memberRequest.getCompanyId(), memberRequest.getReceiverUserId(), notificationEvent);
  }
コード例 #2
0
  protected void sendNotificationEvent(MicroblogsEntry microblogsEntry)
      throws PortalException, SystemException {

    JSONObject notificationEventJSONObject = JSONFactoryUtil.createJSONObject();

    notificationEventJSONObject.put("body", microblogsEntry.getContent());
    notificationEventJSONObject.put("entryId", microblogsEntry.getMicroblogsEntryId());
    notificationEventJSONObject.put("entryKeyName", "receiverMicroblogsEntryId");
    notificationEventJSONObject.put("mvcPath", "/microblogs/view.jsp");
    notificationEventJSONObject.put("portletId", "1_WAR_microblogsportlet");
    notificationEventJSONObject.put("title", "x-commented-on-your-post");
    notificationEventJSONObject.put("userId", microblogsEntry.getUserId());

    NotificationEvent notificationEvent =
        NotificationEventFactoryUtil.createNotificationEvent(
            System.currentTimeMillis(), "6_WAR_soportlet", notificationEventJSONObject);

    notificationEvent.setDeliveryRequired(0);

    ChannelHubManagerUtil.sendNotificationEvent(
        microblogsEntry.getCompanyId(), microblogsEntry.getReceiverUserId(), notificationEvent);
  }