Activity Story Stream widget

Hi,

I am currently attempting to create a custom activity stream widget by passing in container IDs of sub-groups. To give a bit more context, we have create a hierarchical structure that looks like:

  • Parent group A
    • Sub-group
    • Sub-group
    • Sub-group
    • Sub-group
    • Sub-group
  • Parent group B
    • Sub-group
    • Sub-group
    • Sub-group
    • Sub-group
    • Sub group

In the activity stream widget, I've added a custom configuration parameter for the filters with the container IDs of the parent groups. When the activity stream widget invokes the call back function to retrieve all the feeds, it first looks at the configuration for the parent group's container ID. The code then uses the $core_v2_group.List() API, passing the parent's container ID along with IncludeAllSubGroups = true to get all the sub groups within the parent group.

For each sub-group, I then build a string with a comma separator (as noted in the documentation) to be passed into the $core_v2_activityStory.List() call. So the code looks something like this:

#set($parentGroupId = $core_v2_widget.GetStringValue('fromConfig', ''))
## Get parent group
#set($parentGroup = $core_v2_group.Get("%{ ContainerId = $parenGroupId}"))
## Get all subgroups
#set($subGroups = $core_v2_group.List("%{ IncludeAllSubgroups = 'true', PageSize = '20', ParentGroupId = $parentGroup.Id, Permission = 'Group_ReadGroup'}"))

##iterate through all subgroups and grab their container ids
#foreach($subgroup in $subGroups)
    #set($containerIds = "${containerIds},${subGroup.ContainerId}")
#end

##set the ActivityStory query to include all sub group container Ids
#set ($query = "%{ SortBy = 'Date', SortOrder = 'Descending', PageSize= '20', ContainerIds = $containerIds }")


## $query is then used in $core_v2_activityStory.List($query) in callback_getStory.vm - which is in the default widget

The code then proceed to use the existing activity story callback .vm to build the UI

Now the interesting bit is: I get all the feeds as intended. All the sub groups' activity feeds appear. However, there are some differences:

  1. Anything newly created under these parent groups do not show at all.
  2. Older sub groups that already exist within the respective parent groups show as intended, and are working fine.
  3. Reverting to the older query seems to work, but does not partition the feeds as intended. 

The ultimate goal of this implementation is to have 4 different feeds on the home page, as such:

  • Feed 1 - All Feed  (Working)
    • Shows all sub groups from both parent groups (Working)
    • Shows all user activities (Working)
  • Feed 2- Parent Group A (Issue above)
    • Show only Parent group A feeds
    • Show all Parent group A's subgroups feed
    • Show all user activities under the above points.
  • Feed 3 - Parent Group B (Issue above)
    • Show only Parent group A feeds
    • Show all Parent group A's subgroups feed
    • Show all user activities under the above points.
  • Feed 4 - Personal Feed (Working)
    • Show only contextual user's activity 

I've been trying to get my head around this issue as to why newly created sub groups are not showing at all, whereas existing ones do. An interesting note to take is: after a day or so, the newly created groups will show, albeit running the above code in the sandbox. I've checked all variables within the widget to see if any are missing or null or undefined, but this would render no feed to appear at all. So I guess this is overruled by that fact.

Has anyone encountered this issue at all?