eXo Platform 3.5

## Chapter 2. Configurations

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

- Components

  Description of main components that take init-param in the applications of Collaboration, including: CalendarService, HistoryImpl, XMPPMessenger, DefaultPresenceStatus, and ContactService.

- External Component Plugins

  Description of configurations of external component plugins used to implement Calendar, Chat, Contact, Content and Mail applications.

- Data Injectors

  Description of data injectors used to create data for performance test in Collaboration and instruction on how to use them.

- eXo Chatserver Configuration

  Description of Openfire, system and AS configurations.

## 2.1. Components

Components | Applications | Description
--- | --- | ---
CalendarService | Calendar | It is a service that manages calendars in the Calendar application of Collaboration.
HistoryImpl XMPPMessenger DefaultPresenceStatus | Chat | It is a service that saves the chat history of users. It is a service that processes messages of chat users, basing on the XMPP Protocol. It is a component that controls the presence status of chat users.
ContactServiceImpl | Contact | It is a service that supplies functions to manage contacts in the Address Book application of Collaboration.

### Note

The above followings are some main components that take init-param in the applications of Collaboration.

`See also`

- External Component Plugins

- Data Injectors

- eXo Chatserver Configuration

### 2.1.1. CalendarService

The configuration of the Calendar application is applied mainly in /eXoApplication/calendar/service/src/main/resources/conf/portal/configuration.xml.

Use the CalendarService to configure the Calendar. The following information will explain details of its configuration. When this configuration file is executed, the component named org.exoplatform.calendar.service.impl.CalendarServiceImpl will process actions of the Calendar application.

    <component>

        <key>org.exoplatform.calendar.service.CalendarService</key>

        <type>org.exoplatform.calendar.service.impl.CalendarServiceImpl</type>

        <init-params>

            <properties-param>

                <name>eventNumber.info</name>

                <property name="eventNumber" value="100"/>

            </properties-param>

        </init-params>

    </component>

Details:

Properties-Param | Property name | Description | Possible Value | Default Value
--- | --- | --- | --- | ---
eventNumber | `eventNumber` | The number of events in a calendar. | `interger` | `100`

### 2.1.2. HistoryImpl

The configuration of historyImpl is found in the /extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/chat/chat-service-configuration.xml. When this configuration file is executed, the component named org.exoplatform.services.xmpp.history.impl.jcr.HistoryImpl initializes all the configured parameters.

    <component>

        <type>org.exoplatform.services.xmpp.history.impl.jcr.HistoryImpl</type>

        <init-params>

            <value-param>

                <name>workspace</name>

                <value>collaboration</value>

            </value-param>

            <value-param>

                <name>repository</name>

                <value>repository</value>

            </value-param>

            <value-param>

                <name>path</name>

                <value>exo:applications/eXoChat/history</value>

            </value-param>

        </init-params>

    </component>

Details:

Value-Param | Description | Possible Values | Default Value
--- | --- | --- | ---
workspace | The workspace name in JCR where history data is stored. | `string` | `collaboration`
repository | The repository name in JCR where history data is stored. | `string` | `repository`
path | The JCR path to the location where history data is stored. | `string` | `exo:applications/eXoChat/history`.

### 2.1.3. XMPPMessenger

The configuration of the XMPPMessenger component is found in /extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/chat/chat-service-configuration.xml. It helps Collaboration connect the Openfire instance.

    <component>

      <type>org.exoplatform.services.xmpp.connection.impl.XMPPMessenger</type>

      <init-params>

        <properties-param>

          <name>openfire-connection-conf</name>

          <property name="host" value="127.0.0.1"/>

          <property name="port" value="5222"/>

        </properties-param>

        <properties-param>

          <name>send-file</name>

          <property name="timeout" value="7200000"/>

        </properties-param>

      </init-params>

    </component>

Details:

Properties-param | Property name | Description | Possible Values | Default Value
--- | --- | --- | --- | ---
openfire-connection-conf | `host` `port` | IP address or hostname for the openfire server. Port to connect on the Openfire server. Should be the same that is set in the Openfire configuration "Client to Server". | `integer` `integer` | 127.0.0.1 5222
send-file | `timeout` | The timeout before aborting attempt to establish a file transfer. | `integer` | `7200000`

### 2.1.4. DefaultPresenceStatus

The configuration of the DefaultPresenceStatus component is found in /extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/chat/chat-service-configuration.xml.

    <component>

      <type>org.exoplatform.services.presence.DefaultPresenceStatus</type>

      <init-params>

        <properties-param>

          <name>presence-status</name>

          <property name="mode" value="Free to chat"/>

        </properties-param>

      </init-params>

    </component>

Details:

Properties-param | Property name | Description | Possible Values | Default Value
--- | --- | --- | --- | ---
presence-status | `mode` | Show the present status of users. | `string` | `Free to chat`

### 2.1.5. ContactService

The configuration of the ContactService component is found in eXoApplication/contact/service/src/main/resources/conf/portal/configuration.xml.

When the server starts, the configuration file which contains the declaration of ContactService component is executed. A ContactService component is then created with params and plugins in the configuration file.

    <component>

      <key>org.exoplatform.contact.service.ContactService</key>

      <type>org.exoplatform.contact.service.impl.ContactServiceImpl</type>

      <init-params>

        <values-param>

          <name>UserCanSeeAllGroupAddressBooks</name>

          <description>User can see all GroupAddressBooks or only GroupAddressBooks that the user has at least one membership</description>

          <value>false</value>

        </values-param>

        <values-param>

          <name>NonPublicGroups</name>

          <description>Groups that should not be displayed in broadcast list. Wildcards may be used in groups name</description>

        </values-param>

      </init-params>

    </component>

Details:

Values-param | Description | Possible Values | Default Value
--- | --- | --- | ---
UserCanSeeAllGroupAddressBooks | User can see all GroupAddressBooks or only GroupAddressBooks that the user has at least one membership. | `true/false` | `false`
NonPublicGroups | Groups that should not be displayed in the broadcast list. Wildcards may be used in groups name. | `true/false` | N/A

## 2.2. External Component Plugins

- Calendar Configuration

  Description of the configuration of external component plugins used to implement the Calendar application, including: NewUserListener, NewGroupListener, NewMembershipListener, ReminderPeriodJob, PopupReminderPeriodJob and AddActionsPlugin.

- Chat Configuration

  Description of the configuration of external component plugins used to implement the Chat application, including: HistoryPeriodJob, RequestFilterComponentPlugin and AuthenticationLoginListener and AuthenticationLogoutListener.

- Contact Configuration

  Description of the configuration of external component plugins used to implement the Address Book application, including: NewUserListener, NewMembershipListener, and UpdateUserProfileListener.

- Content Configuration

  Description of the configuration of external component plugins used to implement the Content application, including: RSSContentPluginDescriptionPlugin and DescriptionPlugin.

- Mail Configuration

  Description of the configuration of external component plugins used to implement the Mail application, including: AuthenticationLogoutListener and MailSettingConfigPlugin.

