Thursday, 22 September 2011

Bring OpenSocial gadgets to Moodle (updated)

We present here a plugin that allows to bring OpenSocial gadgets into Moodle. OpenSocial gadgets are rendered via Apache Shindig (extension of version 2.0 that supports Spaces).

Moodle is a Learning Management System used in many Educational Institutions (Universities) to manage courses. It is a plugin based PHP application that can be extended by installing additional modules. These modules have to be installed on a Moodle server by a system administrator. The Moodle view usually consists of a main center area and a rather narrow right column with blocks. The center area normally contains main resources, such as, wiki, forum, lesson, quiz, etc. The right block contains some helper plugins, such as, calendar, upcoming events, latest news, recent activity, etc. These are to extend the functionality of the main page.

There are two different OpenSocial plugins for moodle. The first one (shindig-moodle-mod) adds a new module to Moodle. It is very similar to pages in moodle, however in addition, OpenSocial gadgets can be specified. Once it is installed, a teacher can choose a "Widget space" to be added to the course and specify OpenSocial gadgets for it. The teacher can choose whether 1,2,3 column view should be used for gadgets (Fig. 1).
Fig. 1

The resulting outcome is the iGoogle similar view where students can work with gadgets (Fig. 2)
Fig. 2

The second plugin (shindig-moodle-block) adds a new block to Moodle. Teacher can add OpenSocial gadgets to the right column for already existing in Moodle wiki pages, lessons, forums, etc. (Fig. 3)
Fig. 3

One of the main benefits is that the big pool of OpenSocial gadgets can be used by teachers. Thus, once the OpenSocial plugins are installed in Moodle, a teacher can extend the functionality of Moodle without bothering system administrators with plugins installation. The teacher can add and remove gadgets easily and even can write her own ones. The plugins greatly improve the flexibility in choosing the resources and applications for the course specifics. OpenSocial gadgets can be found in the open widget repositories, such as, Role Widget Store, iGoogle Directory, etc.

In addition to reuse of applications existing in the Cloud and flexibility in choosing applications for the course, contextual gadgets and OpenSocial API are the other additional benefits.

Space extension allows gadgets to adapt to a specific context. For example, wiki gadget saves data
for a course and manages access to itself only by people engaged in this course. The same wiki gadget will behave differently being added to another course (different wiki history and different people to access it). Such space extension is already used in production in Graaasp and planned in Apache RAVE project.

OpenSocial API brings the standard way to retrieve and exchange social information between different Moodle installations and other social networks, that improves data portability and interoperability.

