Compare commits
274 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3b364022a | |||
| 56ae2b709d | |||
| 0acc202740 | |||
| 4ad0c1bb89 | |||
| 67da15330e | |||
| a458e7daf0 | |||
| d85cb9e15e | |||
| 19a4cf774b | |||
| ab00ba8a12 | |||
| 57e2a19023 | |||
| daa80a7bf6 | |||
| 8152e7cb92 | |||
| adccb4161e | |||
| 72a0187295 | |||
| 24d6287918 | |||
| 55900a3464 | |||
| a5a42854ef | |||
| 784c84a166 | |||
| f5d78a4d04 | |||
| b334e0ccb2 | |||
| 0a2e5badd0 | |||
| 90b0bf9d82 | |||
| 6bcd1e44f9 | |||
| 36e9bb4d78 | |||
| 4c06ead056 | |||
| 639d04381e | |||
| 031340a2ac | |||
| 2465eb233e | |||
| 7f905bce0e | |||
| 205ea22daa | |||
| 501cef665f | |||
| 8b65968ac9 | |||
| 16e9bf265d | |||
| 9bdd080cfb | |||
| a3e7153bca | |||
| 408232c9ac | |||
| 56bc47302c | |||
| 417e004b23 | |||
| b08e38f9ed | |||
| c7b505fd90 | |||
| c1fcb37642 | |||
| 0bba68a7f5 | |||
| 47e4c12395 | |||
| 25822a7564 | |||
| 072f0d1520 | |||
| c5f7ac18fd | |||
| 10b8fd9fb9 | |||
| 24c053d671 | |||
| 44fc8be49e | |||
| 2a4e73c650 | |||
| f3e78e990f | |||
| f0a540eba2 | |||
| 12922f8413 | |||
| 85f054e3c1 | |||
| 2f7b532209 | |||
| abebb40461 | |||
| 3b54db9b49 | |||
| 1defc1e0e4 | |||
| a7e626f4a7 | |||
| 04f6a01196 | |||
| ef64fbb839 | |||
| 2424a1c04b | |||
| c8c7de065d | |||
| 61d71d0552 | |||
| b8734e5eea | |||
| eefd13547c | |||
| 29d86b8675 | |||
| 470bf86ec0 | |||
| 9367f61952 | |||
| 3cabd8c318 | |||
| 4119380af5 | |||
| fc3b08e374 | |||
| a57abce96e | |||
| b260f6c6de | |||
| a09755ef7f | |||
| afae06a866 | |||
| 736cf94155 | |||
| 86ffd66c8a | |||
| 051af5c48e | |||
| 1fb05fcca7 | |||
| c96e017e65 | |||
| 4f596d20a9 | |||
| 343e462473 | |||
| db414e8045 | |||
| 49d24dada7 | |||
| ef9dd6d803 | |||
| 1fd98dba30 | |||
| 40ea54007f | |||
| fc5bf81991 | |||
| 54e460cf5b | |||
| ba64768d8d | |||
| 6710ac8c85 | |||
| 1f98b76da0 | |||
| fd1da492cc | |||
| 519eb9d641 | |||
| 698f0e975a | |||
| c6ed4eaff6 | |||
| 2964f9a1c7 | |||
| 4612183b13 | |||
| 4fe12d8930 | |||
| a54f4aeffd | |||
| 931db6f0b1 | |||
| 01f50a243b | |||
| f24c56d1ba | |||
| 907afa11ad | |||
| 44608c3122 | |||
| 44732e5f52 | |||
| 90f2fc4cd9 | |||
| 24c7dee5d0 | |||
| 12417c0c48 | |||
| d4919ff8c4 | |||
| b2acb97639 | |||
| 28debbda1b | |||
| 256ebe7c14 | |||
| 038b155aea | |||
| deaa2d939a | |||
| bf4ad25cad | |||
| c58957dc7b | |||
| 7b616cf719 | |||
| cca0f4c293 | |||
| bbe68cc224 | |||
| a162f21a70 | |||
| c0a2a78f3d | |||
| ace111aefb | |||
| 3bdc2e63ab | |||
| 3f7bfe0b3a | |||
| e0d281bb4b | |||
| b7d37af933 | |||
| d24541fce4 | |||
| 7a0ac625ff | |||
| 198edec4f4 | |||
| d2837b9649 | |||
| dfe3798aab | |||
| 3f9cfbb422 | |||
| 2f3d926c08 | |||
| 594c3b8a85 | |||
| 3ad729824e | |||
| 41244485b1 | |||
| ede342feba | |||
| a15bdba5d7 | |||
| 361f5093c7 | |||
| 975535a9e2 | |||
| e7f7631d1e | |||
| 99f66fe6a3 | |||
| b413a6eeae | |||
| 9b9db23461 | |||
| 4fa36cd424 | |||
| 7d4a9998ca | |||
| eba8181d0c | |||
| 21714f0eac | |||
| 8e79e15c71 | |||
| 0c709d144b | |||
| 4e7d2f668b | |||
| bde439d102 | |||
| ba501dbbb8 | |||
| 5041a459d4 | |||
| 04f79ffaf1 | |||
| 32abebd0a0 | |||
| 34b06dc350 | |||
| 16d8c55fa7 | |||
| 2085063231 | |||
| 73f77df5ad | |||
| 8a11b0f7a8 | |||
| 5a2836eb6d | |||
| cfd8d39878 | |||
| e8e0b10559 | |||
| 98279052e6 | |||
| 0b7f60c0f8 | |||
| d563eb07a2 | |||
| f036bc90c3 | |||
| 23304aca0b | |||
| 845dd4673c | |||
| 0a53f7636c | |||
| 6e6d552441 | |||
| 14e402878a | |||
| 5a2687d520 | |||
| 905eed518f | |||
| f75e0cf4ba | |||
| c46f38c73b | |||
| 9718324e6e | |||
| 4c461a733b | |||
| 82ab7c4a01 | |||
| 0dc3bff01a | |||
| 358dd7f32b | |||
| 6531d027fc | |||
| d11e787624 | |||
| 055ae0d126 | |||
| 4c330c8654 | |||
| 2074affd5e | |||
| 17c9d19ebb | |||
| cfd8435d68 | |||
| 77969960d9 | |||
| 52b1a08912 | |||
| 844d6c9972 | |||
| 5e6f1a92ca | |||
| 1a9f336a59 | |||
| b2815d5e63 | |||
| 5b88c57d94 | |||
| 9ba08f275e | |||
| aadd0c9129 | |||
| b3b79a792f | |||
| 59cd4b5c5c | |||
| f5f9ff29ce | |||
| a10b59d03b | |||
| 7ebf51abb7 | |||
| e6b1ecb851 | |||
| 69d6609a3b | |||
| 2196ab3713 | |||
| 89be1cf5d2 | |||
| 2041e85b9e | |||
| 6c2f0e404f | |||
| 770f96b6d5 | |||
| d5e66252dc | |||
| c2359a96f8 | |||
| 1df65bc3ce | |||
| 530a80d7ea | |||
| 8be0f68390 | |||
| 05cb30d79c | |||
| c472d4975e | |||
| 0e31fcf3db | |||
| 1300764770 | |||
| 13ed3303f5 | |||
| f200ab423d | |||
| 42841824bf | |||
| d889d3e385 | |||
| 0bf27fa319 | |||
| 466a37aab8 | |||
| 4ab2130d7d | |||
| 256ceef875 | |||
| 2acde54880 | |||
| a92d255e4b | |||
| dc62272e6e | |||
| 60f6a60ca9 | |||
| eef8d21112 | |||
| 6a374cbfa6 | |||
| ccb8ac4cfc | |||
| 5de21734c0 | |||
| 18deb8ad99 | |||
| d866f1d74a | |||
| 3426ae3722 | |||
| d04510f5f2 | |||
| 84c0682f16 | |||
| 53bbc5f922 | |||
| d8b70d79e8 | |||
| 56d2230251 | |||
| 62f21d3cee | |||
| b9c90af8be | |||
| 7a661c1b48 | |||
| c871a711dd | |||
| d671caf3ab | |||
| 6b038186be | |||
| 95187becaf | |||
| d412d90b17 | |||
| 790e30defd | |||
| 2f74181262 | |||
| 45fd23ff02 | |||
| 4e2fb8e5dc | |||
| afbceca184 | |||
| 1b8c68af02 | |||
| ee925692e5 | |||
| 0832220d61 | |||
| 98430fd573 | |||
| 4a547ba1c9 | |||
| 59f39fd535 | |||
| b4ca04596c | |||
| afa39866ad | |||
| 5bc66c5b7f | |||
| 90136c524c | |||
| 8d7f496f7c | |||
| f62a9ed199 | |||
| bc8b8a69b8 | |||
| 9de3acfae2 | |||
| 87814fa43c | |||
| b40a1fa613 |
@@ -32,13 +32,13 @@
|
||||
<!-- AutoMapper can not be updated due to: https://github.com/AutoMapper/AutoMapper/issues/373#issuecomment-127644405 -->
|
||||
<dependency id="AutoMapper" version="[3.3.1, 4.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[6.0.8, 10.0.0)" />
|
||||
<dependency id="Examine" version="[0.1.70, 1.0.0)" />
|
||||
<dependency id="ImageProcessor" version="[2.4.5, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[4.6.6, 5.0.0)" />
|
||||
<dependency id="Examine" version="[0.1.80, 1.0.0)" />
|
||||
<dependency id="ImageProcessor" version="[2.5.1, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[4.8.0, 5.0.0)" />
|
||||
<dependency id="semver" version="[1.1.2, 2.0.0)" />
|
||||
<dependency id="UrlRewritingNet" version="[2.0.7, 3.0.0)" />
|
||||
<!-- Markdown can not be updated due to: https://github.com/hey-red/markdownsharp/issues/71#issuecomment-233585487 -->
|
||||
<dependency id="Markdown" version="[1.14.4, 2.0.0)" />
|
||||
<dependency id="Markdown" version="[1.14.4, 2.0.0)" />
|
||||
<dependency id="System.Threading.Tasks.Dataflow" version="[4.6.0, 5.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
@@ -104,4 +104,4 @@
|
||||
<file src="..\_BuildOutput\bin\UmbracoExamine.pdb" target="lib" />
|
||||
<file src="..\..\src\UmbracoExamine\**\*.cs" exclude="..\..\src\**\TemporaryGeneratedFile*.cs" target="src\UmbracoExamine" />
|
||||
</files>
|
||||
</package>
|
||||
</package>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<file src="tools\trees.config.install.xdt" target="Content\config\trees.config.install.xdt" />
|
||||
<file src="tools\umbracoSettings.config.install.xdt" target="Content\config\umbracoSettings.config.install.xdt" />
|
||||
<file src="tools\Views.Web.config.install.xdt" target="Views\Web.config.install.xdt" />
|
||||
<file src="tools\processing.config.install.xdt" target="Content\Config\imageprocessor\processing.config.install.xdt" />
|
||||
<file src="build\**" target="build" />
|
||||
</files>
|
||||
</package>
|
||||
|
||||
@@ -71,6 +71,7 @@ if ($project) {
|
||||
if(Test-Path $umbracoBinFolder\ImageProcessor.dll) { Remove-Item $umbracoBinFolder\ImageProcessor.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\ImageProcessor.Web.dll) { Remove-Item $umbracoBinFolder\ImageProcessor.Web.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Lucene.Net.dll) { Remove-Item $umbracoBinFolder\Lucene.Net.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Microsoft.IO.RecyclableMemoryStream.dll) { Remove-Item $umbracoBinFolder\Microsoft.IO.RecyclableMemoryStream.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Microsoft.AspNet.Identity.Core.dll) { Remove-Item $umbracoBinFolder\Microsoft.AspNet.Identity.Core.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Microsoft.AspNet.Identity.Owin.dll) { Remove-Item $umbracoBinFolder\Microsoft.AspNet.Identity.Owin.dll -Force -Confirm:$false }
|
||||
if(Test-Path $umbracoBinFolder\Microsoft.CodeAnalysis.CSharp.dll) { Remove-Item $umbracoBinFolder\Microsoft.CodeAnalysis.CSharp.dll -Force -Confirm:$false }
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<processing xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xdt:Transform="SetAttributes(preserveExifMetaData)" preserveExifMetaData="true" />
|
||||
@@ -1,3 +1,3 @@
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
|
||||
7.6.0
|
||||
alpha038
|
||||
alpha056
|
||||
@@ -49,13 +49,9 @@
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
using System.Resources;
|
||||
|
||||
[assembly: AssemblyCompany("Umbraco")]
|
||||
[assembly: AssemblyCopyright("Copyright © Umbraco 2016")]
|
||||
[assembly: AssemblyCopyright("Copyright © Umbraco 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@@ -12,4 +12,4 @@ using System.Resources;
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyFileVersion("7.6.0")]
|
||||
[assembly: AssemblyInformationalVersion("7.6.0-alpha038")]
|
||||
[assembly: AssemblyInformationalVersion("7.6.0-alpha056")]
|
||||
@@ -296,7 +296,7 @@ namespace Umbraco.Core
|
||||
// if we have a db context available, if we don't then we are not installed anyways
|
||||
if (DatabaseContext.IsDatabaseConfigured && DatabaseContext.CanConnect)
|
||||
{
|
||||
var found = Services.MigrationEntryService.FindEntry(GlobalSettings.UmbracoMigrationName, UmbracoVersion.GetSemanticVersion());
|
||||
var found = Services.MigrationEntryService.FindEntry(Constants.System.UmbracoMigrationName, UmbracoVersion.GetSemanticVersion());
|
||||
if (found == null)
|
||||
{
|
||||
//we haven't executed this migration in this environment, so even though the config versions match,
|
||||
|
||||
@@ -64,7 +64,8 @@ namespace Umbraco.Core.Cache
|
||||
[UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")]
|
||||
public const string ContentTypePropertiesCacheKey = "ContentType_PropertyTypes_Content:";
|
||||
|
||||
[UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")]
|
||||
[Obsolete("No longer used and will be removed in v8")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string PropertyTypeCacheKey = "UmbracoPropertyTypeCache";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
var settings = ConfigurationManager.ConnectionStrings[UmbracoConnectionName];
|
||||
var settings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName];
|
||||
var connectionString = string.Empty;
|
||||
|
||||
if (settings != null)
|
||||
@@ -241,10 +241,7 @@ namespace Umbraco.Core.Configuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Move these to constants!
|
||||
public const string UmbracoConnectionName = "umbracoDbDSN";
|
||||
public const string UmbracoMigrationName = "Umbraco";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration status. This will return the version number of the currently installed umbraco instance.
|
||||
|
||||
@@ -4,8 +4,7 @@ using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
|
||||
internal class ContentElement : ConfigurationElement, IContentSection
|
||||
internal class ContentElement : UmbracoConfigurationElement, IContentSection
|
||||
{
|
||||
[ConfigurationProperty("imaging")]
|
||||
internal ContentImagingElement Imaging
|
||||
@@ -22,25 +21,13 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
[ConfigurationProperty("ResolveUrlsFromTextString")]
|
||||
internal InnerTextConfigurationElement<bool> ResolveUrlsFromTextString
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["ResolveUrlsFromTextString"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement<bool>("ResolveUrlsFromTextString", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("UploadAllowDirectories")]
|
||||
internal InnerTextConfigurationElement<bool> UploadAllowDirectories
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["UploadAllowDirectories"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("UploadAllowDirectories", true); }
|
||||
}
|
||||
|
||||
public IEnumerable<IContentErrorPage> Error404Collection
|
||||
@@ -63,121 +50,61 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
[ConfigurationProperty("ensureUniqueNaming")]
|
||||
internal InnerTextConfigurationElement<bool> EnsureUniqueNaming
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["ensureUniqueNaming"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("ensureUniqueNaming", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("TidyEditorContent")]
|
||||
internal InnerTextConfigurationElement<bool> TidyEditorContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["TidyEditorContent"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("TidyEditorContent", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("TidyCharEncoding")]
|
||||
internal InnerTextConfigurationElement<string> TidyCharEncoding
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["TidyCharEncoding"],
|
||||
//set the default
|
||||
"UTF8");
|
||||
}
|
||||
get { return GetOptionalTextElement("TidyCharEncoding", "UTF8"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("XmlCacheEnabled")]
|
||||
internal InnerTextConfigurationElement<bool> XmlCacheEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["XmlCacheEnabled"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("XmlCacheEnabled", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("ContinouslyUpdateXmlDiskCache")]
|
||||
internal InnerTextConfigurationElement<bool> ContinouslyUpdateXmlDiskCache
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["ContinouslyUpdateXmlDiskCache"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("ContinouslyUpdateXmlDiskCache", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("XmlContentCheckForDiskChanges")]
|
||||
internal InnerTextConfigurationElement<bool> XmlContentCheckForDiskChanges
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["XmlContentCheckForDiskChanges"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("XmlContentCheckForDiskChanges", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("EnableSplashWhileLoading")]
|
||||
internal InnerTextConfigurationElement<bool> EnableSplashWhileLoading
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["EnableSplashWhileLoading"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("EnableSplashWhileLoading", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("PropertyContextHelpOption")]
|
||||
internal InnerTextConfigurationElement<string> PropertyContextHelpOption
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["PropertyContextHelpOption"],
|
||||
//set the default
|
||||
"text");
|
||||
}
|
||||
get { return GetOptionalTextElement("PropertyContextHelpOption", "text"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("UseLegacyXmlSchema")]
|
||||
internal InnerTextConfigurationElement<bool> UseLegacyXmlSchema
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["UseLegacyXmlSchema"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("UseLegacyXmlSchema", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("ForceSafeAliases")]
|
||||
internal InnerTextConfigurationElement<bool> ForceSafeAliases
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["ForceSafeAliases"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("ForceSafeAliases", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("PreviewBadge")]
|
||||
@@ -185,123 +112,63 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["PreviewBadge"],
|
||||
//set the default
|
||||
@"<a id=""umbracoPreviewBadge"" style=""position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;"" href=""{0}/endPreview.aspx?redir={2}""><span style=""display:none;"">In Preview Mode - click to end</span></a>");
|
||||
return GetOptionalTextElement("PreviewBadge", @"<a id=""umbracoPreviewBadge"" style=""position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{1}/preview/previewModeBadge.png') no-repeat;"" href=""{0}/endPreview.aspx?redir={2}""><span style=""display:none;"">In Preview Mode - click to end</span></a>");
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("UmbracoLibraryCacheDuration")]
|
||||
internal InnerTextConfigurationElement<int> UmbracoLibraryCacheDuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<int>(
|
||||
(InnerTextConfigurationElement<int>)this["UmbracoLibraryCacheDuration"],
|
||||
//set the default
|
||||
1800);
|
||||
|
||||
}
|
||||
get { return GetOptionalTextElement("UmbracoLibraryCacheDuration", 1800); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("MacroErrors")]
|
||||
internal InnerTextConfigurationElement<MacroErrorBehaviour> MacroErrors
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
return new OptionalInnerTextConfigurationElement<MacroErrorBehaviour>(
|
||||
(InnerTextConfigurationElement<MacroErrorBehaviour>)this["MacroErrors"],
|
||||
//set the default
|
||||
MacroErrorBehaviour.Inline);
|
||||
}
|
||||
get { return GetOptionalTextElement("MacroErrors", MacroErrorBehaviour.Inline); }
|
||||
}
|
||||
|
||||
[Obsolete("This is here so that if this config element exists we won't get a YSOD, it is not used whatsoever and will be removed in future versions")]
|
||||
[ConfigurationProperty("DocumentTypeIconList")]
|
||||
internal InnerTextConfigurationElement<IconPickerBehaviour> DocumentTypeIconList
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<IconPickerBehaviour>(
|
||||
(InnerTextConfigurationElement<IconPickerBehaviour>)this["DocumentTypeIconList"],
|
||||
//set the default
|
||||
IconPickerBehaviour.HideFileDuplicates);
|
||||
}
|
||||
get { return GetOptionalTextElement("DocumentTypeIconList", IconPickerBehaviour.HideFileDuplicates); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("disallowedUploadFiles")]
|
||||
internal CommaDelimitedConfigurationElement DisallowedUploadFiles
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalCommaDelimitedConfigurationElement(
|
||||
(CommaDelimitedConfigurationElement)this["disallowedUploadFiles"],
|
||||
//set the default
|
||||
new[] { "ashx", "aspx", "ascx", "config", "cshtml", "vbhtml", "asmx", "air", "axd" });
|
||||
|
||||
}
|
||||
get { return GetOptionalDelimitedElement("disallowedUploadFiles", new[] {"ashx", "aspx", "ascx", "config", "cshtml", "vbhtml", "asmx", "air", "axd"}); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("cloneXmlContent")]
|
||||
internal InnerTextConfigurationElement<bool> CloneXmlContent
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["cloneXmlContent"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("cloneXmlContent", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("GlobalPreviewStorageEnabled")]
|
||||
internal InnerTextConfigurationElement<bool> GlobalPreviewStorageEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["GlobalPreviewStorageEnabled"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("GlobalPreviewStorageEnabled", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("defaultDocumentTypeProperty")]
|
||||
internal InnerTextConfigurationElement<string> DefaultDocumentTypeProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["defaultDocumentTypeProperty"],
|
||||
//set the default
|
||||
"Textstring");
|
||||
}
|
||||
get { return GetOptionalTextElement("defaultDocumentTypeProperty", "Textstring"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("EnableInheritedDocumentTypes")]
|
||||
internal InnerTextConfigurationElement<bool> EnableInheritedDocumentTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>) this["EnableInheritedDocumentTypes"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("EnableInheritedDocumentTypes", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("EnableInheritedMediaTypes")]
|
||||
internal InnerTextConfigurationElement<bool> EnableInheritedMediaTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["EnableInheritedMediaTypes"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("EnableInheritedMediaTypes", true); }
|
||||
}
|
||||
|
||||
string IContentSection.NotificationEmailAddress
|
||||
|
||||
@@ -3,42 +3,24 @@ using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ContentScriptEditorElement : ConfigurationElement
|
||||
internal class ContentScriptEditorElement : UmbracoConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty("scriptFolderPath")]
|
||||
internal InnerTextConfigurationElement<string> ScriptFolderPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["scriptFolderPath"],
|
||||
//set the default
|
||||
"/scripts");
|
||||
}
|
||||
get { return GetOptionalTextElement("scriptFolderPath", "/scripts"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("scriptFileTypes")]
|
||||
internal OptionalCommaDelimitedConfigurationElement ScriptFileTypes
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalCommaDelimitedConfigurationElement(
|
||||
(OptionalCommaDelimitedConfigurationElement)this["scriptFileTypes"],
|
||||
//set the default
|
||||
new[] { "js", "xml" });
|
||||
}
|
||||
get { return GetOptionalDelimitedElement("scriptFileTypes", new[] {"js", "xml"}); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("scriptDisableEditor")]
|
||||
internal InnerTextConfigurationElement<bool> ScriptEditorDisable
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>) this["scriptDisableEditor"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("scriptDisableEditor", false); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-29
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ImagingAutoFillUploadFieldElement : ConfigurationElement, IImagingAutoFillUploadField
|
||||
internal class ImagingAutoFillUploadFieldElement : UmbracoConfigurationElement, IImagingAutoFillUploadField
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow setting internally so we can create a default
|
||||
@@ -17,49 +17,25 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
[ConfigurationProperty("widthFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> WidthFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["widthFieldAlias"],
|
||||
//set the default
|
||||
"umbracoWidth");
|
||||
}
|
||||
get { return GetOptionalTextElement("widthFieldAlias", "umbracoWidth"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("heightFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> HeightFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["heightFieldAlias"],
|
||||
//set the default
|
||||
"umbracoHeight");
|
||||
}
|
||||
get { return GetOptionalTextElement("heightFieldAlias", "umbracoHeight"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("lengthFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> LengthFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["lengthFieldAlias"],
|
||||
//set the default
|
||||
"umbracoBytes");
|
||||
}
|
||||
get { return GetOptionalTextElement("lengthFieldAlias", "umbracoBytes"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("extensionFieldAlias")]
|
||||
internal InnerTextConfigurationElement<string> ExtensionFieldAlias
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["extensionFieldAlias"],
|
||||
//set the default
|
||||
"umbracoExtension");
|
||||
}
|
||||
get { return GetOptionalTextElement("extensionFieldAlias", "umbracoExtension"); }
|
||||
}
|
||||
|
||||
string IImagingAutoFillUploadField.Alias
|
||||
|
||||
@@ -3,67 +3,37 @@ using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class LoggingElement : ConfigurationElement, ILoggingSection
|
||||
internal class LoggingElement : UmbracoConfigurationElement, ILoggingSection
|
||||
{
|
||||
|
||||
[ConfigurationProperty("autoCleanLogs")]
|
||||
internal InnerTextConfigurationElement<bool> AutoCleanLogs
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["autoCleanLogs"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("autoCleanLogs", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("enableLogging")]
|
||||
internal InnerTextConfigurationElement<bool> EnableLogging
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["enableLogging"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("enableLogging", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("enableAsyncLogging")]
|
||||
internal InnerTextConfigurationElement<bool> EnableAsyncLogging
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["enableAsyncLogging"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("enableAsyncLogging", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("cleaningMiliseconds")]
|
||||
internal InnerTextConfigurationElement<int> CleaningMiliseconds
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<int>(
|
||||
(InnerTextConfigurationElement<int>)this["cleaningMiliseconds"],
|
||||
//set the default
|
||||
-1);
|
||||
}
|
||||
get { return GetOptionalTextElement("cleaningMiliseconds", -1); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("maxLogAge")]
|
||||
internal InnerTextConfigurationElement<int> MaxLogAge
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<int>(
|
||||
(InnerTextConfigurationElement<int>)this["maxLogAge"],
|
||||
//set the default
|
||||
-1);
|
||||
}
|
||||
get { return GetOptionalTextElement("maxLogAge", -1); }
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(DisabledLogTypesCollection), AddItemName = "logTypeAlias")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class NotificationsElement : ConfigurationElement
|
||||
internal class NotificationsElement : UmbracoConfigurationElement
|
||||
{
|
||||
[ConfigurationProperty("email")]
|
||||
internal InnerTextConfigurationElement<string> NotificationEmailAddress
|
||||
@@ -13,13 +13,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
[ConfigurationProperty("disableHtmlEmail")]
|
||||
internal InnerTextConfigurationElement<bool> DisableHtmlEmail
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>) this["disableHtmlEmail"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("disableHtmlEmail", false); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,30 +5,18 @@ using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class RequestHandlerElement : ConfigurationElement, IRequestHandlerSection
|
||||
internal class RequestHandlerElement : UmbracoConfigurationElement, IRequestHandlerSection
|
||||
{
|
||||
[ConfigurationProperty("useDomainPrefixes")]
|
||||
public InnerTextConfigurationElement<bool> UseDomainPrefixes
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["useDomainPrefixes"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("useDomainPrefixes", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("addTrailingSlash")]
|
||||
public InnerTextConfigurationElement<bool> AddTrailingSlash
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["addTrailingSlash"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("addTrailingSlash", true); }
|
||||
}
|
||||
|
||||
private UrlReplacingElement _defaultUrlReplacing;
|
||||
|
||||
@@ -2,66 +2,36 @@
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class SecurityElement : ConfigurationElement, ISecuritySection
|
||||
internal class SecurityElement : UmbracoConfigurationElement, ISecuritySection
|
||||
{
|
||||
[ConfigurationProperty("keepUserLoggedIn")]
|
||||
internal InnerTextConfigurationElement<bool> KeepUserLoggedIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["keepUserLoggedIn"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("keepUserLoggedIn", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("hideDisabledUsersInBackoffice")]
|
||||
internal InnerTextConfigurationElement<bool> HideDisabledUsersInBackoffice
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["hideDisabledUsersInBackoffice"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("hideDisabledUsersInBackoffice", false); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("allowPasswordReset")]
|
||||
internal InnerTextConfigurationElement<bool> AllowPasswordReset
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["allowPasswordReset"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("allowPasswordReset", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("authCookieName")]
|
||||
internal InnerTextConfigurationElement<string> AuthCookieName
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["authCookieName"],
|
||||
//set the default
|
||||
Constants.Web.AuthCookieName);
|
||||
}
|
||||
get { return GetOptionalTextElement("authCookieName", Constants.Web.AuthCookieName); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("authCookieDomain")]
|
||||
internal InnerTextConfigurationElement<string> AuthCookieDomain
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<string>(
|
||||
(InnerTextConfigurationElement<string>)this["authCookieDomain"],
|
||||
//set the default
|
||||
null);
|
||||
}
|
||||
get { return GetOptionalTextElement<string>("authCookieDomain", null); }
|
||||
}
|
||||
|
||||
bool ISecuritySection.KeepUserLoggedIn
|
||||
|
||||
@@ -3,55 +3,31 @@ using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class TemplatesElement : ConfigurationElement, ITemplatesSection
|
||||
internal class TemplatesElement : UmbracoConfigurationElement, ITemplatesSection
|
||||
{
|
||||
[ConfigurationProperty("useAspNetMasterPages")]
|
||||
internal InnerTextConfigurationElement<bool> UseAspNetMasterPages
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["useAspNetMasterPages"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("useAspNetMasterPages", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("enableSkinSupport")]
|
||||
internal InnerTextConfigurationElement<bool> EnableSkinSupport
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["enableSkinSupport"],
|
||||
//set the default
|
||||
true);
|
||||
}
|
||||
get { return GetOptionalTextElement("enableSkinSupport", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("defaultRenderingEngine", IsRequired = true)]
|
||||
internal InnerTextConfigurationElement<RenderingEngine> DefaultRenderingEngine
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<RenderingEngine>(
|
||||
(InnerTextConfigurationElement<RenderingEngine>)this["defaultRenderingEngine"],
|
||||
//set the default
|
||||
RenderingEngine.Mvc);
|
||||
}
|
||||
get { return GetOptionalTextElement("defaultRenderingEngine", RenderingEngine.Mvc); }
|
||||
}
|
||||
|
||||
[Obsolete("This has no affect and will be removed in future versions")]
|
||||
[ConfigurationProperty("enableTemplateFolders")]
|
||||
internal InnerTextConfigurationElement<bool> EnableTemplateFolders
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<bool>(
|
||||
(InnerTextConfigurationElement<bool>)this["enableTemplateFolders"],
|
||||
//set the default
|
||||
false);
|
||||
}
|
||||
get { return GetOptionalTextElement("enableTemplateFolders", false); }
|
||||
}
|
||||
|
||||
bool ITemplatesSection.UseAspNetMasterPages
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class with shared helper methods
|
||||
/// </summary>
|
||||
internal class UmbracoConfigurationElement : ConfigurationElement
|
||||
{
|
||||
/// <summary>
|
||||
/// Used so the RawElement types are not re-created every time they are accessed
|
||||
/// </summary>
|
||||
private readonly ConcurrentDictionary<string, RawXmlConfigurationElement> _rawElements = new ConcurrentDictionary<string, RawXmlConfigurationElement>();
|
||||
|
||||
protected OptionalInnerTextConfigurationElement<T> GetOptionalTextElement<T>(string name, T defaultVal)
|
||||
{
|
||||
return (OptionalInnerTextConfigurationElement<T>) _rawElements.GetOrAdd(
|
||||
name,
|
||||
s => new OptionalInnerTextConfigurationElement<T>(
|
||||
(InnerTextConfigurationElement<T>) this[s],
|
||||
//set the default
|
||||
defaultVal));
|
||||
}
|
||||
|
||||
protected OptionalCommaDelimitedConfigurationElement GetOptionalDelimitedElement(string name, string[] defaultVal)
|
||||
{
|
||||
return (OptionalCommaDelimitedConfigurationElement) _rawElements.GetOrAdd(
|
||||
name,
|
||||
s => new OptionalCommaDelimitedConfigurationElement(
|
||||
(CommaDelimitedConfigurationElement) this[name],
|
||||
//set the default
|
||||
defaultVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration
|
||||
/// Gets the version comment (like beta or RC).
|
||||
/// </summary>
|
||||
/// <value>The version comment.</value>
|
||||
public static string CurrentComment { get { return "alpha038"; } }
|
||||
public static string CurrentComment { get { return "alpha056"; } }
|
||||
|
||||
// Get the version of the umbraco.dll by looking at a class in that dll
|
||||
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
|
||||
|
||||
@@ -112,9 +112,15 @@
|
||||
|
||||
public const string Languages = "languages";
|
||||
|
||||
public const string PartialViews = "partialViews";
|
||||
|
||||
public const string PartialViewMacros = "partialViewMacros";
|
||||
|
||||
public const string Scripts = "scripts";
|
||||
|
||||
//TODO: Fill in the rest!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,7 +4,8 @@ using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the identifiers for property-type alias conventions that are used within the Umbraco core.
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class DatabaseProviders
|
||||
{
|
||||
public const string SqlCe = "System.Data.SqlServerCe.4.0";
|
||||
public const string SqlServer = "System.Data.SqlClient";
|
||||
public const string MySql = "MySql.Data.MySqlClient";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
|
||||
public static partial class Constants
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Defines well-known entity types.
|
||||
/// </summary>
|
||||
/// <remarks>Well-known entity types are those that Deploy already knows about,
|
||||
/// but entity types are strings and so can be extended beyond what is defined here.</remarks>
|
||||
public static class DeployEntityType
|
||||
{
|
||||
// guid entity types
|
||||
|
||||
public const string AnyGuid = "any-guid"; // that one is for tests
|
||||
|
||||
public const string Document = "document";
|
||||
public const string Media = "media";
|
||||
public const string Member = "member";
|
||||
|
||||
public const string DictionaryItem = "dictionary-item";
|
||||
public const string Macro = "macro";
|
||||
public const string Template = "template";
|
||||
|
||||
public const string DocumentType = "document-type";
|
||||
public const string DocumentTypeContainer = "document-type-container";
|
||||
public const string MediaType = "media-type";
|
||||
public const string MediaTypeContainer = "media-type-container";
|
||||
public const string DataType = "data-type";
|
||||
public const string DataTypeContainer = "data-type-container";
|
||||
public const string MemberType = "member-type";
|
||||
public const string MemberGroup = "member-group";
|
||||
|
||||
public const string RelationType = "relation-type";
|
||||
|
||||
// forms
|
||||
public const string FormsForm = "forms-form";
|
||||
public const string FormsWorkflow = "forms-workflow";
|
||||
public const string FormsRecord = "forms-record";
|
||||
|
||||
// string entity types
|
||||
|
||||
public const string AnyString = "any-string"; // that one is for tests
|
||||
|
||||
public const string MediaFile = "media-file";
|
||||
public const string TemplateFile = "template-file";
|
||||
public const string Script = "script";
|
||||
public const string Stylesheet = "stylesheet";
|
||||
public const string PartialView = "partial-view";
|
||||
public const string PartialViewMacro = "partial-view-macro";
|
||||
public const string Xslt = "xslt";
|
||||
|
||||
public static string FromUmbracoObjectType(UmbracoObjectTypes umbracoObjectType)
|
||||
{
|
||||
switch (umbracoObjectType)
|
||||
{
|
||||
case UmbracoObjectTypes.Document:
|
||||
return Document;
|
||||
case UmbracoObjectTypes.Media:
|
||||
return Media;
|
||||
case UmbracoObjectTypes.Member:
|
||||
return Member;
|
||||
case UmbracoObjectTypes.Template:
|
||||
return Template;
|
||||
case UmbracoObjectTypes.DocumentType:
|
||||
return DocumentType;
|
||||
case UmbracoObjectTypes.DocumentTypeContainer:
|
||||
return DocumentTypeContainer;
|
||||
case UmbracoObjectTypes.MediaType:
|
||||
return MediaType;
|
||||
case UmbracoObjectTypes.MediaTypeContainer:
|
||||
return MediaTypeContainer;
|
||||
case UmbracoObjectTypes.DataType:
|
||||
return DataType;
|
||||
case UmbracoObjectTypes.DataTypeContainer:
|
||||
return DataTypeContainer;
|
||||
case UmbracoObjectTypes.MemberType:
|
||||
return MemberType;
|
||||
case UmbracoObjectTypes.MemberGroup:
|
||||
return MemberGroup;
|
||||
case UmbracoObjectTypes.Stylesheet:
|
||||
return Stylesheet;
|
||||
case UmbracoObjectTypes.RelationType:
|
||||
return RelationType;
|
||||
case UmbracoObjectTypes.FormsForm:
|
||||
return FormsForm;
|
||||
case UmbracoObjectTypes.FormsWorkflow:
|
||||
return FormsWorkflow;
|
||||
case UmbracoObjectTypes.FormsRecord:
|
||||
return FormsRecord;
|
||||
}
|
||||
throw new NotSupportedException(string.Format("UmbracoObjectType \"{0}\" does not have a matching EntityType.", umbracoObjectType));
|
||||
}
|
||||
|
||||
public static UmbracoObjectTypes ToUmbracoObjectType(string entityType)
|
||||
{
|
||||
switch (entityType)
|
||||
{
|
||||
case Document:
|
||||
return UmbracoObjectTypes.Document;
|
||||
case Media:
|
||||
return UmbracoObjectTypes.Media;
|
||||
case Member:
|
||||
return UmbracoObjectTypes.Member;
|
||||
case Template:
|
||||
return UmbracoObjectTypes.Template;
|
||||
case DocumentType:
|
||||
return UmbracoObjectTypes.DocumentType;
|
||||
case DocumentTypeContainer:
|
||||
return UmbracoObjectTypes.DocumentTypeContainer;
|
||||
case MediaType:
|
||||
return UmbracoObjectTypes.MediaType;
|
||||
case MediaTypeContainer:
|
||||
return UmbracoObjectTypes.MediaTypeContainer;
|
||||
case DataType:
|
||||
return UmbracoObjectTypes.DataType;
|
||||
case DataTypeContainer:
|
||||
return UmbracoObjectTypes.DataTypeContainer;
|
||||
case MemberType:
|
||||
return UmbracoObjectTypes.MemberType;
|
||||
case MemberGroup:
|
||||
return UmbracoObjectTypes.MemberGroup;
|
||||
case Stylesheet:
|
||||
return UmbracoObjectTypes.Stylesheet;
|
||||
case RelationType:
|
||||
return UmbracoObjectTypes.RelationType;
|
||||
case FormsForm:
|
||||
return UmbracoObjectTypes.FormsForm;
|
||||
case FormsWorkflow:
|
||||
return UmbracoObjectTypes.FormsWorkflow;
|
||||
case FormsRecord:
|
||||
return UmbracoObjectTypes.FormsRecord;
|
||||
}
|
||||
throw new NotSupportedException(
|
||||
string.Format("EntityType \"{0}\" does not have a matching UmbracoObjectType.", entityType));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains the valid selector values.
|
||||
/// </summary>
|
||||
public static class DeploySelector
|
||||
{
|
||||
public const string This = "this";
|
||||
public const string ThisAndChildren = "this-and-children";
|
||||
public const string ThisAndDescendants = "this-and-descendants";
|
||||
public const string ChildrenOfThis = "children";
|
||||
public const string DescendantsOfThis = "descendants";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -152,6 +152,46 @@ namespace Umbraco.Core
|
||||
/// Guid for a Lock object.
|
||||
/// </summary>
|
||||
public static readonly Guid LockObjectGuid = new Guid(LockObject);
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a relation type.
|
||||
/// </summary>
|
||||
public const string RelationType = "B1988FAD-8675-4F47-915A-B3A602BC5D8D";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a relation type.
|
||||
/// </summary>
|
||||
public static readonly Guid RelationTypeGuid = new Guid(RelationType);
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a Forms Form.
|
||||
/// </summary>
|
||||
public const string FormsForm = "F5A9F787-6593-46F0-B8FF-BFD9BCA9F6BB";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a Forms Form.
|
||||
/// </summary>
|
||||
public static readonly Guid FormsFormGuid = new Guid(FormsForm);
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a Forms Workflow.
|
||||
/// </summary>
|
||||
public const string FormsWorkflow = "42D7BF9B-A362-4FEE-B45A-674D5C064B70";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a Forms Workflow.
|
||||
/// </summary>
|
||||
public static readonly Guid FormsWorkflowGuid = new Guid(FormsWorkflow);
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a Forms Record.
|
||||
/// </summary>
|
||||
public const string FormsRecord = "CFED6CE4-9359-443E-9977-9956FEB1D867";
|
||||
|
||||
/// <summary>
|
||||
/// Guid for a Forms Record.
|
||||
/// </summary>
|
||||
public static readonly Guid FormsRecordGuid = new Guid(FormsRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class Security
|
||||
{
|
||||
|
||||
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
|
||||
public const string BackOfficeExternalAuthenticationType = "UmbracoExternalCookie";
|
||||
public const string BackOfficeExternalCookieName = "UMB_EXTLOGIN";
|
||||
public const string BackOfficeTokenAuthenticationType = "UmbracoBackOfficeToken";
|
||||
public const string BackOfficeTwoFactorAuthenticationType = "UmbracoTwoFactorCookie";
|
||||
|
||||
/// <summary>
|
||||
/// The prefix used for external identity providers for their authentication type
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default we don't want to interfere with front-end external providers and their default setup, for back office the
|
||||
/// providers need to be setup differently and each auth type for the back office will be prefixed with this value
|
||||
/// </remarks>
|
||||
public const string BackOfficeExternalAuthenticationTypePrefix = "Umbraco.";
|
||||
|
||||
public const string StartContentNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startcontentnode";
|
||||
public const string StartMediaNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startmedianode";
|
||||
public const string AllowedApplicationsClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/allowedapp";
|
||||
public const string SessionIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/sessionid";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,13 +25,10 @@
|
||||
public const int DefaultContentListViewDataTypeId = -95;
|
||||
public const int DefaultMediaListViewDataTypeId = -96;
|
||||
public const int DefaultMembersListViewDataTypeId = -97;
|
||||
}
|
||||
|
||||
public static class DatabaseProviders
|
||||
{
|
||||
public const string SqlCe = "System.Data.SqlServerCe.4.0";
|
||||
public const string SqlServer = "System.Data.SqlClient";
|
||||
public const string MySql = "MySql.Data.MySqlClient";
|
||||
public const string UmbracoConnectionName = "umbracoDbDSN";
|
||||
public const string UmbracoMigrationName = "Umbraco";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -29,30 +29,6 @@ namespace Umbraco.Core
|
||||
public const string AuthCookieName = "UMB_UCONTEXT";
|
||||
|
||||
}
|
||||
|
||||
public static class Security
|
||||
{
|
||||
|
||||
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
|
||||
public const string BackOfficeExternalAuthenticationType = "UmbracoExternalCookie";
|
||||
public const string BackOfficeExternalCookieName = "UMB_EXTLOGIN";
|
||||
public const string BackOfficeTokenAuthenticationType = "UmbracoBackOfficeToken";
|
||||
public const string BackOfficeTwoFactorAuthenticationType = "UmbracoTwoFactorCookie";
|
||||
|
||||
/// <summary>
|
||||
/// The prefix used for external identity providers for their authentication type
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default we don't want to interfere with front-end external providers and their default setup, for back office the
|
||||
/// providers need to be setup differently and each auth type for the back office will be prefixed with this value
|
||||
/// </remarks>
|
||||
public const string BackOfficeExternalAuthenticationTypePrefix = "Umbraco.";
|
||||
|
||||
public const string StartContentNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startcontentnode";
|
||||
public const string StartMediaNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startmedianode";
|
||||
public const string AllowedApplicationsClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/allowedapp";
|
||||
public const string SessionIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/sessionid";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace Umbraco.Core
|
||||
LegacyParameterEditorAliasConverter.CreateMappingsForCoreEditors();
|
||||
|
||||
//create database and service contexts for the app context
|
||||
var dbFactory = new DefaultDatabaseFactory(GlobalSettings.UmbracoConnectionName, ProfilingLogger.Logger);
|
||||
var dbFactory = new DefaultDatabaseFactory(Constants.System.UmbracoConnectionName, ProfilingLogger.Logger);
|
||||
Database.Mapper = new PetaPocoMapper();
|
||||
|
||||
var dbContext = new DatabaseContext(
|
||||
@@ -415,7 +415,7 @@ namespace Umbraco.Core
|
||||
|
||||
if (currentTry == 5)
|
||||
{
|
||||
throw new UmbracoStartupFailedException("Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database.");
|
||||
throw new UmbracoStartupFailedException("Umbraco cannot start. A connection string is configured but Umbraco cannot connect to the database.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -195,14 +195,14 @@ namespace Umbraco.Core
|
||||
return _providerName;
|
||||
|
||||
_providerName = Constants.DatabaseProviders.SqlServer;
|
||||
if (ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName] != null)
|
||||
if (ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName] != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName) == false)
|
||||
_providerName = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName;
|
||||
if (string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName) == false)
|
||||
_providerName = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("Can't find a connection string with the name '" + GlobalSettings.UmbracoConnectionName + "'");
|
||||
throw new InvalidOperationException("Can't find a connection string with the name '" + Constants.System.UmbracoConnectionName + "'");
|
||||
}
|
||||
return _providerName;
|
||||
}
|
||||
@@ -241,15 +241,10 @@ namespace Umbraco.Core
|
||||
var path = Path.Combine(GlobalSettings.FullpathToRoot, "App_Data", "Umbraco.sdf");
|
||||
if (File.Exists(path) == false)
|
||||
{
|
||||
var engine = new SqlCeEngine(connectionString);
|
||||
engine.CreateDatabase();
|
||||
|
||||
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
|
||||
// since it's been like this for quite some time
|
||||
//using (var engine = new SqlCeEngine(connectionString))
|
||||
//{
|
||||
// engine.CreateDatabase();
|
||||
//}
|
||||
using (var engine = new SqlCeEngine(connectionString))
|
||||
{
|
||||
engine.CreateDatabase();
|
||||
}
|
||||
}
|
||||
|
||||
Initialize(providerName);
|
||||
@@ -388,9 +383,9 @@ namespace Umbraco.Core
|
||||
{
|
||||
//Set the connection string for the new datalayer
|
||||
var connectionStringSettings = string.IsNullOrEmpty(providerName)
|
||||
? new ConnectionStringSettings(GlobalSettings.UmbracoConnectionName,
|
||||
? new ConnectionStringSettings(Constants.System.UmbracoConnectionName,
|
||||
connectionString)
|
||||
: new ConnectionStringSettings(GlobalSettings.UmbracoConnectionName,
|
||||
: new ConnectionStringSettings(Constants.System.UmbracoConnectionName,
|
||||
connectionString, providerName);
|
||||
|
||||
_connectionString = connectionString;
|
||||
@@ -401,10 +396,10 @@ namespace Umbraco.Core
|
||||
var connectionstrings = xml.Root.DescendantsAndSelf("connectionStrings").Single();
|
||||
|
||||
// Update connectionString if it exists, or else create a new appSetting for the given key and value
|
||||
var setting = connectionstrings.Descendants("add").FirstOrDefault(s => s.Attribute("name").Value == GlobalSettings.UmbracoConnectionName);
|
||||
var setting = connectionstrings.Descendants("add").FirstOrDefault(s => s.Attribute("name").Value == Constants.System.UmbracoConnectionName);
|
||||
if (setting == null)
|
||||
connectionstrings.Add(new XElement("add",
|
||||
new XAttribute("name", GlobalSettings.UmbracoConnectionName),
|
||||
new XAttribute("name", Constants.System.UmbracoConnectionName),
|
||||
new XAttribute("connectionString", connectionStringSettings),
|
||||
new XAttribute("providerName", providerName)));
|
||||
else
|
||||
@@ -429,23 +424,23 @@ namespace Umbraco.Core
|
||||
/// </remarks>
|
||||
internal void Initialize()
|
||||
{
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
|
||||
var databaseSettings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName];
|
||||
if (databaseSettings != null && string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) == false && string.IsNullOrWhiteSpace(databaseSettings.ProviderName) == false)
|
||||
{
|
||||
var providerName = Constants.DatabaseProviders.SqlServer;
|
||||
string connString = null;
|
||||
if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName))
|
||||
if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName))
|
||||
{
|
||||
providerName = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName;
|
||||
connString = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ConnectionString;
|
||||
providerName = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName;
|
||||
connString = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ConnectionString;
|
||||
}
|
||||
Initialize(providerName, connString);
|
||||
|
||||
}
|
||||
else if (ConfigurationManager.AppSettings.ContainsKey(GlobalSettings.UmbracoConnectionName) && string.IsNullOrEmpty(ConfigurationManager.AppSettings[GlobalSettings.UmbracoConnectionName]) == false)
|
||||
else if (ConfigurationManager.AppSettings.ContainsKey(Constants.System.UmbracoConnectionName) && string.IsNullOrEmpty(ConfigurationManager.AppSettings[Constants.System.UmbracoConnectionName]) == false)
|
||||
{
|
||||
//A valid connectionstring does not exist, but the legacy appSettings key was found, so we'll reconfigure the conn.string.
|
||||
var legacyConnString = ConfigurationManager.AppSettings[GlobalSettings.UmbracoConnectionName];
|
||||
var legacyConnString = ConfigurationManager.AppSettings[Constants.System.UmbracoConnectionName];
|
||||
if (legacyConnString.ToLowerInvariant().Contains("sqlce4umbraco"))
|
||||
{
|
||||
ConfigureEmbeddedDatabaseConnection();
|
||||
@@ -476,7 +471,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
//Remove the legacy connection string, so we don't end up in a loop if something goes wrong.
|
||||
GlobalSettings.RemoveSetting(GlobalSettings.UmbracoConnectionName);
|
||||
GlobalSettings.RemoveSetting(Constants.System.UmbracoConnectionName);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -672,7 +667,7 @@ namespace Umbraco.Core
|
||||
|
||||
//DO the upgrade!
|
||||
|
||||
var runner = new MigrationRunner(migrationEntryService, _logger, currentInstalledVersion, UmbracoVersion.GetSemanticVersion(), GlobalSettings.UmbracoMigrationName);
|
||||
var runner = new MigrationRunner(migrationEntryService, _logger, currentInstalledVersion, UmbracoVersion.GetSemanticVersion(), Constants.System.UmbracoMigrationName);
|
||||
|
||||
var upgraded = runner.Execute(database, true);
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a base class to all artifacts.
|
||||
/// </summary>
|
||||
public abstract class ArtifactBase<TUdi> : IArtifact
|
||||
where TUdi : Udi
|
||||
{
|
||||
protected ArtifactBase(TUdi udi, IEnumerable<ArtifactDependency> dependencies = null)
|
||||
{
|
||||
if (udi == null)
|
||||
throw new ArgumentNullException("udi");
|
||||
Udi = udi;
|
||||
|
||||
Dependencies = dependencies ?? Enumerable.Empty<ArtifactDependency>();
|
||||
_checksum = new Lazy<string>(GetChecksum);
|
||||
}
|
||||
|
||||
private readonly Lazy<string> _checksum;
|
||||
private IEnumerable<ArtifactDependency> _dependencies;
|
||||
|
||||
protected abstract string GetChecksum();
|
||||
|
||||
#region Abstract implementation of IArtifactSignature
|
||||
|
||||
Udi IArtifactSignature.Udi
|
||||
{
|
||||
get { return Udi; }
|
||||
}
|
||||
|
||||
public TUdi Udi { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string Checksum
|
||||
{
|
||||
get { return _checksum.Value; }
|
||||
}
|
||||
|
||||
public IEnumerable<ArtifactDependency> Dependencies
|
||||
{
|
||||
get { return _dependencies; }
|
||||
set { _dependencies = value.OrderBy(x => x.Udi); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an artifact dependency.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Dependencies have an order property which indicates whether it must be respected when ordering artifacts.</para>
|
||||
/// <para>Dependencies have a mode which can be <c>Match</c> or <c>Exist</c> depending on whether the checksum should match.</para>
|
||||
/// </remarks>
|
||||
public class ArtifactDependency
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the ArtifactDependency class with an entity identifier and a mode.
|
||||
/// </summary>
|
||||
/// <param name="udi">The entity identifier of the artifact that is a dependency.</param>
|
||||
/// <param name="ordering">A value indicating whether the dependency is ordering.</param>
|
||||
/// <param name="mode">The dependency mode.</param>
|
||||
public ArtifactDependency(Udi udi, bool ordering, ArtifactDependencyMode mode)
|
||||
{
|
||||
Udi = udi;
|
||||
Ordering = ordering;
|
||||
Mode = mode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the entity id of the artifact that is a dependency.
|
||||
/// </summary>
|
||||
public Udi Udi { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the dependency is ordering.
|
||||
/// </summary>
|
||||
public bool Ordering { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the dependency mode.
|
||||
/// </summary>
|
||||
public ArtifactDependencyMode Mode { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of distinct <see cref="ArtifactDependency"/>.
|
||||
/// </summary>
|
||||
/// <remarks>The collection cannot contain duplicates and modes are properly managed.</remarks>
|
||||
public class ArtifactDependencyCollection : ICollection<ArtifactDependency>
|
||||
{
|
||||
private readonly Dictionary<Udi, ArtifactDependency> _dependencies
|
||||
= new Dictionary<Udi, ArtifactDependency>();
|
||||
|
||||
public IEnumerator<ArtifactDependency> GetEnumerator()
|
||||
{
|
||||
return _dependencies.Values.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
|
||||
public void Add(ArtifactDependency item)
|
||||
{
|
||||
if (_dependencies.ContainsKey(item.Udi))
|
||||
{
|
||||
var exist = _dependencies[item.Udi];
|
||||
if (item.Mode == ArtifactDependencyMode.Exist || item.Mode == exist.Mode)
|
||||
return;
|
||||
}
|
||||
|
||||
_dependencies[item.Udi] = item;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_dependencies.Clear();
|
||||
}
|
||||
|
||||
public bool Contains(ArtifactDependency item)
|
||||
{
|
||||
return _dependencies.ContainsKey(item.Udi) &&
|
||||
(_dependencies[item.Udi].Mode == item.Mode || _dependencies[item.Udi].Mode == ArtifactDependencyMode.Match);
|
||||
}
|
||||
|
||||
public void CopyTo(ArtifactDependency[] array, int arrayIndex)
|
||||
{
|
||||
_dependencies.Values.CopyTo(array, arrayIndex);
|
||||
}
|
||||
|
||||
public bool Remove(ArtifactDependency item)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get { return _dependencies.Count; }
|
||||
}
|
||||
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the mode of the dependency.
|
||||
/// </summary>
|
||||
public enum ArtifactDependencyMode
|
||||
{
|
||||
/// <summary>
|
||||
/// The dependency must match exactly.
|
||||
/// </summary>
|
||||
Match,
|
||||
|
||||
/// <summary>
|
||||
/// The dependency must exist.
|
||||
/// </summary>
|
||||
Exist
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represent the state of an artifact being deployed.
|
||||
/// </summary>
|
||||
public abstract class ArtifactDeployState
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="ArtifactDeployState"/> class from an artifact and an entity.
|
||||
/// </summary>
|
||||
/// <typeparam name="TArtifact">The type of the artifact.</typeparam>
|
||||
/// <typeparam name="TEntity">The type of the entity.</typeparam>
|
||||
/// <param name="art">The artifact.</param>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="connector">The service connector deploying the artifact.</param>
|
||||
/// <param name="nextPass">The next pass number.</param>
|
||||
/// <returns>A deploying artifact.</returns>
|
||||
public static ArtifactDeployState<TArtifact, TEntity> Create<TArtifact, TEntity>(TArtifact art, TEntity entity, IServiceConnector connector, int nextPass)
|
||||
where TArtifact : IArtifact
|
||||
{
|
||||
return new ArtifactDeployState<TArtifact, TEntity>(art, entity, connector, nextPass);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the artifact.
|
||||
/// </summary>
|
||||
public IArtifact Artifact
|
||||
{
|
||||
get { return GetArtifactAsIArtifact(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the artifact as an <see cref="IArtifact"/>.
|
||||
/// </summary>
|
||||
/// <returns>The artifact, as an <see cref="IArtifact"/>.</returns>
|
||||
/// <remarks>This is because classes that inherit from this class cannot override the Artifact property
|
||||
/// with a property that specializes the return type, and so they need to 'new' the property.</remarks>
|
||||
protected abstract IArtifact GetArtifactAsIArtifact();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the service connector in charge of deploying the artifact.
|
||||
/// </summary>
|
||||
public IServiceConnector Connector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the next pass number.
|
||||
/// </summary>
|
||||
public int NextPass { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represent the state of an artifact being deployed.
|
||||
/// </summary>
|
||||
/// <typeparam name="TArtifact">The type of the artifact.</typeparam>
|
||||
/// <typeparam name="TEntity">The type of the entity.</typeparam>
|
||||
public class ArtifactDeployState<TArtifact, TEntity> : ArtifactDeployState
|
||||
where TArtifact : IArtifact
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArtifactDeployState{TArtifact,TEntity}"/> class.
|
||||
/// </summary>
|
||||
public ArtifactDeployState()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ArtifactDeployState{TArtifact,TEntity}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="art">The artifact.</param>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="connector">The service connector deploying the artifact.</param>
|
||||
/// <param name="nextPass">The next pass number.</param>
|
||||
public ArtifactDeployState(TArtifact art, TEntity entity, IServiceConnector connector, int nextPass)
|
||||
{
|
||||
Artifact = art;
|
||||
Entity = entity;
|
||||
Connector = connector;
|
||||
NextPass = nextPass;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the artifact.
|
||||
/// </summary>
|
||||
public new TArtifact Artifact { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the entity.
|
||||
/// </summary>
|
||||
public TEntity Entity { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected sealed override IArtifact GetArtifactAsIArtifact()
|
||||
{
|
||||
return Artifact;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
public sealed class ArtifactSignature : IArtifactSignature
|
||||
{
|
||||
public ArtifactSignature(Udi udi, string checksum, IEnumerable<ArtifactDependency> dependencies = null)
|
||||
{
|
||||
Udi = udi;
|
||||
Checksum = checksum;
|
||||
Dependencies = dependencies ?? Enumerable.Empty<ArtifactDependency>();
|
||||
}
|
||||
|
||||
public Udi Udi { get; private set; }
|
||||
|
||||
public string Checksum { get; private set; }
|
||||
|
||||
public IEnumerable<ArtifactDependency> Dependencies { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
public class Difference
|
||||
{
|
||||
public Difference(string title, string text = null, string category = null)
|
||||
{
|
||||
Title = title;
|
||||
Text = text;
|
||||
Category = category;
|
||||
}
|
||||
|
||||
public string Title { get; set; }
|
||||
public string Text { get; set; }
|
||||
public string Category { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var s = Title;
|
||||
if (!string.IsNullOrWhiteSpace(Category)) s += string.Format("[{0}]", Category);
|
||||
if (!string.IsNullOrWhiteSpace(Text))
|
||||
{
|
||||
if (s.Length > 0) s += ":";
|
||||
s += Text;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
public enum Direction
|
||||
{
|
||||
ToArtifact,
|
||||
FromArtifact
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an artifact ie an object that can be transfered between environments.
|
||||
/// </summary>
|
||||
public interface IArtifact : IArtifactSignature
|
||||
{ }
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the signature of an artifact.
|
||||
/// </summary>
|
||||
public interface IArtifactSignature
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the entity unique identifier of this artifact.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The project identifier is independent from the state of the artifact, its data
|
||||
/// values, dependencies, anything. It never changes and fully identifies the artifact.</para>
|
||||
/// <para>What an entity uses as a unique identifier will influence what we can transfer
|
||||
/// between environments. Eg content type "Foo" on one environment is not necessarily the
|
||||
/// same as "Foo" on another environment, if guids are used as unique identifiers. What is
|
||||
/// used should be documented for each entity, along with the consequences of the choice.</para>
|
||||
/// </remarks>
|
||||
Udi Udi { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the checksum of this artifact.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The checksum depends on the artifact's properties, and on the identifiers of all its dependencies,
|
||||
/// but not on their checksums. So the checksum changes when any of the artifact's properties changes,
|
||||
/// or when the list of dependencies changes. But not if one of these dependencies change.</para>
|
||||
/// <para>It is assumed that checksum collisions cannot happen ie that no two different artifact's
|
||||
/// states will ever produce the same checksum, so that if two artifacts have the same checksum then
|
||||
/// they are identical.</para>
|
||||
/// </remarks>
|
||||
string Checksum { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the dependencies of this artifact.
|
||||
/// </summary>
|
||||
IEnumerable<ArtifactDependency> Dependencies { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a deployment context.
|
||||
/// </summary>
|
||||
public interface IDeployContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the unique identifier of the deployment.
|
||||
/// </summary>
|
||||
Guid SessionId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file source.
|
||||
/// </summary>
|
||||
/// <remarks>The file source is used to obtain files from the source environment.</remarks>
|
||||
IFileSource FileSource { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the next number in a numerical sequence.
|
||||
/// </summary>
|
||||
/// <returns>The next sequence number.</returns>
|
||||
/// <remarks>Can be used to uniquely number things during a deployment.</remarks>
|
||||
int NextSeq();
|
||||
|
||||
/// <summary>
|
||||
/// Gets items.
|
||||
/// </summary>
|
||||
IDictionary<string, object> Items { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets item.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the item.</typeparam>
|
||||
/// <param name="key">The key of the item.</param>
|
||||
/// <returns>The item with the specified key and type, if any, else null.</returns>
|
||||
T Item<T>(string key) where T : class;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a file source, ie a mean for a target environment involved in a
|
||||
/// deployment to obtain the content of files being deployed.
|
||||
/// </summary>
|
||||
public interface IFileSource
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the content of a file as a stream.
|
||||
/// </summary>
|
||||
/// <param name="udi">A file entity identifier.</param>
|
||||
/// <returns>A stream with read access to the file content.</returns>
|
||||
/// <remarks>
|
||||
/// <para>Returns null if no content could be read.</para>
|
||||
/// <para>The caller should ensure that the stream is properly closed/disposed.</para>
|
||||
/// </remarks>
|
||||
Stream GetFileStream(StringUdi udi);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content of a file as a stream.
|
||||
/// </summary>
|
||||
/// <param name="udi">A file entity identifier.</param>
|
||||
/// <param name="token">A cancellation token.</param>
|
||||
/// <returns>A stream with read access to the file content.</returns>
|
||||
/// <remarks>
|
||||
/// <para>Returns null if no content could be read.</para>
|
||||
/// <para>The caller should ensure that the stream is properly closed/disposed.</para>
|
||||
/// </remarks>
|
||||
Task<Stream> GetFileStreamAsync(StringUdi udi, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content of a file as a string.
|
||||
/// </summary>
|
||||
/// <param name="udi">A file entity identifier.</param>
|
||||
/// <returns>A string containing the file content.</returns>
|
||||
/// <remarks>Returns null if no content could be read.</remarks>
|
||||
string GetFileContent(StringUdi udi);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content of a file as a string.
|
||||
/// </summary>
|
||||
/// <param name="udi">A file entity identifier.</param>
|
||||
/// <param name="token">A cancellation token.</param>
|
||||
/// <returns>A string containing the file content.</returns>
|
||||
/// <remarks>Returns null if no content could be read.</remarks>
|
||||
Task<string> GetFileContentAsync(StringUdi udi, CancellationToken token);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length of a file.
|
||||
/// </summary>
|
||||
/// <param name="udi">A file entity identifier.</param>
|
||||
/// <returns>The length of the file, or -1 if the file does not exist.</returns>
|
||||
long GetFileLength(StringUdi udi);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the length of a file.
|
||||
/// </summary>
|
||||
/// <param name="udi">A file entity identifier.</param>
|
||||
/// <param name="token">A cancellation token.</param>
|
||||
/// <returns>The length of the file, or -1 if the file does not exist.</returns>
|
||||
Task<long> GetFileLengthAsync(StringUdi udi, CancellationToken token);
|
||||
|
||||
// fixme - doc
|
||||
void GetFiles(IEnumerable<StringUdi> udis, IFileStore fileStore);
|
||||
|
||||
Task GetFilesAsync(IEnumerable<StringUdi> udis, IFileStore fileStore, CancellationToken token);
|
||||
|
||||
///// <summary>
|
||||
///// Gets the content of a file as a bytes array.
|
||||
///// </summary>
|
||||
///// <param name="Udi">A file entity identifier.</param>
|
||||
///// <returns>A byte array containing the file content.</returns>
|
||||
//byte[] GetFileBytes(StringUdi Udi);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
public interface IFileStore
|
||||
{
|
||||
void SaveStream(StringUdi udi, Stream stream);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines methods that can convert a grid cell value to / from an environment-agnostic string.
|
||||
/// </summary>
|
||||
/// <remarks>Grid cell values may contain values such as content identifiers, that would be local
|
||||
/// to one environment, and need to be converted in order to be deployed.</remarks>
|
||||
public interface IGridCellValueConnector
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the connector supports a specified grid editor view.
|
||||
/// </summary>
|
||||
/// <param name="view">The grid editor view. It needs to be the view instead of the alias as the view is really what identifies what kind of connector should be used. Alias can be anything and you can have multiple different aliases using the same kind of view.</param>
|
||||
/// <remarks>A value indicating whether the connector supports the grid editor view.</remarks>
|
||||
/// <remarks>Note that <paramref name="view" /> can be string.Empty to indicate the "default" connector.</remarks>
|
||||
bool IsConnector(string view);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value to be deployed from the control value as a string.
|
||||
/// </summary>
|
||||
/// <param name="gridControl">The control containing the value.</param>
|
||||
/// <param name="property">The property where the control is located. Do not modify - only used for context</param>
|
||||
/// <param name="dependencies">The dependencies of the property.</param>
|
||||
/// <returns>The grid cell value to be deployed.</returns>
|
||||
/// <remarks>Note that </remarks>
|
||||
string GetValue(GridValue.GridControl gridControl, Property property, ICollection<ArtifactDependency> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Allows you to modify the value of a control being deployed.
|
||||
/// </summary>
|
||||
/// <param name="gridControl">The control being deployed.</param>
|
||||
/// <param name="property">The property where the <paramref name="gridControl"/> is located. Do not modify - only used for context.</param>
|
||||
/// <remarks>Follows the pattern of the property value connectors (<see cref="IValueConnector"/>). The SetValue method is used to modify the value of the <paramref name="gridControl"/>.</remarks>
|
||||
/// <remarks>Note that only the <paramref name="gridControl"/> value should be modified - not the <paramref name="property"/>.</remarks>
|
||||
/// <remarks>The <paramref name="property"/> should only be used to assist with context data relevant when setting the <paramref name="gridControl"/> value.</remarks>
|
||||
void SetValue(GridValue.GridControl gridControl, Property property);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides methods to parse image tag sources in property values.
|
||||
/// </summary>
|
||||
public interface IImageSourceParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses an Umbraco property value and produces an artifact property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The property value.</param>
|
||||
/// <param name="dependencies">A list of dependencies.</param>
|
||||
/// <returns>The parsed value.</returns>
|
||||
/// <remarks>Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies.</remarks>
|
||||
string ToArtifact(string value, ICollection<Udi> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Parses an artifact property value and produces an Umbraco property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The artifact property value.</param>
|
||||
/// <returns>The parsed value.</returns>
|
||||
/// <remarks>Turns umb://media/... into /media/....</remarks>
|
||||
string FromArtifact(string value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides methods to parse local link tags in property values.
|
||||
/// </summary>
|
||||
public interface ILocalLinkParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses an Umbraco property value and produces an artifact property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The property value.</param>
|
||||
/// <param name="dependencies">A list of dependencies.</param>
|
||||
/// <returns>The parsed value.</returns>
|
||||
/// <remarks>Turns {{localLink:1234}} into {{localLink:umb://{type}/{id}}} and adds the corresponding udi to the dependencies.</remarks>
|
||||
string ToArtifact(string value, ICollection<Udi> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Parses an artifact property value and produces an Umbraco property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The artifact property value.</param>
|
||||
/// <returns>The parsed value.</returns>
|
||||
/// <remarks>Turns {{localLink:umb://{type}/{id}}} into {{localLink:1234}}.</remarks>
|
||||
string FromArtifact(string value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
public interface IMacroParser
|
||||
{
|
||||
/// <summary>
|
||||
/// Parses an Umbraco property value and produces an artifact property value.
|
||||
/// </summary>
|
||||
/// <param name="value">Property value.</param>
|
||||
/// <param name="dependencies">A list of dependencies.</param>
|
||||
/// <returns>Parsed value.</returns>
|
||||
string ToArtifact(string value, ICollection<Udi> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Parses an artifact property value and produces an Umbraco property value.
|
||||
/// </summary>
|
||||
/// <param name="value">Artifact property value.</param>
|
||||
/// <returns>Parsed value.</returns>
|
||||
string FromArtifact(string value);
|
||||
|
||||
/// <summary>
|
||||
/// Tries to replace the value of the attribute/parameter with a value containing a converted identifier.
|
||||
/// </summary>
|
||||
/// <param name="value">Value to attempt to convert</param>
|
||||
/// <param name="editorAlias">Alias of the editor used for the parameter</param>
|
||||
/// <param name="dependencies">Collection to add dependencies to when performing ToArtifact</param>
|
||||
/// <param name="direction">Indicates which action is being performed (to or from artifact)</param>
|
||||
/// <returns>Value with converted identifiers</returns>
|
||||
string ReplaceAttributeValue(string value, string editorAlias, ICollection<Udi> dependencies, Direction direction);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines methods that can convert a preValue to / from an environment-agnostic string.
|
||||
/// </summary>
|
||||
/// <remarks>PreValues may contain values such as content identifiers, that would be local
|
||||
/// to one environment, and need to be converted in order to be deployed.</remarks>
|
||||
public interface IPreValueConnector
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the property editor aliases that the value converter supports by default.
|
||||
/// </summary>
|
||||
IEnumerable<string> PropertyEditorAliases { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the environment-agnostic preValues corresponding to environment-specific preValues.
|
||||
/// </summary>
|
||||
/// <param name="preValues">The environment-specific preValues.</param>
|
||||
/// <param name="dependencies">The dependencies.</param>
|
||||
/// <returns></returns>
|
||||
IDictionary<string, string> ConvertToDeploy(IDictionary<string, string> preValues, ICollection<ArtifactDependency> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the environment-specific preValues corresponding to environment-agnostic preValues.
|
||||
/// </summary>
|
||||
/// <param name="preValues">The environment-agnostic preValues.</param>
|
||||
/// <returns></returns>
|
||||
IDictionary<string, string> ConvertToLocalEnvironment(IDictionary<string, string> preValues);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
public interface IPrettyArtifact
|
||||
{
|
||||
string Name { get; }
|
||||
string Alias { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Umbraco.Core;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Connects to an Umbraco service.
|
||||
/// </summary>
|
||||
public interface IServiceConnector
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="udi">The entity identifier of the artifact.</param>
|
||||
/// <returns>The corresponding artifact, or null.</returns>
|
||||
IArtifact GetArtifact(Udi udi);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an artifact.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <returns>The corresponding artifact.</returns>
|
||||
IArtifact GetArtifact(object entity);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes processing for an artifact.
|
||||
/// </summary>
|
||||
/// <param name="art">The artifact.</param>
|
||||
/// <param name="context">The deploy context.</param>
|
||||
/// <returns>The mapped artifact.</returns>
|
||||
ArtifactDeployState ProcessInit(IArtifact art, IDeployContext context);
|
||||
|
||||
/// <summary>
|
||||
/// Processes an artifact.
|
||||
/// </summary>
|
||||
/// <param name="dart">The mapped artifact.</param>
|
||||
/// <param name="context">The deploy context.</param>
|
||||
/// <param name="pass">The processing pass number.</param>
|
||||
void Process(ArtifactDeployState dart, IDeployContext context, int pass);
|
||||
|
||||
/// <summary>
|
||||
/// Explodes a range into udis.
|
||||
/// </summary>
|
||||
/// <param name="range">The range.</param>
|
||||
/// <param name="udis">The list of udis where to add the new udis.</param>
|
||||
/// <remarks>Also, it's cool to have a method named Explode. Kaboom!</remarks>
|
||||
void Explode(UdiRange range, List<Udi> udis);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a named range for a specified udi and selector.
|
||||
/// </summary>
|
||||
/// <param name="udi">The udi.</param>
|
||||
/// <param name="selector">The selector.</param>
|
||||
/// <returns>The named range for the specified udi and selector.</returns>
|
||||
NamedUdiRange GetRange(Udi udi, string selector);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a named range for specified entity type, identifier and selector.
|
||||
/// </summary>
|
||||
/// <param name="entityType">The entity type.</param>
|
||||
/// <param name="sid">The identifier.</param>
|
||||
/// <param name="selector">The selector.</param>
|
||||
/// <returns>The named range for the specified entity type, identifier and selector.</returns>
|
||||
/// <remarks>
|
||||
/// <para>This is temporary. At least we thought it would be, in sept. 2016. What day is it now?</para>
|
||||
/// <para>At the moment our UI has a hard time returning proper udis, mainly because Core's tree do
|
||||
/// not manage guids but only ints... so we have to provide a way to support it. The string id here
|
||||
/// can be either a real string (for string udis) or an "integer as a string", using the value "-1" to
|
||||
/// indicate the "root" i.e. an open udi.</para>
|
||||
/// </remarks>
|
||||
NamedUdiRange GetRange(string entityType, string sid, string selector);
|
||||
|
||||
/// <summary>
|
||||
/// Compares two artifacts.
|
||||
/// </summary>
|
||||
/// <param name="art1">The first artifact.</param>
|
||||
/// <param name="art2">The second artifact.</param>
|
||||
/// <param name="differences">A collection of differences to append to, if not null.</param>
|
||||
/// <returns>A boolean value indicating whether the artifacts are identical.</returns>
|
||||
/// <remarks>ServiceConnectorBase{TArtifact} provides a very basic default implementation.</remarks>
|
||||
bool Compare(IArtifact art1, IArtifact art2, ICollection<Difference> differences = null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Deploy
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines methods that can convert a property value to / from an environment-agnostic string.
|
||||
/// </summary>
|
||||
/// <remarks>Property values may contain values such as content identifiers, that would be local
|
||||
/// to one environment, and need to be converted in order to be deployed. Connectors also deal
|
||||
/// with serializing to / from string.</remarks>
|
||||
public interface IValueConnector
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the property editor aliases that the value converter supports by default.
|
||||
/// </summary>
|
||||
IEnumerable<string> PropertyEditorAliases { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the deploy property corresponding to a content property.
|
||||
/// </summary>
|
||||
/// <param name="property">The content property.</param>
|
||||
/// <param name="dependencies">The content dependencies.</param>
|
||||
/// <returns>The deploy property value.</returns>
|
||||
string GetValue(Property property, ICollection<ArtifactDependency> dependencies);
|
||||
|
||||
/// <summary>
|
||||
/// Sets a content property value using a deploy property.
|
||||
/// </summary>
|
||||
/// <param name="content">The content item.</param>
|
||||
/// <param name="alias">The property alias.</param>
|
||||
/// <param name="value">The deploy property value.</param>
|
||||
void SetValue(IContentBase content, string alias, string value);
|
||||
}
|
||||
}
|
||||
@@ -31,13 +31,13 @@ namespace Umbraco.Core.Events
|
||||
[Obsolete("Use constructor accepting a product name instead.")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion, bool canCancel)
|
||||
: this(eventObject, null, configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName, canCancel)
|
||||
: this(eventObject, null, configuredVersion, targetVersion, Constants.System.UmbracoMigrationName, canCancel)
|
||||
{ }
|
||||
|
||||
[Obsolete("Use constructor accepting SemVersion instances and a product name instead.")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public MigrationEventArgs(IList<IMigration> eventObject, Version configuredVersion, Version targetVersion, bool canCancel)
|
||||
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), GlobalSettings.UmbracoMigrationName, canCancel)
|
||||
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, canCancel)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
@@ -74,7 +74,7 @@ namespace Umbraco.Core.Events
|
||||
MigrationContext = migrationContext;
|
||||
ConfiguredSemVersion = configuredVersion;
|
||||
TargetSemVersion = targetVersion;
|
||||
ProductName = GlobalSettings.UmbracoMigrationName;
|
||||
ProductName = Constants.System.UmbracoMigrationName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -97,13 +97,13 @@ namespace Umbraco.Core.Events
|
||||
[Obsolete("Use constructor accepting a product name instead.")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion)
|
||||
: this(eventObject, null, configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName, false)
|
||||
: this(eventObject, null, configuredVersion, targetVersion, Constants.System.UmbracoMigrationName, false)
|
||||
{ }
|
||||
|
||||
[Obsolete("Use constructor accepting SemVersion instances and a product name instead.")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public MigrationEventArgs(IList<IMigration> eventObject, Version configuredVersion, Version targetVersion)
|
||||
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), GlobalSettings.UmbracoMigrationName, false)
|
||||
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, false)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a guid-based entity identifier.
|
||||
/// </summary>
|
||||
public class GuidUdi : Udi
|
||||
{
|
||||
/// <summary>
|
||||
/// The guid part of the identifier.
|
||||
/// </summary>
|
||||
public Guid Guid { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the GuidUdi class with an entity type and a guid.
|
||||
/// </summary>
|
||||
/// <param name="entityType">The entity type part of the udi.</param>
|
||||
/// <param name="guid">The guid part of the udi.</param>
|
||||
public GuidUdi(string entityType, Guid guid)
|
||||
: base(entityType, "umb://" + entityType + "/" + guid.ToString("N"))
|
||||
{
|
||||
Guid = guid;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the GuidUdi class with an uri value.
|
||||
/// </summary>
|
||||
/// <param name="uriValue">The uri value of the udi.</param>
|
||||
public GuidUdi(Uri uriValue)
|
||||
: base(uriValue)
|
||||
{
|
||||
Guid = Guid.Parse(uriValue.AbsolutePath.TrimStart('/'));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the string representation of an entity identifier into the equivalent GuidUdi instance.
|
||||
/// </summary>
|
||||
/// <param name="s">The string to convert.</param>
|
||||
/// <returns>A GuidUdi instance that contains the value that was parsed.</returns>
|
||||
public new static GuidUdi Parse(string s)
|
||||
{
|
||||
var udi = Udi.Parse(s);
|
||||
if (!(udi is GuidUdi))
|
||||
throw new FormatException("String \"" + s + "\" is not a guid entity id.");
|
||||
return (GuidUdi)udi;
|
||||
}
|
||||
|
||||
public static bool TryParse(string s, out GuidUdi udi)
|
||||
{
|
||||
Udi tmp;
|
||||
udi = null;
|
||||
if (!TryParse(s, out tmp)) return false;
|
||||
udi = tmp as GuidUdi;
|
||||
return udi != null;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
var other = obj as GuidUdi;
|
||||
if (other == null) return false;
|
||||
return EntityType == other.EntityType && Guid == other.Guid;
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return base.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool IsRoot
|
||||
{
|
||||
get { return Guid == Guid.Empty; }
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public GuidUdi EnsureClosed()
|
||||
{
|
||||
base.EnsureNotRoot();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,13 +38,12 @@ namespace Umbraco.Core.IO
|
||||
}
|
||||
|
||||
// GetSize has been added to IFileSystem2 but not IFileSystem
|
||||
// this is implementing GetSize for IFileSystem, the old way
|
||||
public static long GetSize(this IFileSystem fs, string path)
|
||||
{
|
||||
// if we reach this point, fs is *not* IFileSystem2
|
||||
// so it's not FileSystemWrapper nor shadow nor anything we know
|
||||
// so... fall back to the old & inefficient method
|
||||
var fs2 = fs as IFileSystem2;
|
||||
if (fs2 != null) return fs2.GetSize(path);
|
||||
|
||||
// this is implementing GetSize for IFileSystem, the old way
|
||||
using (var file = fs.OpenFile(path))
|
||||
{
|
||||
return file.Length;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Umbraco.Core.Logging
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ImageProcessor.Common.Exceptions;
|
||||
|
||||
using ImageProcessor.Common.Exceptions;
|
||||
namespace Umbraco.Core.Logging
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// A logger for explicitly logging ImageProcessor exceptions.
|
||||
|
||||
@@ -394,8 +394,7 @@ namespace Umbraco.Core.Models
|
||||
return content.Properties
|
||||
.Where(property => propertyGroup.PropertyTypes
|
||||
.Select(propertyType => propertyType.Id)
|
||||
.Contains(property.PropertyTypeId))
|
||||
.OrderBy(x => x.PropertyType.SortOrder);
|
||||
.Contains(property.PropertyTypeId));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A model representing the value saved for the grid
|
||||
/// </summary>
|
||||
public class GridValue
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("sections")]
|
||||
public IEnumerable<GridSection> Sections { get; set; }
|
||||
|
||||
public class GridSection
|
||||
{
|
||||
[JsonProperty("grid")]
|
||||
public string Grid { get; set; }
|
||||
|
||||
[JsonProperty("rows")]
|
||||
public IEnumerable<GridRow> Rows { get; set; }
|
||||
}
|
||||
|
||||
public class GridRow
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("id")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[JsonProperty("areas")]
|
||||
public IEnumerable<GridArea> Areas { get; set; }
|
||||
|
||||
[JsonProperty("styles")]
|
||||
public JToken Styles { get; set; }
|
||||
|
||||
[JsonProperty("config")]
|
||||
public JToken Config { get; set; }
|
||||
}
|
||||
|
||||
public class GridArea
|
||||
{
|
||||
[JsonProperty("grid")]
|
||||
public string Grid { get; set; }
|
||||
|
||||
[JsonProperty("controls")]
|
||||
public IEnumerable<GridControl> Controls { get; set; }
|
||||
|
||||
[JsonProperty("styles")]
|
||||
public JToken Styles { get; set; }
|
||||
|
||||
[JsonProperty("config")]
|
||||
public JToken Config { get; set; }
|
||||
}
|
||||
|
||||
public class GridControl
|
||||
{
|
||||
[JsonProperty("value")]
|
||||
public JToken Value { get; set; }
|
||||
|
||||
[JsonProperty("editor")]
|
||||
public GridEditor Editor { get; set; }
|
||||
|
||||
[JsonProperty("styles")]
|
||||
public JToken Styles { get; set; }
|
||||
|
||||
[JsonProperty("config")]
|
||||
public JToken Config { get; set; }
|
||||
}
|
||||
|
||||
public class GridEditor
|
||||
{
|
||||
[JsonProperty("alias")]
|
||||
public string Alias { get; set; }
|
||||
|
||||
[JsonProperty("view")]
|
||||
public string View { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a ContentType, which Media is based on
|
||||
/// </summary
|
||||
/// </summary>
|
||||
public interface IMediaType : IContentTypeComposition
|
||||
{
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ namespace Umbraco.Core.Models.Rdbms
|
||||
[PrimaryKeyColumn(IdentitySeed = NodeIdSeed)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column("typeUniqueId")]
|
||||
[Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoRelationType_UniqueId")]
|
||||
public Guid UniqueId { get; set; }
|
||||
|
||||
[Column("dual")]
|
||||
public bool Dual { get; set; }
|
||||
|
||||
|
||||
@@ -1,15 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
internal static class UmbracoEntityExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Does a quick check on the entity's set path to ensure that it's valid and consistent
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public static void ValidatePathWithException(this NodeDto entity)
|
||||
{
|
||||
//don't validate if it's empty and it has no id
|
||||
if (entity.NodeId == default(int) && entity.Path.IsNullOrWhiteSpace())
|
||||
return;
|
||||
|
||||
if (entity.Path.IsNullOrWhiteSpace())
|
||||
throw new InvalidDataException(string.Format("The content item {0} has an empty path: {1} with parentID: {2}", entity.NodeId, entity.Path, entity.ParentId));
|
||||
|
||||
var pathParts = entity.Path.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (pathParts.Length < 2)
|
||||
{
|
||||
//a path cannot be less than 2 parts, at a minimum it must be root (-1) and it's own id
|
||||
throw new InvalidDataException(string.Format("The content item {0} has an invalid path: {1} with parentID: {2}", entity.NodeId, entity.Path, entity.ParentId));
|
||||
}
|
||||
|
||||
if (entity.ParentId != default(int) && pathParts[pathParts.Length - 2] != entity.ParentId.ToInvariantString())
|
||||
{
|
||||
//the 2nd last id in the path must be it's parent id
|
||||
throw new InvalidDataException(string.Format("The content item {0} has an invalid path: {1} with parentID: {2}", entity.NodeId, entity.Path, entity.ParentId));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does a quick check on the entity's set path to ensure that it's valid and consistent
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <returns></returns>
|
||||
public static bool ValidatePath(this IUmbracoEntity entity)
|
||||
{
|
||||
//don't validate if it's empty and it has no id
|
||||
if (entity.HasIdentity == false && entity.Path.IsNullOrWhiteSpace())
|
||||
return true;
|
||||
|
||||
if (entity.Path.IsNullOrWhiteSpace())
|
||||
return false;
|
||||
|
||||
var pathParts = entity.Path.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (pathParts.Length < 2)
|
||||
{
|
||||
//a path cannot be less than 2 parts, at a minimum it must be root (-1) and it's own id
|
||||
return false;
|
||||
}
|
||||
|
||||
if (entity.ParentId != default(int) && pathParts[pathParts.Length - 2] != entity.ParentId.ToInvariantString())
|
||||
{
|
||||
//the 2nd last id in the path must be it's parent id
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This will validate the entity's path and if it's invalid it will fix it, if fixing is required it will recursively
|
||||
/// check and fix all ancestors if required.
|
||||
/// </summary>
|
||||
/// <param name="entity"></param>
|
||||
/// <param name="logger"></param>
|
||||
/// <param name="getParent">A callback specified to retrieve the parent entity of the entity</param>
|
||||
/// <param name="update">A callback specified to update a fixed entity</param>
|
||||
public static void EnsureValidPath<T>(this T entity,
|
||||
ILogger logger,
|
||||
Func<T, T> getParent,
|
||||
Action<T> update)
|
||||
where T: IUmbracoEntity
|
||||
{
|
||||
if (entity.HasIdentity == false)
|
||||
throw new InvalidOperationException("Could not ensure the entity path, the entity has not been assigned an identity");
|
||||
|
||||
if (entity.ValidatePath() == false)
|
||||
{
|
||||
logger.Warn(typeof(UmbracoEntityExtensions), string.Format("The content item {0} has an invalid path: {1} with parentID: {2}", entity.Id, entity.Path, entity.ParentId));
|
||||
if (entity.ParentId == -1)
|
||||
{
|
||||
entity.Path = string.Concat("-1,", entity.Id);
|
||||
//path changed, update it
|
||||
update(entity);
|
||||
}
|
||||
else
|
||||
{
|
||||
var parent = getParent(entity);
|
||||
if (parent == null)
|
||||
throw new NullReferenceException("Could not ensure path for entity " + entity.Id + " could not resolve it's parent " + entity.ParentId);
|
||||
|
||||
//the parent must also be valid!
|
||||
parent.EnsureValidPath(logger, getParent, update);
|
||||
|
||||
entity.Path = string.Concat(parent.Path, ",", entity.Id);
|
||||
//path changed, update it
|
||||
update(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasChildren(this IUmbracoEntity entity)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Umbraco.Core.CodeAnnotations;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using Umbraco.Core.CodeAnnotations;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
@@ -17,6 +19,8 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.ContentItemType)]
|
||||
[FriendlyName("Content Item Type")]
|
||||
[Obsolete("This is not used and will be removed in future versions")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
ContentItemType,
|
||||
|
||||
/// <summary>
|
||||
@@ -67,6 +71,8 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.ContentItem)]
|
||||
[FriendlyName("Content Item")]
|
||||
[Obsolete("This is not used and will be removed in future versions")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
ContentItem,
|
||||
|
||||
/// <summary>
|
||||
@@ -130,8 +136,34 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.DataTypeContainer)]
|
||||
[FriendlyName("Data Type Container")]
|
||||
DataTypeContainer
|
||||
DataTypeContainer,
|
||||
|
||||
/// <summary>
|
||||
/// Relation type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.RelationType)]
|
||||
[FriendlyName("Relation Type")]
|
||||
RelationType,
|
||||
|
||||
/// <summary>
|
||||
/// Forms Form
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.FormsForm)]
|
||||
[FriendlyName("Form")]
|
||||
FormsForm,
|
||||
|
||||
/// <summary>
|
||||
/// Forms Workflow
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.FormsWorkflow)]
|
||||
[FriendlyName("Workflow")]
|
||||
FormsWorkflow,
|
||||
|
||||
/// <summary>
|
||||
/// Forms Record
|
||||
/// </summary>
|
||||
[UmbracoObjectType(Constants.ObjectTypes.FormsRecord)]
|
||||
[FriendlyName("Record")]
|
||||
FormsRecord
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a <see cref="UdiRange"/> complemented with a name.
|
||||
/// </summary>
|
||||
public class NamedUdiRange : UdiRange
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NamedUdiRange"/> class with a <see cref="Udi"/> and an optional selector.
|
||||
/// </summary>
|
||||
/// <param name="udi">A <see cref="Udi"/>.</param>
|
||||
/// <param name="selector">An optional selector.</param>
|
||||
public NamedUdiRange(Udi udi, string selector = Constants.DeploySelector.This)
|
||||
: base(udi, selector)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NamedUdiRange"/> class with a <see cref="Udi"/>, a name, and an optional selector.
|
||||
/// </summary>
|
||||
/// <param name="udi">A <see cref="Udi"/>.</param>
|
||||
/// <param name="name">A name.</param>
|
||||
/// <param name="selector">An optional selector.</param>
|
||||
public NamedUdiRange(Udi udi, string name, string selector = Constants.DeploySelector.This)
|
||||
: base(udi, selector)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the range.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -468,19 +468,19 @@ namespace Umbraco.Core
|
||||
/// <param name="o"></param>
|
||||
/// <param name="ignoreProperties"></param>
|
||||
/// <returns></returns>
|
||||
internal static IDictionary<string, TVal> ToDictionary<T, TProperty, TVal>(this T o,
|
||||
public static IDictionary<string, TVal> ToDictionary<T, TProperty, TVal>(this T o,
|
||||
params Expression<Func<T, TProperty>>[] ignoreProperties)
|
||||
{
|
||||
return o.ToDictionary<TVal>(ignoreProperties.Select(e => o.GetPropertyInfo(e)).Select(propInfo => propInfo.Name).ToArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns object into dictionary
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
/// <param name="ignoreProperties">Properties to ignore</param>
|
||||
/// <returns></returns>
|
||||
internal static IDictionary<string, TVal> ToDictionary<TVal>(this object o, params string[] ignoreProperties)
|
||||
/// <summary>
|
||||
/// Turns object into dictionary
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
/// <param name="ignoreProperties">Properties to ignore</param>
|
||||
/// <returns></returns>
|
||||
public static IDictionary<string, TVal> ToDictionary<TVal>(this object o, params string[] ignoreProperties)
|
||||
{
|
||||
if (o != null)
|
||||
{
|
||||
|
||||
@@ -27,15 +27,15 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
|
||||
#region Implementation of IEntityFactory<IContent,DocumentDto>
|
||||
|
||||
public IContent BuildEntity(DocumentDto dto)
|
||||
public static IContent BuildEntity(DocumentDto dto, IContentType contentType)
|
||||
{
|
||||
var content = new Content(dto.Text, dto.ContentVersionDto.ContentDto.NodeDto.ParentId, _contentType);
|
||||
var content = new Content(dto.Text, dto.ContentVersionDto.ContentDto.NodeDto.ParentId, contentType);
|
||||
|
||||
try
|
||||
{
|
||||
content.DisableChangeTracking();
|
||||
|
||||
content.Id = _id;
|
||||
content.Id = dto.NodeId;
|
||||
content.Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId;
|
||||
content.Name = dto.Text;
|
||||
content.NodeName = dto.ContentVersionDto.ContentDto.NodeDto.Text;
|
||||
@@ -49,8 +49,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
content.Published = dto.Published;
|
||||
content.CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate;
|
||||
content.UpdateDate = dto.ContentVersionDto.VersionDate;
|
||||
content.ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?) null;
|
||||
content.ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?) null;
|
||||
content.ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?)null;
|
||||
content.ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?)null;
|
||||
content.Version = dto.ContentVersionDto.VersionId;
|
||||
content.PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished;
|
||||
content.PublishedVersionGuid = dto.DocumentPublishedReadOnlyDto == null ? default(Guid) : dto.DocumentPublishedReadOnlyDto.VersionId;
|
||||
@@ -64,6 +64,13 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
{
|
||||
content.EnableChangeTracking();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Obsolete("Use the static BuildEntity instead so we don't have to allocate one of these objects everytime we want to map values")]
|
||||
public IContent BuildEntity(DocumentDto dto)
|
||||
{
|
||||
return BuildEntity(dto, _contentType);
|
||||
}
|
||||
|
||||
public DocumentDto BuildDto(IContent entity)
|
||||
|
||||
@@ -27,15 +27,15 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
|
||||
#region Implementation of IEntityFactory<IMedia,ContentVersionDto>
|
||||
|
||||
public IMedia BuildEntity(ContentVersionDto dto)
|
||||
public static IMedia BuildEntity(ContentVersionDto dto, IMediaType contentType)
|
||||
{
|
||||
var media = new Models.Media(dto.ContentDto.NodeDto.Text, dto.ContentDto.NodeDto.ParentId, _contentType);
|
||||
var media = new Models.Media(dto.ContentDto.NodeDto.Text, dto.ContentDto.NodeDto.ParentId, contentType);
|
||||
|
||||
try
|
||||
{
|
||||
media.DisableChangeTracking();
|
||||
|
||||
media.Id = _id;
|
||||
media.Id = dto.NodeId;
|
||||
media.Key = dto.ContentDto.NodeDto.UniqueId;
|
||||
media.Path = dto.ContentDto.NodeDto.Path;
|
||||
media.CreatorId = dto.ContentDto.NodeDto.UserId.Value;
|
||||
@@ -55,6 +55,13 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
{
|
||||
media.EnableChangeTracking();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Obsolete("Use the static BuildEntity instead so we don't have to allocate one of these objects everytime we want to map values")]
|
||||
public IMedia BuildEntity(ContentVersionDto dto)
|
||||
{
|
||||
return BuildEntity(dto, _contentType);
|
||||
}
|
||||
|
||||
public ContentVersionDto BuildDto(IMedia entity)
|
||||
|
||||
@@ -30,11 +30,11 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
_updateDate = updateDate;
|
||||
}
|
||||
|
||||
public IEnumerable<Property> BuildEntity(PropertyDataDto[] dtos)
|
||||
public static IEnumerable<Property> BuildEntity(IReadOnlyCollection<PropertyDataDto> dtos, PropertyType[] compositionTypeProperties, DateTime createDate, DateTime updateDate)
|
||||
{
|
||||
var properties = new List<Property>();
|
||||
|
||||
foreach (var propertyType in _compositionTypeProperties)
|
||||
foreach (var propertyType in compositionTypeProperties)
|
||||
{
|
||||
var propertyDataDto = dtos.LastOrDefault(x => x.PropertyTypeId == propertyType.Id);
|
||||
var property = propertyDataDto == null
|
||||
@@ -47,8 +47,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
//on initial construction we don't want to have dirty properties tracked
|
||||
property.DisableChangeTracking();
|
||||
|
||||
property.CreateDate = _createDate;
|
||||
property.UpdateDate = _updateDate;
|
||||
property.CreateDate = createDate;
|
||||
property.UpdateDate = updateDate;
|
||||
// http://issues.umbraco.org/issue/U4-1946
|
||||
property.ResetDirtyProperties(false);
|
||||
properties.Add(property);
|
||||
@@ -57,12 +57,18 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
{
|
||||
property.EnableChangeTracking();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
||||
[Obsolete("Use the static method instead, there's no reason to allocate one of these classes everytime we want to map values")]
|
||||
public IEnumerable<Property> BuildEntity(PropertyDataDto[] dtos)
|
||||
{
|
||||
return BuildEntity(dtos, _compositionTypeProperties, _createDate, _updateDate);
|
||||
}
|
||||
|
||||
public IEnumerable<PropertyDataDto> BuildDto(IEnumerable<Property> properties)
|
||||
{
|
||||
var propertyDataDtos = new List<PropertyDataDto>();
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
entity.DisableChangeTracking();
|
||||
|
||||
entity.Id = dto.Id;
|
||||
entity.Key = dto.UniqueId;
|
||||
entity.IsBidirectional = dto.Dual;
|
||||
entity.Name = dto.Name;
|
||||
|
||||
@@ -38,10 +39,13 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
ChildObjectType = entity.ChildObjectType,
|
||||
Dual = entity.IsBidirectional,
|
||||
Name = entity.Name,
|
||||
ParentObjectType = entity.ParentObjectType
|
||||
ParentObjectType = entity.ParentObjectType,
|
||||
UniqueId = entity.Key
|
||||
};
|
||||
if (entity.HasIdentity)
|
||||
{
|
||||
dto.Id = entity.Id;
|
||||
}
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
@@ -292,8 +292,12 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
|
||||
private void CreateUmbracoRelationTypeData()
|
||||
{
|
||||
_database.Insert("umbracoRelationType", "id", false, new RelationTypeDto { Id = 1, Alias = Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = true, Name = Constants.Conventions.RelationTypes.RelateDocumentOnCopyName });
|
||||
_database.Insert("umbracoRelationType", "id", false, new RelationTypeDto { Id = 2, Alias = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteAlias, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = false, Name = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteName });
|
||||
var relationType = new RelationTypeDto { Id = 1, Alias = Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = true, Name = Constants.Conventions.RelationTypes.RelateDocumentOnCopyName };
|
||||
relationType.UniqueId = (relationType.Alias + "____" + relationType.Name).ToGuid();
|
||||
_database.Insert("umbracoRelationType", "id", false, relationType);
|
||||
relationType = new RelationTypeDto { Id = 2, Alias = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteAlias, ChildObjectType = new Guid(Constants.ObjectTypes.Document), ParentObjectType = new Guid(Constants.ObjectTypes.Document), Dual = false, Name = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteName };
|
||||
relationType.UniqueId = (relationType.Alias + "____" + relationType.Name).ToGuid();
|
||||
_database.Insert("umbracoRelationType", "id", false, relationType);
|
||||
}
|
||||
|
||||
private void CreateCmsTaskTypeData()
|
||||
@@ -306,7 +310,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
var dto = new MigrationDto
|
||||
{
|
||||
Id = 1,
|
||||
Name = GlobalSettings.UmbracoMigrationName,
|
||||
Name = Constants.System.UmbracoMigrationName,
|
||||
Version = UmbracoVersion.GetSemanticVersion().ToString(),
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
/// <summary>
|
||||
/// Represents the initial database schema creation by running CreateTable for all DTOs against the db.
|
||||
/// </summary>
|
||||
internal class DatabaseSchemaCreation
|
||||
public class DatabaseSchemaCreation
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
@@ -345,7 +345,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
/// Raises the <see cref="BeforeCreation"/> event.
|
||||
/// </summary>
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
protected internal virtual void FireBeforeCreation(DatabaseCreationEventArgs e)
|
||||
internal virtual void FireBeforeCreation(DatabaseCreationEventArgs e)
|
||||
{
|
||||
if (BeforeCreation != null)
|
||||
{
|
||||
@@ -361,7 +361,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
/// Raises the <see cref="AfterCreation"/> event.
|
||||
/// </summary>
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
protected virtual void FireAfterCreation(DatabaseCreationEventArgs e)
|
||||
internal virtual void FireAfterCreation(DatabaseCreationEventArgs e)
|
||||
{
|
||||
if (AfterCreation != null)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
|
||||
|
||||
if (ValidTables.Any(x => x.InvariantEquals("umbracoMigration")))
|
||||
{
|
||||
var allMigrations = migrationEntryService.GetAll(GlobalSettings.UmbracoMigrationName);
|
||||
var allMigrations = migrationEntryService.GetAll(Constants.System.UmbracoMigrationName);
|
||||
mostrecent = allMigrations.OrderByDescending(x => x.Version).Select(x => x.Version).FirstOrDefault();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourNineZero
|
||||
{
|
||||
[MigrationAttribute("4.9.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
[MigrationAttribute("4.9.0", 0, Constants.System.UmbracoMigrationName)]
|
||||
public class RemoveUmbracoAppConstraints : MigrationBase
|
||||
{
|
||||
public RemoveUmbracoAppConstraints(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourOneZero
|
||||
{
|
||||
[Migration("4.1.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("4.1.0", 0, Constants.System.UmbracoMigrationName)]
|
||||
public class AddPreviewXmlTable : MigrationBase
|
||||
{
|
||||
public AddPreviewXmlTable(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
/// <summary>
|
||||
/// Creats a unique index across two columns so we cannot have duplicate property aliases for one macro
|
||||
/// </summary>
|
||||
[Migration("7.0.0", 5, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 5, Constants.System.UmbracoMigrationName)]
|
||||
public class AddIndexToCmsMacroPropertyTable : MigrationBase
|
||||
{
|
||||
private readonly bool _skipIndexCheck;
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
/// <summary>
|
||||
/// Creates a unique index on the macro alias so we cannot have duplicates by alias
|
||||
/// </summary>
|
||||
[Migration("7.0.0", 4, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 4, Constants.System.UmbracoMigrationName)]
|
||||
public class AddIndexToCmsMacroTable : MigrationBase
|
||||
{
|
||||
private readonly bool _forTesting;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
|
||||
[Migration("7.0.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 0, Constants.System.UmbracoMigrationName)]
|
||||
public class AddPropertyEditorAliasColumn : MigrationBase
|
||||
{
|
||||
public AddPropertyEditorAliasColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
/// needs to be changed to editorAlias, we'll do this by removing the constraint,changing the macroPropertyType to the new
|
||||
/// editorAlias column (and maintaing data so we can reference it)
|
||||
/// </summary>
|
||||
[Migration("7.0.0", 6, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 6, Constants.System.UmbracoMigrationName)]
|
||||
public class AlterCmsMacroPropertyTable : MigrationBase
|
||||
{
|
||||
public AlterCmsMacroPropertyTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 8, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 8, Constants.System.UmbracoMigrationName)]
|
||||
public class AlterTagRelationsTable : MigrationBase
|
||||
{
|
||||
public AlterTagRelationsTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 9, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 9, Constants.System.UmbracoMigrationName)]
|
||||
public class AlterTagsTable : MigrationBase
|
||||
{
|
||||
public AlterTagsTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 3, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 3, Constants.System.UmbracoMigrationName)]
|
||||
public class AlterUserTable : MigrationBase
|
||||
{
|
||||
public AlterUserTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
/// and it wasn't a MySQL install.
|
||||
/// see: http://issues.umbraco.org/issue/U4-5707
|
||||
/// </summary>
|
||||
[Migration("7.0.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 0, Constants.System.UmbracoMigrationName)]
|
||||
public class AssignMissingKeysAndIndexes : MigrationBase
|
||||
{
|
||||
public AssignMissingKeysAndIndexes(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 2, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 2, Constants.System.UmbracoMigrationName)]
|
||||
public class DropControlIdColumn : MigrationBase
|
||||
{
|
||||
public DropControlIdColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 7, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 7, Constants.System.UmbracoMigrationName)]
|
||||
public class RemoveCmsMacroPropertyTypeTable : MigrationBase
|
||||
{
|
||||
public RemoveCmsMacroPropertyTypeTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
/// <summary>
|
||||
/// Updates the data in the changed propertyEditorAlias column after it has been changed by ChangeControlIdColumn
|
||||
/// </summary>
|
||||
[Migration("7.0.0", 1, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 1, Constants.System.UmbracoMigrationName)]
|
||||
public class UpdateControlIdToPropertyEditorAlias : MigrationBase
|
||||
{
|
||||
public UpdateControlIdToPropertyEditorAlias(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
{
|
||||
[Migration("7.0.0", 10, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", 10, Constants.System.UmbracoMigrationName)]
|
||||
public class UpdateRelatedLinksData : MigrationBase
|
||||
{
|
||||
public UpdateRelatedLinksData(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveFive
|
||||
{
|
||||
[Migration("7.5.5", 101, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.5.5", 101, Constants.System.UmbracoMigrationName)]
|
||||
public class AddLockObjects : MigrationBase
|
||||
{
|
||||
public AddLockObjects(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveFive
|
||||
{
|
||||
[Migration("7.5.5", 100, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.5.5", 100, Constants.System.UmbracoMigrationName)]
|
||||
public class AddLockTable : MigrationBase
|
||||
{
|
||||
public AddLockTable(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveFiv
|
||||
/// <summary>
|
||||
/// See: http://issues.umbraco.org/issue/U4-4196
|
||||
/// </summary>
|
||||
[Migration("7.5.5", 1, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.5.5", 1, Constants.System.UmbracoMigrationName)]
|
||||
public class UpdateAllowedMediaTypesAtRoot : MigrationBase
|
||||
{
|
||||
public UpdateAllowedMediaTypesAtRoot(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZero
|
||||
{
|
||||
[Migration("7.5.0", 100, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.5.0", 100, Constants.System.UmbracoMigrationName)]
|
||||
public class AddRedirectUrlTable : MigrationBase
|
||||
{
|
||||
public AddRedirectUrlTable(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer
|
||||
// This migration exists for 7.3.0 but it seems like it was not always running properly
|
||||
// if you're upgrading from 7.3.0 or higher than we add this migration, if you're upgrading
|
||||
// from 7.3.0 or lower then you will already get this migration in the migration to get to 7.3.0
|
||||
[Migration("7.3.0", "7.5.0", 10, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.3.0", "7.5.0", 10, Constants.System.UmbracoMigrationName)]
|
||||
public class EnsureServersLockObject : MigrationBase
|
||||
{
|
||||
public EnsureServersLockObject(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer
|
||||
/// <summary>
|
||||
/// This is here to re-remove these tables, we dropped them in 7.3 but new installs created them again so we're going to re-drop them
|
||||
/// </summary>
|
||||
[Migration("7.5.0", 1, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.5.0", 1, Constants.System.UmbracoMigrationName)]
|
||||
public class RemoveStylesheetDataAndTablesAgain : MigrationBase
|
||||
{
|
||||
public RemoveStylesheetDataAndTablesAgain(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer
|
||||
/// <summary>
|
||||
/// See: http://issues.umbraco.org/issue/U4-8522
|
||||
/// </summary>
|
||||
[Migration("7.5.0", 2, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.5.0", 2, Constants.System.UmbracoMigrationName)]
|
||||
public class UpdateUniqueIndexOnCmsPropertyData : MigrationBase
|
||||
{
|
||||
public UpdateUniqueIndexOnCmsPropertyData(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 1, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 1, Constants.System.UmbracoMigrationName)]
|
||||
public class AddDataDecimalColumn : MigrationBase
|
||||
{
|
||||
public AddDataDecimalColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 5, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 5, Constants.System.UmbracoMigrationName)]
|
||||
public class AddUmbracoDeployTables : MigrationBase
|
||||
{
|
||||
public AddUmbracoDeployTables(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 2, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 2, Constants.System.UmbracoMigrationName)]
|
||||
public class AddUniqueIdPropertyTypeGroupColumn : MigrationBase
|
||||
{
|
||||
public AddUniqueIdPropertyTypeGroupColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer
|
||||
/// alias, so we need to ensure that these are initially consistent on
|
||||
/// all environments (based on the alias).
|
||||
/// </summary>
|
||||
[Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 3, Constants.System.UmbracoMigrationName)]
|
||||
public class EnsureContentTypeUniqueIdsAreConsistent : MigrationBase
|
||||
{
|
||||
public EnsureContentTypeUniqueIdsAreConsistent(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 4, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 4, Constants.System.UmbracoMigrationName)]
|
||||
public class FixListViewMediaSortOrder : MigrationBase
|
||||
{
|
||||
public FixListViewMediaSortOrder(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero
|
||||
{
|
||||
[Migration("7.4.0", 4, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.4.0", 4, Constants.System.UmbracoMigrationName)]
|
||||
public class RemoveParentIdPropertyTypeGroupColumn : MigrationBase
|
||||
{
|
||||
public RemoveParentIdPropertyTypeGroupColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger)
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenOneZero
|
||||
// this is because when the 7.0.0 migrations are executed, this primary key get's created so if this migration is also executed
|
||||
// we will get exceptions because it is trying to create the PK two times.
|
||||
|
||||
[Migration("7.0.0", "7.1.0", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
[Migration("7.0.0", "7.1.0", 0, Constants.System.UmbracoMigrationName)]
|
||||
public class AssignMissingPrimaryForMySqlKeys : MigrationBase
|
||||
{
|
||||
public AssignMissingPrimaryForMySqlKeys(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user