PortalContainer settings

We can inject the value of the portal container settings into the portal container configuration files thanks to the variables of which name starts with "portal.container.", so to get the value of a setting called "foo", just use the following syntax ${portal.container.foo}. You can also use internal variables, such as:

portal.container.nameGives the name of the current portal container.
portal.container.restGives the context name of the rest web application of the current portal container.
portal.container.realmGives the realm name of the current portal container.

You can find below an example of how to use the variables:

<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 name of the portal container -->
      <!-- The name of the rest ServletContext -->
      <!-- The name of the realm -->
        <name>before foo after</name>
        <value>before ${portal.container.foo} after</value>

In the properties file corresponding to the external settings, you can reuse variables previously defined (in the external settings or in the internal settings) to create a new variable. In this case, the prefix "portal.container." is not needed, see an example below:

my-var1=value 1
my-var2=value 2

In the external and internal settings, you can also create variables based on value of System paramaters. The System parameters can either be defined at launch time or thanks to the PropertyConfigurator (see next section for more details). See an example below:


However, for the internal settings, you can use System parameters only to define settings of type java.lang.String.

It can be also very usefull to define a generic variable in the settings of the default portal container, the value of this variable will change according to the current portal container. See below an example:

my-generic-var=ABC ${name}

If this variable is defined at the default portal container level, the value of this variable for a portal container named "foo" will be ABC foo.

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