Cherry-pick: support import/export for doc type history cleanup policy (#11708)
* cherry-pick 13a51d32 (V8 History cleanup import/export)
Support import/export for doc type history cleanup policy (#11660)
* Support import/export for doc type history cleanup policy
* Support unset/null history cleanup value
* Resolve issue when api endpoints called without cleanup policy.
noop isn't good enough as map fails for response.
* null conditional vs null coalesce assignment
* Don't overwrite existing policy if omitted in import XML
* Update history cleanup warning and translations
* Change history cleanup alert to infomational styling
* Remove margin around history cleanup config
Co-authored-by: Ronald Barendse <ronald@barend.se>
# Conflicts:
# src/Umbraco.Core/Models/IContentType.cs
# src/Umbraco.Core/Packaging/PackageDataInstallation.cs
# src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeRepository.cs
# src/Umbraco.Infrastructure/Services/Implement/EntityXmlSerializer.cs
# src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
# src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs
# src/Umbraco.Tests/Umbraco.Tests.csproj
# src/Umbraco.Web.UI/umbraco/config/lang/en.xml
# src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
# src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs
# tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/Importing/ImportResources.resx
# tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/Importing/SingleDocType-WithCleanupPolicy.xml
* Remove namespace aliases
* Update IContentTypeWithHistoryCleanup documentation
Co-authored-by: Ronald Barendse <ronald@barend.se>
This commit is contained in:
@@ -4,12 +4,16 @@ using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models
|
||||
{
|
||||
[Obsolete("This will be merged into IContentType in Umbraco 10")]
|
||||
/// <summary>
|
||||
/// Defines a content type that contains a history cleanup policy.
|
||||
/// </summary>
|
||||
[Obsolete("This will be merged into IContentType in Umbraco 10.")]
|
||||
public interface IContentTypeWithHistoryCleanup : IContentType
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the history cleanup configuration
|
||||
/// Gets or sets the history cleanup configuration.
|
||||
/// </summary>
|
||||
/// <value>The history cleanup configuration.</value>
|
||||
HistoryCleanup HistoryCleanup { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -185,20 +185,15 @@ namespace Umbraco.Cms.Core.Models.Mapping
|
||||
{
|
||||
target.HistoryCleanup = new HistoryCleanupViewModel
|
||||
{
|
||||
PreventCleanup = sourceWithHistoryCleanup.HistoryCleanup.PreventCleanup,
|
||||
KeepAllVersionsNewerThanDays =
|
||||
sourceWithHistoryCleanup.HistoryCleanup.KeepAllVersionsNewerThanDays,
|
||||
KeepLatestVersionPerDayForDays =
|
||||
sourceWithHistoryCleanup.HistoryCleanup.KeepLatestVersionPerDayForDays,
|
||||
GlobalKeepAllVersionsNewerThanDays =
|
||||
_contentSettings.ContentVersionCleanupPolicy.KeepAllVersionsNewerThanDays,
|
||||
GlobalKeepLatestVersionPerDayForDays =
|
||||
_contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays,
|
||||
PreventCleanup = sourceWithHistoryCleanup.HistoryCleanup?.PreventCleanup ?? false,
|
||||
KeepAllVersionsNewerThanDays = sourceWithHistoryCleanup.HistoryCleanup?.KeepAllVersionsNewerThanDays,
|
||||
KeepLatestVersionPerDayForDays = sourceWithHistoryCleanup.HistoryCleanup?.KeepLatestVersionPerDayForDays,
|
||||
GlobalKeepAllVersionsNewerThanDays = _contentSettings.ContentVersionCleanupPolicy.KeepAllVersionsNewerThanDays,
|
||||
GlobalKeepLatestVersionPerDayForDays = _contentSettings.ContentVersionCleanupPolicy.KeepLatestVersionPerDayForDays,
|
||||
GlobalEnableCleanup = _contentSettings.ContentVersionCleanupPolicy.EnableCleanup
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
target.AllowCultureVariant = source.VariesByCulture();
|
||||
target.AllowSegmentVariant = source.VariesBySegment();
|
||||
target.ContentApps = _commonMapper.GetContentApps(source);
|
||||
|
||||
@@ -814,9 +814,47 @@ namespace Umbraco.Cms.Infrastructure.Packaging
|
||||
UpdateContentTypesPropertyGroups(contentType, documentType.Element("Tabs"));
|
||||
UpdateContentTypesProperties(contentType, documentType.Element("GenericProperties"));
|
||||
|
||||
if (contentType is IContentTypeWithHistoryCleanup withCleanup)
|
||||
{
|
||||
UpdateHistoryCleanupPolicy(withCleanup, documentType.Element("HistoryCleanupPolicy"));
|
||||
}
|
||||
|
||||
return contentType;
|
||||
}
|
||||
|
||||
private void UpdateHistoryCleanupPolicy(IContentTypeWithHistoryCleanup withCleanup, XElement element)
|
||||
{
|
||||
if (element == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
withCleanup.HistoryCleanup ??= new Core.Models.ContentEditing.HistoryCleanup();
|
||||
|
||||
if (bool.TryParse(element.Attribute("preventCleanup")?.Value, out var preventCleanup))
|
||||
{
|
||||
withCleanup.HistoryCleanup.PreventCleanup = preventCleanup;
|
||||
}
|
||||
|
||||
if (int.TryParse(element.Attribute("keepAllVersionsNewerThanDays")?.Value, out var keepAll))
|
||||
{
|
||||
withCleanup.HistoryCleanup.KeepAllVersionsNewerThanDays = keepAll;
|
||||
}
|
||||
else
|
||||
{
|
||||
withCleanup.HistoryCleanup.KeepAllVersionsNewerThanDays = null;
|
||||
}
|
||||
|
||||
if (int.TryParse(element.Attribute("keepLatestVersionPerDayForDays")?.Value, out var keepLatest))
|
||||
{
|
||||
withCleanup.HistoryCleanup.KeepLatestVersionPerDayForDays = keepLatest;
|
||||
}
|
||||
else
|
||||
{
|
||||
withCleanup.HistoryCleanup.KeepLatestVersionPerDayForDays = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateContentTypesAllowedTemplates(IContentType contentType, XElement allowedTemplatesElement, XElement defaultTemplateElement)
|
||||
{
|
||||
if (allowedTemplatesElement != null && allowedTemplatesElement.Elements("Template").Any())
|
||||
|
||||
@@ -297,15 +297,17 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
|
||||
|
||||
private void PersistHistoryCleanup(IContentType entity)
|
||||
{
|
||||
// historyCleanup property is not mandatory for api endpoint, handle the case where it's not present.
|
||||
// DocumentTypeSave doesn't handle this for us like ContentType constructors do.
|
||||
if (entity is IContentTypeWithHistoryCleanup entityWithHistoryCleanup)
|
||||
{
|
||||
ContentVersionCleanupPolicyDto dto = new ContentVersionCleanupPolicyDto()
|
||||
{
|
||||
ContentTypeId = entity.Id,
|
||||
Updated = DateTime.Now,
|
||||
PreventCleanup = entityWithHistoryCleanup.HistoryCleanup.PreventCleanup,
|
||||
KeepAllVersionsNewerThanDays = entityWithHistoryCleanup.HistoryCleanup.KeepAllVersionsNewerThanDays,
|
||||
KeepLatestVersionPerDayForDays = entityWithHistoryCleanup.HistoryCleanup.KeepLatestVersionPerDayForDays
|
||||
PreventCleanup = entityWithHistoryCleanup.HistoryCleanup?.PreventCleanup ?? false,
|
||||
KeepAllVersionsNewerThanDays = entityWithHistoryCleanup.HistoryCleanup?.KeepAllVersionsNewerThanDays,
|
||||
KeepLatestVersionPerDayForDays = entityWithHistoryCleanup.HistoryCleanup?.KeepLatestVersionPerDayForDays
|
||||
};
|
||||
Database.InsertOrUpdate(dto);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Xml.Linq;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.PropertyEditors;
|
||||
using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
@@ -494,6 +495,11 @@ namespace Umbraco.Cms.Core.Services.Implement
|
||||
genericProperties,
|
||||
tabs);
|
||||
|
||||
if (contentType is IContentTypeWithHistoryCleanup withCleanup && withCleanup.HistoryCleanup is not null)
|
||||
{
|
||||
xml.Add(SerializeCleanupPolicy(withCleanup.HistoryCleanup));
|
||||
}
|
||||
|
||||
var folderNames = string.Empty;
|
||||
var folderKeys = string.Empty;
|
||||
//don't add folders if this is a child doc type
|
||||
@@ -564,6 +570,29 @@ namespace Umbraco.Cms.Core.Services.Implement
|
||||
propertyType.ValidationRegExpMessage != null ? new XElement("ValidationRegExpMessage", propertyType.ValidationRegExpMessage) : null,
|
||||
propertyType.Description != null ? new XElement("Description", new XCData(propertyType.Description)) : null);
|
||||
|
||||
private XElement SerializeCleanupPolicy(HistoryCleanup cleanupPolicy)
|
||||
{
|
||||
if (cleanupPolicy == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(cleanupPolicy));
|
||||
}
|
||||
|
||||
var element = new XElement("HistoryCleanupPolicy",
|
||||
new XAttribute("preventCleanup", cleanupPolicy.PreventCleanup));
|
||||
|
||||
if (cleanupPolicy.KeepAllVersionsNewerThanDays.HasValue)
|
||||
{
|
||||
element.Add(new XAttribute("keepAllVersionsNewerThanDays", cleanupPolicy.KeepAllVersionsNewerThanDays));
|
||||
}
|
||||
|
||||
if (cleanupPolicy.KeepLatestVersionPerDayForDays.HasValue)
|
||||
{
|
||||
element.Add(new XAttribute("keepLatestVersionPerDayForDays", cleanupPolicy.KeepLatestVersionPerDayForDays));
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
// exports an IContentBase (IContent, IMedia or IMember) as an XElement.
|
||||
private XElement SerializeContentBase(IContentBase contentBase, string urlValue, string nodeName, bool published)
|
||||
{
|
||||
|
||||
@@ -101,23 +101,19 @@
|
||||
</div>
|
||||
|
||||
<div class="sub-view-column-right">
|
||||
<umb-box-content>
|
||||
<div class="umb-panel-group__details-status-text" ng-if="!model.historyCleanup.globalEnableCleanup">
|
||||
<p class="umb-panel-group__details-status-action"><localize key="contentTypeEditor_historyCleanupGloballyDisabled"></localize></p>
|
||||
</div>
|
||||
<p ng-if="!model.historyCleanup.globalEnableCleanup" class="umb-alert umb-alert--info"><localize key="contentTypeEditor_historyCleanupGloballyDisabled"></localize></p>
|
||||
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupPreventCleanup">
|
||||
<umb-toggle checked="model.historyCleanup.preventCleanup" on-click="vm.toggleHistoryCleanupPreventCleanup()"></umb-toggle>
|
||||
</umb-control-group>
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupPreventCleanup">
|
||||
<umb-toggle checked="model.historyCleanup.preventCleanup" on-click="vm.toggleHistoryCleanupPreventCleanup()"></umb-toggle>
|
||||
</umb-control-group>
|
||||
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupKeepAllVersionsNewerThanDays">
|
||||
<input ng-readonly="model.historyCleanup.preventCleanup" placeholder="{{model.historyCleanup.globalKeepAllVersionsNewerThanDays}}" type="number" min="0" max="2147483647" ng-model="model.historyCleanup.keepAllVersionsNewerThanDays" />
|
||||
</umb-control-group>
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupKeepAllVersionsNewerThanDays">
|
||||
<input ng-readonly="model.historyCleanup.preventCleanup" placeholder="{{model.historyCleanup.globalKeepAllVersionsNewerThanDays}}" type="number" min="0" max="2147483647" ng-model="model.historyCleanup.keepAllVersionsNewerThanDays" />
|
||||
</umb-control-group>
|
||||
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupKeepLatestVersionPerDayForDays">
|
||||
<input ng-readonly="model.historyCleanup.preventCleanup" placeholder="{{model.historyCleanup.globalKeepLatestVersionPerDayForDays}}" type="number" min="0" max="2147483647" ng-model="model.historyCleanup.keepLatestVersionPerDayForDays" />
|
||||
</umb-control-group>
|
||||
</umb-box-content>
|
||||
<umb-control-group label="@contentTypeEditor_historyCleanupKeepLatestVersionPerDayForDays">
|
||||
<input ng-readonly="model.historyCleanup.preventCleanup" placeholder="{{model.historyCleanup.globalKeepLatestVersionPerDayForDays}}" type="number" min="0" max="2147483647" ng-model="model.historyCleanup.keepLatestVersionPerDayForDays" />
|
||||
</umb-control-group>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1833,11 +1833,11 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
|
||||
</key>
|
||||
<key alias="usingEditor">using this editor will get updated with the new settings.</key>
|
||||
<key alias="historyCleanupHeading">History cleanup</key>
|
||||
<key alias="historyCleanupDescription">Allow override the global settings for when history versions are removed.</key>
|
||||
<key alias="historyCleanupDescription">Allow overriding the global history cleanup settings.</key>
|
||||
<key alias="historyCleanupKeepAllVersionsNewerThanDays">Keep all versions newer than days</key>
|
||||
<key alias="historyCleanupKeepLatestVersionPerDayForDays">Keep latest version per day for days</key>
|
||||
<key alias="historyCleanupPreventCleanup">Prevent cleanup</key>
|
||||
<key alias="historyCleanupGloballyDisabled">NOTE! The content version cleanup feature is disabled globally. These settings will not take effect until it is enabled.</key>
|
||||
<key alias="historyCleanupGloballyDisabled">History cleanup is disabled globally, these settings will not take effect until it is enabled.</key>
|
||||
</area>
|
||||
<area alias="languages">
|
||||
<key alias="addLanguage">Add language</key>
|
||||
|
||||
@@ -1897,11 +1897,11 @@ To manage your website, simply open the Umbraco backoffice and start adding cont
|
||||
</key>
|
||||
<key alias="usingEditor">using this editor will get updated with the new settings.</key>
|
||||
<key alias="historyCleanupHeading">History cleanup</key>
|
||||
<key alias="historyCleanupDescription">Allow override the global settings for when history versions are removed.</key>
|
||||
<key alias="historyCleanupDescription">Allow overriding the global history cleanup settings.</key>
|
||||
<key alias="historyCleanupKeepAllVersionsNewerThanDays">Keep all versions newer than days</key>
|
||||
<key alias="historyCleanupKeepLatestVersionPerDayForDays">Keep latest version per day for days</key>
|
||||
<key alias="historyCleanupPreventCleanup">Prevent cleanup</key>
|
||||
<key alias="historyCleanupGloballyDisabled">NOTE! The content version cleanup feature is disabled globally. These settings will not take effect until it is enabled.</key>
|
||||
<key alias="historyCleanupGloballyDisabled">History cleanup is disabled globally, these settings will not take effect until it is enabled.</key>
|
||||
</area>
|
||||
<area alias="languages">
|
||||
<key alias="addLanguage">Add language</key>
|
||||
|
||||
@@ -766,6 +766,77 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Packaging
|
||||
Assert.That(testContentType.ContentTypeCompositionExists("Seo"), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImportDocumentType_NewTypeWithOmittedHistoryCleanupPolicy_InsertsDefaultPolicy()
|
||||
{
|
||||
// Arrange
|
||||
var withoutCleanupPolicy = XElement.Parse(ImportResources.SingleDocType);
|
||||
|
||||
// Act
|
||||
var contentTypes = PackageDataInstallation
|
||||
.ImportDocumentType(withoutCleanupPolicy, 0)
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.NotNull(contentTypes.Single().HistoryCleanup);
|
||||
Assert.IsFalse(contentTypes.Single().HistoryCleanup.PreventCleanup);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImportDocumentType_WithHistoryCleanupPolicyElement_ImportsWithCorrectValues()
|
||||
{
|
||||
// Arrange
|
||||
var docTypeElement = XElement.Parse(ImportResources.SingleDocType_WithCleanupPolicy);
|
||||
|
||||
// Act
|
||||
var contentTypes = PackageDataInstallation
|
||||
.ImportDocumentType(docTypeElement, 0)
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.NotNull(contentTypes.Single().HistoryCleanup);
|
||||
Assert.IsTrue(contentTypes.Single().HistoryCleanup.PreventCleanup);
|
||||
Assert.AreEqual(1, contentTypes.Single().HistoryCleanup.KeepAllVersionsNewerThanDays);
|
||||
Assert.AreEqual(2, contentTypes.Single().HistoryCleanup.KeepLatestVersionPerDayForDays);
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ImportDocumentType_ExistingTypeWithOmittedHistoryCleanupPolicy_DoesNotOverwriteDatabaseContent()
|
||||
{
|
||||
// Arrange
|
||||
var withoutCleanupPolicy = XElement.Parse(ImportResources.SingleDocType);
|
||||
var withCleanupPolicy = XElement.Parse(ImportResources.SingleDocType_WithCleanupPolicy);
|
||||
|
||||
// Act
|
||||
var contentTypes = PackageDataInstallation
|
||||
.ImportDocumentType(withCleanupPolicy, 0)
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
var contentTypesUpdated = PackageDataInstallation
|
||||
.ImportDocumentType(withoutCleanupPolicy, 0)
|
||||
.OfType<IContentTypeWithHistoryCleanup>();
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.NotNull(contentTypes.Single().HistoryCleanup);
|
||||
Assert.IsTrue(contentTypes.Single().HistoryCleanup.PreventCleanup);
|
||||
Assert.AreEqual(1, contentTypes.Single().HistoryCleanup.KeepAllVersionsNewerThanDays);
|
||||
Assert.AreEqual(2, contentTypes.Single().HistoryCleanup.KeepLatestVersionPerDayForDays);
|
||||
|
||||
Assert.NotNull(contentTypesUpdated.Single().HistoryCleanup);
|
||||
Assert.IsTrue(contentTypesUpdated.Single().HistoryCleanup.PreventCleanup);
|
||||
Assert.AreEqual(1, contentTypes.Single().HistoryCleanup.KeepAllVersionsNewerThanDays);
|
||||
Assert.AreEqual(2, contentTypes.Single().HistoryCleanup.KeepLatestVersionPerDayForDays);
|
||||
});
|
||||
}
|
||||
|
||||
private void AddLanguages()
|
||||
{
|
||||
var globalSettings = new GlobalSettings();
|
||||
|
||||
@@ -25,6 +25,7 @@ using Umbraco.Cms.Core.PropertyEditors;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Umbraco.Cms.Core.Media;
|
||||
using Umbraco.Cms.Core.Models.ContentEditing;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
|
||||
@@ -225,6 +226,58 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services
|
||||
Assert.AreEqual(media.Properties[Constants.Conventions.Media.Bytes].GetValue().ToString(), element.Elements(Constants.Conventions.Media.Bytes).Single().Value);
|
||||
Assert.AreEqual(media.Properties[Constants.Conventions.Media.Extension].GetValue().ToString(), element.Elements(Constants.Conventions.Media.Extension).Single().Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Serialize_ForContentTypeWithHistoryCleanupPolicy_OutputsSerializedHistoryCleanupPolicy()
|
||||
{
|
||||
// Arrange
|
||||
var template = TemplateBuilder.CreateTextPageTemplate();
|
||||
FileService.SaveTemplate(template); // else, FK violation on contentType!
|
||||
|
||||
var contentType = ContentTypeBuilder.CreateTextPageContentType(defaultTemplateId: template.Id);
|
||||
|
||||
contentType.HistoryCleanup = new HistoryCleanup
|
||||
{
|
||||
PreventCleanup = true,
|
||||
KeepAllVersionsNewerThanDays = 1,
|
||||
KeepLatestVersionPerDayForDays = 2
|
||||
};
|
||||
|
||||
ContentTypeService.Save(contentType);
|
||||
|
||||
// Act
|
||||
var element = Serializer.Serialize(contentType);
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(element.Element("HistoryCleanupPolicy")!.Attribute("preventCleanup")!.Value, Is.EqualTo("true"));
|
||||
Assert.That(element.Element("HistoryCleanupPolicy")!.Attribute("keepAllVersionsNewerThanDays")!.Value, Is.EqualTo("1"));
|
||||
Assert.That(element.Element("HistoryCleanupPolicy")!.Attribute("keepLatestVersionPerDayForDays")!.Value, Is.EqualTo("2"));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Serialize_ForContentTypeWithNullHistoryCleanupPolicy_DoesNotOutputSerializedDefaultPolicy()
|
||||
{
|
||||
// Arrange
|
||||
var template = TemplateBuilder.CreateTextPageTemplate();
|
||||
FileService.SaveTemplate(template); // else, FK violation on contentType!
|
||||
|
||||
var contentType = ContentTypeBuilder.CreateTextPageContentType(defaultTemplateId: template.Id);
|
||||
|
||||
contentType.HistoryCleanup = null;
|
||||
|
||||
ContentTypeService.Save(contentType);
|
||||
|
||||
var element = Serializer.Serialize(contentType);
|
||||
|
||||
// Assert
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(element.Element("HistoryCleanupPolicy"), Is.Null);
|
||||
});
|
||||
}
|
||||
|
||||
private void CreateDictionaryData()
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importin
|
||||
/// </info>
|
||||
/// <Documents>
|
||||
/// <DocumentSet importMode="root">
|
||||
/// <NewType id="1148" parentID="-1" level="1" creatorID="0" sortOrder="9" createDate="2013-07-23T12:06:07" updateDate="2013-07-23T15:56:37" nodeName="DoIt" urlName="doit" path="-1,1148" isDoc="" nodeType="1134" creatorName="admin" writerName="admin" writerID="0" template="1133" nodeTy [rest of string was truncated]";.
|
||||
/// <NewType key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1148" parentID="-1" level="1" creatorID="0" sortOrder="9" createDate="2013-07-23T12:06:07" updateDate="2013-07-23T15:56:37" nodeName="DoIt" urlName="doit" path="-1,1148" isDoc="" nodeType="1134" creatorName="admin" writerName= [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string CheckboxList_Content_Package {
|
||||
get {
|
||||
@@ -91,7 +91,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importin
|
||||
/// </info>
|
||||
/// <Documents>
|
||||
/// <DocumentSet importMode="root">
|
||||
/// <umbHomePage id="1068" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2014-11-26T12:52:35" updateDate="2014-11-26T12:52:36" nodeName="Home" urlName="home" path="-1,1068" isDoc="" nodeType="1056" creatorName="Morten Christensen" writerName="Morten Christensen" [rest of string was truncated]";.
|
||||
/// <umbHomePage key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1068" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2014-11-26T12:52:35" updateDate="2014-11-26T12:52:36" nodeName="Home" urlName="home" path="-1,1068" isDoc="" nodeType="1056" creatorName="Morten Ch [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string CompositionsTestPackage {
|
||||
get {
|
||||
@@ -124,15 +124,14 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importin
|
||||
/// <files />
|
||||
/// <info>
|
||||
/// <package>
|
||||
/// <name>Dictionary-Package</name>
|
||||
/// <name>Dictionary-Package</name>
|
||||
/// </package>
|
||||
/// </info>
|
||||
/// <DictionaryItems>
|
||||
/// <DictionaryItem Key="Parent">
|
||||
/// <DictionaryItem Key="28f2e02a-8c66-4fcd-85e3-8524d551c0d3" Name="Parent">
|
||||
/// <Value LanguageId="2" LanguageCultureAlias="nb-NO"><![CDATA[ForelderVerdi]]></Value>
|
||||
/// <Value LanguageId="3" LanguageCultureAlias="en-GB"><![CDATA[ParentValue]]></Value>
|
||||
/// <DictionaryItem Key="Child">
|
||||
/// <Value LanguageId="2" LanguageCultureAlias="nb-NO"><![CDATA[BarnV [rest of string was truncated]";.
|
||||
/// <DictionaryItem Key="e7dba0a9-d517-4ba4-8e18-2764d392c611" Name=" [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string Dictionary_Package {
|
||||
get {
|
||||
@@ -239,6 +238,33 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importin
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?>
|
||||
///<DocumentType>
|
||||
/// <Info>
|
||||
/// <Name>test</Name>
|
||||
/// <Key>150ead17-d359-42a2-ac33-6504cc52ced1</Key>
|
||||
/// <Alias>test</Alias>
|
||||
/// <Icon>folder.gif</Icon>
|
||||
/// <Thumbnail>folder.png</Thumbnail>
|
||||
/// <Description>
|
||||
/// </Description>
|
||||
/// <AllowAtRoot>False</AllowAtRoot>
|
||||
/// <AllowedTemplates>
|
||||
/// <Template>test</Template>
|
||||
/// </AllowedTemplates>
|
||||
/// <DefaultTemplate>test</DefaultTemplate>
|
||||
/// </Info>
|
||||
/// <Structure>
|
||||
/// <DocumentType>test</DocumentType>
|
||||
/// </Str [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string SingleDocType_WithCleanupPolicy {
|
||||
get {
|
||||
return ResourceManager.GetString("SingleDocType_WithCleanupPolicy", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
///<umbPackage>
|
||||
@@ -249,8 +275,7 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Infrastructure.Services.Importin
|
||||
/// </info>
|
||||
/// <Documents>
|
||||
/// <DocumentSet importMode="root">
|
||||
/// <Homepage id="1072" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2013-02-17T09:04:39" updateDate="2013-02-17T09:10:47" nodeName="Home" urlName="home" path="-1,1072" isDoc="" nodeType="1062" creatorName="admin" writerName="admin" writerID="0" template="1049">
|
||||
/// <slide [rest of string was truncated]";.
|
||||
/// <Homepage key="9c9b55d0-2fbf-4f12-afea-023bd7b2519d" id="1072" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2013-02-17T09:04:39" updateDate="2013-02-17T09:10:47" nodeName="Home" urlName="home" path="-1,1072" isDoc="" nodeType="1062" creatorName="admin" writerName="admin" wr [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string StandardMvc_Package {
|
||||
get {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
@@ -26,36 +26,36 @@
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
@@ -157,4 +157,7 @@
|
||||
<data name="MediaTypesAndMedia_Package.xml" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>MediaTypesAndMedia-Package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
<data name="SingleDocType_WithCleanupPolicy" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>SingleDocType-WithCleanupPolicy.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<DocumentType>
|
||||
<Info>
|
||||
<Name>test</Name>
|
||||
<Key>150ead17-d359-42a2-ac33-6504cc52ced1</Key>
|
||||
<Alias>test</Alias>
|
||||
<Icon>folder.gif</Icon>
|
||||
<Thumbnail>folder.png</Thumbnail>
|
||||
<Description>
|
||||
</Description>
|
||||
<AllowAtRoot>False</AllowAtRoot>
|
||||
<AllowedTemplates>
|
||||
<Template>test</Template>
|
||||
</AllowedTemplates>
|
||||
<DefaultTemplate>test</DefaultTemplate>
|
||||
</Info>
|
||||
<Structure>
|
||||
<DocumentType>test</DocumentType>
|
||||
</Structure>
|
||||
<GenericProperties>
|
||||
<GenericProperty>
|
||||
<Name>test</Name>
|
||||
<Alias>test</Alias>
|
||||
<Type>b4471851-82b6-4c75-afa4-39fa9c6a75e9</Type>
|
||||
<Definition>fbaf13a8-4036-41f2-93a3-974f678c312a</Definition>
|
||||
<Tab>
|
||||
</Tab>
|
||||
<Mandatory>False</Mandatory>
|
||||
<Validation>
|
||||
</Validation>
|
||||
<Description><![CDATA[]]></Description>
|
||||
</GenericProperty>
|
||||
</GenericProperties>
|
||||
<Tabs />
|
||||
<HistoryCleanupPolicy preventCleanup="true" keepAllVersionsNewerThanDays="1" keepLatestVersionPerDayForDays="2" />
|
||||
</DocumentType>
|
||||
Reference in New Issue
Block a user