eXo Platform 3.5

## Chapter 2. Configuration

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

- Components

  Description of the services which provide low-level functionality for UI components, including:

  - SpaceService

  - LifeCycleCompletionService

  - RestPortalContainerNameConfig

  - LinkProvider

- External component plugins

  Usage, sample configurations and its details of the main component plugins used in Social, including:

  - ActivityResourceBundlePlugin

  - IdentityProviderPlugin

  - MentionsProcessor

  - OSHtmlSanitizerProcessor

  - PortletPreferenceRequiredPlugin

  - SpaceApplicationConfigPlugin

  - SocialChromatticLifeCycle

  - TemplateParamsProcessor

  - URLConverterFilterPlugin

  - and RestPortalContainerNameConfig

## 2.1. Component

- SpaceService

  This service is used for spaces management, including creating spaces, and installing applications.

- LifeCycleCompletionService

  This component is used to process the callable request out of the HTTP request.

- RestPortalContainerNameConfig

  This plugin is used to set the portal container name used for REST service.

- LinkProvider

  This service is used to provide the utility to get the URLs of the activities, profiles, spaces, avatars and more.

### Note

This section describes services which provide low-level functionality for UI components.

`See also`

- External Component Plugin

### 2.1.1. SpaceService

The service is used for spaces management, including creating spaces, and installing applications.

sjfdfksa kjhdkgoeri ksh oie iudshg iogidsg iusd iudfg dg ierj dfs idfg eriudf sriuf idf er iudf sdfsdaasd -asd -asdf -as sadth-sa afsdf sdf assfd asg-r adf asdf asfd

Sample configuration:

    <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>

- Init-params:

Name | Type | 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.

### 2.1.2. LifeCycleCompletionService

This component is used to process the callable request out of the HTTP request.

Sample configuration:

    <component>

        <key>org.exoplatform.social.common.lifecycle.LifeCycleCompletionService</key>

        <type>org.exoplatform.social.common.lifecycle.LifeCycleCompletionService</type>

        <init-params>

          <value-param>

            <name>thread-number</name>

            <value>10</value>

          </value-param>

          <value-param>

            <name>async-execution</name>

            <value>false</value>

          </value-param>

        </init-params>

    </component>

- Init-params:

Name | Type | Value | Description
--- | --- | --- | ---
thread-number | `integer` | `10` | The maximum number of threads parallel executed.
async-execution | `boolean` | `false` | Specify the running mode of service is synchronous or asynchronous.

### 2.1.3. RestPortalContainerNameConfig

This plugin is used to set the portal container name used for REST service.

Sample configuration:

    <component>

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

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

        <init-params>

          <value-param>

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

            <value>portal</value>

          </value-param>

        </init-params>

    </component>

- Init-params:

Name | Type | Value | Description
--- | --- | --- | ---
rest-container-name | `any valid container name` | `portal` | The name of the container.

### 2.1.4. LinkProvider

This service is used to provide the utility to get the URLs of the activities, profiles, spaces, avatars and more.

Sample configuration:

    <component>

        <key>org.exoplatform.social.core.service.LinkProvider</key>

        <type>org.exoplatform.social.core.service.LinkProvider</type>

        <init-params>

            <value-param>

              <name>predefinedOwner</name>

              <description>this for generate profile link</description>

              <value>classic</value>

            </value-param>

        </init-params>

      </component>

- Init-params:

Name | Type | Value | Description
--- | --- | --- | ---
predefinedOwner | `String` | `classic` | The default portal owner name.

## 2.2. External Component Plugin

- ActivityResourceBundlePlugin

  This plugin is used to register the external resource bundle for the internationalized activity type.

- IdentityProviderPlugin

  This plugin provides the identity for a space.

- MentionsProcessor

  This plugin allows creating a link to a user profile when the user is mentioned in the activity content.

- OSHtmlSanitizerProcessor

  This plugin renders valid HTML tags appearing in the Activity body (content).

- PortletPreferenceRequiredPlugin

  This plugin is used to configure the list of portlet names which will have portlet preference of space context.

- SpaceApplicationConfigPlugin

  This plugin is used to configure the default applications when creating a new space.

- SocialChromatticLifeCycle

  This plugin is used to manage ChromatticSession in the Social project.

- TemplateParamsProcessor

  This plugin uses the value in the template parameter of the activity and replaces the title and body of the activity with the template parameter of this activity.

- URLConverterFilterPlugin

  This plugin converts all the URLs in the activity into the hyperlinks.

- RestPortalContainerNameConfig

  This plugin is used to set the portal container name used for REST service.

### Note

This section only describes the main component plugins used in Social. Each part supplies an sample configuration with the explanation about init-params so you can know how to use these plugins.

`See also`

- Component

### 2.2.1. ActivityResourceBundlePlugin

This plugin is used to register the external resource bundle for the internationalized activity type.

Sample configuration:

    <component-plugin>

      <name>exosocial:spaces</name> <!-- activity type -->

      <set-method>addActivityResourceBundlePlugin</set-method>

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

      <init-params>

        <object-param>

          <name>locale.social.Core</name> <!-- resource bundle key file -->

          <description>activity key type resource bundle mapping for exosocial:spaces</description>

          <object type="org.exoplatform.social.core.processor.ActivityResourceBundlePlugin">

            <field name="activityKeyTypeMapping">

              <map type="java.util.HashMap">

                <entry>

                  <key><string>space_created</string></key>

                  <value><string>SpaceActivityPublisher.space_created</string></value>

                </entry>

                <entry>

                  <key><string>manager_role_granted</string></key>

                  <value><string>SpaceActivityPublisher.manager_role_granted</string></value>

                </entry>

                <entry>

                  <key><string>user_joined</string></key>

                  <value><string>SpaceActivityPublisher.user_joined</string></value>

                </entry>

                <entry>

                  <key><string>member_left</string></key>

                  <value><string>SpaceActivityPublisher.member_left</string></value>

                </entry>

              </map>

            </field>

          </object>

        </object-param>

      </init-params>

    </component-plugin>

In which:

- Name: exosocial:spaces

- Set-method: addActivityResourceBundlePlugin

- Type: org.exoplatform.social.core.processor.ActivityResourceBundlePlugin

- Init-params:

Object-param | Description
--- | ---
locale.social.Core | The resource bundle key file.

### 2.2.2. IdentityProviderPlugin

The plugin provides the identity for a space.

Sample configuration:

    <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>

In which:

- Name: SpaceIdentityProvider plugin

- Set-method: registerIdentityProviders

- Type: org.exoplatform.social.core.identity.IdentityProviderPlugin

- Init-params:

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

### 2.2.3. MentionsProcessor

This plugin allows creating a link to a user profile when the user is mentioned in the activity content.

To use the plugin in the component configuration, you must use the following target-component:

    <target-component>org.exoplatform.social.core.manager.ActivityManager</target-component>

Sample 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 are executed first)</description>

          <value>2</value>

        </value-param>

      </init-params>

    </component-plugin>

In which:

- Name: MentionsProcessor

- Set-method: addProcessorPlugin

- Type: org.exoplatform.social.core.processor.MentionsProcessor

- Init-params:

Name | Possible value | Default value | Description
--- | --- | --- | ---
priority | `integer` | 2 | The priority of this processor. The lower priority level is executed first.

### 2.2.4. OSHtmlSanitizerProcessor

The plugin renders valid HTML tags appearing in the Activity body (content).

Sample configuration:

    <component>

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

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

        <component-plugins>

          <component-plugin>

            <name>OSHtmlSanitizer</name>

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

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

          </component-plugin>

        </component-plugins>

    </component>

In which:

- Name: OSHtmlSanitizer

- Set-method: addProcessorPluginn

- Type: org.exoplatform.social.core.processor.OSHtmlSanitizerProcessor

### 2.2.5. PortletPreferenceRequiredPlugin

This plugin is used to configure the list of portlet names which will have portlet preference of space context.

To use the plugin in the component configuration, you must use the following target-component:

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

Sample configuration:

    <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>

In which:

- Name: portlets.prefs.required

- Set-method: setPortletsPrefsRequired

- Type: org.exoplatform.social.core.application.PortletPreferenceRequiredPlugin

- Init-params:

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

### 2.2.6. SpaceApplicationConfigPlugin

This plugin is used to configure the default applications when creating a new space.

Sample configuration:

    <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>

In which:

- Name: Space Application Configuration

- Set-method: setSpaceApplicationConfigPlugin

- Type: org.exoplatform.social.core.space.SpaceApplicationConfigPlugin

- Init-params:

Object-param | Description
--- | ---
spaceHomeApplication | Set the Application portlet to be the home page of a space.
spaceApplicationListConfig | The list of the applications that are installed by default to a new space.

Field name | Possible value | Description
--- | --- | ---
portletAp | `string` | The .war name file which has the portlet.
portletName | `string` | The name of portlet which is registered in the system.
appTitle | `string` | The display name of the application.
removable | `boolean` | Specify if the application is removed from the space or not.
order | `integer` | The order of the application in the space navigation.
uri | `string` | The URI of the application in the page node.
icon | `string` | The icon of the application.

### 2.2.7. SocialChromatticLifeCycle

This plugin is used to manage ChromatticSession in the Social project.

To use the plugin in the component configuration, you must use the following target-component:

    <target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>

