JBoss.orgCommunity Documentation

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:

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

Value-paramsPossible valueDefault valueDescription
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