2.2.7.6. User Statistics

The Auto-count Active Users component is to calculate the number of active users automatically. A user is considered as the active user only when he/she adds a topic/post in the Forum and his/her last post date matches the predefined interval time.

For example, if one user does not have any new posts after 15 days, he/she is not considered as an active user.

When the Job Scheduler runs, it will get values returned from the Auto-count Active Users plug-in component to identify the number of active users. This value is updated to Active Members information when the user views Forum statistics.

Configuration

The properties of Auto-count Active Users plug-in is configured in the war:/ks-extension/ks/forum/statistics-configuration.xml file.

In details, at runtime of Job Scheduler, the Auto-count Active Users plug-in component is called. Then, the statistics-configuration.xml file is executed. The component-plugin named RecountActiveUserJob will refer to org.exoplatform.forum.service.conf.RecountActiveUserPeriodJob to calculate the number of active users.


<component-plugin>
  <name>RecountActiveUserJob</name>
  <set-method>addPeriodJob</set-method>
  <type>org.exoplatform.forum.service.conf.RecountActiveUserPeriodJob</type>
  <description>add a RecountActiveUser job to the JobSchedulerService</description>
  <init-params>
    <properties-param>
      <name>job.info</name>
      <description>save the monitor data periodically</description>
      <property name="jobName" value="RecountActiveUserJob"/>
      <property name="groupName" value="KnowlegedSuite"/>
      <property name="job" value="org.exoplatform.forum.service.conf.RecountActiveUserJob"/>
      <property name="repeatCount" value="0"/>
      <property name="period" value="7200000"/> <!-- 2 hours-->
      <property name="startTime" value="+0"/>
      <property name="endTime" value=""/>
    </properties-param>
    <properties-param>
      <name>RecountActiveUser.info</name>
      <description/>
      <property name="lastPost" value="15"/> <!-- users are active if have last posts in 15 day -->
    </properties-param>
  </init-params>
</component-plugin>
NameMethodTypeDescription
RecountActiveUserJob addPeriodJoborg.exoplatform.forum. service.conf. RecountActiveUserPeriodJobAdds a RecountActiveUser job to the JobSchedulerService.

...
<property name="jobName" value="RecountActiveUserJob"/>
<property name="groupName" value="KnowlegedSuite"/>
<property name="job" value="org.exoplatform.forum.service.conf.RecountActiveUserJob"/>
<property name="repeatCount" value="0"/>
<property name="period" value="7200000"/>
<property name="startTime" value="+0"/>
<property name="endTime" value=""/>
...
<property name="lastPost" value="15"/>
...

In which:

Property namePossible valueDefault valueDescription
jobname String RecountActiveUserJob The name of job which will be executed.
groupname String KnowlegedSuite The name of application which will be executed.
job Class path org.exoplatform.forum.service.conf.RecountActiveUserJobThe reference function of job which will be executed.
repeatCount Long 0The number of times the job is repeated. If repeatCount is set to 0, RecountActiveUserJob is called at runtime only without repeating. If the number is set to 2 or 3, RecountActiveUserJob will be called two or three times.
period Long 7200000 (millisecond) (equal to two hours)The interval time to execute the job.
starttime Integer 0The start time when the function executes. The starttime is 0, meaning that the time to start executing RecountActiveUserJob is the runtime.
endtime Integer nullThe end time when the function stops executing. The endtime is blank, meaning that there is no limitation for the end time for RecountActiveUserJob.

With start and end time, you can give a specific date in the format: yyyy-mm-dd HH:mm:ss.sss to define the start and end time for RecountActiveUserJob. The information of active time is also defined:

Property namePossible valueDefault valueDescription
lastPost Integer 15The number of days that the user has added the last post. lastPost is 15, meaning that all users, who have any new posts within 15 days as from their last post date, are active members.

By default, the default properties can only be changed by editing its values in the statistics-configuration.xml file.

At runtime, the new changes in the statistics-configuration.xml file will be executed and updated. The Auto-count Active Users plug-in will be executed, depending on its properties.

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