Try now Demo en
  • en
  • fr
  • de
  • Solutions
    • Use cases
      • Modern IntranetBuild strong internal culture & sense of belonging
      • Collaboration PlatformEfficient project management & teamwork
      • Social NetworkEngage users & recognize contributions
      • Knowledge managementCentralize & share your company knowledge
      • Employee PortalEngage your community
    • Industries
      • Public Sector
      • Networks
      • Education
      • Enterprises
  • Product
    • Overview
      • Digital workplaceFeatures & capabilities
      • Why eXoKey differentiators
      • InternationalisationMultilingual environments
      • MobileBranded mobile applications
    • Platform
      • No CodeTailor to your needs without code
      • IntegrationsAvailable connectors & extension capabilities
    • Technology
      • ArchitectureAn overview of eXo Platform technology
      • SecurityeXo Platform security measures
      • Open sourceComponents & licensing
  • Offers
    • EnterpriseMore than 250 users
    • ProfessionalLess than 250 users
    • OEM EditionFor software vendors & service providers
    • ServicesDiscover eXo professional services
  • Resources
    • Resource center
      • Case studies
      • White Papers
      • Datasheets
      • Videos
    • Migration guide
      • Alternative to Microsoft 365
      • Alternative to Sharepoint
      • Alternative to Workplace from Meta
    • From The Blog
      • eXo Platform 7.0 is released
      • eXo Platform Community Edition 7.0 is released
      • Cloud Vs On-premise Digital Workplace: Which one is right for your business?
  • Community
    • CommunityJoin our online community platform
    • DownloadLaunch eXo platform in your infrastructure
    • Source codeSource code on github
    • FAQsAbout the software, the community and our offers
    • REST APIs & DocumentationAll REST APIs available in eXo Platform
  • Company
    • About us
    • Customers
    • Partners
    • Contact us
    • Newsroom
  • Menu mobile
    • Pricing
    • About us
    • Careers
    • Resource center
    • Blog
    • Contact us
    • Try eXo
Use cases
  • Modern Intranet Build strong internal culture & sense of belonging
  • Collaboration Platform Efficient project management & teamwork
  • Social Network Engage users & recognize contributions
  • Knowledge management Centralize & share your company knowledge
  • Employee Portal Engage your community
Industries
  • Public Sector
  • Networks
  • Education
  • Enterprises
Overview
  • Digital workplace Features & capabilities
  • Why eXo Key differentiators
  • Internationalisation Multilingual environments
  • Mobile Branded mobile applications
Platform
  • No Code Tailor to your needs without code
  • Integrations Available connectors & extension capabilities
Technology
  • Architecture An overview of eXo Platform technology
  • Security eXo Platform security measures
  • Open source Components & licensing
Enterprise More than 250 users
Professional Less than 250 users
OEM Edition For software vendors & service providers
Services Discover eXo professional services
Resource center
  • Case studies
  • White Papers
  • Datasheets
  • Videos
Migration guide
  • Alternative to Microsoft 365
  • Alternative to Sharepoint
  • Alternative to Workplace from Meta
From The Blog
  • eXo Platform 7.0 is released
  • eXo Platform Community Edition 7.0 is released
  • Cloud Vs On-premise Digital Workplace: Which one is right for your business?
Community Join our online community platform
Download Launch eXo platform in your infrastructure
Source code Source code on github
FAQs About the software, the community and our offers
REST APIs & Documentation All REST APIs available in eXo Platform
About us
Customers
Partners
Contact us
Newsroom
Pricing
About us
Careers
Resource center
Blog
Contact us
Try eXo
  1. Accueil
  2. Uncategorized
  3. How to Customize Your Platform Activity Stream Content

How to Customize Your Platform Activity Stream Content

Overview

The Activity Stream (AS) is the most recognizable social feature of eXo Platform. AS gives you updates of the activities of your connections and spaces. It is also the place to share your work, your stuff or even just your mood.

By using the event listener mechanism, AS automatically publishes activities like user profile updates, document updates, relationship updates and space updates.

1-Activity-Stream

In some cases, you might want to remove such default activities from AS or implement customized actions based on dedicated activities. In this tutorial, you will see how to remove the activities for space leaving and space joining by overriding the SpaceActivityPublisher listener.

How a listener works

Listeners are registered with the main services. Every time the main service is running and fires a registered event, listeners will be called.

<component>
	<key>org.exoplatform.social.core.space.spi.SpaceService</key>
	<type>org.exoplatform.social.core.space.impl.SpaceServiceImpl</type>	
………………      	
  	<component-plugin>
    		<name>SpaceActivityPublisher</name>
    		<set-method>addSpaceListener</set-method>
    		<type>org.exoplatform.social.core.application.SpaceActivityPublisher</type>
  	</component-plugin>   		
