We have a couple of groups that are public and need to be public, but I would like to be able to exclude them from inclusion in the Activity Story Stream except if the widget is used in those specific groups. It seems that I should be able to add an exclusion filter to the query, but I don't see a method for doing that. As an alternative it would seem like maybe when parse-query.vm is looping through the subgroups that the specific subgroups could be skipped. Does anyone have an approach/solution for this problem?
The out-of-the-box activity story stream widget doesn't support exclusions as you noticed, but, you've identified the approach to implement that behavior by limiting the list provided as ContainerIds to not include groups that should be excluded.
As I look at it a little more, the solution will work in the "group" mode. But for "site" more ContainerIds are not included in the query. The documentation isn't specific on this point, but I assume that by default it will retrieve from all groups.
So, if I read that right I would have to implement the code to add the ContainerIds, excluding the specific ones, into the "site" section of the code. I also notice that within the group code it is hard coded with a limit of 50 subgroups in the containerID retrieval. That is way low for what would need to be handled. What is the performance hit when you run that query with say 500?
As another approach I was thinking about looking at the "stories" that were retrieved and eliminating them there. But the group information does not appear to be included in the story object and is only coming through through the core_v2_story.ViewHTML() method. So there isn't a handle there to do the elimination.