Activity sharing

From OLPC
Revision as of 18:36, 8 July 2011 by Soequelle (talk | contribs) (Interactions)
Jump to: navigation, search
  english | español HowTo [ID# 257851]  +/-  

Overview

Collaboration in Sugar activities works using a set of services that run on the laptop, and APIs in the Sugar Python modules that wrap those services. The main services are the Telepathy connection managers and the Presence Service that coordinates them.

Shared activites.png

Telepathy is a system describing a generic interface for various kinds of communication. It is the underlying infrastructure used by Sugar for collaboration. Currently, two Telepathy implementations are used: Gabble, for Jabber, and Salut for serverless Jabber (a.k.a. link-local XMPP). The former is used when the school server is reachable; the latter in the simple mesh case.

Advertisements and invitations

Shared sugar activities are discovered in two different ways: through broadcast advertisements, and through invitations.

Advertisements are made when the user tells the activity to share itself with the entire network. Anybody on the network can see the activity.

Invitations are send to particular users. Only those users who are sent an invitation see the activity (unless the activity has also been advertised). When Sugar recevies an invitation, it asks the user whether they want to accept or reject it.

Tubos

Tubos son un medio para actividades compartidas para intercambiar datos. Actualmente hay dos tipos de tubos:

  • Tubos D-Bus provee un servicio D-Bus que es compartido entre los participantes en una actividad compartida, proveyendo señales para todos los participantes, y metodos llamados por un participante en particular.
  • Tubos Stream proveen una conexipon por sockets construida via XMPP, para un flujo de datos con HTTP, entre dos particpantes.

Usando tubos en las actividades de Sugar

El Presence Service crea objetos para administrar la conexión (Gabble y/o Salut). Obtiene un objeto de conexión (para el servidor Jabber en el caso de Gabble). PS crea u obtiene un canal de Tubos. Para las Actividades de Python, Sugar crea o une un tubo D-Bus automaticamente.

El iniciador de la actividad deberia entonces llamar a los tubos. OfferDBusTube para ofrecer un tubo con un nombre de servicio especifico.Cuando un participante se une a una actividad, tratará de averiguar que tubos estan disponiblesllamando Tubes.ListTubes() en el canal de tubos (el cual no tiene que crear nada más). Ambos OfferDBusTube y ListTubes son el resultado de una llamada cuando el tubo se hace realmente disponible. Solo entonces un tubo trabajando es entregado a la(compartido) actividad y es posible esportar objetos en el bus y suscribirse a las señales etc.

Ver Collaboration Tutorial para más información sobre los tubos.

¿Quién es quién?

Participantes/nodos dentro de una actividad son actualmente identificados por diferentes componentes. Los siguientes pueden ser distinguidos:

  • Nombre Dbus. Si tienes una función Dbus relacionada con quien envia el argumento especificado, esto es lo que obtendrás. Para objetos participantes:
   sugar.presence.PresenceService.get_buddy(llave pública del participante)
  • Telepathy handle. Para el objeto participante:
   sugar.presence.PresenceService.get_buddy_by_telepathy_handle(tp_conn, tp_conn_path, handle)

Interacciones

Como interactuan los distintos componentes.

Presence Service ⟷ administrador de conexión

  • org.freedesktop.Telepathy.ConnectionManager
    • RequestConnection
  • org.freedesktop.Telepathy.Connection
    • RequestChannel
  • org.laptop.Telepathy.BuddyInfo
  • org.laptop.Telepathy.ActivityProperties

Actividad ⟷ Presence Service

  • org.laptop.Sugar.Presence
  • org.laptop.Sugar.Presence.Buddy
  • org.laptop.Sugar.Presence.Activity

Actividad ⟷ manejador de conexión

  • org.freedesktop.Telepathy.Channel.Type.Tube
    • OfferDBusTube
    • OfferStreamTube