- Social Integration Configuration

  Description of the configuration of external component plugins used to integrate Social with Collaboration, including: CalendarDataInitialize, ContactDataInitialize, ContactSpaceActivityPublisher, CalendarSpaceActivityPublisher, and PortletPreferenceRequiredPlugin.

The following table describes the main functions of external component plugins:

Applications | Components | Description
--- | --- | ---
Calendar | `NewUserListener` | Create default personal calendars.
| `NewGroupListener` | Create default group calendars.
| `NewMembershipListener` | Share calendars to members of a specific group.
| `ReminderPeriodJob` | Execute sending reminder emails to users.
| `PopupReminderPeriodJob` | Open a pop-up reminder on the browser of users.
| `AddActionsPlugin` | Enable the systems to automatically update the updated date of events/tasks in a calendar when contents of these events/tasks are changed.
Chat | `HistoryPeriodJob` | Save the chat history of users.
| `RequestFilterComponentPlugin` | Delete the session of a user when the browser is suddenly closed or the session is changed.
| `AuthenticationLoginListener` | Start the session and log in the chat server.
| `AuthenticationLogoutListener` | End the session and log out the chat server.
Contact | `NewUserListener` | Create personal contact data for users.
| `NewMembershipListener` | Create address book for a specific group.
| `UpdateUserProfileListener` | Update the personal profile of a user when it is changed on the portal.
Content | `RSSContentPlugin` | The formatter used to analyze the data from a RSS resource.
| `DescriptionPlugin` | Represent the data from a RSS resource.
Mail | `AuthenticationLogoutListener` | Stop checking mails of a user when he logs out.
Social Intergration | `CalendarDataInitialize` | Create a calendar for a group in a specific space.
| `ContactDataInitialize` | Create an address book for a group in a specific space.
| `ContactSpaceActivityPublisher` | Customize the activity status of a specific space when an event happens on an address book.
| `CalendarSpaceActivityPublisher` | Customize the activity status of a specific space when an event happens on a calendar.
| `PortletPreferenceRequiredPlugin` | Declare the application that will automatically create database.

`See also`

- Components

- Data Injectors

- eXo Chatserver Configuration

### 2.2.1. Calendar Configuration

This section describes the configuration of external component plugin used to implement the Calendar application.

#### NewUserListener

Each user can have a default personal calendar created. Use the NewUserListener to configure that. To use the plugin in the component configuration, you must use the target-component:

    <target-component>org.exoplatform.services.organization.OrganizationService</target-component>

The configuration is applied mainly in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/calendar/calendar-service-configuration.xml.

    <component-plugin>

      <name>calendar.new.user.event.listener</name>

      <set-method>addListenerPlugin</set-method>

      <type>org.exoplatform.calendar.service.impl.NewUserListener</type>

      <description>description</description>

      <init-params>

        <value-param>

          <name>defaultEventCategories</name>

          <value>Meeting,Calls,Clients,Holiday,Anniversary</value>

        </value-param>

        <value-param>

          <name>defaultCalendarCategory</name>

          <value>My group</value><!-- Single value -->

        </value-param>

        <value-param>

          <name>defaultCalendar</name>

          <value>Default</value>

        </value-param>

        <!--Params for default calendar setting -->

        <value-param>

          <name>viewType</name>

          <value>1</value>

        </value-param>

        <value-param>

          <name>timeInterval</name>

          <value>15</value><!-- in minutes -->

        </value-param>

        <value-param>

          <name>weekStartOn</name>

          <value>2</value>

        </value-param>

        <value-param>

          <name>dateFormat</name>

          <value>MM/dd/yyyy</value>

        </value-param>

        <value-param>

          <name>timeFormat</name>

          <value>HH:mm</value> <!-- HH:mm/hh:mm a -->

        </value-param>

        <value-param>

          <name>localeId</name>

          <value>BEL</value>

        </value-param>

        <value-param>

          <name>timezoneId</name>

          <value>Europe/Brussels</value>

        </value-param>

        <value-param>

          <name>baseUrlForRss</name>

          <value/>

        </value-param>

        <value-param>

          <name>isShowWorkingTime</name>

          <value>false</value><!-- boolean true/false -->

        </value-param>

        <value-param>

          <name>workingTimeBegin</name>

          <value>08:00</value><!-- -->

        </value-param>

        <value-param>

          <name>workingTimeEnd</name>

          <value>18:00</value><!-- -->

        </value-param>

        <values-param>

          <name>ignoredUsers</name>

          <description>Definition users to ignore create default calendar</description>

          <!-- <value>demo</value> <value>marry</value> -->

        </values-param>

      </init-params>

    </component-plugin>

Details:

- Name: `calendar.new.user.event.listener` - The unique key to avoid duplicate names. Users can change it.

- Set-method: `addListenerPlugin` - The function is executed at the target of the component to register NewUserListener.

- Type: `org.exoplatform.calendar.service.impl.NewUserListener` - The class is set up to execute the creation of database.

- Description: It is a plugin used to create default personal calendars.

See the details about the init-params of the component in the following table:

Value-params | Possible value | Default value | Description
--- | --- | --- | ---
defaultEventCategories | `String (Comma separated list of category names)` | `Meeting,Calls,Clients,Holiday,Anniversary` | Default event categories for users.
defaultCalendarCategory | `String` | `Default` | Name of the calendar group.
viewType | `0-6 (see below)` | `1` | Default view after user logs in and goes to the Calendar portlet.
timeInterval | `integer in minutes` | `15` | The time unit interval when you drag and move the event (in Day and Week views only).
weekStartOn | `1-7 (see below)` | `2` | Day to use as the beginning of the week. It only affects the Week view.
dateFormat | `valid Java Date format` | `MM/dd/yyyy` | The display format for dates.
timeFormat | `valid Java Date format` | `HH:mm` | The display format for time.
localeId | `valid locale ID` | `BEL` | Id of the geographic locale.
timezoneIds | `valid TimeZone id` | `Europe` | User time zone.
baseUrlForRss | `none` | `none` | The URL to publish the RSS content.
isShowWorkingTime | `true/false` | `false` | Indicate if the working time should be highlighted in the Day view.
workingTimeBegin | `time in timeFormat` | `08:00` | The start time in working time.
workingTimeEnd | `time in timeFormat` | `18:00` | The end time in working time.
ignoredUsers | `user id, use multiple by each line` | `demo/marry` | Definition users to ignore creating the default calendar.

The viewType parameter is encoded by a number as follow:

0 : Day view

1 : Week view

2 : Month view

3 : Year view

4 : List view

5 : Schedule view

6 : Working days view

The weekStartOn parameter is encoded as follow:

1 : Sunday

2 : Monday

3 : Tuesday

4 : Wednesday

5 : Thursday

6 : Friday

7 : Saturday

#### NewGroupListener

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

    <target-component>org.exoplatform.services.organization.OrganizationService</target-component>

