Difference between revisions of "Social Networking Library"

From Gcube Wiki
Jump to: navigation, search
(Overview)
(ASL Social Extension)
Line 29: Line 29:
 
* '''Application News Manager''': to be used by gCube Applications when they need to post news on their user news feeds;
 
* '''Application News Manager''': to be used by gCube Applications when they need to post news on their user news feeds;
 
* '''User Notifications Manager''': to be used by gCube Applications when they need to notify their users about some events.
 
* '''User Notifications Manager''': to be used by gCube Applications when they need to notify their users about some events.
 
The overall
 
  
 
==== Application News Manager ====
 
==== Application News Manager ====
 +
 +
In order to publish a news from within your application you first need to create an Application Profile for your gCube Application. You need to create Generic Resource in of secondary type 'ApplicationProfile' having your application name as resource name. You will also need to provide additional information in the body of your Generic Resource.
 +
 +
The <body> part of your Generic Resource must be compliant with the following xml schema, available in this [[File:SampleApplicationProfile.xsd]] in case you need.
 +
 +
<source lang="xml">
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
 +
  <xs:element name="body">
 +
    <xs:complexType>
 +
      <xs:sequence>
 +
        <xs:element ref="AppId"/>
 +
        <xs:element ref="ThumbnailURL"/>
 +
        <xs:element maxOccurs="unbounded" ref="EndPoint"/>
 +
      </xs:sequence>
 +
    </xs:complexType>
 +
  </xs:element>
 +
  <xs:element name="AppId" type="xs:string"/>
 +
  <xs:element name="ThumbnailURL" type="xs:anyURI"/>
 +
  <xs:element name="EndPoint">
 +
    <xs:complexType>
 +
      <xs:sequence>
 +
        <xs:element ref="scope"/>
 +
        <xs:element ref="URL"/>
 +
      </xs:sequence>
 +
    </xs:complexType>
 +
  </xs:element>
 +
  <xs:element name="scope" type="xs:string"/>
 +
  <xs:element name="URL" type="xs:string"/>
 +
</xs:schema>
 +
</source>
  
  
 
==== User Notifications Manager ====
 
==== User Notifications Manager ====

Revision as of 00:51, 14 December 2012

Overview

The purpose of this document is to provide instructions for developers wishing to exploit Social Networking from within their applications.

The gCube Social Library, so far, provides methods for:

  • Publishing Users Posts;
  • Retrieving Users Feeds, Comments, Likes;
  • Managing Users Connections;
  • Publishing Users Notifications;
  • Publishing Application News to User feeds.

Architecture Scenario

The gCube Social Networking Library is the 'bridge' between your gCube Applications and the social networking facilities. The social networking facilities exploit a NoSQL data store for their storage. Specifically an Apache Cassandra data store. Figure 1 present the place of the Social Library in a simplified gCube Portal architecture.

Figure 1. Social Library in the simplified gCube Portal Reference Architecture

How to use the gCube Social Networking Library (SNL)

Your gCube Application will the SNL through a specific ASL Extension, the ASL Social Extension

ASL Social Extension

The ASL Social Extension is formed by different modules, each of these is delegated to one specific task. Every module inherits from a super class called SocialPortalBridge. Currently there are two modules available:

  • Application News Manager: to be used by gCube Applications when they need to post news on their user news feeds;
  • User Notifications Manager: to be used by gCube Applications when they need to notify their users about some events.

Application News Manager

In order to publish a news from within your application you first need to create an Application Profile for your gCube Application. You need to create Generic Resource in of secondary type 'ApplicationProfile' having your application name as resource name. You will also need to provide additional information in the body of your Generic Resource.

The <body> part of your Generic Resource must be compliant with the following xml schema, available in this File:SampleApplicationProfile.xsd in case you need.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="body">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="AppId"/>
        <xs:element ref="ThumbnailURL"/>
        <xs:element maxOccurs="unbounded" ref="EndPoint"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="AppId" type="xs:string"/>
  <xs:element name="ThumbnailURL" type="xs:anyURI"/>
  <xs:element name="EndPoint">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="scope"/>
        <xs:element ref="URL"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="scope" type="xs:string"/>
  <xs:element name="URL" type="xs:string"/>
</xs:schema>


User Notifications Manager