h1. Overview {anchor:id=KSref.AutoPrune.Overview}

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.

h1. Configuration {anchor:id=KSref.AutoPrune.Configuration}

The properties of Auto-prune plug-in are configured in the _{noformat}war:webapp/WEB-INF/ks-extension/ks/forum/prune-configuration.xml{noformat}_ 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.

{code:xml}
<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="+0"/>
      <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>
{code}

* In which,
|| Name || Set-method || Type || Description ||
| *ForumDeactiveJob* | addPeriodJob | org.exoplatform.forum. service.conf. DeactivePeriodJob | Add a DeactiveJob to the JobSchedulerService. |

* The properties for the Auto-prune plug-in are defined in the _property_ tag with the format as below:

{code:xml}
...
<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="+0"/>
<property name="endTime" value=""/>             
...
<property name="inactiveDays" value="15"/>          
<property name="forumName" value="Live demo"/>    
...
{code}

In details:

|| Property name || Possible value || Default value || Description ||
| *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.DeactiveJob | The 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}} | {{+0}} | The start time when the function executes. The _starttime_ is +0, meaning that the time to start executing _DecactiveJob_ is the runtime. |
| *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 name || Possible value || Default value || Description ||
| *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.