Try now Demo en
  • en
  • fr
  • de
  • Solutions
    • Use cases
      • Modern IntranetBuild strong internal culture & sense of belonging
      • Collaboration PlatformEfficient teamwork and project collaboration
      • Social NetworkEngage users & recognize contributions
      • Knowledge hubCentralize, organize and share company knowledge
      • Application PortalUnified access to business applications and information
    • Switch to eXo
      • Microsoft 365 AlternativeAn open-source digital workplace alternative to M365
      • Migrate to eXo PlatformA guided, secure migration path from your existing tools to eXo
  • Product
    • Overview
      • Platform overviewExplore core capabilities
      • Why eXoKey differentiators
      • InternationalisationMultilingual environments
      • MobileBranded mobile applications
    • Platform
      • No CodeTailor to your needs without code
      • IntegrationsConnectors & extension capabilities
      • Controlled AIGoverned, extensible AI
    • Technology
      • ArchitectureArchitecture & technology
      • SecuritySecurity measures
      • Open sourceComponents & licensing
  • Offers
    • EnterprisePrivate cloud or on-premise deployments
    • eXo HubsReady-to-use SaaS edition for teams
    • Compare EditionsCompare editions and choose the right fit
    • OEM EditionFor software vendors & service providers
    • ServicesDiscover eXo professional services
  • Resources
    • Resource center
      • Case studies
      • White Papers
      • Datasheets
      • Videos
    • FAQsAbout the software, the community and our offers
      • Platform & Use Cases
      • AI & Responsible AI
      • Deployment, Security & Compliance
      • Open-source, Pricing & Services
    • From The Blog
      • eXo Platform 7.1 is released
      • Digital sovereignty: when public organizations move from words to action
      • 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
    • REST APIs & DocumentationAll REST APIs available in eXo Platform
  • Company
    • About us
    • Customers
    • Partners
    • Contact us
    • Newsroom
  • Menu mobile
    • Enterprise Offers
    • Blog
    • About us
    • Resource center
    • Careers
    • Contact us
    • Try eXo
Use cases
  • Modern Intranet Build strong internal culture & sense of belonging
  • Collaboration Platform Efficient teamwork and project collaboration
  • Social Network Engage users & recognize contributions
  • Knowledge hub Centralize, organize and share company knowledge
  • Application Portal Unified access to business applications and information
Switch to eXo
  • Microsoft 365 Alternative An open-source digital workplace alternative to M365
  • Migrate to eXo Platform A guided, secure migration path from your existing tools to eXo
Overview
  • Platform overview Explore core capabilities
  • Why eXo Key differentiators
  • Internationalisation Multilingual environments
  • Mobile Branded mobile applications
Platform
  • No Code Tailor to your needs without code
  • Integrations Connectors & extension capabilities
  • Controlled AI Governed, extensible AI
Technology
  • Architecture Architecture & technology
  • Security Security measures
  • Open source Components & licensing
Enterprise Private cloud or on-premise deployments
eXo Hubs Ready-to-use SaaS edition for teams
Compare Editions Compare editions and choose the right fit
OEM Edition For software vendors & service providers
Services Discover eXo professional services
Resource center
  • Case studies
  • White Papers
  • Datasheets
  • Videos
FAQs About the software, the community and our offers
  • Platform & Use Cases
  • AI & Responsible AI
  • Deployment, Security & Compliance
  • Open-source, Pricing & Services
From The Blog
  • eXo Platform 7.1 is released
  • Digital sovereignty: when public organizations move from words to action
  • 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
REST APIs & Documentation All REST APIs available in eXo Platform
About us
Customers
Partners
Contact us
Newsroom
Enterprise Offers
Blog
About us
Resource center
Careers
Contact us
Try eXo
  1. Accueil
  2. Uncategorized
  3. Super easy guide: inject your portlets wherever you want!

Super easy guide: inject your portlets wherever you want!

With our extension mechanism, we can now package and deploy new features easily in eXo Platform 4 as add-ons. You can deploy your own portlets but also existing ones, ready to use and ready to be deployed, with the add-ons manager:

1-dynamic-container

Platform 4.1 has a new way to inject your portlets easily into pre-established places within the platform. It’s easy and we have covered most of the places you will need. Of course, the feature is extensible, which means you can define new places and then inject your portlets wherever you want

Let’s say you want to inject your new add-on into the Platform to add a simple new application on the top right of your Home:

2-new-add-on-placement

Most of the changes are going to be made within your WAR file in the file /webapp/WEB-INF/conf/portlet/dynamic-container-configuration.xml.

This file is imported into configuration.xml within the WAR. The goal is to redefine a configuration file from the WAR without overriding the previous one present with the exact same location and name in your Platform. (documentation).

dynamic-container-configuration.xml

<external-component-plugins>
	<target-component>org.exoplatform.commons.addons.AddOnService</target-component>
	<component-plugin>
		<name>addPlugin</name>
		<set-method>addPlugin</set-method>
		<type>org.exoplatform.commons.addons.AddOnPluginImpl</type>
		<description>add application Config</description>
		<init-params>
			<value-param>
				<name>priority</name>
				<value>1</value>
			</value-param>
			<value-param>
				<name>containerName</name>
				<value>top-application-container</value>
			</value-param>

			<object-param>
			<!-- You must define here the portlet Name -->
				<name>helloPortlet</name>
				<description>sample hello portlet</description>
				<object type="org.exoplatform.commons.addons.PortletModel">
					<field name="contentId">
					<!-- In the container definition within your jar you have added a new container : sampleDynamicContainer
					This container will contain the targeted portlet helloPortlet. -->
						<string>sampleDynamicContainer/helloPortlet</string>
					</field>
					<!--The following values are optionals-->
					...
				</object>
			</object-param>
		</init-params>
	</component-plugin>
</external-component-plugins>

This file declares the new add-on but also the container name where you want to inject it.

Your JAR should contain your backend and the portal container configuration in file /src/main/resources/conf/configuration.xml.

configuration.xml

<external-component-plugins>
<!-- The full qualified name of the PortalContainerConfig —>     
	<target-component>org.exoplatform.container.definition.PortalContainerConfig</target-component>
	<component-plugin>
	<!-- The name of the plugin -->
		<name>Add PortalContainer Definitions</name>
		<!-- The name of the method to call on the PortalContainerConfig in order to register the changes on the PortalContainerDefinitions -->
		<set-method>registerChangePlugin</set-method>
		<!-- The full qualified name of the PortalContainerDefinitionChangePlugin -->
		<type>org.exoplatform.container.definition.PortalContainerDefinitionChangePlugin</type>
		<init-params>
			<values-param>
				<name>apply.specific</name>
				<value>portal</value>
			</values-param>
			<object-param>
				<name>change</name>
				<object type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependencies">
				<!-- The list of name of the dependencies to add -->
					<field name="dependencies">
						<collection type="java.util.ArrayList">
							<value>
								<string>sampleDynamicContainer</string>
							</value>
						</collection>
					</field>
				</object>
			</object-param>
		</init-params>
	</component-plugin>
</external-component-plugins>

In this file we are updating the portlet configuration from the PortalContainerConfig to register the new sampleDynamicContainer in the PortalContainerDefinitions.

3-add-on-deployed

That’s just an example for a social intranet. With the new dynamic container we have provided, you are going to be able to inject your portlets more easily and safely.

You will find this example of packaging on the eXo Samples Repository. In the meantime, if you want to try ready-to-use add-ons for your Platform, check out the add-ons repository and of course you can submit your add-ons to the community!

Join the eXo tribe by registering for the community and get updates, tutorials, support, and access to the Platform and add-on 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
    • Internationalisation
    • Mobile
    • No Code
    • Architecture
    • Integrations
    • Security
    • Open Source
  • Uses cases
    • Employee Portal
    • Knowledge management
    • Entreprise Social Network
    • Employee Engagement
    • Community Management
    • Extranet
  • Guides
    • What is a digital workplace?
    • Intranet guide
    • What is an extranet?
    • Employee engagement
    • Collaboration guide
    • Teamwork guide
    • Internal Communication guide
  • Enterprise
    • Product offer
    • Services Offer
    • Customers
    • About us
  • Resources
    • FAQs
    • Resource Center
    • Intranet Portal
    • What Is a Collaboration Software?
    • Talent Management
    • Employee Connection
    • Employee Intranet
    • Improve internal communication
    • eXo Tribe
  • Terms and Conditions
  • Legal
  • Privacy Policy
  • Accessibility
  • Contact us
  • Sitemap
  • Facebook
  • Twitter
  • LinkedIn
wpDiscuz