Sample configuration:

    <component-plugin>

      <name>chromattic</name>

      <set-method>addLifeCycle</set-method>

      <type>org.exoplatform.social.common.lifecycle.SocialChromatticLifeCycle</type>

      <init-params>

        <value-param>

          <name>domain-name</name>

          <value>soc</value>

        </value-param>

        <value-param>

          <name>workspace-name</name>

          <value>social</value>

        </value-param>

        <value-param profiles="all,default,minimal">

          <name>workspace-name</name>

          <value>social</value>

        </value-param>

        <values-param>

          <name>entities</name>

          <value>org.exoplatform.social.core.chromattic.entity.ProviderRootEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ProviderEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.IdentityEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ProfileEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.RelationshipEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.RelationshipListEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ActivityEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ActivityListEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ActivityDayEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ActivityMonthEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ActivityYearEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.ActivityParameters</value>

          <value>org.exoplatform.social.core.chromattic.entity.SpaceRootEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.SpaceEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.SpaceListEntity</value>

          <value>org.exoplatform.social.core.chromattic.entity.SpaceRef</value>

        </values-param>

        <properties-param>

          <name>options</name>

          <property name="org.chromattic.api.Option.root_node.path" value="/production"/>

          <property name="org.chromattic.api.Option.root_node.create" value="true"/>

        </properties-param>

      </init-params>

    </component-plugin>

In which:

- Name: chromattic

- Set-method: addLifeCycle

- Type: org.exoplatform.social.common.lifecycle.SocialChromatticLifeCycle

- Init-params:

Value-param | Possible value | Description
--- | --- | ---
domain-name | `String` | The life cycle domain name.
workspace-name | `String` | The repository workspace name that is associated with this life cycle.
entities | `List<String>` | The list of chromatic entities that will be registered against the chromatic builder.

Properties-param: option

Property name | Possible value | Default value | Description
--- | --- | --- | ---
org.chromattic.api.Option.rootnode.path | `String` | `/production` | The path of the root node.
org.chromattic.api.Option.rootnode.create | `Boolean` | `true` | Specify whether or not the root node is created by the ROOT_NODE_PATH option when it does not exist.

### 2.2.8. TemplateParamsProcessor

This plugin uses the value in the template parameter of the activity and replaces the title and body of the activity with the template parameter of this activity.

To use the plugin in the component configuration, you must use the following target-component:

    <target-component>org.exoplatform.social.core.manager.ActivityManager</target-component>

Sample configuration:

    <component-plugin>

      <name>TemplateParamsProcessor</name>

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

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

      <init-params>

        <value-param>

          <name>priority</name>

          <value>1</value>

        </value-param>

      </init-params>

    </component-plugin>

In which:

- Name: TemplateParamsProcessor

- Set-method: addProcessorPlugin

- Type: org.exoplatform.social.core.processor.TemplateParamsProcessor

- Init-params:

Name | Possible value | Default value | Description
--- | --- | --- | ---
priority | `integer` | 1 | The priority of this processor. The lower priority level is executed first.

### 2.2.9. URLConverterFilterPlugin

This plugin converts all the URLs in the activity into the hyperlinks.

To use the plugin in the component configuration, you must use the following target-component:

    <target-component>org.exoplatform.social.common.xmlprocessor.XMLProcessor</target-component>

Sample configuration:

    <component-plugin>

      <name>URLConverterFilterPlugin</name>

      <set-method>addFilterPlugin</set-method>

      <type>org.exoplatform.social.common.xmlprocessor.filters.URLConverterFilterPlugin</type>

      <init-params>

        <value-param>

          <name>urlMaxLength</name>

          <description>the max length of URL</description>

          <value>-1</value>

        </value-param>

      </init-params>

    </component-plugin>

In which:

- Name: URLConverterFilterPlugin

- Set-method: addFilterPlugin

- Type: org.exoplatform.social.common.xmlprocessor.filters.URLConverterFilterPlugin

- Init-params:

Value-param | Possible value | Default value | Description
--- | --- | --- | ---
urlMaxLength | `integer` | -1 | The maximum length of the URL. If the URL is exceeding the maximum length, the URL will be shorten. If the value is -1, it means the URL is not be shortened.

### 2.2.10. RestPortalContainerNameConfig

This plugin is used to set the portal container name used for REST service.

To use the plugin in the component configuration, you must use the following target-component:

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

Sample configuration:

    <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>

In which:

- Set-method: setRestContainerName

- Type: org.exoplatform.social.opensocial.auth.RestPortalContainerNameConfig

- Init-params:

Value-param | Possible value | Default value | Description
--- | --- | --- | ---
rest-container-name | `String` | `socialdemo` | The portal container name.

Copyright © 2009-2012. All rights reserved. eXo Platform SAS