Plugins work for new version of Moodle 2.1. It should work for Moodle 2.0, though it was not tested. The installation instructions and source code can be found at github:
OpenSocial Moodle module (
OpenSocial Moodle block (

This plugin was developed within the ROLE Integrated Project and is already used in 5 courses at Shanghai Jiao Tong University.

Thursday, 8 September 2011

Crowd (collaborative) translation Rails plugin.

This plugin is to add collaborative language translation (also known as crowd translation) functionality to your site!

If you use several languages, you can ask your users to help you to translate your web application into other languages (crowd translation). This plugin helps you to manage this process. All installation instructions and the source code can be found at github: crowd-translate.

When you manage your languages you normally have parametrized strings pairs (key-translation) "login_required":"Login required for this action." Then, depending on the current language, string "login_required" will be substitued by either english or russian or something else.

This plugin allows to keep track of key-translation pairs and users can provide their own translation for different languages in a collaborative way. It helps you to generate the resulting language files for languages you use. You also have a rather flexible rights management - you can specify who is able to add translations and who is not.

See below for screenshots, small howto and explanations. If you have any questions, post comments here or on github.

Statistics page
Translation interface

Translation Howto

We have four basic statuses of every string to translate.

untranslated - No human translation is done for this string
needs review - String was translated but approval is required by admin
reviewed - String translation is approved and ready to be used in Yoursite
improvement - An improvement or errors fix was added for the already reviewed string and waits for approval by admin.

Automatic machine translation

Untranslated strings have an automatic machine translation. Change it if appropriately or leave it if it is correct, then submit the string translation.

Reviewers and ordinary translators

If you are a reviewer, your changes will not require confirmation and become 'reviewed' as soon as you submit them. If you are not a reviewer, your changes will have a status 'needs_review' and will require confirmation by admin. We will grant you reviewer right, once we are sure that you are serious about this work.


On the 'View stats' page you can see how many sentences are there for every language: how many untranslated, reviewed, etc. You can directly jump to specific translation page from the statistics page.


If you set notifications to "Yes" for a specific language, then when new untranslated strings are added to this language set, you will receive a notification by email.


You can search for a keywords in a translation set for specific language.

Bring OpenSocial gadgets to Moodle.

I have developed a plugin for Moodle that allows to add OpenSocial gadgets. OpenSocial gadgets are rendered via Apache Shindig (extension of version 2.0) in an iGoogle similar fashion.

Plugin works for new version of Moodle 2.1. The installation instructions and source code can be found at github: moodle-shindig-mod.

The plugin adds a new module to shindig. It is very similar to pages in moodle, however in addition,
OpenSocial gadgets can be specified. Once it is installed, a teacher can choose a "Widget space" to be added to the course and specify OpenSocial gadgets for it. The teacher can decide whether 1,2,3 column view is used for gadgets.

Widget space creation

The resulting outcome is the iGoogle similar view where students can work with gadgets.

Widget space view

Hope it is useful!

Thursday, 30 June 2011

Digging deeper into Google+ or why it can be very big thing

Simply put, Google+ is to fight Facebook

Main business model is (well, who was doubting it!) - online ads

Why Google+ can be big thing?

Small story. Luckily I've received an invitation today to Google+ so I could try it out.
Invitation came from ... Won't tell the name, ok?
But he is a big guy (the big tech guy behind Red Hat, hi5, LinkedIn and now Google (10 months)).
Why would I receive an invitation from him? Well, he is the biggest guy behind Apache Shindig and
OpenSocial. That's why (I am also quite active here). When I entered Google+, I realized that he is in Google now and he is one of the people behind Google+ :). I got as well an invitation from another OpenSocial/Shindig guy who is also in Google.

As I looked closely at the interface, I realize that it is nothing but the implementation of OpenSocial specification.
1. Circles are exactly OpenSocial groups - Family, Acquaintances, Friends, Following.
That's the main (and cool!) difference from Facebook where everybody is a friend (which often does not make sense at all)
2. Activity Streams - standardized in OpenSocial 2.0. These Streams are connected to Groups or a Person.
3. Albums - standardized in OpenSocial

I do not know if they already opened the apis to these things, but it is exactly OpenSocial thingy, so I am quite sure they will.
This means their data is interoperable with LinkedIn, hi5 and all others OpenSocial compliant containers - all but Facebook.

That's about connections to OpenSocial. So why it can be a big thing?

1. OpenSocial gadgets and APIs are to come (for sure). They are open vs. closed Facebook-own APIs.
2. Google has a big luggage of cool things and services already and they will be integrating it within Google+.
    a) they integrated google talk chat already.
    b) Picasa photoes are integrated
    c) They integrated your contacts from gmail
    e) How about sharing a google calendar with a circle ?
    f) How about gmail, sending emails to a circle ?
    g) How about Google docs shared within a circle ?
3. A lot of people already use google tools and Google+ allows to take advantage of sharing these tools with people (circles), making these tools social. Facebook actually does not have any tools. I can't imagine using Facebook with my colleges, for example.
4. Everybody is using google as a start page, and now you get this Google+ at a starting page. Why would you go to Facebook ?
5. Google has very nice, simple and intuitive interface!
6. Google has a lot of data about his users, which means recommendations/suggestions can be very precise :)
7. Hehe - you can actually export all your facebook friends :)

In any case. As in any Google application, there are a lot of techy and nice visual things to re-use in building web applications. See multiple selections and drag-and-drop, for example.

Long life to Google.

I have no relation to Google (I'd like it to but I don't, at least for now)

Wednesday, 22 June 2011

Why is JavaScript 2.0 the Next Big Language?!

2007 forecast is turning into reality.

Why JavaScript ?

Everything below is my personal opinion and experience (I am just a researcher at university,
no company interests involved :)). You are free to agree or disagree.

It is already big thing. It is in every browser, on every mobile, in palm's WebOS you can run it natively. There is a lot of work around "JavaScript outside the browser" going on (CommonJS, Node.js, Rhino on Rails). If you know JavaScript, you can code browsers, Web servers, mobile, 2D and 3D graphics, anything!

Some people say: "It's not serious language". Well this language is used to build Google Maps for you, Google Docs, Facebook. If that's not a serious projects, maybe Google should concentrate on some other serious stuff?

Most of JavaScript code is open source. It's running in browser and it's an interpreted language you can easily get the code and run it yourself.

