[GSoC Proposal] Implement Activity Logging API, publish ActivityStreams and expose Drupal translation activity

Events happening in the community are now at Drupal community events on www.drupal.org.
superpointer's picture

Context

Drupal is an open source content management platform powering millions of websites and applications. It’s built, used, and supported by an active and diverse community of people around the world.

Drupal translations is a service, built on Drupal itself, that is used by translators from around the world to maintain localizations of all projects on http://drupal.org.

This document is a proposal for Gábor Hojtsy idea (with some extras!) to organize and expose in natural and automated way the massive activity happening under the hood on http://localise.drupal.org.

About the author

Application withdrawn, removed personal information.

Motivation

This year I eagerly want to expose Drupal translation activity and add support for ActivityStreams. Adding value to the massive amount of information being stored on localize.drupal.org is like gold mining. The information is there waiting for us to extract it, which is pretty amazing.

Also, I want to see Drupal, this awesome platform/core/brain, being (re)used to implement a concept as compelling as ActivityStreams.

Overview

Its a definite characteristic of communities online and offline that seeing the momentum, the activity and work being done energizes others and moves them to contribute more, so exposing all this information is crucial.

Specifically for Drupal's localization service, helping people realize that they work in an active team, moderators to recognize contributions and better organize their work and translation users to have more data points to asses the quality of translation teams when related to certain projects, would boost growth and activity.

But getting activity logging/publishing right is important for another reason too.

There is a trend to expand from social network sites to social applications hosted on the social network site itself and social networking services capable of adding social context to productivity suites, collaboration tools, enterprise portals, business processes, and mobile applications.

By marking up social activities and social objects, delivered with the activity stream microformat, we could turn Drupal to a full fledged, sophisticated and configurable activity stream publisher interconnectable with other social networking sites or services.

To achieve the above two goals, this project has the following objectives:

  • Build a new or modify an existing module(s) that would provide an Activity Logging API.
  • Expose Drupal translation activity via activity graphs and on the site level.
  • Add support for publishing activities using the ActivityStreams microformat.

Description

Logging Activities

Activity messages should be possible to generate based on user activity, without the user explicitly typing in any part of this message. Modules would have to capture interesting user activity and log it via the Activities Logging API.

In order to model the underlying storage of the API we need a definition of an Activity. Thankfully there already is a a good definition:

An activity is a description of an action that was performed (the verb) at some instant in time by someone or something (the actor) against some kind of person, place, or thing (the object). There may also be a target (like a photo album or wishlist) involved. [1].

Based on this definition we could model the API the following way:

Only local images are allowed.

Some notes about the model:

  • modules can install their own verbs, objects and actors, that could be further categorized.
  • it gives us the flexibility to group/partition activities by user, model, verb and/or object.

Existing modules that could serve as a basis for a new module or that could be modified to provide the desired functionality:

Module Description Comments
Activity Allow users to see their friends' activity on the site.
Heartbeat Logs user activity when certain events occur, triggering actions. The logged data is accessable through views. The module includes predefined rules and views. This module seems the most promising, it is user-centric though which is limiting. However, the idea is there, and we could extend this module or use it as a basis for this project.
Microactivity Micro activity is a small module, depending on heartbeat that will show the micro stream of a user when for instance hovering over an avatar or username link.
ActivityStream Activity Stream builds a lifestream for you by aggregating your social activities all in one place. Whether it's bookmarks on Del.icio.us and Ma.gnolia, pictures on Flickr, music on Last.fm, or posts on your blog, anything you create can be gathered into one easy to read stream. As its description suggests, it mostly does aggregation.
Message A general logging utility that can be used as (yet another) activity module. Needs investigation.

Publishing/Displaying Activities

ActivityStreams

Activities will be published using the ActivityStreams microformat, the standardized method of representing human activity within an online status update.

The ActivityStreams microformat was originally formulated by Chris Messina. The stream in ActivityStreams is a feed of related activities for a given person or social object. Put together, ActivityStreams is a convenient and consistent way to syndicate social activities around the web. The Activity Streams format has already been adopted by MySpace, Windows Live, Google Buzz, BBC, Opera, TypePad, Gowalla, Gnip, Socialcast, Superfeedr, YIID, and many others.

For a broader high level overview of the concepts, take a look at these presentations.

Site level display

The activity will be visible on the site level (such as for announcements and new releases made available), and on the language group level (such as for the language and team specific activity messages).

To display a social objects activity on the site level we could use Views, like the heartbeat module does.

Activity Graphing

Showing the growth of teams over time, the submission and moderation activity via graphical means can expose really telling details about a team and would help moderators notice if suggestions outnumber active translations, for translators to see that others are active on the team and energize them to keep contributing.

Translation activity could be exposed via Sparklines. There are a few possible ways to generate the necessary charts.

There is an interesting analysis on using sparklines to show the "Activity" for each project, which resembles to what we want to do here; show the activity for each team.

Localisation server activities