The configuration is applied mainly in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/calendar/calendar-service-configuration.xml.

    <component-plugin>

      <name>calendar.new.group.event.listener</name>

      <set-method>addListenerPlugin</set-method>

      <type>org.exoplatform.calendar.service.impl.NewGroupListener</type>

      <description>description</description>

      <init-params>

        <value-param>

          <name>defaultEditPermission</name>

          <value>*.*</value><!-- Multi value membership, use coma (,) to split values -->

        </value-param>

        <value-param>

          <name>defaultViewPermission</name>

          <value>*.*</value>

        </value-param>

        <value-param>

          <name>defaultLocale</name>

          <value>BEL</value>

        </value-param>

        <value-param>

          <name>defaultTimeZone</name>

          <value>Europe/Brussels</value>

        </value-param>

        <values-param>

          <name>ignoredGroups</name>

          <description>Definition group to ignore create default calendar</description>

          <!-- <value>/platform/guests</value> -->

          <value>/spaces/*</value> <!-- single value, use more <value> tags to add more group -->

        </values-param>

      </init-params>

    </component-plugin>

Details:

- Name: `calendar.new.group.event.listener` - The unique key to avoid duplicate names. Users can change it.

- Set-method: `addListenerPlugin` - The function is executed at the target of the component to register NewGroupListener.

- Type: `org.exoplatform.calendar.service.impl.NewGroupListener` - The class which is set up to execute the creation of database.

- Description - It is the plugin used to create default group calendars.

See the details about the init-params of the component in the following table:

Value-params | Possible values | Default values | Description
--- | --- | --- | ---
defaultEditPermission | `User id` (Multi value membership, use coma (,) to split values) | `. means that all members in that group can modify and add, remove a calendar, events/tasks of the calendar` | The default permission assigned to membership in a specific group to edit calendars and events/tasks of the calendar.
defaultViewPermission | `User id` (Multi value membership, use coma (,) to split values) | `. means that all members in that group can view this calendar and all the events/tasks of this calendar.` | The default permission assigned to membership in a specific group to view a calendar and events /tasks of the calendar.
defaultLocale | `Valid locade id` | `BEL (see more locale ids http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html )` | The default locale of the calendar.
defaultTimeZone | `Valid timezone id` | `Europe/Brussels (see more for timeZone ids http://www.unicode.org/cldr/data/docs/design/formatting/zone_log.html#windows_ids)` | The default time zone of the calendar.
ignoredGroups | `Group id (use line to define multiple value)` | `/platform/guests` | Definition group to ignore create the default calendar.

#### NewMembershipListener

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

    <target-component>org.exoplatform.services.organization.OrganizationService</target-component>

The configuration is applied mainly in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/calendar/calendar-service-configuration.xml.

    <component-plugin>

      <name>calendar.new.membership.event.listener</name>

      <set-method>addListenerPlugin</set-method>

      <type>org.exoplatform.calendar.service.impl.NewMembershipListener</type>

      <description>description</description>

    </component-plugin>

Details:

- Name: `calendar.new.membership.event.listener` - The unique key to avoid duplicate names. Users can change it.

- Set-method: `addListenerPlugin` - The function which is executed at the target of the component.

- Type: `org.exoplatform.calendar.service.impl.NewMembershipListener` - The class which is set up to execute the creation of database.

- Description: It is a plugin used to execute sending reminder emails to users.

#### ReminderPeriodJob

The Calendar application of Collaboration send event reminders by using the email reminder plugin configuration. You will probably need to adjust this configuration to meet your own needs. The feature is based on a periodic poll of the stored reminders.

You must use the following target component to use the plugin in this configuration:

    <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>

The configuration is applied in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/cs-configuration.xml.

    <component-plugin>

      <name>RecordsJob</name>

      <set-method>addPeriodJob</set-method>

      <type>org.exoplatform.calendar.service.ReminderPeriodJob</type>

      <description>add e-mail reminder job to the JobSchedulerService</description>

      <init-params>

        <properties-param>

          <name>job.info</name>

          <description>save the monitor data periodically</description>

          <property name="jobName" value="ReminderJob"/>

          <property name="groupName" value="CollaborationSuite"/>

          <property name="job" value="org.exoplatform.calendar.service.ReminderJob"/>

          <property name="repeatCount" value="0"/>

          <property name="period" value="180000"/>

          <property name="startTime" value="+0"/>

          <property name="endTime" value=""/>

        </properties-param>

      </init-params>

    </component-plugin>

Details:

- Name: `RecordsJob` - The name of a schedule job.

- Set-method: `addPeriodJob` - The plugin which registers the method.

- Type: `org.exoplatform.calendar.service.ReminderPeriodJob` - A class that executes to transfer data into database of Job Scheduler.

- Description: Add email reminder job to the JobSchedulerService.

See details about the init-params of the component in the following table:

Properties-param | Description | Property names | Description | Possible values | Default values
--- | --- | --- | --- | --- | ---
job.info | Save the monitor data periodically. | `jobName` | The name of job | `String` | `ReminderJob`
|  | `groupName` | The name of group job. | `String` | `CollaborationSuite`
|  | `job` | The name of actual job class. | `Class path` | `org.exoplatform.calendar.service.ReminderJob`
|  | `repeatCount` | How many times to run this job. | `Long` | `0, ( use '0' which means 'run forever)`
|  | `period` | The time interval (millisecond) between job executions. | `Long` | `180000`
|  | `startTime` | The time when the job starts running. | `Integer` | `+0`
|  | `endTime` | The time when the job ends running. | `Integer` | `none`

#### PopupReminderPeriodJob

You must use the following target component to use the plugin in this configuration:

    <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>

The configuration is applied in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/cs-configuration.xml.

    <component-plugin>

      <name>PopupRecordsJob</name>

      <set-method>addPeriodJob</set-method>

      <type>org.exoplatform.calendar.service.PopupReminderPeriodJob</type>

      <description>add popup reminder job to the JobSchedulerService</description>

      <init-params>

        <properties-param>

          <name>job.info</name>

          <description>save the monitor data periodically</description>

          <property name="jobName" value="PopupReminderJob"/>

          <property name="groupName" value="CollaborationSuite"/>

          <property name="job" value="org.exoplatform.calendar.service.PopupReminderJob"/>

          <property name="repeatCount" value="0"/>

          <property name="period" value="6000"/>

          <property name="startTime" value="+0"/>

          <property name="endTime" value=""/>

        </properties-param>

        <properties-param>

          <name>popupreminder.info</name>

          <description>save the monitor data periodically</description>

          <property name="portalName" value="portal"/>

        </properties-param>

      </init-params>

    </component-plugin>

Details:

- Name: `PopupRecordsJob` - The name of the job.

- Set-method: `addPeriodJob` - The plugin registering method.

- Type: `org.exoplatform.calendar.service.PopupReminderPeriodJob` - The class which executes to transfer the data into database of Job Scheduler.

- Description: Add popup reminder job to the JobSchedulerService.

See details about the init-params of the component in the following table:

- Properties-param: job.info. This param saves the monitor data periodically and includes the following sub-params:

Properties-param | Description | Property names | Description | Possible values | Default values
--- | --- | --- | --- | --- | ---
job.info | Save the monitor data periodically. | `jobName` | The name of job. | `String` | `PopupReminderJob`
|  | `groupName` | The name of group job. | `String` | `CollaborationSuite`
|  | `job` | The name of actual job class. | `Class path` | `org.exoplatform.calendar.service.PopupReminderJob`
|  | `repeatCount` | How many times to run this job. | `Long` | `0, ( use '0' which means 'run forever)`
|  | `period` | The time interval (millisecond) between job executions. | `Long` | `6000`
|  | `startTime` | The time when the job starts running. | `Long` | `+0`
|  | `endTime` | The time when the job ends running. | `Integer` | `None`
popupreminder.info | Save the monitor data periodically. | `portalName` | The name of the portal. | `String` | `portal`

#### AddActionsPlugin

The configuration of the AddActionsPlugin is found in WEB-INF/cs-extension/cs/webservice/webservice-configuration.xml.

It is used to register the listener named `org.exoplatform.webservice.cs.LastUpdateAction` and it is executed, basing on eventTypes.

    <component>

      <type>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</type>

      <component-plugins>

        <component-plugin>

          <name>Last Update Action</name>

          <set-method>addPlugin</set-method>

          <type>org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin</type>

          <description>add actions plugin</description>

          <init-params>

            <object-param>

              <name>actions</name>

              <object type="org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin$ActionsConfig">

                <field name="actions">

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

                    <value>

                      <object type="org.exoplatform.services.jcr.impl.ext.action.ActionConfiguration">

                        <field name="eventTypes">

                          <string>addNode,changeProperty</string>

                        </field>

                        <field name="nodeTypes">

                          <string>exo:calendarEvent</string>

                        </field>

                        <field name="actionClassName">

                          <string>org.exoplatform.webservice.cs.LastUpdateAction</string>

                        </field>

                      </object>

                    </value>

                  </collection>

                </field>

              </object>

            </object-param>

          </init-params>

        </component-plugin>

      </component-plugins>

    </component>

- object-param: `Actions` - The name of the object.

- object type: `org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin$ActionsConfig` - A class used to register the following field names in the table below:

Field name | String | Description
--- | --- | ---
eventTypes | `addNode,changeProperty` | The type of the event.
nodeTypes | `exo:calendarEvent` | The type of the node.
actionClassName | `org.exoplatform.webservice.cs.LastUpdateAction` | The registration class to execute the actions that the plugin requires.

### 2.2.2. Chat Configuration

The Chat Configuration is applied in /extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/chat/chat-service-configuration.xml.

### Warning

The Chat portlet and its services are deprecated. It remains fully supported for eXo customers, however it will not receive any enhancement and will be removed from the product scope in the future.

#### HistoryPeriodJob

    <external-component-plugins>

      <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>

      <component-plugin>

        <name>ChatRecordsJob</name>

        <set-method>addPeriodJob</set-method>

        <type>org.exoplatform.services.xmpp.connection.impl.HistoryPeriodJob</type>

        <description>add chat messages from Openfire Server to History</description>

        <init-params>

          <properties-param>

            <name>job.info</name>

            <description>save the monitor data periodically</description>

            <property name="jobName" value="messageToHistoricalMessageJob"/>

            <property name="groupName" value="CollaborationSuite"/>

            <property name="job" value="org.exoplatform.services.xmpp.connection.impl.HistoryJob"/>

            <property name="repeatCount" value="0"/>

            <property name="period" value="3000"/>

            <property name="startTime" value="+0"/>

            <property name="endTime" value=""/>

          </properties-param>

          <properties-param>

            <name>history.info</name>

            <description>save the monitor data periodically</description>

            <property name="logBatchSize" value="50"/>

          </properties-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `ChatRecordsJob` - The name of the job.

- Set-method: `addPeriodJob` - The plugin which registers the method.

- Type: `org.exoplatform.services.xmpp.connection.impl.HistoryPeriodJob` - A class which executes to transfer the data into the database of Job Scheduler.

- Description: It is used to save chat messages from Openfire Server to History.

See details about the init-params of the component in the following table:

Properties-param | Description | Property names | Description | Possible values | Default values
--- | --- | --- | --- | --- | ---
job.info | Save the monitor data periodically. | `jobName` | The name of job. | `String` | `messageToHistoricalMessageJob`
|  | `groupName` | The name of group name. | `String` | `CollaborationSuite`
|  | `job` | The name of actual job class. | `Class path` | `org.exoplatform.services.xmpp.connection.impl.HistoryJob`
|  | `repeatCount` | How many times to run this job. | `integer` | `0` ( use '0' which means 'run forever)
|  | `period` | The time interval (millisecond) between job executions. | `Long` | `3000`
|  | `startTime` | The time the job starts running. | `Long` | `+0`
|  | `endTime` | The time the job ends running. | `Long` | `none`
history.info | Save the monitor data periodically. | `logBatchSize` | The maximum number of messages in the cache are saved once the job runs. | `Integer` | `50`

#### RequestFilterComponentPlugin

    <external-component-plugins>

      <target-component>org.exoplatform.services.rest.impl.RequestHandlerImpl</target-component>

      <component-plugin>

        <name>ws.rs.request.filter</name>

        <set-method>addPlugin</set-method>

        <type>org.exoplatform.services.rest.impl.RequestFilterComponentPlugin</type>

        <init-params>

          <value-param>

            <name>RESTXMPPServiceFilter</name>

            <value>org.exoplatform.services.xmpp.rest.filter.RESTXMPPServiceFilter</value>

          </value-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `ws.rs.request.filter` - The name of the filter.

- Set-method: `addPlugin` - The plugin which registers the method.

- Type: `org.exoplatform.services.rest.impl.RequestFilterComponentPlugin` - The class which executes the requests of the plugin.

- Description: It is used to delete the session of a user when he suddenly closes the browser or changes the session.

See details about the init-params of the component in the following table:

Value-param | Description | Possible value | Default value
--- | --- | --- | ---
RESTXMPPServiceFilter | The name of the filter. | `Class path` | `org.exoplatform.services.xmpp.rest.filter.RESTXMPPServiceFilter`

#### AuthenticationLoginListener & AuthenticationLogoutListener

Two functions, including login and logout of XMPPRestService, are responsible for creating a new XMPPSessionImpl and destroying an existing XMPPSessionImpl. They can be called by listeners: AuthenticationLoginListener, AuthenticationLogoutListener or from client(browser) through the REST protocol (jabberLogin, jabberLogout in UIMainChatWindow.js). You must use the same target component for two external component plugins:

    <target-component>org.exoplatform.services.listener.ListenerService</target-component>

AuthenticationLoginListener

    <component-plugin>

      <name>exo.core.security.ConversationRegistry.register</name>

      <set-method>addListener</set-method>

      <type>org.exoplatform.services.xmpp.connection.impl.AuthenticationLoginListener</type>

      <description>description</description>

    </component-plugin>

Details:

- Name: `exo.core.security.ConversationRegistry.register` - The name of plugin.

- Set-method: `addListener` - The plugin which registers the method.

- Type: `org.exoplatform.services.xmpp.connection.impl.AuthenticationLoginListener` - The class to execute the requests of the plugin.

- Description: It is used to start the session and log in the chat server.

AuthenticationLogoutListener

    <component-plugin>

      <name>exo.core.security.ConversationRegistry.unregister</name>

      <set-method>addListener</set-method>

      <type>org.exoplatform.services.xmpp.connection.impl.AuthenticationLogoutListener</type>

      <description>description</description>

    </component-plugin>

Details:

- Name: `exo.core.security.ConversationRegistry.unregister` - The name of plugin.

- Set-method: `addListener` - The plugin which registers the method.

- Type: `org.exoplatform.services.xmpp.connection.impl.AuthenticationLogoutListener` - A class to execute the requests of the plugin.

- Description: It is used to end the session and log in the chat server.

### 2.2.3. Contact Configuration

The Contact Application is configured by three external component plugins: `NewUserListener`, `NewMembershipListener` and `UpdateUserProfileListener`. They use the same target component:

    <target-component>org.exoplatform.services.organization.OrganizationService</target-component>

The Contact configuration is found in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/contact/contact-service-configuration.xml.

NewUserListener

    <component-plugin>

      <name>contact.new.user.event.listener</name>

      <set-method>addListenerPlugin</set-method>

      <type>org.exoplatform.contact.service.impl.NewUserListener</type>

      <description>description</description>

    </component-plugin>

Details:

- Name: `contact.new.user.event.listener` - The name of listener.

- Set-method: `addListenerPlugin` - The plugin which registers the method.

- Type: `org.exoplatform.contact.service.impl.NewUserListener` - A class that executes all requirements of the plugin.

- Description: It is used to initialize personal contact data for users.

NewMembershipListener

    <component-plugin>

      <name>contact.new.membership.event.listener</name>

      <set-method>addListenerPlugin</set-method>

      <type>org.exoplatform.contact.service.impl.NewMembershipListener</type>

      <description>description</description>

    </component-plugin>

Details:

- Name: `contact.new.membership.event.listener` - The name of the listener.

- Set-method: `addListenerPlugin` - The plugin which registers the method. Keep this value.

- Type: `org.exoplatform.contact.service.impl.NewMembershipListener` - The class which executes all requirements of the plugin.

- Description: It is used to initialize an address book for a specific group.

UpdateUserProfileListener

    <component-plugin>

      <name>contact.new.userprofile.event.listener</name>

      <set-method>addListenerPlugin</set-method>

      <type>org.exoplatform.contact.service.impl.UpdateUserProfileListener</type>

      <description>description</description>

    </component-plugin>

Details:

- Name: `contact.new.userprofile.event.listener` - The name of the listener.

- Set-method: `addListenerPlugin` - The plugin which registers the method. Keep this value.

- Type: `org.exoplatform.contact.service.impl.UpdateUserProfileListener` - The class which executes all the requirements of the plugin.

- Description: It is used to update the personal profile of a user when he changes it on the portal.

### 2.2.4. Content Configuration

The Content application, such as RSS reader of Collaboration, is configured by two external component plugins: RSSContentPlugin and DescriptionPlugin. Both the external components plugins use the same target component:

    <target-component>org.exoplatform.content.service.ContentDAO</target-component>

This content configuration is applied in extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/content/content-service-configuration.xml.

RSSContentPluginDescriptionPlugin

    <component-plugin>

      <name>rssreader.listener</name>

      <set-method>addPlugin</set-method>

      <type>org.exoplatform.content.service.RSSContentPlugin</type>

      <description>rss reader plugin</description>

    </component-plugin>

Details:

- Name: `rssreader.listener` - The name of the listener.

- Set-method: `addPlugin` - The plugin which registers the method. Keep this value.

- Type: `org.exoplatform.content.service.RSSContentPlugin` - A class which extends ContentPlugin and implements the loadContentMeta method to get content items.

- Description: It is a formater used to analyze the data from a RSS resource.

DescriptionPlugin

    <component-plugin>

      <name>description.listener</name>

      <set-method>addPlugin</set-method>

      <type>org.exoplatform.content.service.DescriptionPlugin</type>

      <description>Description plugin</description>

    </component-plugin>

Details:

- Name: `description.listener` - The name of the listener.

- Set-method: `addPlugin` - The plugin registering method. Keep this value.

- Type: `org.exoplatform.content.service.DescriptionPlugin` - A class which executes all requirements of the plugin.

- Description: It is a plugin to represent data from a RSS source.

### 2.2.5. Mail Configuration

### Warning

The Mail portlet and its services are deprecated. It remains fully supported for eXo customers, however it will not receive any enhancement and will be removed from the product scope in the future.

AuthenticationLogoutListener

In the Mail application of Collaboration, when a user checks messages for one account, the remote mailbox fetch is performed as a background job. Before Collaboration 1.2, the job was continued until all messages had been retrieved or when the user stopped the check through the UI. Hence, even when a user was not logged in, the background job was continued. This can be the resource intensive for the server if many users have large mailboxes. Since Collaboration 1.2, one capability is added to halt the background job when the user session terminates (logout or timeout). It makes Collaboration more friendly with server resources. If you want to activate this feature, you need to add a bunch of the xml congifuration in /extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/mail/mail-service-configuration.xml:

    <external-component-plugins>

      <target-component>org.exoplatform.services.listener.ListenerService</target-component>

       <component-plugin>

        <name>exo.core.security.ConversationRegistry.unregister</name>

        <set-method>addListener</set-method>

        <type>org.exoplatform.mail.service.AuthenticationLogoutListener</type>

        <description>description</description>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `exo.core.security.ConversationRegistry.unregister` - The name of listener.

- Set-method: `addListener` The plugin which registers the method. Keep this value.

- Type: `org.exoplatform.mail.service.AuthenticationLogoutListener` - A class which executes all requirements of the plugin.

- Description: It is a plugin used to stop checking mails of a user when he logs out.

MailSettingConfigPlugin

Since Collaboration 2.2.0, MailSettingConfigPlugin is used to define the behavior, for example, showing/hiding fields and checking/unchecking checkboxes, of email account settings in the mail-server-configuration.xml file. It allows administrators to preconfigure all settings and to specify if end-users have the modification right on each specific setting or not.

    <external-component-plugins>

      <target-component>org.exoplatform.mail.service.MailService</target-component>

        <component-plugin>

            <name>cs.mail.service.settings</name>

            <set-method>addPlugin</set-method>

            <type>org.exoplatform.mail.service.MailSettingConfigPlugin</type>

            <description>description</description>

                <init-params>

                    <object-param>

                        <name>leaveOnServer</name>

                    <description>options to keep a copy of the message on the mail server after eXo Mail has downloaded the message</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>leaveOnServer</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>true</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>incomingServer</name>

                    <description>default incoming server to check for new mails.</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>incomingServer</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>imap.gmail.com</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>incomingPort</name>

                    <description>default port incoming server to check for new mails.</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>incomingPort</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>993</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>outgoingServer</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>outgoingServer</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>smtp.gmail.com</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>outgoingPort</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>outgoingPort</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>465</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>acceptIncomingSecureAuthentication</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>acceptIncomingSecureAuthentication</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>true</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>incomingSecureAuthentication</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>incomingSecureAuthentication</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>starttls</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>incomingAuthenticationMechanism</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>incomingAuthenticationMechanism</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>plain</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>acceptOutgoingSecureAuthentication</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>acceptOutgoingSecureAuthentication</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>true</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>outgoingSecureAuthentication</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>outgoingSecureAuthentication</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>starttls</string></field>

                    </object>

                    </object-param>

                    <object-param>

                        <name>outgoingAuthenticationMechanism</name>

                    <description>description</description>

                    <object type="org.exoplatform.mail.service.MailSettingConfig">

                        <field name="name"><string>outgoingAuthenticationMechanism</string></field>

                        <field name="userAllowed"><boolean>true</boolean></field>

                        <field name="defaultValue"><string>plain</string></field>

                    </object>

                    </object-param>

                </init-params>

        </component-plugin>

      </external-component-plugins>

Details:

- Name: `cs.mail.service.settings` - The name of the mail settings.

- Set-method: `addPlugin` - The plugin which registers the method.

- Type: `org.exoplatform.mail.service.MailSettingConfigPlugin` - The plugin's class name.

- object type: `org.exoplatform.mail.service.MailSettingConfig` - A class of object that contains a specific setting.

- Description: Describes what the setting is or what the setting does.

Object-param | Desciption
--- | ---
leaveOnServer | Options to keep the message on the mail server after it has been downloaded to the Mail application of Collaboration.
incomingServer | The default incoming server used to check new mails.
incomingPort | The default port of the incoming server used to check new mails.
outgoingServer | The default port of the outgoing server used to send new mails.
outgoingPort | The default outgoing port to send new mails.
acceptIncomingSecureAuthentication | Accept the secure authentication of the incoming server.
incomingSecureAuthentication | The type of incoming secure authentication.
incomingAuthenticationMechanism | The type of incoming authentication mechanism.
acceptOutgoingSecureAuthentication | Accepts the secure authentication of the outgoing server.
outgoingSecureAuthentication | The type of outgoing secure authentication.
outgoingAuthenticationMechanism | The type of incoming authentication mechanism.

The object parameters have the same field names, but the values of the parameters are different.

Field names | Description | Possible values
--- | --- | ---
name | The field name in the account settings form. | String
userAllowed | Allow users to edit the field in the account settings form or not. | Boolean
defaultValue | The default value of the field in the account settings form. | String

### 2.2.6. Social Integration Configuration

The Social Integration Configuration is applied in /extension/webapp/src/main/webapp/WEB-INF/cs-extension/cs/social-integration/social-integration-configuration.xml.

#### CalendarDataInitialize

    <external-component-plugins>

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

      <component-plugin>

        <name>CalendarDataInitialize</name>

        <set-method>addSpaceListener</set-method>

        <type>org.exoplatform.cs.ext.impl.CalendarDataInitialize</type>

        <init-params>

          <value-param>

            <name>portletName</name>

            <value>CalendarPortlet</value>

          </value-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `CalendarDataInitialize` - The name of plugin.

- Set-method: `addSpaceListener` - The plugin which registers the method.

- Type: `org.exoplatform.cs.ext.impl.CalendarDataInitialize` - A class that executes all requirements of the plugin.

- Description: It is used to initialize a calendar for a group in a specific space.

See the details about the init-params of the component in the following table:

value-param | Description | Possible value | Default value
--- | --- | --- | ---
portletName | The name of the portlet | `String` | `CalendarPortlet`

#### ContactDataInitialize

    <external-component-plugins>

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

      <component-plugin>

        <name>ContactDataInitialize</name>

        <set-method>addSpaceListener</set-method>

        <type>org.exoplatform.cs.ext.impl.ContactDataInitialize</type>

        <init-params>

          <value-param>

            <name>portletName</name>

            <value>ContactPortlet</value>

          </value-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `ContactDataInitialize` - The name of the plugin.

- Set-method: `addSpaceListener` - The plugin which registers the method.

- Type: `org.exoplatform.cs.ext.impl.ContactDataInitialize` - A class that executes all the requires of the plugin.

- Description: It is a plugin used to initialize an address book for a group in a specific space.

See the details about the init-params of the component in the following table:

value-param | Possible value | Default value | Description
--- | --- | --- | ---
portletName | `String` | `ContactPortlet` | The name of the portlet.

#### ContactSpaceActivityPublisher

    <external-component-plugins>

      <target-component>org.exoplatform.contact.service.ContactService</target-component>

      <component-plugin>

        <name>ContactEventListener</name>

        <set-method>addListenerPlugin</set-method>

        <type>org.exoplatform.cs.ext.impl.ContactSpaceActivityPublisher</type>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `ContactEventListener` - The name of the plugin.

- Set-method: `addListenerPlugin` - The plugin which registers the method.

- Type: `org.exoplatform.cs.ext.impl.ContactSpaceActivityPublisher` - A class that executes all requirements of the plugin.

- Description: It is a plugin used to customize the activity status of a specific space when an event happens on an address book.

#### CalendarSpaceActivityPublisher

    <external-component-plugins>

      <target-component>org.exoplatform.calendar.service.CalendarService</target-component>

      <component-plugin>

        <name>CalendarEventListener</name>

        <set-method>addEventListenerPlugin</set-method>

        <type>org.exoplatform.cs.ext.impl.CalendarSpaceActivityPublisher</type>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `CalendarEventListener` - The name of the plugin.

- Set-method: `addEventListenerPlugin` - The plugin which registers the method.

- Type: `org.exoplatform.cs.ext.impl.CalendarSpaceActivityPublisher` - A class that executes all the requires of the plugin.

- Description: It is a plugin used to customize the activity status of a specific space when an event happens on a calendar.

#### 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>CalendarPortlet</value>

            <value>ContactPortlet</value>

          </values-param>

        </init-params>

      </component-plugin>

    </external-component-plugins>

Details:

- Name: `portlets.prefs.required` - The name of the plugin.

- Set-method: `setPortletsPrefsRequired` - The plugin which registers the method.

- Type: `org.exoplatform.social.core.application.PortletPreferenceRequiredPlugin` - A class that executes all the requires of the plugin.

- Description: It is a plugin used to declare the application that will automatically create database.

See the details about the init-params of the component in the following table:

value-param | Possible value | Default value | Description
--- | --- | --- | ---
portletsPrefsRequired | `String` | `ContactPortlet / ContactPortlet` | The name of plugin added to SpaceService.

## 2.3. Data Injectors

- ContactDataInjector

  Instructions on how to use the ContactDataInjector plug-in that manages data injection in the Address Book application.

- CalendarDataInjector

  Instructions on how to use the CalendarDataInjector plug-in that manages data injection in the Calendar application.

- MailDataInjector

  Instructions on how to use the MailDataInjector plug-in that manages data injection in the Mail application.

Data injectors are used to create data for performance test. This part will describe which data injectors are implemented in Collaboration and how to use them.

In Collaboration, data injectors are implemented as plug-ins attached to the org.exoplatform.services.bench.DataInjectorService service and handled via RESTful requests. This service is normally registered to the portal container as a general component.

To use this service, add the following dependency to the Classpath of the server:

    <dependency>

          <groupId>org.exoplatform.commons</groupId>

          <artifactId>exo.platform.commons.component</artifactId>

    </dependency>

To activate the DataInjectorService component, you need to register it to a portal container by the following configuration:

    <component>

        <type>org.exoplatform.services.bench.DataInjectorService</type>

    </component>

When you want to inject data for a specific product, you must implement a class which extends "org.exoplatform.services.bench.DataInjector" and register it to the DataInjectorService component as a plug-in.

In Collaboration, there are three plug-ins attached to the DataInjectorService component:

- ContactDataInjector

- CalendarDataInjector

- MailDataInjector

`See also`

- Components

- External Component Plugins

- eXo Chatserver Configuration

### 2.3.1. ContactDataInjector

The ContactDataInjector plug-in is used to manage data injection of the Address Book application.

To use this plug-in, do as follows:

1. Add the following configuration to the configuration.xml file to register the plug-in to the DataInjectorService component:

    <external-component-plugins>

        <target-component>org.exoplatform.services.bench.DataInjectorService</target-component>

        <component-plugin>

          <name>ContactDataInjector</name>

          <set-method>addInjector</set-method>

          <type>org.exoplatform.contact.service.bench.ContactDataInjector</type>

          <description>inject data for Contact</description>

          <init-params>

            <value-param>

              <name>mA</name> <!-- maximum number of address books -->

              <value>5</value>

            </value-param>

            <value-param>

              <name>mC</name> <!-- maximum number of contacts per a address books -->

              <value>10</value>

            </value-param>

          </init-params>

        </component-plugin>

    </external-component-plugins>

In which:

- Name: `ContactDataInjector`

- Set-method: `addInjector`

- Type: `org.exoplatform.contact.service.bench.ContactDataInjector`

Parameters | Possible Values | Default Values | Description
--- | --- | --- | ---
mA | number | 5 | The maximum number of address books of the Address Book application in each injection.
mC | number | 5 | The maximum number of contacts of an address book in each injection.

2. Execute the injector by the RESTful request as follows:

    http://{domain}/{rest}/bench/inject/ContactDataInjector?mA=5&mC=10

In which:

- {domain}: The domain name of the server.

- {rest}: The name of eXo REST service.

### 2.3.2. CalendarDataInjector

The CalendarDataInjector plug-in is used to manage data injection in the Calendar application.

To use this plug-in, do as follows:

1. Add the following configuration to the configuration.xml file to register the plug-in to the DataInjectorService component:

    <external-component-plugins>

        <target-component>org.exoplatform.services.bench.DataInjectorService</target-component>

        <component-plugin>

          <name>CalendarDataInjector</name>

          <set-method>addInjector</set-method>

          <type>org.exoplatform.calendar.bench.CalendarDataInjector</type>

          <description>inject data for Calendar</description>

          <init-params>

            <value-param>

              <name>mCt</name> <!-- maximum number of categories -->

              <value>5</value>

            </value-param>

            <value-param>

              <name>mEcat</name> <!-- maximum number of event categories -->

              <value>10</value>

            </value-param>

            <value-param>

              <name>mCal</name> <!-- maximum number of calendars -->

              <value>10</value>

            </value-param>

            <value-param>

              <name>mEv</name> <!-- maximum number of events -->

              <value>5</value>

            </value-param>

            <value-param>

              <name>mTa</name> <!-- maximum number of tasks -->

              <value>5</value>

            </value-param>

            <value-param>

              <name>typeOfInject</name> <!-- type of inject -->

              <value>all</value> <!-- string all/public/private -->

            </value-param>

          </init-params>

        </component-plugin>

    </external-component-plugins>

In which:

- Name: `CalendarDataInjector`

- Set-method: `addInjector`

- Type: `org.exoplatform.calendar.bench.CalendarDataInjector`

Parameters | Possible Values | Default Values | Description
--- | --- | --- | ---
mCt | number | 5 | The maximum number of categories in each injection.
mEcat | number | 10 | The maximum number of event categories in each injection.
mCal | number | 10 | The maximum number of calendars in each injection.
mEv | number | 5 | The maximum number of events in one calendar in each injection.
mTa | number | 5 | The maximum number of tasks in one calendar in each injection.
typeOfInject | String | all | The type of injection, including "public", "private" and "all". If the type is set as "public", only public calendars are created. If the type is set as "private", only personal calendars are create. If the type is set as "all", both the public and private ones are created.

2. Execute the injector by the RESTful request as follows.

    http://{domain}/{rest}/bench/inject/CalendarDataInjector?mCt=5&mEcat=10&mCal=10&mEv=20&mTa=20&typeOfInject=private

### 2.3.3. MailDataInjector

The MailDataInjector is used to manage data injection in the Mail application.

Because of the quite complicated architecture of the Mail application in Collaboration, the injector uses a simple mail server (a mock server) to simulate the way a mail server works. This will create real mail data without mocking effort from the injector and create a reliable testing environment.

To use the injector, do as follows:

1. Add the Greenmail library to the classpath of the web server (in tomcat, copy it to the lib folder). The library is Greenmail 1.3.1b but including some bug fixes which are not updated in the counterpart version of Icegreen. (To have the library, contact eXo Support team).

2. Initialize this component as a service of GateIn, then it will be invoked by MailDataInjector.

    <component>

        <type>org.exoplatform.mail.service.bench.SimpleMailServerInitializer</type>

    </component>

3. Register MailDataInjector to DataInjectorService by the following configuration:

    <external-component-plugins>

      <target-component>org.exoplatform.services.bench.DataInjectorService</target-component>

      <component-plugin>

          <name>MailDataInjector</name>

          <set-method>addInjector</set-method>

          <type>org.exoplatform.mail.service.bench.MailDataInjector</type>

          <description>inject data for Contact</description>

        </component-plugin>

    </external-component-plugins>

In which:

- Name: `MailDataInjector`

- Set-method: `addInjector`

- Type: `org.exoplatform.mail.service.bench.MailDataInjector`

Usage of MailDataInjector

- To insert mail data into the Mail application, the request link is as follows:

    http://{domain}/{rest}/bench/inject/MailDataInjector/?users=mary,root&accounts=2,account&inPro=IMAP&check=true&msgs=100&attSize=100

Params | Values | Description
--- | --- | ---
users | String | The list of users separated by commas.
accounts | String | The number of accounts injected by the data injector. This value consists of two parts separated by commas: the first is the number of accounts of an user, the second is the prefix of the account Id.
inPro | String | The incoming protocol. The possible values are: POP3 and IMAP.
check | Boolean | Specify if checking mails after the data are created on the mail server or not. If the value is true, the injector will execute checking new message tasks sequentially. This task can take some time if the data are large.
msgs | Number | The number of messages will be available in each account.
attSize | Number | The size of an attachment. If it does not exist or is equal to 0, no file is attached to the mail message.

- To reject mail data from the Mail application, the request link is as follows:

    http://{domain}/{rest}/bench/reject/MailDataInjector/?users=root&accounts=2,account

This link will request for removing 2 accounts of "root" of which Id starts with "account".

### Note

By default, such settings have been declared in "csdemo.war/WEB-INF/conf/csdemo/cs/bench-configuration.xml". Therefore, to save time, you should import the bench-configuration.xml file to "csdemo.war/WEB-INF/conf/configuration.xml", and then modify it as your purpose rather than create a new one.

## 2.4. eXo Chatserver Configuration

- Openfire Configuration

  Introduction to Openfire, its configurations and eXo specific configuration.

- System Configuration

  Information about several ports used for communication by Openfire.

- AS configuration

  Information about the AS configuration that supports SSO in Collaboration.

`See also`

- Components

- External Component Plugins

- Data Injectors

### 2.4.1. Openfire Configuration

The Chat service of Collaboration is a Jabber engine powered by Openfire. eXo Platform will delegate the actual Jabber protocol communication to Openfire.

You have the full latitude to configure Openfire. There are two possible ways to do it:

- The admin console: http://localhost:9090/.

- The openfire.xml file in $openfire_home/conf/.

Configuration in Openfire.xml

The Openfire server has a single configuration file called openfire.xml and located under the exo-openfire/conf directory. Configuration is based on properties expressed in an XML syntax. For example, to set the property prop.name.is.blah=value, you would write this xml snippet:

    <prop>

      <name>

        <is>

          <blah>value</blah>

        </is>

      </name>

    </prop>

Openfire has an extensive list of configuration properties. You can read a list of all properties on this page: http://www.igniterealtime.org/community/docs/DOC-1061.

eXo specific configuration

The Collaboration bundle comes with a pre-configured Openfire server. It is bundled with some eXo plugins and configurations that allow connectivity with eXo Platform. The key properties for integration are:

- provider.auth.className: An implementation of the AuthProvider interface for authentication of users on the Chat server.

- provider.users.className: An implementation of the UserProvider interface to which Openfire will delegate users management.

- provider.groups.className: An implementation of the GroupProvider interface to which Openfire will delegate groups management.

eXo Platform provides implementations for these 3 interfaces with ExoAuthProvider, ExoUserProvider, ExoGroupProvider. These implementations are based on the eXo REST framework and let you configure the endpoints within the openfire.xml file with additional properties:

Property | Default value | Description
--- | --- | ---
eXo.env.serverBaseURL | `http://localhost:8080/` | The base URL of the server.
eXo.env.restContextName | `rest` | The context name of REST Web application.
provider.authorizedUser.name | `root` | The username to authenticate to access the HTTP REST service.
provider.authorizedUser.password | `gtn` | The password matching with provider.authorizeduser.name.
exoAuthProvider.authenticationURL | `/organization/authenticate/` | The URL to authenticate users.
exoAuthProvider.authenticationMethod | `POST` | The HTTP method used for the authentication method.
exoUserProvider.findUsersURL | `/organization/xml/user/find-all/` | The URL to find all users.
exoUserProvider.findUsersMethod | `GET` | The HTTP method used to find all users in the system.
exoUserProvider.getUsersURL | `/organization/xml/user/view-range/` | The URL to retrieve a range of users.
exoUserProvider.getUsersMethod | `GET` | The HTTP method used for user/view-range.
exoUserProvider.usersCountURL | `/organization/xml/user/count` | The URL to count the number of users.
exoUserProvider.usersCountMethod | `GET` | The HTTP method used to count the number of users.
exoUserProvider.userInfoURL | `/organization/xml/user/info/` | The URL to get the information of users.
exoUserProvider.userInfoMethod | `GET` | The HTTP method used to get the information of users.
exoGroupProvider.groupInfoURL | `/organization/xml/group/info/` | The URL to get the information of a group of users.
exoGroupProvider.groupInfoMethod | `GET` | The HTTP method used to get the information of a group of users.
exoGroupProvider.getGroupsAllURL | `/organization/xml/group/view-all/` | The URL to view a list of all user groups.
exoGroupProvider.getGroupsAllMethod | `GET` | The HTTP method used to view a list of all user groups.
exoGroupProvider.getGroupsRangeURL | `/organization/xml/group/view-from-to/` | The URL to list groups in a specific range.
exoGroupProvider.getGroupsRangeMethod | `GET` | The HTTP method used to list groups in a specific range.
exoGroupProvider.getGroupsForUserURL | `/organization/xml/group/groups-for-user/` | The URL to list groups to which a user belongs.
exoGroupProvider.getGroupsForUserMethod | `GET` | The HTTP method used to list groups to which a user belongs.
exoGroupProvider.groupsCountURL | `/organization/xml/group/count` | The URL to count the number of groups.
exoGroupProvider.groupsCountMethod | `GET` | The HTTP method used to count the number of groups.

As you can see, the default settings will only work if eXo Platform is deployed on the same host as Openfire, on the port 8080.

### Note

restContextName is used to specify the Openfire server that is dedicated for the portal. If the eXo.env.restContextName system property exists, it will override this value.

The eXo.env.restContextName system property can be set by specifying the -D option to the Java command when running Openfire.

For example:

- If the Openfire server is dedicated for the portal named "portal", the command will have the following format: java -DeXo.env.restContextName=rest -jar ../lib/startup.jar.

- If the Openfire server is dedicated for the portal named "csdemo", the command will have following format: java -DeXo.env.restContextName=rest-csdemo -jar ../lib/startup.jar.

By default, the Openfire server is dedicated to the portal named "portal".

### 2.4.2. System Configuration

Openfire makes use of several ports for communication.

Interface | Port | Type | Description
--- | --- | --- | ---
All addresses | `5222` | `Client to Server` | The standard port for clients is to connect to the server. Connection may or may not be encrypted. You can update the security settings for this port.
All addresses | `9090 & 9091` | `Admin Console` | The ports used for the unsecured and secured Openfire Admin Console accesses respectively.
All addresses | `7777` | `File Transfer Proxy` | The port used for the proxy service that allows files to be transferred between two entities on the XMPP network.
All addresses | `3478 & 3479` | `STUN Service` | The port used for the service that ensures connectivity between entities behind a NAT.

You can view the table above in http://hostname:9090/index.jsp after you have logged into the Openfire's web console and also customize those ports by yourself.

### 2.4.3. AS configuration

To enable the propagation of identity across the Chat webapp, you are required to enable the SSO valve on the Tomcat-based Application server.

- For the Jboss server, edit jboss/server/default/deploy/jboss-web.deployer/server.xml.

- For the Tomcat server, edit tomcat/conf/server.xml. The valve should already be there, you just need to uncomment it if it is not already done.

    <Valve className="org.apache.catalina.authenticator.SingleSignOn"/>

In case of the cluster deployment, you may want to use `ClusteredSingleSignOn` instead.

    <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn"/>

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