………………
  </component>

The above configuration can be found in social-extension.war: /WEB-INF/conf/social-extension/social/core-configuration.xml

SpaceActivityPublisher implements the SpaceLifeCycleListener interface and it is registered with SpaceService as a listener. It listens to most space-related activities, such as when a space is created, a space is removed, space settings change or someone leaves or joins a space, and it publishes them as social activities on AS.

If you would like to remove all space-related activities from AS, just simply comment out the component plugin config of SpaceActivityPublisher. This will disable the SpaceActivityPublisher listener. If you want to remove just the activities for when someone leaves or joins a space, as seeing such activities can sometimes be annoying, then you have to override SpaceActivityPublisher with your own implementation. To do so, you need to create an extension project, which can override the default components or default configuration of eXo Platform. Please find details for how to create an extension project here.

Override a listener

We will create a sub-class of SpaceActivityPublisher called CustomSpaceActivityPublisher in our extension project. In this class, we inherit all the methods of SpaceActivityPublisher, and only override the joined(SpaceLifeCycleEvent event) and left(SpaceLifeCycleEvent event) methods so that no action is taken for the events when a member joins or leaves.

public class CustomSpaceActivityPublisher extends SpaceActivityPublisher {
  public CustomSpaceActivityPublisher(InitParams params,
  	ActivityManager activityManager, IdentityManager identityManager) {
	super(params, activityManager, identityManager);
	// TODO Auto-generated constructor stub
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void joined(SpaceLifeCycleEvent event) {
   //Do nothing
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public void left(SpaceLifeCycleEvent event) {
	//Do nothing
  }
}

Override a configuration

As mentioned above, the configuration needed to register SpaceActivityPublisher listener with SpaceService is in social-extension.war: /WEB-INF/conf/social-extension/social/core-configuration.xml

We copy this configuration file into our extension project and update the configuration as follows:

<component-plugin>
	<name>SpaceActivityPublisher</name>
	<set-method>addSpaceListener</set-method>
	<type>org.exoplatform.customization.listener.CustomSpaceActivityPublisher</type>
</component-plugin>

This registers our new sub-class as the listener for SpaceService. Remember that to override the existing core-configuration.xml of social-extension.war, we have to put our configuration file in the same path as the original one.

* Important note: We cannot just add the above listener registration to the existing core-configuration.xml. We have to override the existing core-configuration.xml with the new one in our extension project. This is to avoid a registration conflict.

Launching customization

Now you are ready to deploy your extension project. The source code of a sample extension project can be found here. After you have built this extension project using Maven, simply copy the .war files to $TomcatHome/webapps and copy the .jar files to $TomcatHome/lib then start your Tomcat instance.

Going further

Customization can do more than removing unwanted activities from AS. You can override any method of the existing listener for the expected behavior. Besides SpaceActivityPublisher, there are a number of overridable components supported by eXo Platform.

You can download the Sample extension project.

Join the eXo tribe by registering for the community and access tutorials, support, and downloads!


make-the-most-out-of-eXo-platform4

Make the most out of eXo Platform 4

Register to the next webinar and get a complete overview of what you can do with eXo Platform 4. Reserve your seat now!

Brahim Jaouane

I am a Digital Marketing specialist specialized in SEO at eXo Platform. Passionate about new technologies and Digital Marketing. With 10 years' experience, I support companies in their digital communication strategies and implement the tools necessary for their success. My approach combines the use of different traffic acquisition levers and an optimization of the user experience to convert visitors into customers. After various digital experiences in communication agencies as well as in B2B company, I have a wide range of skills and I am able to manage the digital marketing strategy of small and medium-sized companies.

Full-featured digital workplace with everything your employees need to work efficiently, smartly integrated for a compelling employee experience

  • Product
    • Software tour
    • Communication
    • Collaboration
    • Knowledge
    • Productivity
    • Open Source
    • Integrations
    • Security
  • Uses cases
    • Digital Workplace
    • Intranet software
    • Collaboration software
    • Knowledge management software
    • Entreprise Social Network
    • Employee Engagement platform
  • Roles
    • Internal Communications
    • Human Resources
    • Information Technology
  • Company
    • Product offer
    • Services Offer
    • Customers
    • Partners
    • About us
  • Resources
    • FAQs
    • Resource Center
    • Collaboration guide
    • What is a Digital workplace?
    • What is an intranet?
    • Employee engagement
  • Terms and Conditions
  • Legal
  • Privacy Policy
  • Accessibility
  • Contact us
  • Sitemap
  • Facebook
  • Twitter
  • LinkedIn
wpDiscuz