Activity Streams Scenario 1.0 – Draft 1

March 21, 2012

Abstract

This document describes a Backplane application scenario
that allows widgets to exchange messages that represent
Activity Streams.


Table of Contents

1. Introduction

1.1.Definitions

1.2.Requirements Language

2.Message Types

2.1. activity/json

2.2. activity/atom

3. Examples

4. Normative References

§ Author’s Address


 TOC 

1.
Introduction

Widgets that generate or consume Activity Streams can exchange
the associated messages using a Backplane framework. A
serialized Activity Stream MUST constitute the full payload of a
Backplane Message. This document defines two Backplane Message
types to identify such payloads as Activity Streams messages
using one of the two encoding formats defined by the Activity
Streams specifications suite.


 TOC 

1.1.
Definitions


 TOC 

1.2.
Requirements Language

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL
NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and
“OPTIONAL” in this document are to be interpreted as described
in RFC 2119 (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) [RFC2119].


 TOC 

2.
Message Types

Following are definitions of the Backplane message types
employed by the Activity Streams Scenario.

Note that message payloads are sent only to server-side
Backplane clients. Widgets only receive message headers: no
payloads, acting as event notifications. They must contact
their corresponding server-side components for the details
on how to fully react to each event.


 TOC 

2.1.
activity/json

The payload of Backplane Message having the ‘activity/json’
type MUST be a JSON object which contains a message
conforming to the
Activity Streams schema (Snell, J., Atkins, M., Recordon, D., Messina, M., Keller, M., Steinberg, A., and R. Dolin, “Activity Base Schema (Draft),” May 2011.) [ActivityStreamsSchema]
using
JSON serialization (Snell, J., Atkins, M., Norris, W., Messina, M., Wilkinson, M., and R. Dolin, “JSON Activity Streams 1.0,” May 2011.) [ActivityStreamsJson].


 TOC 

2.2.
activity/atom

The payload of Backplane Message having the ‘activity/atom’
type MUST be a XML object which contains a message
conforming to the
Activity Streams schema (Snell, J., Atkins, M., Recordon, D., Messina, M., Keller, M., Steinberg, A., and R. Dolin, “Activity Base Schema (Draft),” May 2011.) [ActivityStreamsSchema]
using
Atom serialization (Atkins, M., Norris, W., Messina, M., Wilkinson, M., and R. Dolin, “Atom Activity Streams 1.0,” February 2011.) [ActivityStreamsAtom].


 TOC 

3.
Examples

Example downstream Activity Stream Backplane Message
containing a single activity:

{
    "bus": "customer.com",
    "channel": "67dc880cc265b0dbc755ea959b257118",
    "messageURL": "https://bp.example.com/v2/message/097a5cc401001f95b45d37aca32a3bd2",
    "source": "http://aboutecho.com",
    "payload": {
      "published": "2011-02-10T15:04:55Z",
      "actor": {
        "url": "http://example.org/martin",
        "objectType" : "person",
        "id": "tag:example.org,2011:martin",
        "image": {
          "url": "http://example.org/martin/image",
          "width": 250,
          "height": 250
        },
        "displayName": "Martin Smith"
      },
      "verb": "post",
      "object" : {
        "url": "http://example.org/blog/2011/02/entry",
        "id": "tag:example.org,2011:abc123/xyz"
      },
      "target" : {
        "url": "http://example.org/blog/",
        "objectType": "blog",
        "id": "tag:example.org,2011:abc123",
        "displayName": "Martin's Blog"
      }
    },
    "type": "activity/json",
    "sticky": false
}

Example downstream Activity Stream Backplane Message
containing an Activity Streams array with one activity
entry:

{
    "bus": "customer.com",
    "channel": "67dc880cc265b0dbc755ea959b257118",
    "messageURL": "https://bp.example.com/v2/message/097a5cc401001f95b45d37aca32a3bd2",
    "source": "http://aboutecho.com",
    "payload": {
        "items" : [
          {
            "published": "2011-02-10T15:04:55Z",
            "foo": "some extension property",
            "generator": {
              "url": "http://example.org/activities-app"
            },
            "provider": {
              "url": "http://example.org/activity-stream"
            },
            "title": "Martin posted a new video to his album.",
            "actor": {
              "url": "http://example.org/martin",
              "objectType": "person",
              "id": "tag:example.org,2011:martin",
              "foo2": "some other extension property",
              "image": {
                "url": "http://example.org/martin/image",
                "width": 250,
                "height": 250
              },
              "displayName": "Martin Smith"
            },
            "verb": "post",
            "object" : {
              "url": "http://example.org/album/my_fluffy_cat.jpg",
              "objectType": "photo",
              "id": "tag:example.org,2011:my_fluffy_cat",
              "image": {
                "url": "http://example.org/album/my_fluffy_cat_thumb.jpg",
                "width": 250,
                "height": 250
              }
            },
            "target": {
              "url": "http://example.org/album/",
              "objectType": "photo-album",
              "id": "tag:example.org,2011:abc123",
              "displayName": "Martin's Photo Album",
              "image": {
                "url": "http://example.org/album/thumbnail.jpg",
                "width": 250,
                "height": 250
              }
            }
          }
        ]
    },
    "type": "activity/json",
    "sticky": false
}


 TOC 

4. Normative References

[ActivityStreamsAtom] Atkins, M., Norris, W., Messina, M., Wilkinson, M., and R. Dolin, “Atom Activity Streams 1.0,” February 2011.
[ActivityStreamsJson] Snell, J., Atkins, M., Norris, W., Messina, M., Wilkinson, M., and R. Dolin, “JSON Activity Streams 1.0,” May 2011.
[ActivityStreamsSchema] Snell, J., Atkins, M., Recordon, D., Messina, M., Keller, M., Steinberg, A., and R. Dolin, “Activity Base Schema (Draft),” May 2011.
[Backplane2.0] Saad, C., Skvortsov, V., Lukyanov, Y., Zhuravlev, A., Glushkov, I., Howells, C., and J. Bufu, “Backplane 1.2,” June 2011.
[RFC2119] Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” BCP 14, RFC 2119, March 1997 (TXT, HTML, XML).
[RFC4627] Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” RFC 4627, July 2006 (TXT).


 TOC 

Author’s Address

Johnny Bufu
Janrain
Email: jbufu@janrain.com
URI: http://www.janrain.com/