#4396 Implement new class(es) for timeline retrieval/curation - NEEDS MONGO CMDS

v1.0.0
closed
General
Cory Johns
2015-08-20
2012-06-15
No

Right now, the only way to get a timeline is to call director.create_timeline(), which does an actual aggregation. We need something higher-level than this. Something like:

def get_timeline(node, page=0, limit=100, subject_only=True, check_perms=True):
    # do stuff ...
    return timeline

Things encapsulated by this method or the class that implements it:

  • figuring our whether a new aggregation needs to happen and doing it if necessary, or else fetching a cached timeline
  • filtering activities based on permissions
  • filtering activities based on whether subject_only=True or not; if True, only return activities where node is the subject (actor) in the activity; this will be used for the Your Activity page
  • converting raw activity dicts from mongo into nice object that are easy to use for rendering in the html templates

Related

Tickets: #4242

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-06-15
    • size: --> 4
     
  • Tim Van Steenburgh

    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
     
  • Tim Van Steenburgh

    • status: in-progress --> code-review
    • qa: Cory Johns
     
  • Tim Van Steenburgh

    forge:tv/4396
    activitystream:tv/4396

    Run setup.py develop on the activitystream branch.
    Drop existing activitystream collections (data format is changing):

    $ mongo activitystream
    > db.nodes.drop()
    > db.activities.drop()
    > db.timelines.drop()
    

    Register (at least one) new user on your sandbox. Confirmation email is sent to your sfpy box - you'll need it to confirm the account.

    Using your new user(s), admin1, and a test project, test the activitystream display for users and projects. Here are my notes from the last demo, which should give you some ideas for things to try:

    ActivityStream Demo
    -------------------
    
    Users: Admin1, Tim V, Another Guy
    Project: asdemo
    
    Tim V follows Admin1
    Tim V watches project asdemo
    
    Admin1 creates Wiki Page on his user project.
        Tim V sees it in his activitystream b/c he follows Admin1.
    
    Another Guy posts a comment on asdemo forum.
        Tim V sees it in his activitystream b/c he is watching the asdemo project.
    
    Permission checking:
        Admin1 creates a ticket - Tim V sees it.
        Admin1 makes the Ticket private - disappears from Tim V timeline.
    
    Looking at your own timeline shows your aggregated feed.
    Looking at someone else's timeline shows only stuff they've done.
    Looking at project timeline shows all activity for the project.
    
    Paging hooks are ready but not wired up yet.
        e.g. .../activity/?page=0&limit=2
    

    AFTER TESTING:

    Before merging, send back to me so I can build a new activitystream release with the tv/4396 changes, and add the new package to the Allura requirements.

     
  • Cory Johns

    Cory Johns - 2012-08-13
    • status: code-review --> validation
     
  • Tim Van Steenburgh

    • summary: Implement new class(es) for timeline retrieval/curation --> Implement new class(es) for timeline retrieval/curation - NEEDS MONGO CMDS
    • status: validation --> closed
     

Log in to post a comment.