If someone does web development, he has to know javascript. That's THE language to be used on the client (you just don't have a choice). On the server side - well that's up to you! You can choose Java, Ruby, PHP, Python, Scala, whatever. But think, that's one more language to learn.

I personally use now (due to the project requirement) Ruby and Java on the server (before it was also PHP). That's OK for me (cause I've already done it), but it's a pain when new student comes and ... I tell him: "here are four languages you have to learn now - Ruby, Java, PHP, JavaScript". That's a lot for one single student. Of course, one could say - "if you know one language, it is ok to learn another one". Well, that's true but in addition to a language you need to learn a framework for it. And even simply few languages is a lot for a person. It's much easier to say: "Learn JavaScript and you are done", right?

Write code only once
I've been coding for Web for quite some time now. I do heavy client side applications and unfortunately sometimes I need the same functionality both on the client and on the server. Well for now I have to implement a thing in Ruby and then re-implement it in JavaScript or vice-versa. That's a real pain! With JavaScript everywhere, I don't need it any more - I write every function only once!

JavaScript is an interpreted language. Which means that it is supposed to be much slower, than compiled languages (C, Java), and get into category of Ruby/Python/PHP.

JS is around 3-10 times slower than Java while Ruby is 10-30. See this benchmark study:
This is due to special optimizations done by Google and other browsers. The constant rivalry between browsers makes the JavaScript engines faster and faster every day.

There are discussions (and implementations!) about introducing static types to javascript, that would make its performance the same as compiled languages.

Actually JavaScript is a very nice language. Many people used to see it as a hacky not-reliable language, but many things have changed since its first introduction in Netscape. I (and many will agree with me) find it as a nice, elegant language. If you disagree, get a good book and start reading it :)

It is so easy to start. Just run the Chrome browser. Right click -> Inspect Element -> Console tab. You got it! Just type the code 8+5-7 and hit the Enter. You'll see 6 as a result. It was easy, right?

Google behind and others
Google is a big pusher for JavaScript. Having a big company behind the language is almost often language success (Java, as example). There are many others to help Google here (Joyent, Mozilla, Opera, etc.)

JavaScript is THE language for Web development

Some people claim Scala to be the Next Big Language. Well, I doubt it. I find it very cool and I would definitely prefer Scala to Java. Maybe it will get accepted in some areas, but I don't think in Web development. I personally do not want to learn an additional language. I am fine with only one. I do not want to rewrite my code for both Scala and JavaScript. Remember - I have to do it for JavaScript, no choice here :)

If you are creating a web application, very often language speed does not matter that much. The most important thing is the memory management and JavaScript has a super-cool thing here called Node.js It is an event-driven server-side JavaScript based on fastest V8 JavaScript engine from Google. This is THE WAY to go today and this is one more big PLUS for JavaScript.

If you are to learn a programming language and you have a slightest feeling you might need to do some work for the browser, pick up JavaScript!

Tuesday, 24 May 2011

+1 for Node.js

Everybody talks today about Node.js.
I should say that's the coolest thing I've seen lately on the Web.

All my Web projects are in Javascript with Rails backend.
I should say I love Ruby, I love its simplicity and clarity, I love to write code
in it. But (of course) there is a small "but".

First, Ruby is still slower than compiled languages and often it matters!
Second, if somebody wants to join my project they need to know both JavaScript and Ruby.

I've been always dreaming about having ruby running inside of a browser instead of JavaScript.
Unfortunately, this is just a dream. The reality is different.
Javascript is coming to the server side to replace Ruby/PHP/Python/Java. I truly believe it will happen soon. It is kind of obvious. Every Ruby Web developer knows JavaScript. Every PHP Web developer - does. Every Python Web developer - does.

