Group Notifications

When Charlie accepts Irene's group membership request, Irene should be notified that her request has been accepted by the group administrator. VCE provides a tag library to retrieve this type of notifications.

Here is an example script on how to show the notification that group membership request has been accepted.

<community:user id="communityUser"/>
<community:groupsNotifications id="acceptedGroups" name="communityUser" type="Accepted"/>

<c:forEach var="acceptedGroup" items="${acceptedGroups}">
  Membership Accepted to group ${acceptedGroup.article.title}
  <html:form styleId="groupMemberForm" action="/notification/group/clear">
    <html:hidden property="groupId" value="${acceptedGroup.id}"/>
    <html:hidden property="userId" value="${communityUser.id}"/>
    <html:submit value="Clear"/>
  </html:form>
</c:forEach>

Similarly, the group administrator can see the notifications of acceptances or rejections of the group invitations he has sent. There is a tag <community:groupMembersNotifications/> to retrieve these notifications. For further details on group related tags, see Escenic Community Expansion Taglib Reference: Chapter 4: Community.

Once the user has read the notification, he will want to remove that notification. The script above showed how to clear the group notifications using the Struts action /notification/group/clear. The Struts action class serving this purpose is com.ndc.community.struts.actions.groupmembership.ClearGroupMemberNotification which uses the form class com.ndc.community.struts.actions.forms.GroupMembershipForm.

Form PropertyDescription

userId

The ID of the user whose notification is to be cleared.

groupId

The ID of the group for which notification is to be cleared.