Added XML configuration support for cleanup policy
This commit is contained in:
@@ -22,6 +22,9 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
[ConfigurationProperty("notifications", IsRequired = true)]
|
||||
internal NotificationsElement Notifications => (NotificationsElement) base["notifications"];
|
||||
|
||||
[ConfigurationProperty("contentVersionCleanupPolicy", IsRequired = false)]
|
||||
internal ContentVersionCleanupPolicyElement ContentVersionCleanupPolicy => (ContentVersionCleanupPolicyElement) this["contentVersionCleanupPolicy"];
|
||||
|
||||
[ConfigurationProperty("PreviewBadge")]
|
||||
internal InnerTextConfigurationElement<string> PreviewBadge => GetOptionalTextElement("PreviewBadge", DefaultPreviewBadge);
|
||||
|
||||
@@ -61,6 +64,8 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
|
||||
IEnumerable<string> IContentSection.AllowedUploadFiles => AllowedUploadFiles;
|
||||
|
||||
IContentVersionCleanupPolicySettings IContentSection.ContentVersionCleanupPolicySettings => ContentVersionCleanupPolicy;
|
||||
|
||||
bool IContentSection.ShowDeprecatedPropertyEditors => ShowDeprecatedPropertyEditors;
|
||||
|
||||
string IContentSection.LoginBackgroundImage => LoginBackgroundImage;
|
||||
|
||||
@@ -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"];
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,8 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
|
||||
IEnumerable<string> AllowedUploadFiles { get; }
|
||||
|
||||
IContentVersionCleanupPolicySettings ContentVersionCleanupPolicySettings { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether to show deprecated property editors in
|
||||
/// a datatype list of available editors.
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IContentVersionCleanupPolicySettings
|
||||
{
|
||||
bool EnableCleanup { get; }
|
||||
int KeepAllVersionsNewerThanDays { get; }
|
||||
int KeepLatestVersionPerDayForDays { get; }
|
||||
}
|
||||
}
|
||||
@@ -130,6 +130,8 @@
|
||||
<Compile Include="AssemblyExtensions.cs" />
|
||||
<Compile Include="Collections\StackQueue.cs" />
|
||||
<Compile Include="Configuration\ICoreDebug.cs" />
|
||||
<Compile Include="Configuration\UmbracoSettings\ContentVersionCleanupPolicyElement.cs" />
|
||||
<Compile Include="Configuration\UmbracoSettings\IContentVersionCleanupPolicySettings.cs" />
|
||||
<Compile Include="Constants-CharArrays.cs" />
|
||||
<Compile Include="Collections\EventClearingObservableCollection.cs" />
|
||||
<Compile Include="Constants-Sql.cs" />
|
||||
|
||||
@@ -190,6 +190,8 @@
|
||||
|
||||
<!-- You can specify your own logo for the login screen here. This path is relative to the ~/umbraco path. The default location is: /umbraco/assets/img/application/umbraco_logo_white.svg -->
|
||||
<loginLogoImage>assets/img/application/umbraco_logo_white.svg</loginLogoImage>
|
||||
|
||||
<contentVersionCleanupPolicy enable="true" keepAllVersionsNewerThanDays="2" keepLatestVersionPerDayForDays="30" />
|
||||
</content>
|
||||
|
||||
<security>
|
||||
|
||||
Reference in New Issue
Block a user