Document Retention

Samples and Examples of using the Jiwa 7 framework - including plugins, stand-alone applications and scripts.

Document Retention

Postby Mike.Sheen » Tue May 10, 2016 1:19 pm

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.
Attachments
Plugin Document Retention.xml
Sample Plugin
(30.25 KiB) Downloaded 139 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Return to Samples and Examples

Who is online

Users browsing this forum: No registered users and 1 guest

cron