Why Node.js?
- It is based on V8 JavaScript Engine (performance ~ compiled language)
- It is event-based framework compared to thread-based (memory savings: 8mb -> 8kb per user)
- JavaScript has some libraries on top (, that makes it fun-to-write similarly to Ruby/Python/etc.

Of course, all these things can be done for Ruby or Python as well (EventMachine, for example).
The strength of Node.js is that it is not bound to some specific community but to all Web developers in general. Which means a lot of libraries to come soon.

To conclude. I give my vote to Node.js. I (as a Javascript/Rails developer) will switch all my rails projects that are in active development to Node.js.

Tuesday, 29 March 2011

Clever embedding with Opensocial gadgets

A bunch of very cool features is about to appear in Opensocial 2.0. I will point out now two of them related to embedding content into html pages.

Everybody is used to embed youtube videos, slideshare presentations into there web pages, blogs, etc. But how about embedding an Opensocial gadget into an html page?
This is one of the features on todo list in opensocial. Sounds cooool, right?

Second thing is related but more for service providers. It is called Embedded Experiences. Let's see one of the usecases. Let's say I am a service provider - Youtube. I already have a way to embed my videos in another applications,
but all people can do is to watch videos (actually no interaction). If I want to allow people to comment it or rate, they have to go to youtube to do so by loosing the context. With Embedded Experiences it is now solved. I (as a service provider) supply my embed code with an Opensocial gadget and a url to embed. Then the gadget will render the youtube video on customers page and allow users to directly like/dislike video from the embed code (or some other functionality I want to support).

There are still some things to be done to fully implement it, but you got the idea!

Tuesday, 8 March 2011

Functional skins in action

The idea about functional skins was discussed here

Let's see real life example now. All the actions are done based on Graaasp:

We have a space that contains four gadgets: Google map search, Quick Latex, Todo list and English resource browser. Graaasp provides us with the following default view for this space:

You can see every gadget one by one, but you can't see few gadgets on the page at the same time (similar to iGoogle view). In Graaasp you can attach a functional skin to a space which could change the representation of this space. Let's do that. Let's add the following gadget as a functional skin:

Now we can click on the button "View space with skin" and we see the following view, where all widgets are displayed on the page as a grid:

We can go further and add another skin to a space that contains youtube videos.
I have few videos in my space and default view for it is as follows:

Now I add the next functional skin to this space:
And I see the space differently, all youtube videos are open and can be played:

You can easily write your own functional skin and use Graaasp's space as you wish.

Few points on implementation. Graaasp implements Opensocial APIs via Shindig. Plus it uses Space extension to Opensocial. Gadget finds out the space to which it belongs and then retrieves gadgets for this space as in the example below.

Once list of gadgets is received, they are built in a standard Apache Shindig way.
You have to only require a feature

In the second functional skin you retrieve list of assets for a space in a similar way.

Wednesday, 2 February 2011

What is a "Functional skin"?

To understand what Functional skin is, why and how it can be useful, you have to first understand what is a space. You can read more information about it here: Space.

For now you can see it as a place where you have few friends and you share some resources with them: few youtube videos, slideshare presentations and some applications: opensocial gadgets (calendar, todo list) for example. We can call such space as group.

Let's say that the container's default view of your space is as in the picture below
Default view

Let's say that you are not always satisfied with this view and you want a different one, where videos are directly shown on the page on the left and friends are shown as a list in the right column. And it also has some additional functionality as "Play all" button, that will play all youtube videos one-by-one. Like in image below
Play view

Easy! That is exactly what the functional skin is supposed to do.
The goal of functional skin is to take your space information (list of applications in a space, list of resources in a space, list of people in space) and build some functionality and visual representation for it. Once such functional skin is implemented, it can be attached to any space and space can be presented in different ways.

Well, easier said than done. How actually it can be done? There is one suggestion on how to do that. First, use Opensocial gadget for this functional skin. You implement required functionality as opensocial gadget, then you attach this gadget to a space. 
But how does gadget know about this space and how it can get list of people and videos for this space?
This should be managed by a space extension to Opensocial. Read more about it here.

Once this function skin gadget is ready, you can switch between different views for a space.
It is like a skin but the main goal is to provide new functionality (view all videos at once in current scenario), this is why we call it Functional skin.

For more detailed information, please refer to the paper:
Contextual Spaces with Functional Skins as OpenSocial Extension

What is a "Space" and what is it used for?

A space is an abstract concept that shapes the context in which user is currently placed. A space can represent a group of people, a university course, a company division, a folder, a forum, a blog, etc.

A space normally consists of people, tools, assets and other sub-spaces. Tools are different applications and agents that exist inside a space and can be used by people inside this space (opensocial gadgets for example). Assets are different resources that can be added to space, this includes documents (attachments, html pages), online resources (youtube videos, slideshare presentations), etc. A space can contain other sub-spaces as well.

Space concept allows to model such concepts as group of people, community, event, competition, etc. It is an important part of our social lives, that's why we proposed it as an extension to Opensocial specification.

See below more information and discussions about space.

Space proposal to Opensocial 2.0
Space extension draft
Space proposal discussion