forked from umbraco/Umbraco-CMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added XML configuration support for cleanup policy
- Loading branch information
Paul Johnson
committed
Oct 26, 2021
1 parent
d865448
commit a1ac730
Showing
6 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/Umbraco.Core/Configuration/UmbracoSettings/ContentVersionCleanupPolicyElement.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Configuration; | ||
|
||
namespace Umbraco.Core.Configuration.UmbracoSettings | ||
{ | ||
internal class ContentVersionCleanupPolicyElement : UmbracoConfigurationElement, IContentVersionCleanupPolicySettings | ||
{ | ||
[ConfigurationProperty("enable", DefaultValue = false)] | ||
public bool EnableCleanup => (bool)this["enable"]; | ||
|
||
[ConfigurationProperty("keepAllVersionsNewerThanDays", DefaultValue = 2)] | ||
public int KeepAllVersionsNewerThanDays => (int)this["keepAllVersionsNewerThanDays"]; | ||
|
||
[ConfigurationProperty("keepLatestVersionPerDayForDays", DefaultValue = 30)] | ||
public int KeepLatestVersionPerDayForDays => (int)this["keepLatestVersionPerDayForDays"]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/Umbraco.Core/Configuration/UmbracoSettings/IContentVersionCleanupPolicySettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Umbraco.Core.Configuration.UmbracoSettings | ||
{ | ||
public interface IContentVersionCleanupPolicySettings | ||
{ | ||
bool EnableCleanup { get; } | ||
int KeepAllVersionsNewerThanDays { get; } | ||
int KeepLatestVersionPerDayForDays { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters