Resource Center

How to Mash-up Activity Streams from Jira, Sonar and Hudson

Overview

We are going to build a space in exo social to follow the development of a software. We are going to take as an example the development of eXo Social.

We want to integrate the 3 following things:

  • Our task manager: Jira
  • Our code quality tool: Sonar
  • Our building system: Hudson

Requirements

For all the other things we are going to use exo's infrastructure.

Preparation

  • Unzip the exo social tomcat in /src/tutorial/. It will be in /src/tutorial/tomcat, we will call this directory $TOMCAT_HOME.
  • Open a terminal and start the tomcat, our tomcat will run on the port 8080.
    			$ cd $TOMCAT_HOME$ ./bin/gatein.sh run
  • go to http://localhost:8080/socialdemo/public/classic/ you should see the home page of eXo Social.

Create the space and configure it

We want to create a space for eXo Social Team members to share.

  • Go to the page spaces.
  • Create a new space, call it exosocial.
  • Go to your new space, click on "Dashboard".

Now we will add the sonar gadgets needed to follow our development:

For the Hudson gadget, you need to edit the preferences of the gadget to change the project and enter the url of the hudson page you want to follow, for exemple: http://builder.exoplatform.org/hudson/job/social-trunk-ci/.

If you want to add a Jira gadget, you will have to add a patch because of the bug GTNPORTAL-511. You can add the GTNPORTAL-511.js.patch it modify the file ExoBasedUserPrefStore.js.

Integrate data into the activity stream of a space

Thanks to the extensibility of eXo Social, we can re-publish feeds into different stream. The Feedmash service is an extensible service that can take an RSS feed and push the entries into the activity stream of a user or a space. By default, eXo Social is coming with 2 of them : Jira and Hudson.

  • To configure Feedmash, you need to add JiraFeedConsumer and HudsonFeedConsumer as scheduled job (FeedmashJobPlugin). Edit the file gatein/conf/portal/socialdemo/configuration.xml to add the following configuration for Feedmash.
    			<code>
        <configuration xmlns="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.exoplaform.org/xml/ns/kernel_1_1.xsd http://www.exoplaform.org/xml/ns/kernel_1_1.xsd">
          <external-component-plugins>       
          <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>     
          <component-plugin>            
            <name>RepubSocialJiraActivityJob</name>             
            <set-method>addPeriodJob</set-method>             
            <type>org.exoplatform.social.feedmash.FeedmashJobPlugin</type>        
            <description>will republish resolved and closed jiras events of exosocial project into a space</description>        
            <init-params>         
              <properties-param>            
                <name>mash.info</name>            
                <property name="categoryMatch" value="resolved|created|reopened">                              
                <property name="targetActivityStream" value="space:exosocial">                         
                <property name="baseURL" value="http://jira.exoplatform.org">                      
                <property name="project" value="SOC">
              </property></property></property></property></properties-param>                 
              <properties-param>                      
                <name>job.info</name>                     
                <description>save the monitor data  periodically</description>                      
                <property name="jobName" value="JIRAFeedConsumer">                     
                <property name="groupName" value="Feedmash">                     
                <property name="job" value="org.exoplatform.social.feedmash.JiraFeedConsumer">                     
                <property name="repeatCount" value="0">                      
                <property name="period" value="60000">             
                <span class="code-comment">             
                <!-- 1 mins-->                          
                <property name="startTime" value="+45">                      
                <property name="endTime" value="">                         
              </property></property></span></property></property></property></property></property></properties-param>                       
            </init-params>            
          </component-plugin>           
          <component-plugin>              
            <name>WatchSocialBuildStatus</name>               
            <set-method>addPeriodJob</set-method>               
            <type>org.exoplatform.social.feedmash.FeedmashJobPlugin</type>              
            <description>will republish build changes in exosocial space</description>              
            <init-params>                   
              <properties-param>                      
                <name>mash.info</name>                        
                <property name="feedURL" value="http://builder.exoplatform.org/hudson/view/social/job/social-trunk-ci/rssAll">                         
                <property name="baseURL" value="http://builder.exoplatform.org/hudson/view/social">                          
                <property name="project" value="social-trunk-ci">                                    
                <property name="targetActivityStream" value="space:exosocial">                       
                <property name="successIcon" value="http://builder.exoplatform.org/hudson/plugin/greenballs/48x48/green.gif">                          
                <property name="failureIcon" value="http://builder.exoplatform.org/hudson/images/48x48/red.gif">                       
              </property></property></property></property></property></property></properties-param>                   
              <properties-param>                      
                <name>job.info</name>                       
                <description>save the monitor data  periodically</description>                      
                <property name="jobName" value="HudsonFeedConsumer">                       
                <property name="groupName" value="Feedmash">                       
                <property name="job" value="org.exoplatform.social.feedmash.HudsonFeedConsumer">                       
                <property name="repeatCount" value="0">                      
                <property name="period" value="60000"><!-- 1 mins-->                           
                <property name="startTime" value="+100">                       
                <property name="endTime" value="">                         
              </property></property></property></property></property></property></property></properties-param>                       
            </init-params>        
          </component-plugin>       
          </external-component-plugins>  
        </configuration>
                
      </code>
    

Summary

We've learned how to build a customized space for eXo Social that fill the need of a typical developer team. We have added gadget about the status of the development of the project to a shared dashboard, and pushed information about the activity of the project into the activity stream. You can now start to create your own spaces and customize them with your needs.

 

Contact Us

Questions about eXo products and services? Talk to sales.

Follow Us

eXo on Twitter eXo on Facebook eXo Blog eXo on LinkedIn eXo RSS feed
 
 
Powered by eXo Platform 3.5
Copyright © 2000-2012. All rights Reserved, eXo Platform SAS.