Proposal for a "SocialActionHandler"

21 views
Skip to first unread message

Laurent-Walter Goix

unread,
May 19, 2014, 7:44:03 AM5/19/14
to activity...@googlegroups.com
Hi,

By looking at the current action handlers defined in [1] i couldn't find any specific way of describing possible activity entries that could be triggered from an initial activity. In other words, i'd like to have the ability of expressing specific actions (e.g. verbs) that would result in publishing a new activity according to that info.
This would allow to trigger actions still in the context of the social network (not outside like http or intent handlers) and at the same time allow greater flexibility.

To take an example in the context of appliance control, i could receive a notification suggesting actions to take, to be sent back via regular activities to the same account. here could be an example of notification:

{
    "actor": {
            "id": "acct:entranc...@example.com",
            "displayName": "Entrance lights",
            "objectType": "urn:somenamespace:light",
            "actions ": {
             "urn:somenamespace:turn-on": {
               "objectType": "SocialActionHandler"
              },
             "urn:somenamespace:turn-off": {
               "objectType": "SocialActionHandler"
            }
           }
    },
    "object": {
            "objectType": "note"
    },
    "title": "I detected some movement. Shall I do something?",
    "verb": "post"
}

could trigger an activity like this:

{
    "actor": {
        "id": "acct:john...@example.com"
    },
    "object": {
        "id": "acct:entranc...@example.com"
    },
    "title": "Turn on lights please",
    "verb": "urn:somenamespace:turn-on"
}

In this example the actions are included in the actor object as they can represent generic actions always available, rather than being included in other parts of the activities (but this is an example).
of course this type of use cases triggers other questions but i'd be mainly interested in getting your feedback on the concept behind the "socialactionhandler" (i do believe it can also apply to other use cases to trigger social reactions that may not be the usuals suspects such as comment or like).

[1] http://tools.ietf.org/html/draft-snell-activitystreams-actions-06

James M Snell

unread,
May 27, 2014, 2:31:13 PM5/27/14
to activity...@googlegroups.com
I'm sorry, I missed this one previously... After reading through this
twice I'm not 100% sure how this would work and how it would be
different from the other action handler types. Can you describe a bit
more detail how it would differ relative to HttpActionHandler,
ViewActionHandler, EmbedActionHandler and IntentActionHandler?

- James
> --
> You received this message because you are subscribed to the Google Groups
> "Activity Streams" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to activity-strea...@googlegroups.com.
> To post to this group, send email to activity...@googlegroups.com.
> Visit this group at http://groups.google.com/group/activity-streams.
> For more options, visit https://groups.google.com/d/optout.

Laurent-Walter Goix

unread,
May 28, 2014, 6:14:37 AM5/28/14
to activity...@googlegroups.com


Il giorno martedì 27 maggio 2014 20:31:13 UTC+2, James M Snell ha scritto:
I'm sorry, I missed this one previously... After reading through this
twice I'm not 100% sure how this would work and how it would be
different from the other action handler types. Can you describe a bit
more detail how it would differ relative to HttpActionHandler,
ViewActionHandler, EmbedActionHandler and IntentActionHandler?

Sure. The difference stands in the fact that the "SocialActionHandler" aims at triggering a new AS post, so it should contain the necessary information to create a new activity to be posted on behalf of the user if it clicks on it for example. Http and Intent handlers typically trigger actions "out" of the social network in that they trigger independent calls: of course one could mimic eg OpenSocial API calls using the htttphandler but that would look underperforming to me. View and Embed typically have more GUI-related focus although they can hide remote calls as well.
Typically the API used for posting the resulting activity would be the same as the one used to retrieve the stream in which the handler was read, so it could be OS API or any other.
more precisely, the name of the specific action of type SocialActionhandler would be the one used as verb of the resulting activity, and the "actor" of the initial activity become the object of the resulting activity...

did i clarify my point? I do believe this is very different from the current handlers and that although technically (nearly) feasible with other handlers a dedicated "self-referencing" handler would be useful
in alternative, do you have any suggestion in reusing existing handlers to mimic this scenario?

thanks
walter


- James



On Mon, May 19, 2014 at 4:44 AM, Laurent-Walter Goix
<laurentwa...@gmail.com> wrote:
> Hi,
>
> By looking at the current action handlers defined in [1] i couldn't find any
> specific way of describing possible activity entries that could be triggered
> from an initial activity. In other words, i'd like to have the ability of
> expressing specific actions (e.g. verbs) that would result in publishing a
> new activity according to that info.
> This would allow to trigger actions still in the context of the social
> network (not outside like http or intent handlers) and at the same time
> allow greater flexibility.
>
> To take an example in the context of appliance control, i could receive a
> notification suggesting actions to take, to be sent back via regular
> activities to the same account. here could be an example of notification:
>
> {
>     "actor": {
>             "id": "acct:entra...@example.com",
>             "displayName": "Entrance lights",
>             "objectType": "urn:somenamespace:light",
>             "actions ": {
>              "urn:somenamespace:turn-on": {
>                "objectType": "SocialActionHandler"
>               },
>              "urn:somenamespace:turn-off": {
>                "objectType": "SocialActionHandler"
>             }
>            }
>     },
>     "object": {
>             "objectType": "note"
>     },
>     "title": "I detected some movement. Shall I do something?",
>     "verb": "post"
> }
>
> could trigger an activity like this:
>
> {
>     "actor": {
>         "id": "acct:j...@example.com"
>     },
>     "object": {
>         "id": "acct:entra...@example.com"
Reply all
Reply to author
Forward
0 new messages