Activity streams

Inbox vs Outbox

Activities have been entirely rewritten in Pydio Cells. Inspired by social network interactions, activities are generated by internal events and stored in "denormalized" queues, which means that an event may trigger the creation of many activities.

Currently, the main objects interacting together are "Users" and "Nodes", but this could be easily generalized to other aspects as well.
Basically, any object has an "Inbox" and an "Outbox" stack. Inbox represents the activities that were generated by other actors and that this object should be aware of. Outbox represents the object’s own activities. Typically, in a social network, the Inbox of a user could be seen as her wall, whereas her Outbox could be seen as her profile feed.

The figure below shows how a "node event" (e.g. file XXX created by user A in folder YYY) will be dispatched to the various boxes involved. An additional "Subscription" box will store the watches that a user can set on any file or folder.

When events arrive from the global bus, they are dispatched as follow:

  • Post in the node Outbox (this is the own activity of this node)
  • Post in the event user Outbox (the own activity of this user)
  • Check other users for subscriptions, and if found, post in these users’ Inbox.

This is then done on the parent Node until the root.

AS2 Format

Activities are stored in the Activity Streams 2.0 format. This is a generic JSON-based RFC published by the W3C. This format is used for all activities either sent via the event bus (and then for example sent back to the users via WebSocket), or when listing activities using the Rest API.

Here is an example of a REST call to http://proxy:8083/activity/streams:

{
    "@context": "https://www.w3.org/ns/activitystreams",
    "type": "Collection",
    "items": [
        {
            "@context": "https://www.w3.org/ns/activitystreams",
            "type": "Read",
            "id": "/activity-17",
            "name": "File Event",
            "summary": "Document [Athens.jpg](doc://add672fc-6e7852e4-6b98172a-7d3eebaf) was accessed by [new](user://new)",
            "updated": "2017-11-27T16:15:49.000Z",
            "actor": {
                "type": "Person",
                "id": "new",
                "name": "new"
            },
            "object": {
                "type": "Document",
                "id": "add672fc-6e7852e4-6b98172a-7d3eebaf",
                "name": "ds1/extraction/Photos Vacances/Athens.jpg",
                "partOf": {
                    "type": "Collection",
                    "items": [
                        {
                            "type": "Workspace",
                            "id": "18583bcd22c3c2705ef55131e1d809a8",
                            "name": "DS1",
                            "rel": "ds1/extraction/Photos Vacances/Athens.jpg"
                        }
                    ]
                }
            }
        },
        {
     "@context": "https://www.w3.org/ns/activitystreams",
            "type": "Read",
            "id": "/activity-15",
            "name": "File Event",
            "summary": "Folder [Photos Vacances](doc://6jgjyRzPwyfg7tqKhz12m0fuZrwReuuqKWm2) was accessed by [new](user://new)",
            "updated": "2017-11-27T15:13:07.000Z",
            "actor": {
                "type": "Person",
                "id": "new",
                "name": "new"
            },
            "object": {
                "type": "Folder",
                "id": "6jgjyRzPwyfg7tqKhz12m0fuZrwReuuqKWm2",
                "name": "ds1/extraction/Photos Vacances",
                "partOf": {
                    "type": "Collection",
                    "items": [
                        {
                            "type": "Workspace",
                            "id": "18583bcd22c3c2705ef55131e1d809a8",
                            "name": "DS1",
                            "rel": "ds1/extraction/Photos Vacances"
                        }
                    ]
                }
            }
        },
        {
            "@context": "https://www.w3.org/ns/activitystreams",
            "type": "Read",
            "id": "/activity-14",
            "name": "File Event",
            "summary": "Folder [extraction](doc://R8BYGzZXxNxhPgzmh9pBh5Ax3ZB6VjM1ZHHj) was accessed by [new](user://new)",
            "updated": "2017-11-27T15:13:05.000Z",
            "actor": {
                "type": "Person",
                "id": "new",
                "name": "new"
            },
      "object": {
                "type": "Folder",
                "id": "R8BYGzZXxNxhPgzmh9pBh5Ax3ZB6VjM1ZHHj",
                "name": "ds1/extraction",
                "partOf": {
                    "type": "Collection",
                    "items": [
                        {
                            "type": "Workspace",
                            "id": "18583bcd22c3c2705ef55131e1d809a8",
                            "name": "DS1",
                            "rel": "ds1/extraction"
                        }
                    ]
                }
            }
        },
    ],
    "totalItems": 3
}
Back to top