New Community Activity Map

You may have noticed a new feature on our community homepage, http://liferay.org - the Recent Activity Map is a dynamic Google Map that displays activities from our community, as they happen.  The map itself is a standard Google Map - and therefore, you can scroll around (using the hand tool), zoom in and out, and use the standard keyboard shortcuts (e.g. arrow keys, +/- keys).

The location information is taken from your liferay.com profile - either your actual address (city, region, and country only, not your street address), or your country, if you entered it.  Your profile picture is also used, along with the clickable activity information in the bubbles that pop up.

Entering your Location

If you want your location on the map to be correct, you can either enter your country, or your full address.

To enter your country, go to "My Account", and select a country from the "Country" drop-down list.  Note that when only entering country information, then all of your activities will appear to emanate from the geographical center of your country, which may be in the middle of a lake or the top of a mountain :-)

To enter a more accurate address, click on the "Address" tab on the right, and enter a complete address.  Make sure to mark it as your "Primary" address, as this is the address used for the map.

From then on, your activitiy bubbles will be shown in their proper location.  

Technical Notes

This is the best part: the map is implemented entirely as a Web Content Template!  Thanks to the power of Liferay's WCM system, and Peter Shin, who noticed my portlet was basically doing an AJAX call to the portlet's serveResource facility, Peter converted this to a velocity-based web content template (similar to Ray's earlier example).  Much easier to maintain and make updates.

The client side part is very simple, it just uses javascript and the Google Maps API to put up a map, and loop through the list of SocialActivity objects returned from Liferay's SocialActivity service.  User addresses are similarly looked up using Liferay's Address service.  If a user does not enter a full address, they can also just enter their Country through a drop-down on the user profile, implemented as an Expando attribute on the User entity.  We then access this through the ExpandoBridge for the User entity.

Once we have a set of activities, and associated usernames, profile URL and picture, timestamp (formatted to read nicer, such as "a few seconds ago" or "yesterday", also localized), then we use simple javascript to loop through them and place each of them on the map using the Google Maps API.  Once all entries are shown, we re-fetch a new set of activities. 

I think this gives our community a more lively, vibrant feel, especially for newcomers who happen upon this page early in their Liferay experience.  And it's fun seeing your name and activities "up in lights" every so often.  

Blogs
can we have the code to implemented?, it's a nice feature !!.
Cool stuff!
Is this available as a portlet in 6.1 or did you guys just develop a "private" portlet for liferay.com?
It's a "private" portlet (actually it's web content, not a true portlet). I've pubished a bunch of details and the full source code at http://www.liferay.com/web/james.falkner/blog/-/blogs/community-activity-map-explained