Page 1 of 1

Document Retention

PostPosted: Tue May 10, 2016 1:19 pm
by Mike.Sheen
This sample plugin adds a system setting "RetentionInDays". When set to a non-zero value, all documents older than the retention days value are deleted on login.

This plugin uses some reflection to look at all registered business logic types for the implementation of the IJiwaDocuments interface. If the type does implement that interface, it creates an instance of the business logic type using the factory, in order to obtain the table name used to store documents, and from that a delete query is constructed and executed.

This way, whenever we introduce a new business logic type which has documents, this plugin will still know how to delete old documents from the correct tables.