Skip to end of metadata
Go to start of metadata

Introduction

ATutor Social is a social networking module that allows ATutor users to connect with each other. They can gather contacts, create a public profile, track network activity, create and join groups, and customize the environment with any of the thousands of OpenSocial gadgets available all over the Web. ATutor Social can be used alone as a social networking application, or it can be used with the ATutor Learning Management System to create a social learning environment.

ATutor Social is built on the Apache Shindig Project, which includes several useful APIs. ATutor is currently using Apache Shindig 1.0.1 and the OpenSocial API v0.8.1 specification.

OpenSocial APIs

Apache Shindig implements several OpenSocial APIs:

  • OpenSocial REST: for server to server communication
  • OpenSocial JSON-RPC: for gadget to server communication
  • Javascript: for gadgets

OpenSocial REST

There are four types of REST services which can be exposed by Apache Shindig: people, activities, appdata and groups. There are URI Templates defined for each type of service. 

An Example: User "Harris Test2"(uid: 219) from ATutor.ca's demo can be obtained through http://social.atutor.ca/shindig/php/social/rest/people/219/@all.

Type

Spec.

URI-Template

People

6.1 People

/social/rest/people/<uid>/@all
    Collection of all people connected to user <uid>
/social/rest/people/<uid>/@all
    Collection of all people connected to user <uid>
/social/rest/people/<uid>/@friends
    Collection of all friends of user <uid>; subset of @all
/social/rest/people/<uid>/<groupid>
    Collection of all people connected to user <uid> in group <groupid>
/social/rest/people/<uid>/@all/<pid>
    Individual person record for a specific person known to <uid>; shows <uid>'s view of <pid>.
/social/rest/people/<uid>/@self
    Profile record for user <uid>
/social/rest/people/@me/@self
    Profile record for requestor

Group

6.2 Group

 /social/rest/groups/<uid>
    Collection of groups associated with user <uid>

Activities

6.3 Activities

/social/rest/activities/<uid>/@self
    Collection of activities generated by given user
/social/rest/activities/<uid>/@friends
    Collection of activities for friends of the given user <guid>
/social/rest/activities/<uid>/<groupid>
    Collection of activities for people in group <groupid> belonging to given user <uid>
/social/rest/activities/<uid>/@self/<activityid>
    Individual activity resource; usually discovered from collection

AppData

6.4 AppData

/social/rest/appdata/<uid>/@self/<appid>
    All app data for user <uid>, app <appid>
/social/rest/appdata/<uid>/@friends/<appid>
    All app data for friends of user <uid> and app <appid>; read-only (only GET and HEAD supported)
/social/rest/appdata/<uid>/@self/<appid>?fields=count
    Just the count field for user <uid>, app <appid>

OpenSocial JSON-RPC

Apache Shindig implements all required RPC services: People, Activities, Appdata, Messages and System.

Note: Apache Shindig doesn't implement all methods defined in OpenSocial RPC Protocol, Section 8, Services but these missing methods are not required to be OpenSocial compliant.

Type

Spec.

URI-Template

People

8.1 People

people.get
    Retrieve a single person or list of opensocial.Person objects.
people.supportedFields
    List the supported fields for this service.

Activities

8.2 Activities

activities.create
    Support creating opensocial.Activity objects as the targets of a relationship with the specified user.
activities.get
    Retrieve a one or list of opensocial.Activity objects.
activities.update
    Support updating opensocial.Activity objects as the targets of a relationship with the specified user.
activities.delete
    Support removing the relationship between an opensocial.Activity and the specified user.
activities.supportedFields
    List the supported fields for this service.  

AppData

8.3 AppData

appdata.create
    Not defined in the spec. Support creating key-value pairs in a user appdata.
appdata.get
    Retrieve a map of key-value pairs for the list of specified keys.
appdata.update
    Add or replace key-value pairs stored in a users appdata with the key-vaues in the data parameter.
appdata.delete
    Remove the specifed keys from a users appdata and returned the values associated with those removed keys.

Messaging

8.4 Messaging

messages.create
    Not defined in the spec. Support creating opensocial.Message objects.
messages.get
    Not defined in the spec. etrieve a one or list of opensocial.Message objects.
messages.modify
    Not defined in the spec. Support updating opensocial.ActivityMessage objects.
messages.delete
    Not defined in the spec. Support removing opensocial.ActivityMessage objects.

System

8.5 System

system.listMethods
    Returns an array of all methods supported by the endpoint including the system methods.
messages.methodSignatures
    Not implemented yet. Returns a method signature describing the types of the parameters.
messages.methodHelp
    Not implemented yet. Returns a textual description of the operation identified by the methodName parameter.

Javascript API

Apache Shindig includes all JavaScript APIs as described in OpenSocial API Reference and Gadgets API Reference.

See also the JavascriptDoc for Apache Shindig 1.1.x.

ATutor OAuth

There are very useful information on OpenSocial Documentation OAuth Usecase. You may also want to check out some OpenSocial Client Libraries to get you started.

ATutor End points are as follow:

  • Request Token URL: mods/_standard/social/lib/oauth/request_token.php
  • Authorization URL: mods/_standard/social/lib/oauth/authorize.php
  • Access Token URL: mods/_standard/social/lib/oauth/access_token.php

FAQ

Q. Is ATutor planning on updating its OpenSocial specification?
A. Yes. ATutor is piloted on Apache Shindig, we will update when Apache Shindig is stabled on supporting the newer specification.

Q. Is REST supported in ATutor Social?
A. Yes.

Q. How does OAuth work in ATutor?
A. You need to have a client that connects to our endpoints for authentication. OpenSocial has some great explanation here. If you are not familiar with OAuth, there is tihs great beginner's guide from hueniverse to get you started. I would also suggest you to try playing around with the opensocial-php-client to try connecting to our endpoints given above.

Resources

Apache Shindig Overview
OpenSocial 0.8.1 JSON-RPC Spec.
OpenSocial 0.8.1 REST Spec.
OpenSocial Tutorials

  • No labels