Community articleSupport for Rollup
Added by IBM contributorIBM on September 5, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.

What is rollup?


In order to address the scenario where a user posts a file and 200 people 'like' it, filling up their Activity Stream, rollup needs to be performed. This means:
  • Only the latest event on any given object is shown
  • The 2 most recent comments are returned.
  • We support the rollup=true flag on retrieval for specifying that a rolled up feed is required. However, rollup is not meaningful (and therefore not supported) for all views.

    Determining what is rolled up


    Normally the object id is used as the 'rollup id'. What this means is that all events with the same object id are rolled up together. However in many cases, events that specify the object in question as the Target (for example when posting a comment) are suitable for rolling up with those that specify it as the Object in the event. For this reason it is possible to specify a rollupid in the data model, which will determine what events get rolled up together in the rolled up view. Simply add the following to the connections property of the event:

     "connections": {

    "rollupid": "3d7638dd-b5e1-4d52-a03d-83591996da20"
    },

    Views that support rollup


    Views that select a subset of events of those that may be appropriate for any given object do generally not support rollup. In general this means you cannot get a rolled up view on:
    • Actionable events views
    • Saved events views
    However rollup is available for the following:
    My Activity Stream: /activitystreams/@me/@all?rollup=true

    Filtered by Application: /activitystreams/@me/@all/blogs?rollup=tr/activitystreams/@me/@all/blogs?rollup=true

    Responses: /activitystreams/@me/@responses?rollup=true

    Filtered by Application: /activitystreams/@me/@responses/blogs?rollup=true

    Discover: /activitystreams/@public/@all?rollup=true

    Filtered by Application: /activitystreams/@public/@all/blogs?rollup=true

    Profile View: /activitystreams/@public/@all?FilterBy=involved&filterOp=equals&filterValue=pid&rollup=true

    Filtered by Application: /activitystreams/@public/@all/blogs?FilterBy=involved . . .&rollup=true

    Community View: /activitystreams/urn:lsid:lconn.ibm.com:communities.community:communityid/@all?rollup=true

    Filtered by Application: /activitystreams/urn:lsid:lconn.ibm.com:communities.community:communityid/@all/blogs?rollup=true

    Status Updates (all): /activitystreams/@me/@all/@status?rollup=true

    Filtered by My Updates: /activitystreams/@me/@self/@status?rollup=true
    Filtered by My Network: /activitystreams/@me/@friends/@status?rollup=true
    Filtered by I'm Following: /activitystreams/@me/@following/@status?rollup=true
    Filtered by I'm Following and My Network: /activitystreams/@me/@following&@friends/@status/?rollup=true

    The rollup data model provided


    As mentioned above, the rollup identifier is returned indicating what we use to gather the events. The 2 most recent comments are also included in the replies property of the appropriate object. It's important to note that the relevant object may be the object property (typically in the case of a recommendation) or the target object (typically in the case of a comment). A good idea is to compare their id's to the rollup id in the object to see what has been rolled up.

    Example:

     "target": {
    • "summary": "A status updates",
    • 
      
    • "replies": {
    • 
      
      • "items": [
      • 
        
        • {
        • 
          
          • "content": "A comment",
          • 
            
          • "author": {
          • 
            
            • "connections": {
            • 
              
              • "state": "active"
              • 
                
                },
              • "objectType": "person",
              • 
                
              • "id": "urn:lsid:lconn.ibm.com:profiles.person:99450a40-7546-102f-9f49-f6be80987c6a",
              • 
                
              • "displayName": "John Doe2"
              • 
                
                },
              • "updated": "2012-08-14T12:16:50.032Z",
              • 
                
              • "id": "urn:lsid:lconn.ibm.com:profiles:fa4c3c6c-b3f2-4c49-8eb7-280cb753d2d3"
              • 
                
                },
              • {
              • 
                
                • "content": "Another comment",
                • 
                  
                • "author": {
                • 
                  
                  • "objectType": "person",
                  • 
                    
                  • "id": "urn:lsid:lconn.ibm.com:profiles.person:af52cac0-7546-102f-9f4a-f6be80987c6a",
                  • 
                    
                  • "displayName": "John Doe3"
                  • 
                    
                    },
                  • "updated": "2012-08-14T12:17:15.183Z",
                  • 
                    
                  • "id": "urn:lsid:lconn.ibm.com:profiles:8b01619a-fd35-48d6-b380-d6576cabc139"
                  • 
                    
                    }
                    ],
                  • "totalItems": 2
                  • 
                    
                    },
                  • "objectType": "note",