Changes in Social Equity in Liferay 6.1
Company Blogs January 10, 2012 By Zsolt Berentey Staff
There have been some pretty interesting and important changes regarding Social Equity for Liferay 6.1. While some of the changes are conceptual and others are additional features, there is one thing that is very important: there has been a change of API.
The new equity system is now part of the social activity framework. This is not just a naming concept. As part of the change, several functionalities were moved to different services and the original Social Equity services were removed. The whole framework got its own XML descriptor (formerly activities were configured in resource actions descriptors) that can be used to define activities and everything else related to them. This new descriptor can be used to extend already configured activities and can be used in plugins as well.
The Goal of the New System
While the main goal of being able to measure participation and contribution in a communty hasn't changed, there are some differences how these values are created and maintained. The new social equity system is now part of a broader scoped social activity framework that is designed to log certain activities as well as provide numerical instruments to monitor actvities or simply to provide the means for statistical analysis.
The heart of the new system is the counter framework. These counters are defined for activites in the new liferay-social.xml. The basic concept is to have three types of counters: actor, asset and creator. The difference is the owner of the counter. An actor counter is linked to the user doing the activity, while the asset counter is linked to the asset the activity is being done on. Creator counters have a reference to the user that is the owner/creator of the asset the activity was done on.
This system provides the basis for an extendable metrics system for assets and users.
One of the biggest conceptual changes is the introduction of the counter period. Values no longer degrade, rather there is a configurable time interval where points are aggregated resulting in a "current" value for each of these periods. A total value is also maintained. This method suits the human thinking more than the former method of degrading values. We are more used to thinking in periods. We are used to having "employee of the month" or values projected to a certain year - such as balance sheets.
The old social equity scores are mostly still there. Fundamentally these values are just counters. Of course there are always those more equals among equals, so equity counters have some special treatment. In addition to the limit system that has been implemented for normal counters these counters have some other checks that for example guard against an asset owner building up its own asset's popularity and a result his or her own contribution score by doing certain actions on his or her asset.
One of the equity counters has also been renamed. Formerly known as Information Equity, this counter is called now Popularity. The reason behind the change is that with the actions available in a normal portal it is very hard to really mark asset as informative. Chances are that people do certain things on assets they simply like. Whether they like them because they are infomative is a possibility but it is not certain. Also contribution to a community is not necessarily requires assets with a high informational value. Some of the sites just want to increase the time people spend there, or want to increase the pariticipation of their users and users spend as much time with assets they just like as with assets that provide information to them. Therefore the relation between the popularity counter (that is an asset counter and was formerly called Information Equity) and the contribution counter (formerly known as Contribution Equity, currently an actor counter) remained the same: whenever an asset receives popularity points, its owner gets the same points in contribution.
One of the most importart API changes is that the triggering of an equity action was moved to the social activity service. In fact, adding a social activity now triggers the new social equity service automatically, so you can simply call one of the addActviity() methods in SocualActivityLocalService and if things are configured and social equity is enabled for the group, everything will be fine. If the activity is configured to be logged, the social activity service will log it the same way it's been doing so far, so that it can appear in the activities portlet. Additionally it will call new SocialActivityCounterLocalService to trigger counter processing.
To get the value of a counter (including participation and contribution values as they are handled as counters) you can use the fetchLatestActivityCounter() method of the SocialActivityCounterLocalService. There are additional helper methods to retrieve a list of counters by other criteria, but probably this is the most important method of the service.