Page 1 of 1

Empty trash on file age basis

PostPosted:Thu May 07, 2009 8:16 am
by ribizli
Dear Support,

could you give me some hint, how can we implement the following feature?

The deleted files in the trash should be purged if they are longer than a specified time (e.g. 1 month) there.

We would like to prohibit the purge for the users, but don\'t keep the deleted files forever.


Is it possible to implement a feature like this?

Thanks in advance.

Re:Empty trash on file age basis

PostPosted:Fri May 08, 2009 11:09 am
by ribizli
I\'ve figured out and implemented a solution:
  1. on deletion of files or folders a new date attribute is added to the Node
  2. this date attribute is set to the current date
  3. a new retain.trash setting is introduced in OpenKM.cfg
  4. on \'Purge All\' only that entries will be deleted, which have older date than the days specified in the config
Additionally I\'ve introduced a scheduled task, which runs daily and purges the trash of all users (obviously removing only the old entries). So the users don\'t have to care about cleaning.


PS: One challenge - The new JRC attribute has to be registered in the current repository, so I\'ve put a DirectRepositoryModule.registerCustomNodeTypes() call into the init() method of the RepositoryStartupServlet. This will either register or re-register all attributes. After the next restart the call can be removed.

Re: Empty trash on file age basis

PostPosted:Mon Jan 25, 2010 2:44 pm
by fabios
Ribizli:
can you post the code changes you made?

thanks
Fabio

Re: Empty trash on file age basis

PostPosted:Thu Jan 28, 2010 9:47 am
by pavila
May be we can include these changes into the OpenKM source? Perhaps it sounds insteresting for more people.