Examples of desired activity messages:

  • Views 7.x-3.4 became available for translation
  • Joe joined the German team
  • Edith is now promoted to be administrator of the Italian team
  • Josh left the Greek team
  • Aaron submitted 6 new translations (in the past hour) for Pathauto, Views and Calendar in Danish
  • Jill imported 354 suggestions for Views, Display Suite, Drupal commerce, Drupal and 14 other projects in Korean
  • Dana approved 23 translations and declined 9 suggestions (in the past hour) for Date and Panels in Estonian
  • Announcement: new moderation functionality available (link)

More formally, this could be modeled the following way:

actor (by someone or something) verb (action that was performed) time (instant in time) object (against some kind of person, place, or thing)
l10n_server Views 7.x-3.4 became available for translation
Joe joined the German team
Edith promoted to be administrator 1301802533 (2011-04-03 03:48:53Z, could display "now") Italian team
Josh left 1301802533 the Greek team
Aaron submitted 6 new translations (in the past hour) in Danish 1301802533 for Pathauto, Views and Calendar
Jill imported 354 suggestions in Korean 1301802533 for Views, Display Suite, Drupal commerce, Drupal and 14 other projects
Dana approved 23 translations and declined 9 suggestions in Estonian 1301802533 (could display "in the past hour") for Date and Panels
l10n_server new moderation functionality available (link)

Planning

I purposely kept blank some weeks near the end of GSoC. They can be justified by the fact that I start working on April 25, and not May 23, which gives me 4 extra weeks of work. I plan to use them in case I'm off schedule.

Week N° Milestone
Week 1, Mon April 25 - Results announced Evaluate modules that do activity logging.
Week 2, Mon May 2 Modify an existing module or create a new module that would do activity logging.
Week 3 Continue work on API. Start modifying i10_server module so as to capture interesting user activity.
Week 4 Continue work on API and i10_server module.
Week 5 Continue work on API and i10_server module.
Week 6 Add Activity Logging configuration UI. Modify i10_server module to work with this new UI.
Week 7 Continue work on Activity Logging config UI.
Week 8, Mon June 6 Evaluate modules that do graphing, candidates are ...
Week 9 Modify an existing module or create a new module that would do graphing.
Week 10 Continue work on graphing.
Week 11 Continue work on graphing.
Week 12, Mon July 4 Continue work on graphing.
Week 13, Mon July 11 - Mentors and students can begin submitting mid-term evaluations Finalize API, on site display and graphing.
Week 14 Modify an existing module or create a new module that would do ActivityStream publishing.
Week 15
Week 16, Mon August 1
Week 17
Week 18
Week 19, Mon Aug 22 - Mentors, students and organization administrators can begin submitting final evaluations to Google

Mentors

I don't have any mentors as of yet. I hope someone will be interested!

Puzzle

Question: If we know that isset($a) === empty($a) then what $a could be?


Answer: "", 0, "0", FALSE, array()

Comments

For the puzzle: $a = 0.0;

alippai's picture

For the puzzle:
$a = 0.0; //it's not an integer, missing from the PHP Manual too ;)

Aha! It would have been cool

superpointer's picture

Aha! It would have been cool to include this in my answer :)

usability #1 here

gábor hojtsy's picture

My proposal is about exposing data from our database in meaningful chunks and visualize it. Whether its made available as a 3rd party API or it ends up with yet another activity module that needs to build its following is secondary, because the primary goal is that digestible displays of both activity stream and visual representations of the activity are available.

I can hardly imagine that we'd need to have new modules developed for either activity streams or graphing, however, slicing the data available to be effectively available for the activity stream and graphing could be the real challenge of my proposal. Ie. a user can submit 20 forms in a hour, and we don't want to report each submission right away. A user can import a file with 2300 suggestions, and we need to identify where did those belong and filter down the more important ones to an activity message. We need to adapt the stream to user behavior. This would either require queue module or other trickery, and would actually help us get useful activity messages. However nice the underlying activity stream architecture is (many of the existing modules are probably fine for this), the real meat here is understanding how the data gets in and the useful activity stats get out.

It is great you'd like to see a superb activitystrea.ms integration implementation, that is not the problem at hand on localize.drupal.org though.

I have to withdraw my

superpointer's picture

I have to withdraw my application for personal reasons :-( Maybe next year. Good luck to the rest of the students in the contest!

all the best

gábor hojtsy's picture

Sorry to hear, all the best for the summer anyway!

Hi Gábor, thank you for the

superpointer's picture

Hi Gábor, thank you for the feedback. I think you're right, it seems I got a little over excited with ActivityStreams and I missed the real problem here. I'll update the proposal and I'll try to focus more on the real issue.

Any progress on this?

andypost's picture

Is there any issue|sandbox|project to follow and probably to help by contributing code

not applicable

gábor hojtsy's picture

This proposal was not even submitted at the end, so no reason to expect progress, right?

Google Summer of Code 2011

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: