eXo Platform 3.5

## Chapter 2. Configuration

This chapter describes about configurations used in eXo Social. It consists of the following main sections:

- Components

- External component plugins

## Components

### ActivityManager

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
allowedTags | `String list` | `b, i, a, span, em, strong, p, ol, ul,li, br, img` | HTML tags

### SpaceService

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
space.homeNodeApp | `String` | `SpaceActivityStreamPortlet` | The home application for a space.
space.apps | `String list` | `DashboardPortlet:true`, `SpaceSettingPortlet:false`, `MembersPortlet:true` | The applications that are used for initializing the application when the space is created.

### Note

Deprecated: Use external-component-plugins instead: org.exoplatform.social.core.space.SpaceApplicationConfigPlugin.

### IdentityManager

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
providers | `String` | `org.exoplatform.social.core.identity.provider.SpaceIdentityProvider` | The identity providers.

### ProfileConfig

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
nodetype.emails | `String` | `exo:profileKeyValue` |
nodetype.phones | `String` | `exo:profileKeyValue` |
nodetype.ims | `String` | `exo:profileKeyValue` |
nodetype.urls | `String` | `exo:profileKeyValue` |
nodetype.address | `String` | `exo:profileAddress` |
nodetype.experiences | `String` | `exo:profileExperience` |
nodetype.education | `String` | `exo:profileEducation` |
forceMultiValue | `String` | xxxxxxxxxxxx |

### ServiceProviderStore

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
sample-provider | properties-params |  | Sample service provider.

## External component plugins

### MentionsProcessor

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
priority | `String` | 2 | The priority of this processor (the lower is executed first).

### PortletPreferenceRequiredPlugin

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
portletsPrefsRequired | `String list` | `SpaceActivityStreamPortlet, SpaceSettingPortlet, MembersPortlet` | The portlet name which requires space URL preference.

### SpaceApplicationConfigPlugin

Configuration name | Data type | Description
--- | --- | ---
spaceHomeApplication | `SpaceApplicationConfigPlugin$SpaceApplication` | The space application for the space home node.
spaceApplicationList | `SpaceApplicationConfigPlugin` | Space application list configuration.

### AddNodeTypePlugin

Configuration name | Data type | Possible value | Description
--- | --- | --- | ---
autoCreatedInNewRepository | `String` | `jar:/conf/portal/core-nodetypes.xml` | Node types configuration file.

## RelationshipManager

The Service is used to manipulate user relationships.

## SpaceIdentityProvider

The provider is to give identity space instances.

## SpaceApplicationHandler

The service is to handle all events related to creating and managing all the application spaces.

## ExoPeopleService

The service is to manipulate all data related to people in the Portal.

## Space Service

### Description

The service for spaces management includes creating spaces, and installing applications.

### Components configuration

Component name | Description
--- | ---
SpaceServiceImpl | Implementation class of Space Service.

    <component>

      <key>org.exoplatform.social.core.space.spi.SpaceService</key>

      <type>org.exoplatform.social.core.space.impl.SpaceServiceImpl</type>

      <!--Deprecated, Use external-component-plugins instead

      <init-params>

        <values-param>

          <name>space.homeNodeApp</name>

          <value>SpaceActivityStreamPortlet</value>

        </values-param>

        <values-param>

          <name>space.apps</name>

          <value>DashboardPortlet:true</value>

          <value>SpaceSettingPortlet:false</value>

          <value>MembersPortlet:true</value>

        </values-param>

      </init-params>

      -->

    </component>

Configuration name | Data type | Possible value | Possible value | Description
--- | --- | --- | --- | ---
SpaceActivityStreamPortlet | `String` | N/A | `SpaceActivityStreamPortlet` | The name of portlet displaying activities of spaces.
space.apps | `String list` | `Porlets' name: true/false` | `DashboardPortlet:true`; `SpaceSettingPortlet:false`; `MembersPortlet:true` | The list of configurations for portlets.

### External plug-in configuration

#### PortletPreferenceRequiredPlugin

    <external-component-plugins>

      <target-component>org.exoplatform.social.core.space.spi.SpaceService</target-component>

      <component-plugin>

        <name>portlets.prefs.required</name>

        <set-method>setPortletsPrefsRequired</set-method>

        <type>org.exoplatform.social.core.application.PortletPreferenceRequiredPlugin</type>

        <init-params>

          <values-param>

            <name>portletsPrefsRequired</name>

            <value>SpaceActivityStreamPortlet</value>

            <value>SpaceSettingPortlet</value>

            <value>MembersPortlet</value>

          </values-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

In which:

Name | Set-method | Type | Description
--- | --- | --- | ---
PortletPreferenceRequiredPlugin | setPortletsPrefsRequired | org.exoplatform.social.core.application.PortletPreferenceRequiredPlugin | Configure the list of portlet names which will have portlet preference of space context.

- Init-params:

Name | Possible value | Possible value | Description
--- | --- | --- | ---
portletsPrefsRequired | `Portlet names` | `SpaceActivityStreamPortlet; SpaceSettingPortlet; MembersPortlet` | List of portlets which need to be saved and get the space context name.

#### SpaceApplicationConfigPlugin

### Note

Since 1.2.0-GA

    <external-component-plugins>

      <target-component>org.exoplatform.social.core.space.spi.SpaceService</target-component>

      <!-- Default applications to be installed when creating a new space -->

      <component-plugin>

        <name>Space Application Configuration</name>

        <set-method>setSpaceApplicationConfigPlugin</set-method>

        <type>org.exoplatform.social.core.space.SpaceApplicationConfigPlugin</type>

        <init-params>

          <object-param>

            <name>spaceHomeApplication</name>

            <description>Space Home Application</description>

            <object type="org.exoplatform.social.core.space.SpaceApplicationConfigPlugin$SpaceApplication">

              <field name="portletApp">

                <string>social-portlet</string>

              </field>

              <field name="portletName">

                <string>SpaceActivityStreamPortlet</string>

              </field>

              <field name="appTitle">

                <string>Home</string>

              </field>

              <!--<field name="icon"><string>SpaceHomeIcon</string></field> -->

            </object>

          </object-param>

          <object-param>

            <name>spaceApplicationListConfig</name>

            <description>space application list configuration</description>

            <object type="org.exoplatform.social.core.space.SpaceApplicationConfigPlugin">

              <field name="spaceApplicationList">

                <collection type="java.util.ArrayList">

                  <value>

                    <object type="org.exoplatform.social.core.space.SpaceApplicationConfigPlugin$SpaceApplication">

                      <field name="portletApp">

                        <string>dashboard</string>

                      </field>

                      <field name="portletName">

                        <string>DashboardPortlet</string>

                      </field>

                      <field name="appTitle">

                        <string>Dashboard</string>

                      </field>

                      <field name="removable">

                        <boolean>true</boolean>

                      </field>

                      <field name="order">

                        <int>1</int>

                      </field>

                      <field name="uri">

                        <string>dashboard</string>

                      </field>

                      <!--<field name="icon"><string>SpaceDashboardIcon</string></field> -->

                    </object>

                  </value>

                  <value>

                    <object type="org.exoplatform.social.core.space.SpaceApplicationConfigPlugin$SpaceApplication">

                      <field name="portletApp">

                        <string>social-portlet</string>

                      </field>

                      <field name="portletName">

                        <string>SpaceSettingPortlet</string>

                      </field>

                      <field name="appTitle">

                        <string>Space Settings</string>

                      </field>

                      <field name="removable">

                        <boolean>false</boolean>

                      </field>

                      <field name="order">

                        <int>2</int>

                      </field>

                      <field name="uri">

                        <string>settings</string>

                      </field>

                      <!--<field name="icon"><string>SpaceSettingsIcon</string></field> -->

                    </object>

                  </value>

                  <value>

                    <object type="org.exoplatform.social.core.space.SpaceApplicationConfigPlugin$SpaceApplication">

                      <field name="portletApp">

                        <string>social-portlet</string>

                      </field>

                      <field name="portletName">

                        <string>MembersPortlet</string>

                      </field>

                      <field name="appTitle">

                        <string>Members</string>

                      </field>

                      <field name="removable">

                        <boolean>true</boolean>

                      </field>

                      <field name="order">

                        <int>3</int>

                      </field>

                      <field name="uri">

                        <string>members</string>

                      </field>

                      <!--<field name="icon"><string>SpaceMembersIcon</string></field> -->

                    </object>

                  </value>

                </collection>

              </field>

            </object>

          </object-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

In which:

Name | Set-method | Type | Description
--- | --- | --- | ---
Space Application Configuration | setSpaceApplicationConfigPlugin | org.exoplatform.social.core.application.PortletPreferenceRequiredPlugin | Configure the list of space applications to be installed when creating a new space.

## Activity Manager

### Description

The service is to manipulate space and user activities.

### Component plug-in configuration

    <component-plugin>

      <name>OSHtmlSanitizer</name>

      <set-method>addProcessorPlugin</set-method>

      <type>org.exoplatform.social.core.processor.OSHtmlSanitizerProcessor</type>

      <init-params>

        <values-param>

          <name>allowedTags</name>

          <value>b</value>

          <value>i</value>

          <value>span</value>

          <value>a</value>

          <value>em</value>

          <value>strong</value>

          <value>p</value>

          <value>ol</value>

          <value>ul</value>

          <value>li</value>

          <value>br</value>

          <value>img</value>

        </values-param>

      </init-params>

    </component-plugin>

In which,

Name | Set-method | Type | Description
--- | --- | --- | ---
OSHtmlSanitizerProcessor | addProcessorPlugin | org.exoplatform.social.core.processor.OSHtmlSanitizerProcessor | The plugin that renders valid HTML tags appearing in the Activity body (content).

- Init-params:

Name | Possible value | Possible value | Description
--- | --- | --- | ---
allowedTags | `html tags` | b, i, a, span, em, strong, p, ol, ul,li, br, img | Process and render HTML tags in the activity content (body).

### External plug-in configuration

    <component-plugin>

      <name>MentionsProcessor</name>

      <set-method>addProcessorPlugin</set-method>

      <type>org.exoplatform.social.core.processor.MentionsProcessor</type>

      <init-params>

        <value-param>

          <name>priority</name>

          <description>priority of this processor (lower number will be executed first)</description>

          <value>2</value>

        </value-param>

      </init-params>

    </component-plugin>

In which:

Name | Set-method | Type | Description
--- | --- | --- | ---
MentionsProcessor | addProcessorPlugin | org.exoplatform.social.core.processor.MentionsProcessor | A processor that will substitute @username expressions by a link on the user profile.

- Init-params:

Name | Possible value | Possible value | Description
--- | --- | --- | ---
priority | `priority number` | 2 | The priority of this processor (The lower level will be executed first).

## Identity Manager

### Description

The service is to manipulate the identity operations, such as creating, getting, deleting or finding a profile.

### Component plug-in configuration

    <component>

      <key>org.exoplatform.social.core.manager.IdentityManager</key>

      <type>org.exoplatform.social.core.manager.IdentityManager</type>

      <component-plugins>

        <component-plugin>

          <name>SpaceIdentityProvider plugin</name>

          <set-method>registerIdentityProviders</set-method>

          <type>org.exoplatform.social.core.identity.IdentityProviderPlugin</type>

          <init-params>

            <values-param>

              <name>providers</name>

              <description>Identity Providers</description>

              <value>org.exoplatform.social.core.identity.provider.SpaceIdentityProvider</value>

            </values-param>

          </init-params>

        </component-plugin>

      </component-plugins>

    </component>

In which:

Name | Set-method | Type | Description
--- | --- | --- | ---
SpaceIdentityProvider plugin | registerIdentityProviders | org.exoplatform.social.core.identity.IdentityProviderPlugin | The plugin that provides identity for a space.

- Init-params:

Name | Possible value | Possible value | Description
--- | --- | --- | ---
providers | `Every other identity providers` | `org.exoplatform.social.core.identity.provider.SpaceIdentityProvider` | Identity Provider instances for managing identities.

## OpenSocial Rest Context Configuration

### Description

The service is used to configure the portal container name when there is an OpenSocial REST API request. By configuring this service, you can make sure that the right portal container is reached. The default portal container is portal.

### Component plug-in configuration

This should be used when there is a portal container different than the default portal one.

    <external-component-plugins>

      <target-component>org.exoplatform.social.opensocial.auth.RestPortalContainerNameConfig</target-component>

      <component-plugin>

        <name>set portal container name used for REST service</name>

        <set-method>setRestContainerName</set-method>

        <type>org.exoplatform.social.opensocial.auth.RestPortalContainerNameConfig</type>

        <init-params>

          <value-param>

            <name>rest-container-name</name>

            <value>socialdemo</value>

          </value-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

In which:

Name | Set-method | Type | Description
--- | --- | --- | ---
set portal container name used for REST service | setRestContainerName | org.exoplatform.social.opensocial.auth.RestPortalContainerNameConfig | This plugin is used to set the rest portal container name for the OpenSocial REST API request.

- Init-params:

Name | Possible value | Possible value | Description
--- | --- | --- | ---
rest-container-name | `any valid portal container name` | `N/A` | Name of the portal container.

## Spaces Template configuration

In eXo Social, you may have two space types (classic and webos spaces).

For the classic space, you can pre-configure the template. You can configure the layout to select where to display the applications (for example, the application's menu on the left, the selected application is displayed on the right, and more).

Here is an example of the configuration file that displays the menu on the left. The application will be inserted in the container with the ID Application:

    <page>

      <owner-type/>

      <owner-id/>

      <name/>

      <container id="SpacePage" template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">

        <container id="Menu" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">

          <portlet-application>

            <portlet>

              <application-ref>space</application-ref>

              <portlet-ref>SpaceMenuPortlet</portlet-ref>

            </portlet>

            <access-permissions>*:/platform/users</access-permissions>

            <show-info-bar>false</show-info-bar>

          </portlet-application>

        </container>

        <container id="Application" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">

        </container>

      </container>

    </page>

In this example, the outer container contains two inner containers: one container has id as Menu for your Menu and another has id as Application containing your applications.

If you want to put the menu on the right and the application on the left, you can swap the declared position of these two containers:

    <page>

      <owner-type/>

      <owner-id/>

      <name/>

      <container id="SpacePage" template="system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl">

        <container id="Application" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">

        <container id="Menu" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">

          <portlet-application>

            <portlet>

              <application-ref>space</application-ref>

              <portlet-ref>SpaceMenuPortlet</portlet-ref>

            </portlet>

            <access-permissions>*:/platform/users</access-permissions>

            <show-info-bar>false</show-info-bar>

          </portlet-application>

        </container>

        </container>

      </container>

    </page>

In eXo Social standalone, this configuration file is at:

- $EXO_TOMCAT/webapps/socialdemo/WEB-INF/conf/portal/template/pages/space/page.xml

In eXo Platform, this configuration file is at:

- $EXO_TOMCAT/webapps/{portal-name}/WEB-INF/conf/portal/template/pages/space/page.xml

## Configure the oauth 2 legged scenario

This section is about configuring the oAuth 2 legs scenario in OpenSocial. (Reference: OpenSocial.org)

For more information, visit 2-legged OAuth for the OpenSocial REST API.

### Generate the certificates

To generate the key:

    $ openssl req -newkey rsa:1024 -days 365 -nodes -x509 -keyout testkey.pem \
         -out testkey.pem -subj '/CN=mytestkey'
    $ openssl pkcs8 -in testkey.pem -out oauthkey.pem -topk8 -nocrypt -outform PEM

### Configure the property file

Edit container.js and change the following parameter to point to your private key and key name.

    "gadgets.signingKeyFile" : "oauth.pem",
    "gadgets.signingKeyName" : "oauthKey",