2.1.2. Creating a portal extension

Here you create a portal extension webapp and a jar to register it to portal container.

An example of the poorest portal extension - like the one in this tutorial - contains only configuration xml file. You can use Maven or Aunt to build it, or simply create a directory then archive it with jar or zip command or any archiver you have.

In case you need one, this is the instruction to use jar command (that is available once you installed JDK).


Take care that WEB-INF/ must be the top folder inside the .war, and conf/ must be the top folder inside the .jar.

  1. Create a portal extension. For example, it is named custom-extension.war.

    • WEB-INF/web.xml:

    • WEB-INF/conf/configuration.xml: this file is supposed to be service configuration; however, in the poorest portal extension you just write the root element configuration. You will be told to fill more configuration in later tutorials.

      <configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
  2. Create a jar that declares custom-extension.war as a portal dependency.

    This jar contains only conf/configuration.xml file and can be named, for example custom-extension-config.jar.

    <configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
            <!-- The full qualified name of the PortalContainerConfig -->
                <!-- 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 PortalContainerDefinitions -->
                <!-- The full qualified name of the PortalContainerDefinitionPlugin -->
                        <object type="org.exoplatform.container.definition.PortalContainerDefinitionChange$AddDependencies">
                            <!-- The name of the portal container -->
                            <field name="dependencies">
                                <collection type="java.util.ArrayList">
    • priority: set to "101" that is higher than platform-extension.war if you want your custom-extension to override configuration in that one.

    • dependencies: a collection of portal extensions. Here it is only custom-extension.


To deploy this poorest portal extension in case you do not use Add-ons Manager:

For Tomcat:

  1. Add custom-extension.war to the $PLATFORM_TOMCAT_HOME/webapps/ directory.

  2. Add custom-extension-config.jar to the $PLATFORM_TOMCAT_HOME/lib directory.

  3. Restart the server.

For JBoss:

  1. Add new WEB-INF/jboss-deployment-structure.xml file to custom-extension.war with the following content:

    <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
        <!-- This is the top level ear module, which contains all the classes in the EAR's lib folder     -->
        <!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
                <module name="deployment.platform.ear" export="true"/>
  2. Add custom-extension.war to $PLATFORM_JBOSS_HOME/standalone/deployments/ directory.

  3. Add custom-extension-config.jar to $PLATFORM_JBOSS_HOME/standalone/deployments/platform.ear!/lib directory.

  4. Restart the server.

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus