2.2.8.2. Auto-prune

The Auto-prune component is to prune inactive topics which have not been viewed, edited or received for a given period. The "prune" operation does not denote to the physical removal of topics, but sets them to invisible. The function helps you not clutter busy forums from outdated information.

When the Job Scheduler runs, it will get values returned from the Auto-prune plug-in component to identify topics which have to be inactivated in the Forum application. These topics will be invisible to users.

Configuration

The properties of Auto-prune plug-in are configured in the war:/ks-extension/ks/forum/prune-configuration.xml file.

In particular, at runtime of Job Scheduler, the Auto-prune plugin component is called. Then, the prune-configuration.xml file will be executed. The component-plugin named ForumDeactiveJob will refer to org.exoplatform.forum.service.conf.DeactivePeriodJob to inactivate topics in Forum which meets predefined inactivation properties.


<component-plugin>
  <name>ForumDeactiveJob</name>
  <set-method>addPeriodJob</set-method>
  <type>org.exoplatform.forum.service.conf.DeactivePeriodJob</type>
  <description>add a Deactive job to the JobSchedulerService</description>
  <init-params>
    <properties-param>
      <name>job.info</name>
      <description>save the monitor data periodically</description>
      <property name="jobName" value="DeactiveJob"/>
      <property name="groupName" value="KnowlegedSuite"/>
      <property name="job" value="org.exoplatform.forum.service.conf.DeactiveJob"/>
      <property name="repeatCount" value="0"/>
      <property name="period" value="7200000"/> <!-- 2 hours-->
      <property name="startTime" value="+1296000000"/>
      <property name="endTime" value=""/>
    </properties-param>
    <properties-param>
      <name>deactive.info</name>
      <description></description>
      <property name="inactiveDays" value="15"/>
      <property name="forumName" value="Live demo"/>
    </properties-param>
  </init-params>
</component-plugin>
NameSet-methodTypeDescription
ForumDeactiveJob addPeriodJoborg.exoplatform.forum. service.conf.DeactivePeriodJobAdds a DeactiveJob to the JobSchedulerService.

...
<property name="jobName" value="DeactiveJob"/>
<property name="groupName" value="KnowlegedSuite"/>
<property name="job" value="org.exoplatform.forum.service.conf.DeactiveJob"/>
<property name="repeatCount" value="0"/>
<property name="period" value="7200000"/> <!-- 2 hours-->
<property name="startTime" value="+1296000000"/>
<property name="endTime" value=""/>
...
<property name="inactiveDays" value="15"/>
<property name="forumName" value="Live demo"/>
...

In details:

Property namePossible valueDefault valueDescription
jobname String DeactiveJob 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.DeactiveJobThe reference function of the job which will be executed.
repeatCount Long 0 The repeating time for the job, meaning that how many times the job will be executed. The 0 value means that DecactiveJob is called at runtime only without repeating. If the value is set to 2 or 3, DecactiveJob will be called two or three times correspondingly.
period Long 72000000 The interval between job executions.
starttime Integer +1296000000 The start time when the function executes.
endtime Integer null The end time when the function stops executing. The endtime is blank, meaning that there is no limitation for the end time for DecactiveJob.

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 DecactiveJob. Besides, inactive information is also defined:

Property namePossible valueDefault valueDescription
inactiveDays Integer 15 The number of days the topic has not been activated. The inactivateDays is set to 1, meaning that all the topics, which have one inactivated day, will be set as inactivated status. They will be invisible.
forumname String Live Demo The name of Forum which will be checked for Auto-prune. In case the value of forumname is blank, all forums will be checked for the Auto-prune. If the forumname is Live demo, only the Forum named 'Live demo' is checked for the Auto-prune.

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

At runtime, the new changes in the prune-configuration.xml file are executed and updated. After that, the Auto-prune plug-in will be executed, depending on its properties.

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