Compare commits
496 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 350f60c056 | |||
| 954b5ac296 | |||
| 12787f0bd2 | |||
| 6cf15f42a8 | |||
| b5b971a189 | |||
| 26a026b17a | |||
| 9054b84c50 | |||
| 5cb5f13d08 | |||
| 89468fce97 | |||
| a1997291ab | |||
| 1f8fae0dd4 | |||
| 3bd2f766ef | |||
| f8ed341eec | |||
| f3b745f5b3 | |||
| 8d23a9b480 | |||
| c2e89ed955 | |||
| 782fc26723 | |||
| 378c2f727c | |||
| 5c983bce5f | |||
| 4eb18855e9 | |||
| 2200839bfa | |||
| 796cb9c35b | |||
| ac0d21cb3d | |||
| 70951317c5 | |||
| 4270a6c440 | |||
| 030688f1a2 | |||
| b11b2c0a71 | |||
| 7680ce4ef1 | |||
| ab872b7ca4 | |||
| 8533210761 | |||
| 673575594d | |||
| 4702bdab33 | |||
| ab08f1fc06 | |||
| 6b29bbc9e7 | |||
| 80f92311dc | |||
| c1723cbda6 | |||
| 5ee0311371 | |||
| d6c7ba03e6 | |||
| 32ecf932a6 | |||
| 26d16e3897 | |||
| ab0074e07c | |||
| 71c8e20a79 | |||
| 58bd7e8453 | |||
| d57c168f82 | |||
| 4a5a7068bc | |||
| d34649ab1a | |||
| 24407ead18 | |||
| ad4f0cf9d1 | |||
| f5efb7609a | |||
| ab82d3b053 | |||
| 36e0673c83 | |||
| 9d27e7386e | |||
| 8502e10900 | |||
| 0a701d0c64 | |||
| ceaa15aa82 | |||
| 2445e0cbcb | |||
| 5a5ad350d6 | |||
| 40e986d5dc | |||
| c81b68e9a8 | |||
| 8e9f1bc949 | |||
| e8b7ffd6f5 | |||
| b12eecfb1d | |||
| 06ca34f434 | |||
| 5880b1b612 | |||
| 12fc88aca9 | |||
| e56db8baa4 | |||
| c7aae533ad | |||
| acaa062b7d | |||
| f9928906fa | |||
| d3719122ce | |||
| 1e3fbf4e2f | |||
| fc8130987c | |||
| f3dc8f592b | |||
| 8fda46f0ad | |||
| 8d3c9caafb | |||
| 23031a64d1 | |||
| 37b27f5e73 | |||
| 129e094b09 | |||
| c3c24eba4f | |||
| 145858a302 | |||
| c13e3ec220 | |||
| 6ce24bf1a1 | |||
| 6c61eb2d69 | |||
| 76bf84f8ea | |||
| a8ba8598f2 | |||
| 6e7bb41190 | |||
| 7387379aea | |||
| 50659787ee | |||
| 3da120ce33 | |||
| de9f4f8d0b | |||
| 20ecb6a779 | |||
| 40f2558a70 | |||
| f44c5ad757 | |||
| 1cf63bd471 | |||
| 07a263b794 | |||
| c2236b7b97 | |||
| 9e3db051c9 | |||
| 70d1bed396 | |||
| a6ea270d93 | |||
| a39a9b7a89 | |||
| 8c815cf47e | |||
| 2b7966dc55 | |||
| fe1a4f7d4f | |||
| 9b17468c43 | |||
| 6bedc1020b | |||
| fc56126820 | |||
| c6fa0e560a | |||
| 34de58e0dc | |||
| 056bcaff96 | |||
| f38df3753c | |||
| 7fd78aaf2e | |||
| 9bba6f4b9b | |||
| 5128c23413 | |||
| b565b8be77 | |||
| 2e2e76c92a | |||
| 1bc3fdd07c | |||
| c1e0b86554 | |||
| bf7591aaa0 | |||
| 6c5abf14bd | |||
| 8044ccbf27 | |||
| 95c6de5534 | |||
| 2c124e87dd | |||
| c655873b7d | |||
| ea6c466323 | |||
| 6e647d87fa | |||
| 07e7068c22 | |||
| 971114e0fd | |||
| 03977c4806 | |||
| 842d5049b5 | |||
| e4d1415627 | |||
| 5dad26cb92 | |||
| 491ce00c17 | |||
| b7c7e8e84b | |||
| 095704d297 | |||
| 09d03161ce | |||
| aa4dc64a57 | |||
| d78fa85307 | |||
| 0ee056aafc | |||
| 68f0a64136 | |||
| f9f108ef33 | |||
| 573b8a0701 | |||
| 4ce6f5c3b0 | |||
| f2b78c06ef | |||
| d27594d4af | |||
| 7239ce97aa | |||
| 18b7581879 | |||
| 8535ff1d01 | |||
| 4f366bbdda | |||
| 86c554e3d3 | |||
| d97d1c427e | |||
| 600979d129 | |||
| 8be861809a | |||
| 8642a52a12 | |||
| d90ccbb7f0 | |||
| 9c1451ecd3 | |||
| c890421f55 | |||
| 6d1f42c9b6 | |||
| b1faade9b0 | |||
| 5bc229801b | |||
| f3e509ad55 | |||
| 9e8239f05b | |||
| 6051891280 | |||
| 70e4ea5502 | |||
| 216aaec7f2 | |||
| db160cdc85 | |||
| d1191c0693 | |||
| 9ac7df82ad | |||
| 389fb100bb | |||
| 7728dfa853 | |||
| 177bba5e73 | |||
| ee9f150483 | |||
| 85c739aed4 | |||
| 0e19ec7495 | |||
| 6e61450788 | |||
| 736190f93c | |||
| 02f95053b8 | |||
| 3f73452bc7 | |||
| 5247a9d143 | |||
| 912d89cdb3 | |||
| 1a82f93722 | |||
| 8a5ca2c4b4 | |||
| b1eeb5b193 | |||
| 97cb752cda | |||
| 5a991c9424 | |||
| ff505531c2 | |||
| 1b2a964001 | |||
| 1d5751a1e5 | |||
| b8c5a389d2 | |||
| 5d37df182a | |||
| d13a6f5f58 | |||
| aa35b28349 | |||
| 6104dcafd5 | |||
| 71ed99f080 | |||
| bb0f6fe0e3 | |||
| 73b5694aad | |||
| 63d7768653 | |||
| ed0886b040 | |||
| 9474c78de8 | |||
| 8388eca503 | |||
| cc7febcc6d | |||
| c5de31cce3 | |||
| 48c70604a9 | |||
| 650441b1f6 | |||
| 7a92691bf5 | |||
| 506365b8ff | |||
| a5bbf3d832 | |||
| 101d92ca2d | |||
| 912711bfa0 | |||
| 677bf71a94 | |||
| b35d28c568 | |||
| 3495331005 | |||
| bcf46eceb6 | |||
| d04a573888 | |||
| 41144bb7f7 | |||
| 5798d8e57b | |||
| e2478e5cd4 | |||
| c4027898cb | |||
| 2704111497 | |||
| 8a9caad23d | |||
| 1fc0b32fc2 | |||
| 11a4040da7 | |||
| b5ec775833 | |||
| 329f90922c | |||
| 4eca4ac291 | |||
| f447294c0b | |||
| 46c7290e4f | |||
| c33bdf1f27 | |||
| a545c3c333 | |||
| aaa1ac0700 | |||
| 93adda2e4a | |||
| 5c96b32c64 | |||
| 2246e5bc2f | |||
| a5f1ad6da1 | |||
| d56af5872d | |||
| a4cc67f732 | |||
| 64d467e071 | |||
| 394e7f3d6d | |||
| 211267d500 | |||
| a695b8aed5 | |||
| 6fe9c4d4df | |||
| 9843f3a5fd | |||
| efc56c015f | |||
| 638b6e9cdc | |||
| fb759e3923 | |||
| c308b081a1 | |||
| 6c77313a82 | |||
| 7c42d29eb0 | |||
| 106955f6c3 | |||
| e3754fb62f | |||
| db2d75c3f5 | |||
| adfc8769e6 | |||
| 6548154261 | |||
| 630212f66f | |||
| a4b5e08a73 | |||
| be4ea93d12 | |||
| 8f11edc17a | |||
| fc860d5061 | |||
| 03c574a97c | |||
| f407c3b2b3 | |||
| 39f9449dc7 | |||
| 171a82e233 | |||
| 459479a7b8 | |||
| 1bdf064437 | |||
| 92b9184706 | |||
| ff7c74ec8a | |||
| dbf310caf1 | |||
| 2afd257838 | |||
| 19edfdb2a4 | |||
| 6faa2ff177 | |||
| c8d2ea141b | |||
| 310a31b03e | |||
| 0a18306d40 | |||
| 0a5db8f97b | |||
| a4b24bf198 | |||
| 92d88d5a4c | |||
| 6db5ebf6f9 | |||
| a7f9628b48 | |||
| 9a2797303b | |||
| 51d608125d | |||
| 890b5f30a1 | |||
| 038fc87a40 | |||
| 954098eb7e | |||
| bcd0c95ec1 | |||
| 7dd1efb29f | |||
| 6959e595f5 | |||
| ce8775b3e7 | |||
| 27390afe86 | |||
| 923fdf9199 | |||
| 908589277a | |||
| 8873fa9dd4 | |||
| a26d7747b6 | |||
| 1a99d0e4d0 | |||
| da0fe5e5a3 | |||
| 8f13fa3ae5 | |||
| aa46e1e282 | |||
| dbf1b1e0d4 | |||
| 9407f75522 | |||
| dbad0d261e | |||
| 5b555d35d3 | |||
| f6984438a0 | |||
| 335cf65663 | |||
| c19dbeda23 | |||
| 73567ffdce | |||
| ad6a745681 | |||
| 59b6665ff3 | |||
| 3cdc0e1142 | |||
| 270f3a75ff | |||
| 12d56cd201 | |||
| cb3cba5b05 | |||
| ffd85b4e94 | |||
| 23c40cbf2c | |||
| e99c519032 | |||
| c435597d7e | |||
| c71d00cd7e | |||
| 40f94d23d4 | |||
| f3bf5d86d2 | |||
| 16aac382d1 | |||
| ef3b3326fc | |||
| 79f303ddcf | |||
| 87f9e8c72e | |||
| aba5e849c1 | |||
| ef2fd52482 | |||
| 7b82208677 | |||
| 23333710f5 | |||
| 2e38f7b27b | |||
| c5ca61f249 | |||
| 6db75d4226 | |||
| 43ca9593d4 | |||
| a1cd80a0f6 | |||
| f49fa7b567 | |||
| d552d5dadb | |||
| de2784c281 | |||
| 7c05f2e86c | |||
| e9bfad3c09 | |||
| 9044c9328d | |||
| 48641166b9 | |||
| 6dfb618efe | |||
| 7e383ea961 | |||
| 5e14af7d38 | |||
| 312b2ff435 | |||
| 6b9adfa929 | |||
| a69019aea0 | |||
| d30ec335b8 | |||
| e820d2a4aa | |||
| 5aa490cbff | |||
| f1a8da2876 | |||
| 27f6560a00 | |||
| 7a181bd281 | |||
| 4a0cd87a38 | |||
| 861e5908a7 | |||
| ae5a5bd2c0 | |||
| 7d349ef518 | |||
| 395575dbe4 | |||
| 5dfa0e7446 | |||
| 9325d30e7c | |||
| d99beb0c8b | |||
| e9f0e98d2c | |||
| 6d6be4e6a4 | |||
| fbc9c6aed6 | |||
| 386dc1a14d | |||
| 8fc33f6aea | |||
| 6c8e39876f | |||
| bfca8c555e | |||
| c84087e96b | |||
| d4252a3dc8 | |||
| 6b12fe7c57 | |||
| 04da7cfd20 | |||
| d5ebe12983 | |||
| 5d1abaa713 | |||
| e9e0274ad8 | |||
| 966de9b9f4 | |||
| c46d4e9e43 | |||
| ee853f0189 | |||
| 1d0d6e78de | |||
| 8ae27ecc27 | |||
| 642ce36f59 | |||
| db5ffd6b29 | |||
| 9384cd0f27 | |||
| 0262b4aa76 | |||
| 158eb18de0 | |||
| 03ac073c02 | |||
| 96761efe4d | |||
| 8e02aad2bb | |||
| 75fb070825 | |||
| 8a0f32e980 | |||
| a68e37c67b | |||
| dea47dfafe | |||
| f5163ed0c2 | |||
| 694f3d71e2 | |||
| 5b1bdd84ee | |||
| 15eb40aedb | |||
| 49251271e9 | |||
| cc3e75dc63 | |||
| 4f17ecbdee | |||
| ec7b038569 | |||
| d4244d3807 | |||
| eeaf17c857 | |||
| 46487fa466 | |||
| 21a8395142 | |||
| f25233ac2b | |||
| 415810ecfe | |||
| fd3129f166 | |||
| 58e4e2398a | |||
| 392965bb3a | |||
| 61cd59b237 | |||
| 7d171b1e95 | |||
| d63061fade | |||
| 362261e879 | |||
| af8c00d075 | |||
| 68b440e494 | |||
| 0c328ef30e | |||
| ef47e85741 | |||
| 26af63549f | |||
| 70e3f895da | |||
| e6a69ccb0d | |||
| f80a27f5d7 | |||
| f3d68276fe | |||
| 0c191a3ef7 | |||
| 2872d0b0a2 | |||
| 97548df146 | |||
| ebf3ab3a41 | |||
| c97822a430 | |||
| 319bd783ff | |||
| e234eb22f6 | |||
| d45112f2ab | |||
| 6b3c6eba8d | |||
| f7719773f2 | |||
| 15c6e28354 | |||
| b5b643e04c | |||
| dc589f9b96 | |||
| 7a4ff7b9c0 | |||
| a92361bd00 | |||
| f7ce8af24d | |||
| 9ac96f24aa | |||
| eca5b6e4e6 | |||
| 2dd7c5210f | |||
| 3a854688e0 | |||
| 1594adf3ed | |||
| 23fcb38d69 | |||
| 7571949ad0 | |||
| d45c3520d4 | |||
| b7c04575fa | |||
| 588f5a3789 | |||
| b535a45898 | |||
| aebfc33037 | |||
| 1b56c55300 | |||
| 29d9dcffb8 | |||
| b0f0a7afc4 | |||
| 30f8885aa9 | |||
| 94ed741dd5 | |||
| b6d5ac6a01 | |||
| 4664266b8d | |||
| c61fd65463 | |||
| 1e2598a3a3 | |||
| 5003a55aca | |||
| b5415844b8 | |||
| 19241995e8 | |||
| b53400ceca | |||
| 828dbaedfb | |||
| 52701f0056 | |||
| c802171f38 | |||
| 81c5c66e15 | |||
| 79515cdae7 | |||
| 99ce7c0736 | |||
| d9b1598fa2 | |||
| c630e5ef8e | |||
| fe5896c85f | |||
| 28cbb0a517 | |||
| 0597b43014 | |||
| a124d77670 | |||
| 1076b882fb | |||
| 4a47c5e129 | |||
| 6d052aeeac | |||
| 5380b62504 | |||
| 354505fde3 | |||
| 9b33c8a0e2 | |||
| 07fc6753f5 | |||
| 967178cb92 | |||
| fe44494936 | |||
| 793c9470c2 | |||
| 95d40049f5 | |||
| f003c3602c | |||
| 862fdf27e4 | |||
| 7225ec29fe | |||
| cf1069e0e1 | |||
| 99ce88228c | |||
| cf871196f2 | |||
| 36d6b6a254 | |||
| 29bb86ea13 | |||
| fa171e4553 | |||
| 0b63eb9430 | |||
| d7ddbfec35 | |||
| d260a9dc88 | |||
| 6861453166 | |||
| 5f263ad851 | |||
| afc2363163 |
@@ -15,3 +15,16 @@ indent_size = 4
|
||||
# Trim trailing whitespace, limited support.
|
||||
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{cs,vb}]
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:error
|
||||
|
||||
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
|
||||
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
|
||||
dotnet_naming_rule.private_members_with_underscore.severity = suggestion
|
||||
|
||||
dotnet_naming_symbols.private_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
|
||||
|
||||
dotnet_naming_style.prefix_underscore.capitalization = camel_case
|
||||
dotnet_naming_style.prefix_underscore.required_prefix = _
|
||||
+24
-5
@@ -1,3 +1,8 @@
|
||||
#
|
||||
# Umbraco Cms Git Ignore
|
||||
#
|
||||
|
||||
# common files
|
||||
*.obj
|
||||
*.pdb
|
||||
*.user
|
||||
@@ -8,22 +13,31 @@
|
||||
*.suo
|
||||
*.vs10x
|
||||
*.ndproj
|
||||
*.log
|
||||
|
||||
# common directories
|
||||
.DS_Store
|
||||
._.DS_Store
|
||||
.vs/
|
||||
/local/
|
||||
|
||||
[Bb]in
|
||||
# build directories
|
||||
[Bb]in/
|
||||
[Db]ebug*/
|
||||
obj/
|
||||
[Rr]elease*/
|
||||
obj/
|
||||
|
||||
# tools
|
||||
_ReSharper*/
|
||||
|
||||
_NCrunch_*/
|
||||
*.ncrunchsolution
|
||||
*.ncrunchsolution.user
|
||||
*.ncrunchproject
|
||||
*.crunchsolution.cache
|
||||
tools/NDepend/
|
||||
|
||||
|
||||
|
||||
|
||||
[Tt]est[Rr]esult*
|
||||
[Bb]uild[Ll]og.*
|
||||
@@ -97,7 +111,6 @@ src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
|
||||
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
|
||||
|
||||
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
|
||||
tools/NDepend/
|
||||
|
||||
src/Umbraco.Web.UI/App_Plugins/*
|
||||
src/*.psess
|
||||
@@ -121,6 +134,9 @@ src/Umbraco.Web.UI.Client/bower_components/*
|
||||
/src/Umbraco.Web.UI/Umbraco/preview
|
||||
/src/Umbraco.Web.UI/Umbraco/preview.old
|
||||
|
||||
# ignore rule for clearing out Belle (avoid rebuilding all the time)
|
||||
preserve.belle
|
||||
|
||||
#Ignore Rule for output of generated documentation files from Grunt docserve
|
||||
src/Umbraco.Web.UI.Client/docs/api
|
||||
src/*.boltdata/
|
||||
@@ -143,7 +159,6 @@ apidocs/api/*
|
||||
build/docs.zip
|
||||
build/ui-docs.zip
|
||||
build/csharp-docs.zip
|
||||
.vs/
|
||||
src/packages/
|
||||
src/PrecompiledWeb/*
|
||||
|
||||
@@ -152,3 +167,7 @@ build.out/
|
||||
build.tmp/
|
||||
build/hooks/
|
||||
build/temp/
|
||||
|
||||
|
||||
|
||||
# eof
|
||||
|
||||
@@ -6,19 +6,13 @@ Umbraco Cms Build
|
||||
|
||||
To build Umbraco, fire PowerShell and move to Umbraco's repository root (the directory that contains `src`, `build`, `README.md`...). There, trigger the build with the following command:
|
||||
|
||||
build\build.ps1
|
||||
build/build.ps1
|
||||
|
||||
By default, this builds the current version. It is possible to specify a different version as a parameter to the build script:
|
||||
|
||||
build\build.ps1 7.6.44
|
||||
|
||||
Valid version strings are defined in the `Set-UmbracoVersion` documentation below.
|
||||
|
||||
## PowerShell Quirks
|
||||
|
||||
There is a good chance that running `build.ps1` ends up in error, with messages such as
|
||||
|
||||
>The file ...\build\build.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies.
|
||||
>The file ...\build.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies.
|
||||
|
||||
PowerShell has *Execution Policies* that may prevent the script from running. You can check the current policies with:
|
||||
|
||||
@@ -42,7 +36,7 @@ Alternatively, you can do it at machine level, from within an elevated PowerShel
|
||||
|
||||
And *then* the script should run. It *might* however still complain about executing scripts, with messages such as:
|
||||
|
||||
>Security warning - Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ...\build\build.ps1?
|
||||
>Security warning - Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ...\build.ps1?
|
||||
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
|
||||
|
||||
This is usually caused by the scripts being *blocked*. And that usually happens when the source code has been downloaded as a Zip file. When Windows downloads Zip files, they are marked as *blocked* (technically, they have a Zone.Identifier alternate data stream, with a value of "3" to indicate that they were downloaded from the Internet). And when such a Zip file is un-zipped, each and every single file is also marked as blocked.
|
||||
@@ -51,34 +45,20 @@ The best solution is to unblock the Zip file before un-zipping: right-click the
|
||||
|
||||
PS> Get-ChildItem -Recurse *.* | Unblock-File
|
||||
|
||||
## Notes
|
||||
## Git Quirks
|
||||
|
||||
Git might have issues dealing with long file paths during build. You may want/need to enable `core.longpaths` support (see [this page](https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path) for details).
|
||||
|
||||
If PowerShell does not execute the script due to a security error, you may have to run the following command from an administrator prompt:
|
||||
# Build Infrastructure
|
||||
|
||||
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
|
||||
The Umbraco Build infrastructure relies on a PowerShell object. The object can be retrieved with:
|
||||
|
||||
# Build
|
||||
$ubuild = build/build.ps1 -get
|
||||
|
||||
The Umbraco Build solution relies on a PowerShell module. The module needs to be imported into PowerShell. From within Umbraco's repository root:
|
||||
|
||||
build\build.ps1 -ModuleOnly
|
||||
|
||||
Or the abbreviated form:
|
||||
|
||||
build\build.ps1 -mo
|
||||
|
||||
Once the module has been imported, a set of commands are added to PowerShell.
|
||||
|
||||
## Get-UmbracoBuildEnv
|
||||
|
||||
Gets the Umbraco build environment ie NuGet, Semver, Visual Studio, etc. Downloads things that can be downloaded such as NuGet. Examples:
|
||||
|
||||
$uenv = Get-UmbracoBuildEnv
|
||||
Write-Host $uenv.SolutionRoot
|
||||
&$uenv.NuGet help
|
||||
The object exposes various properties and methods that can be used to fine-grain build Umbraco. Some, but not all, of them are detailed below.
|
||||
|
||||
## Properties
|
||||
|
||||
The object exposes the following properties:
|
||||
|
||||
* `SolutionRoot`: the absolute path to the solution root
|
||||
@@ -96,11 +76,11 @@ The Visual Studio object is `null` when Visual Studio has not been detected (eg
|
||||
* `Minor`: Visual Studio minor version
|
||||
* `MsBUild`: the absolute path to the MsBuild executable
|
||||
|
||||
## Get-UmbracoVersion
|
||||
## GetUmbracoVersion
|
||||
|
||||
Gets an object representing the current Umbraco version. Example:
|
||||
|
||||
$v = Get-UmbracoVersion
|
||||
$v = $ubuild.GetUmbracoVersion()
|
||||
Write-Host $v.Semver
|
||||
|
||||
The object exposes the following properties:
|
||||
@@ -110,28 +90,24 @@ The object exposes the following properties:
|
||||
* `Comment`: the pre release part of the version (eg `alpha02`)
|
||||
* `Build`: the build number part of the version (eg `1234`)
|
||||
|
||||
## Set-UmbracoVersion
|
||||
## SetUmbracoVersion
|
||||
|
||||
Modifies Umbraco files with the new version.
|
||||
|
||||
>This entirely replaces the legacy `UmbracoVersion.txt` file.
|
||||
>This entirely replaces the legacy `UmbracoVersion.txt` file. Do *not* edit version infos in files.
|
||||
|
||||
The version must be a valid semver version. It can include a *pre release* part (eg `alpha02`) and/or a *build number* (eg `1234`). Examples:
|
||||
|
||||
Set-UmbracoVersion 7.6.33
|
||||
Set-UmbracoVersion 7.6.33-alpha02
|
||||
Set-UmbracoVersion 7.6.33+1234
|
||||
Set-UmbracoVersion 7.6.33-beta05+5678
|
||||
$ubuild.SetUmbracoVersion("7.6.33")
|
||||
$ubuild.SetUmbracoVersion("7.6.33-alpha.2")
|
||||
$ubuild.SetUmbracoVersion("7.6.33+1234")
|
||||
$ubuild.SetUmbracoVersion("7.6.33-beta.5+5678")
|
||||
|
||||
Note that `Set-UmbracoVersion` enforces a slightly more restrictive naming scheme than what semver would tolerate. The pre release part can only be composed of a-z and 0-9, therefore `alpha033` is considered valid but not `alpha.033` nor `alpha033-preview` nor `RC2` (would need to be lowercased `rc2`).
|
||||
|
||||
>It is considered best to add trailing zeroes to pre releases, else NuGet gets the order of versions wrong. So if you plan to have more than 10, but no more that 100 alpha versions, number the versions `alpha00`, `alpha01`, etc.
|
||||
|
||||
## Build-Umbraco
|
||||
## Build
|
||||
|
||||
Builds Umbraco. Temporary files are generated in `build.tmp` while the actual artifacts (zip files, NuGet packages...) are produced in `build.out`. Example:
|
||||
|
||||
Build-Umbraco
|
||||
$ubuild.Build()
|
||||
|
||||
Some log files, such as MsBuild logs, are produced in `build.tmp` too. The `build` directory should remain clean during a build.
|
||||
|
||||
@@ -185,6 +161,4 @@ We should increment versions as soon as a version is released. Ie, as soon as `7
|
||||
|
||||
NuGet / NuSpec consistency checks are performed in tests. We should move it so it is done as part of the PowerShell script even before we try to compile and run the tests.
|
||||
|
||||
There are still a few commands in `build` (to build docs, install Git or cleanup the install) that will need to be migrated to PowerShell.
|
||||
|
||||
/eof
|
||||
+4
-2
@@ -2,7 +2,7 @@
|
||||
|
||||
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
|
||||
|
||||
The following is a set of guidelines for contributing to Umbraco CMS.
|
||||
The following is a set of guidelines for contributing to Umbraco CMS.
|
||||
|
||||
These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
|
||||
|
||||
@@ -10,6 +10,8 @@ Remember, we're a friendly bunch and are happy with whatever contribution you mi
|
||||
|
||||
#### Table Of Contents
|
||||
|
||||
__[Quick start guide for Umbraco v8](https://github.com/umbraco/Umbraco-CMS/blob/temp8/V8_GETTING_STARTED.md)__
|
||||
|
||||
[Code of Conduct](#code-of-conduct)
|
||||
|
||||
[How Can I Contribute?](#how-can-i-contribute)
|
||||
@@ -41,7 +43,7 @@ This project and everyone participating in it is governed by the [our Code of Co
|
||||
### Reporting Bugs
|
||||
This section guides you through submitting a bug report for Umbraco CMS. Following these guidelines helps maintainers and the community understand your report 📝, reproduce the behavior 💻 💻, and find related reports 🔎.
|
||||
|
||||
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](ISSUE_TEMPLATE.md), the information it asks for helps us resolve issues faster.
|
||||
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](http://issues.umbraco.org/issues#newissue=61-30118), the information it asks for helps us resolve issues faster.
|
||||
|
||||
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!--
|
||||
this is Umbraco's NuGet configuration,
|
||||
content of this file is merged with the system-wide configuration,
|
||||
at %APPDATA%\NuGet\NuGet.config
|
||||
-->
|
||||
<packageSources>
|
||||
<add key="UmbracoCoreMyGet" value="https://www.myget.org/F/umbracocore/api/v3/index.json" />
|
||||
<add key="ExamineAppVeyor" value="https://ci.appveyor.com/nuget/examine-f73l6qv0oqfh/" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
@@ -1,3 +1,7 @@
|
||||
_Looking for Umbraco version 7? [Click here](https://github.com/umbraco/Umbraco-CMS) to go to the v7 branch_
|
||||
|
||||
__Ready to try out Version 8? [See the quick start guide](https://github.com/umbraco/Umbraco-CMS/blob/temp8/V8_GETTING_STARTED.md).__
|
||||
|
||||
Umbraco CMS
|
||||
===========
|
||||
The friendliest, most flexible and fastest growing ASP.NET CMS used by more than 443,000 websites worldwide: [https://umbraco.com](https://umbraco.com)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
## A quick start guide for getting up and runnning with Umbraco v8
|
||||
|
||||
### What you need:
|
||||
|
||||
* [Visual Studio 2017 Community (Free)](https://www.visualstudio.com/vs/community/), or Professional, Enterprise, etc...
|
||||
* .NET Framework 4.7.2 installed, get it here: https://www.microsoft.com/net/download/thank-you/net472?survey=false
|
||||
* .NET Framework 4.7.2 developer pack, get it here: https://www.microsoft.com/net/download/thank-you/net472-developer-pack _(be sure this is the ENU file which will be named `NDP472-DevPack-ENU.exe`)_
|
||||
* Clone the Umbraco repository and ensure you have the `temp8` branch checked out
|
||||
|
||||
### Start the solution
|
||||
|
||||
* Open the `/src/umbraco.sln` Visual Studio solution
|
||||
* Start the solution (easiest way is to use `ctrl + F5`)
|
||||
* When the solution is first built this may take some time since it will restore all nuget, npm and bower packages, build the .net solution and also build the angular solution.
|
||||
* When the website starts you'll see the Umbraco installer and just follow the prompts
|
||||
* Your all set!
|
||||
|
||||
### Making code changes
|
||||
|
||||
* _The process for making code changes in v8 is the same as v7_
|
||||
* Any .NET changes you make you just need to compile
|
||||
* Any Angular/JS changes you make you will need to make sure you are running the Gulp build. Easiest way to do this is from within Visual Studio in the `Task Runner Explorer`. You can find this window by pressing `ctrl + q` and typing in `Task Runner Explorer`. In this window you'll see all Gulp tasks, double click on the `dev` task, this will compile the angular solution and start a file watcher, then any html/js changes you make are automatically built.
|
||||
* When making js changes, you should have the chrome developer tools open to ensure that cache is disabled
|
||||
|
||||
### What to work on?
|
||||
|
||||
We are keeping track of [known issues and limitations here](http://issues.umbraco.org/issue/U4-11279). These line items will eventually be turned into actual tasks to be worked on. Feel free to help us keep this list updated if you find issues and even help fix some of these items. If there is a particular item you'd like to help fix please mention this on the task and we'll create a sub task for the item to continue discussion there.
|
||||
|
||||
There's [a list of tasks for v8 that haven't been completed](http://issues.umbraco.org/issues/U4?q=Due+in+version%3A+8.0.0+%23Unresolved+). If you are interested in helping out with any of these please mention this on the task. This list will be constantly updated as we begin to document and design some of the other tasks that still need to get done.
|
||||
|
||||
@@ -15,51 +15,66 @@
|
||||
<language>en-US</language>
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="Microsoft.AspNet.Mvc" version="[5.2.4,6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi" version="[5.2.4,6.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.Identity.Owin" version="[2.2.1, 3.0.0)" />
|
||||
<dependency id="Microsoft.Owin.Security.Cookies" version="[4.0.0, 5.0.0)" />
|
||||
<dependency id="Microsoft.Owin.Security.OAuth" version="[4.0.0, 5.0.0)" />
|
||||
<dependency id="Microsoft.Owin.Host.SystemWeb" version="[4.0.0, 5.0.0)" />
|
||||
<dependency id="MiniProfiler" version="[3.2.0.157, 3.9.999)" />
|
||||
<dependency id="HtmlAgilityPack" version="[1.7.2, 2.0.0)" />
|
||||
<dependency id="Lucene.Net" version="[3.0.3, 4.0.0.0)" />
|
||||
<dependency id="MySql.Data" version="[6.10.6, 7.0.0)" />
|
||||
<dependency id="ClientDependency" version="[1.9.6, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc5" version="[1.8.0.0, 2.0.0)" />
|
||||
<dependency id="AutoMapper" version="[6.2.2, 7.0.0)" />
|
||||
<dependency id="LightInject" version="[5.1.2, 6.0.0)" />
|
||||
<dependency id="LightInject.Mvc" version="[2.0.0, 3.0.0)" />
|
||||
<dependency id="LightInject.Web" version="[2.0.0, 3.0.0)" />
|
||||
<dependency id="LightInject.WebApi" version="[2.0.0, 3.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[11.0.2, 12.0.0)" />
|
||||
<dependency id="Examine" version="[1.0.0-beta025, 1.666.666)" />
|
||||
<dependency id="ImageProcessor" version="[2.6.0, 3.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[4.8.7, 5.0.0)" />
|
||||
<dependency id="semver" version="[2.0.4, 3.0.0)" />
|
||||
<dependency id="Markdown" version="[2.2.1, 3.0.0)" />
|
||||
<dependency id="log4net" version="[2.0.8, 3.0.0)" />
|
||||
<dependency id="System.Threading.Tasks.Dataflow" version="[4.8.0, 5.0.0)" />
|
||||
<dependency id="System.ValueTuple" version="[4.4.0, 5.0.0)" />
|
||||
<dependency id="NPoco" version="3.9.0" />
|
||||
<dependency id="NuGet.Core" version="2.14.0" />
|
||||
<dependency id="AutoMapper" version="[6.2.2,6.666666)" />
|
||||
<dependency id="ClientDependency" version="[1.9.6,1.666666)" />
|
||||
<dependency id="ClientDependency-Mvc5" version="[1.8.0,1.666666)" />
|
||||
<dependency id="CSharpTest.Net.Collections" version="[14.906.1403.1082,14.666666)" />
|
||||
<dependency id="Examine" version="[1.0.0-beta025,1.666666)" />
|
||||
<dependency id="HtmlAgilityPack" version="[1.7.2,1.666666)" />
|
||||
<dependency id="ImageProcessor" version="[2.6.1.19,2.666666)" />
|
||||
<dependency id="ImageProcessor.Web" version="[4.9.2.19,4.666666)" />
|
||||
<dependency id="ImageProcessor.Web.Config" version="[2.4.1.19,2.666666)" />
|
||||
<dependency id="LightInject" version="[5.1.2,5.666666)" />
|
||||
<dependency id="LightInject.Annotation" version="[1.1.0,1.666666)" />
|
||||
<dependency id="LightInject.Mvc" version="[2.0.0,2.666666)" />
|
||||
<dependency id="LightInject.WebApi" version="[2.0.0,2.666666)" />
|
||||
<dependency id="log4net" version="[2.0.8,2.666666)" />
|
||||
<dependency id="Log4Net.Async" version="[2.0.4,2.666666)" />
|
||||
<dependency id="Lucene.Net.Contrib" version="[3.0.3,3.666666)" />
|
||||
<dependency id="Markdown" version="[2.2.1,2.666666)" />
|
||||
<dependency id="Microsoft.AspNet.Identity.Owin" version="[2.2.1,2.666666)" />
|
||||
<dependency id="Microsoft.AspNet.Mvc" version="[5.2.6,5.666666)" />
|
||||
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.3,2.666666)" />
|
||||
<dependency id="Microsoft.AspNet.WebApi" version="[5.2.6,5.666666)" />
|
||||
<dependency id="Microsoft.CodeAnalysis.CSharp" version="[2.8.0,2.666666)" />
|
||||
<dependency id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="[1.0.8,1.666666)" />
|
||||
<dependency id="Microsoft.Net.Compilers" version="[2.8.0,2.666666)" />
|
||||
<dependency id="Microsoft.Owin.Host.SystemWeb" version="[4.0.0,4.666666)" />
|
||||
<dependency id="Microsoft.Owin.Security.Cookies" version="[4.0.0,4.666666)" />
|
||||
<dependency id="Microsoft.Owin.Security.OAuth" version="[4.0.0,4.666666)" />
|
||||
<dependency id="Microsoft.Web.Xdt" version="[2.1.2,2.666666)" />
|
||||
<dependency id="MiniProfiler" version="[3.2.0.157,3.666666)" />
|
||||
<dependency id="MySql.Data" version="[6.10.7,6.666666)" />
|
||||
<dependency id="Newtonsoft.Json" version="[11.0.2,11.666666)" />
|
||||
<dependency id="NPoco" version="[3.9.3,3.666666)" />
|
||||
<dependency id="Semver" version="[2.0.4,2.666666)" />
|
||||
<dependency id="System.Reflection.Metadata" version="[1.5.0,1.666666)" />
|
||||
<dependency id="System.Reflection.Primitives" version="[4.3.0,4.666666)" />
|
||||
<dependency id="System.Runtime.Handles" version="[4.3.0,4.666666)" />
|
||||
<dependency id="System.Security.Cryptography.Algorithms" version="[4.3.1,4.666666)" />
|
||||
<dependency id="System.Security.Cryptography.X509Certificates" version="[4.3.2,4.666666)" />
|
||||
<dependency id="System.Text.Encoding.CodePages" version="[4.4.0,4.666666)" />
|
||||
<dependency id="System.Threading.Tasks.Dataflow" version="[4.8.0,4.666666)" />
|
||||
<dependency id="System.ValueTuple" version="[4.4.0,4.666666)" />
|
||||
<dependency id="Umbraco.ModelsBuilder" version="[8.0.0-alpha.18,8.666666)" />
|
||||
<dependency id="Umbraco.SqlServerCE" version="[4.0.0.1,4.666666)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="$BuildTmp$\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\System.Data.SqlServerCe.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\System.Data.SqlServerCe.Entity.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Core.dll" target="lib\Umbraco.Core.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Core.dll" target="lib\net472\Umbraco.Core.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.dll" target="lib\net472\Umbraco.Web.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.UI.dll" target="lib\net472\Umbraco.Web.UI.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Examine.dll" target="lib\net472\Umbraco.Examine.dll" />
|
||||
|
||||
<!-- docs -->
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Core.xml" target="lib\Umbraco.Core.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.dll" target="lib\Umbraco.Web.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.xml" target="lib\Umbraco.Web.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Web.UI.xml" target="lib\Umbraco.Web.UI.xml" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Examine.dll" target="lib\Umbraco.Examine.dll" />
|
||||
<file src="$BuildTmp$\WebApp\bin\Umbraco.Examine.xml" target="lib\Umbraco.Examine.xml" />
|
||||
|
||||
<file src="tools\install.core.ps1" target="tools\install.ps1" />
|
||||
|
||||
<!-- produce symbols package -->
|
||||
<!-- symbols -->
|
||||
<file src="$BuildTmp$\bin\Umbraco.Core.pdb" target="lib" />
|
||||
<file src="$BuildTmp$\..\src\Umbraco.Core\**\*.cs" exclude="$BuildTmp$\..\src\**\TemporaryGeneratedFile*.cs" target="src\Umbraco.Core" />
|
||||
<file src="$BuildTmp$\bin\Umbraco.Web.pdb" target="lib" />
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<tags>umbraco</tags>
|
||||
<dependencies>
|
||||
<dependency id="UmbracoCms.Core" version="[$version$]" />
|
||||
<dependency id="Umbraco.ModelsBuilder" version="[8.0.0-alpha.17, 9.0.0)" />
|
||||
<dependency id="Umbraco.ModelsBuilder" version="[8.0.0-alpha.18, 9.0.0)" />
|
||||
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.3, 3.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
@@ -27,8 +27,6 @@
|
||||
<file src="$BuildTmp$\WebApp\Global.asax" target="Content\Global.asax" />
|
||||
<file src="$BuildTmp$\WebApp\Web.config" target="UmbracoFiles\Web.config" />
|
||||
<file src="$BuildTmp$\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
|
||||
<file src="$BuildTmp$\WebApp\bin\amd64\**" target="UmbracoFiles\bin\amd64" />
|
||||
<file src="$BuildTmp$\WebApp\bin\x86\**" target="UmbracoFiles\bin\x86" />
|
||||
<file src="$BuildTmp$\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
|
||||
<file src="$BuildTmp$\WebApp\config\BackOfficeTours\**" target="Content\Config\BackOfficeTours" />
|
||||
<file src="$BuildTmp$\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<configSections>
|
||||
<section name="BaseRestExtensions" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<section name="FileSystemProviders" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<section name="ExamineLuceneIndexSets" type="Examine.LuceneEngine.Config.IndexSets, Examine" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="SetAttributes(type,requirePermission)" />
|
||||
|
||||
<section name="ExamineLuceneIndexSets" type="Umbraco.Examine.Config.IndexSets, Umbraco.Examine" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="SetAttributes(type,requirePermission)" />
|
||||
|
||||
<sectionGroup name="applicationSettings" xdt:Locator="Match(name)">
|
||||
<section name="umbraco.presentation.Properties.Settings" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
</sectionGroup>
|
||||
@@ -67,190 +67,6 @@
|
||||
<profile defaultProvider="DefaultProfileProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove"/>>
|
||||
<sessionState customProvider="DefaultSessionProvider" xdt:Locator="Match(customProvider)" xdt:Transform="Remove"/>
|
||||
<compilation xdt:Transform="InsertIfMissing" />
|
||||
<compilation>
|
||||
<assemblies xdt:Transform="InsertIfMissing" />
|
||||
<assemblies>
|
||||
<add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<add assembly="System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Collections.Concurrent, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ComponentModel.Annotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ComponentModel.EventBasedAsync, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Diagnostics.Contracts, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Diagnostics.Debug, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Diagnostics.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Dynamic.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Globalization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Linq.Expressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Linq.Parallel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Linq.Queryable, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Net.NetworkInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Net.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Net.Requests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Reflection.Emit, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Reflection.Emit.ILGeneration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Reflection.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Reflection.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Resources.ResourceManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.InteropServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.InteropServices.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.Serialization.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.Serialization.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Runtime.Serialization.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Security.Principal, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ServiceModel.Duplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ServiceModel.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ServiceModel.NetTcp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ServiceModel.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.ServiceModel.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Text.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Text.Encoding.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Text.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Threading.Tasks.Parallel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Xml.ReaderWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Xml.XDocument, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
<add assembly="System.Xml.XmlSerializer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
<compilation>
|
||||
<assemblies>
|
||||
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Collections" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Collections.Concurrent" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ComponentModel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ComponentModel.Annotations" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ComponentModel.EventBasedAsync" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Diagnostics.Contracts" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Diagnostics.Debug" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Diagnostics.Tools" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Diagnostics.Tracing" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Dynamic.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Globalization" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.IO" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Linq" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Linq.Expressions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Linq.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Linq.Queryable" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Net.NetworkInformation" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Net.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Net.Requests" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ObjectModel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Reflection" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Reflection.Emit" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Reflection.Emit.ILGeneration" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Reflection.Emit.Lightweight" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Reflection.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Reflection.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Resources.ResourceManager" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.InteropServices" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.InteropServices.WindowsRuntime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.Numerics" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.Serialization.Json" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.Serialization.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Runtime.Serialization.Xml" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Security.Principal" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ServiceModel.Duplex" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ServiceModel.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ServiceModel.NetTcp" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ServiceModel.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.ServiceModel.Security" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Text.Encoding" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Text.Encoding.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Text.RegularExpressions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Threading" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Threading.Tasks" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Threading.Tasks.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Xml.ReaderWriter" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Xml.XDocument" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
<remove assembly="System.Xml.XmlSerializer" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<compilation>
|
||||
<assemblies>
|
||||
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Collections" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Collections.Concurrent" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ComponentModel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ComponentModel.Annotations" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ComponentModel.EventBasedAsync" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Diagnostics.Contracts" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Diagnostics.Debug" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Diagnostics.Tools" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Diagnostics.Tracing" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Dynamic.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Globalization" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.IO" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Linq" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Linq.Expressions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Linq.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Linq.Queryable" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Net.NetworkInformation" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Net.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Net.Requests" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ObjectModel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Reflection" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Reflection.Emit" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Reflection.Emit.ILGeneration" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Reflection.Emit.Lightweight" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Reflection.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Reflection.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Resources.ResourceManager" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.InteropServices" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.InteropServices.WindowsRuntime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.Numerics" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.Serialization.Json" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.Serialization.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Runtime.Serialization.Xml" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Security.Principal" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ServiceModel.Duplex" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ServiceModel.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ServiceModel.NetTcp" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ServiceModel.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.ServiceModel.Security" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Text.Encoding" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Text.Encoding.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Text.RegularExpressions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Threading" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Threading.Tasks" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Threading.Tasks.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Xml.ReaderWriter" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Xml.XDocument" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
<remove assembly="System.Xml.XmlSerializer" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
|
||||
<xhtmlConformance xdt:Transform="Remove" />
|
||||
|
||||
|
||||
@@ -86,9 +86,6 @@
|
||||
<add application="developer" alias="relationTypes" title="Relation Types" type="umbraco.loadRelationTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4"
|
||||
xdt:Locator="Match(application,alias)"
|
||||
xdt:Transform="SetAttributes()" />
|
||||
<add initialize="true" sortOrder="5" alias="xslt" application="developer" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.XsltTreeController, umbraco"
|
||||
xdt:Locator="Match(application,alias)"
|
||||
xdt:Transform="SetAttributes()" />
|
||||
|
||||
<add application="developer" alias="partialViewMacros" type="Umbraco.Web.Trees.PartialViewMacrosTree, umbraco"
|
||||
xdt:Locator="Match(application,alias,type)"
|
||||
|
||||
@@ -5,4 +5,6 @@
|
||||
</content>
|
||||
|
||||
<webservices xdt:Transform="Remove" />
|
||||
|
||||
<repositories xdt:Transform="Remove" />
|
||||
</settings>
|
||||
@@ -5,7 +5,7 @@
|
||||
# . "$PSScriptRoot\build-bootstrap.ps1"
|
||||
|
||||
# THIS FILE IS DISTRIBUTED AS PART OF UMBRACO.BUILD
|
||||
# DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION
|
||||
# DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION
|
||||
|
||||
# ################################################################
|
||||
# BOOTSTRAP
|
||||
@@ -41,12 +41,28 @@
|
||||
throw "Failed to locate NuGet.exe."
|
||||
}
|
||||
|
||||
# NuGet notes
|
||||
# As soon as we use -ConfigFile, NuGet uses that file, and only that file, and does not
|
||||
# merge configuration from system level. See comments in NuGet.Client solution, class
|
||||
# NuGet.Configuration.Settings, method LoadDefaultSettings.
|
||||
# For NuGet to merge configurations, it needs to "find" the file in the current directory,
|
||||
# or above. Which means we cannot really use -ConfigFile but instead have to have Umbraco's
|
||||
# NuGet.config file at root, and always run NuGet.exe while at root or in a directory below
|
||||
# root.
|
||||
|
||||
$solutionRoot = "$scriptRoot\.."
|
||||
$testPwd = [System.IO.Path]::GetFullPath($pwd.Path) + "\"
|
||||
$testRoot = [System.IO.Path]::GetFullPath($solutionRoot) + "\"
|
||||
if (-not $testPwd.ToLower().StartsWith($testRoot.ToLower()))
|
||||
{
|
||||
throw "Cannot run outside of the solution's root."
|
||||
}
|
||||
|
||||
# get the build system
|
||||
if (-not $local)
|
||||
{
|
||||
$solutionRoot = "$scriptRoot\.."
|
||||
$nugetConfig = @{$true="$solutionRoot\src\NuGet.config.user";$false="$solutionRoot\src\NuGet.config"}[(test-path "$solutionRoot\src\NuGet.config.user")]
|
||||
&$nuget install Umbraco.Build -OutputDirectory $scriptTemp -Verbosity quiet -PreRelease -ConfigFile $nugetConfig
|
||||
$params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease"
|
||||
&$nuget install Umbraco.Build @params
|
||||
if (-not $?) { throw "Failed to download Umbraco.Build." }
|
||||
}
|
||||
|
||||
@@ -63,7 +79,7 @@
|
||||
|
||||
# at that point the build.ps1 script must boot the build system
|
||||
# eg
|
||||
# $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."),
|
||||
# $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."),
|
||||
# @{ Local = $local; With7Zip = $false; WithNode = $false },
|
||||
# @{ continue = $continue })
|
||||
# if (-not $?) { throw "Failed to boot the build system." }
|
||||
@@ -73,4 +89,4 @@
|
||||
# Write-Host "Umbraco.Whatever Build"
|
||||
# Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
|
||||
|
||||
# eof
|
||||
# eof
|
||||
|
||||
+7
-15
@@ -235,7 +235,6 @@
|
||||
/t:Build `
|
||||
/tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" `
|
||||
/p:UmbracoBuild=True `
|
||||
/p:NugetPackages="$($this.SolutionRoot)\src\packages" `
|
||||
> $log
|
||||
|
||||
if (-not $?) { throw "Failed to compile tests." }
|
||||
@@ -299,10 +298,10 @@
|
||||
# copy libs
|
||||
Write-Host "Copy SqlCE libraries"
|
||||
$nugetPackages = [System.Environment]::ExpandEnvironmentVariables("%userprofile%\.nuget\packages")
|
||||
$this.CopyFiles("$nugetPackages\SqlServerCE\4.0.0.1", "*.*", "$tmp\bin", `
|
||||
{ -not $_.Extension.StartsWith(".nu") -and -not $_.RelativeName.StartsWith("lib\") })
|
||||
$this.CopyFiles("$nugetPackages\SqlServerCE\4.0.0.1", "*.*", "$tmp\WebApp\bin", `
|
||||
{ -not $_.Extension.StartsWith(".nu") -and -not $_.RelativeName.StartsWith("lib\") })
|
||||
$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\bin\x86")
|
||||
$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\bin\amd64")
|
||||
$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\WebApp\bin\x86")
|
||||
$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\WebApp\bin\amd64")
|
||||
|
||||
# copy Belle
|
||||
Write-Host "Copy Belle"
|
||||
@@ -343,13 +342,13 @@
|
||||
$this.TempStoreFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config")
|
||||
Write-Host "Create clean web.config"
|
||||
$this.CopyFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.Template.config", "$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config")
|
||||
|
||||
|
||||
Write-host "Set environment"
|
||||
$env:UMBRACO_VERSION=$this.Version.Semver.ToString()
|
||||
$env:UMBRACO_RELEASE=$this.Version.Release
|
||||
$env:UMBRACO_COMMENT=$this.Version.Comment
|
||||
$env:UMBRACO_BUILD=$this.Version.Build
|
||||
|
||||
|
||||
if ($args -and $args[0] -eq "vso")
|
||||
{
|
||||
Write-host "Set VSO environment"
|
||||
@@ -373,15 +372,13 @@
|
||||
Write-Host "Add web.config transforms to NuGet package"
|
||||
mv "$($this.BuildTemp)\WebApp\Views\Web.config" "$($this.BuildTemp)\WebApp\Views\Web.config.transform"
|
||||
|
||||
# fixme - that one does not exist in .bat build either?
|
||||
#mv "$($this.BuildTemp)\WebApp\Xslt\Web.config" "$($this.BuildTemp)\WebApp\Xslt\Web.config.transform"
|
||||
})
|
||||
|
||||
$ubuild.DefineMethod("RestoreNuGet",
|
||||
{
|
||||
Write-Host "Restore NuGet"
|
||||
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
|
||||
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" -ConfigFile $this.BuildEnv.NuGetConfig > "$($this.BuildTemp)\nuget.restore.log"
|
||||
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" > "$($this.BuildTemp)\nuget.restore.log"
|
||||
if (-not $?) { throw "Failed to restore NuGet packages." }
|
||||
})
|
||||
|
||||
@@ -391,11 +388,6 @@
|
||||
|
||||
Write-Host "Create NuGet packages"
|
||||
|
||||
# see https://docs.microsoft.com/en-us/nuget/schema/nuspec
|
||||
# note - warnings about SqlCE native libs being outside of 'lib' folder,
|
||||
# nothing much we can do about it as it's intentional yet there does not
|
||||
# seem to be a way to disable the warning
|
||||
|
||||
&$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.Core.nuspec" `
|
||||
-Properties BuildTmp="$($this.BuildTemp)" `
|
||||
-Version "$($this.Version.Semver.ToString())" `
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
|
||||
<add key="umbracocore" value="https://www.myget.org/F/umbracocore/api/v3/index.json" />
|
||||
<add key="examineAppVeyor" value="https://ci.appveyor.com/nuget/examine-f73l6qv0oqfh/" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
+3
-1
@@ -10,6 +10,8 @@ using System.Resources;
|
||||
|
||||
// versions
|
||||
// read https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin
|
||||
|
||||
// note: do NOT change anything here manually, use the build scripts
|
||||
|
||||
// this is the ONLY ONE the CLR cares about for compatibility
|
||||
// should change ONLY when "hard" breaking compatibility (manual change)
|
||||
@@ -17,4 +19,4 @@ using System.Resources;
|
||||
|
||||
// these are FYI and changed automatically
|
||||
[assembly: AssemblyFileVersion("8.0.0")]
|
||||
[assembly: AssemblyInformationalVersion("8.0.0-alpha.32")]
|
||||
[assembly: AssemblyInformationalVersion("8.0.0-alpha.37")]
|
||||
|
||||
@@ -22,9 +22,7 @@ namespace Umbraco.Core.Cache
|
||||
|
||||
[UmbracoWillObsolete("This cache key is only used for the legacy 'library' caching, remove in v8")]
|
||||
public const string MediaCacheKey = "UL_GetMedia";
|
||||
|
||||
public const string MacroXsltCacheKey = "macroXslt_";
|
||||
|
||||
|
||||
[UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")]
|
||||
public const string MacroCacheKey = "UmbracoMacroCache";
|
||||
|
||||
@@ -39,54 +37,14 @@ namespace Umbraco.Core.Cache
|
||||
[UmbracoWillObsolete("This cache key is only used for legacy template business logic caching, remove in v8")]
|
||||
public const string TemplateFrontEndCacheKey = "template";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string TemplateBusinessLogicCacheKey = "UmbracoTemplateCache";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string UserContextCacheKey = "UmbracoUserContext";
|
||||
|
||||
public const string UserContextTimeoutCacheKey = "UmbracoUserContextTimeout";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string UserCacheKey = "UmbracoUser";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string UserGroupPermissionsCacheKey = "UmbracoUserGroupPermissions";
|
||||
|
||||
[UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")]
|
||||
public const string ContentTypeCacheKey = "UmbracoContentType";
|
||||
|
||||
[UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")]
|
||||
public const string ContentTypePropertiesCacheKey = "ContentType_PropertyTypes_Content:";
|
||||
|
||||
[Obsolete("No longer used and will be removed in v8")]
|
||||
public const string PropertyTypeCacheKey = "UmbracoPropertyTypeCache";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string LanguageCacheKey = "UmbracoLanguageCache";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string DomainCacheKey = "UmbracoDomainList";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string StylesheetCacheKey = "UmbracoStylesheet";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string StylesheetPropertyCacheKey = "UmbracoStylesheetProperty";
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in the future")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string DataTypeCacheKey = "UmbracoDataTypeDefinition";
|
||||
public const string DataTypePreValuesCacheKey = "UmbracoPreVal";
|
||||
|
||||
|
||||
public const string IdToKeyCacheKey = "UI2K__";
|
||||
public const string KeyToIdCacheKey = "UK2I__";
|
||||
}
|
||||
|
||||
@@ -24,8 +24,13 @@ namespace Umbraco.Core.Cache
|
||||
protected abstract object GetEntry(string key);
|
||||
|
||||
// read-write lock the underlying cache
|
||||
protected abstract IDisposable ReadLock { get; }
|
||||
protected abstract IDisposable WriteLock { get; }
|
||||
//protected abstract IDisposable ReadLock { get; }
|
||||
//protected abstract IDisposable WriteLock { get; }
|
||||
|
||||
protected abstract void EnterReadLock();
|
||||
protected abstract void ExitReadLock();
|
||||
protected abstract void EnterWriteLock();
|
||||
protected abstract void ExitWriteLock();
|
||||
|
||||
protected string GetCacheKey(string key)
|
||||
{
|
||||
@@ -88,21 +93,31 @@ namespace Umbraco.Core.Cache
|
||||
|
||||
public virtual void ClearAllCache()
|
||||
{
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
foreach (var entry in GetDictionaryEntries()
|
||||
.ToArray())
|
||||
RemoveEntry((string) entry.Key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheItem(string key)
|
||||
{
|
||||
var cacheKey = GetCacheKey(key);
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
RemoveEntry(cacheKey);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheObjectTypes(string typeName)
|
||||
@@ -110,15 +125,16 @@ namespace Umbraco.Core.Cache
|
||||
var type = TypeFinder.GetTypeByName(typeName);
|
||||
if (type == null) return;
|
||||
var isInterface = type.IsInterface;
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
foreach (var entry in GetDictionaryEntries()
|
||||
.Where(x =>
|
||||
{
|
||||
// entry.Value is Lazy<object> and not null, its value may be null
|
||||
// remove null values as well, does not hurt
|
||||
// get non-created as NonCreatedValue & exceptions as null
|
||||
var value = GetSafeLazyValue((Lazy<object>)x.Value, true);
|
||||
var value = GetSafeLazyValue((Lazy<object>) x.Value, true);
|
||||
|
||||
// if T is an interface remove anything that implements that interface
|
||||
// otherwise remove exact types (not inherited types)
|
||||
@@ -127,14 +143,19 @@ namespace Umbraco.Core.Cache
|
||||
.ToArray())
|
||||
RemoveEntry((string) entry.Key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheObjectTypes<T>()
|
||||
{
|
||||
var typeOfT = typeof(T);
|
||||
var isInterface = typeOfT.IsInterface;
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
foreach (var entry in GetDictionaryEntries()
|
||||
.Where(x =>
|
||||
{
|
||||
@@ -142,7 +163,7 @@ namespace Umbraco.Core.Cache
|
||||
// remove null values as well, does not hurt
|
||||
// compare on exact type, don't use "is"
|
||||
// get non-created as NonCreatedValue & exceptions as null
|
||||
var value = GetSafeLazyValue((Lazy<object>)x.Value, true);
|
||||
var value = GetSafeLazyValue((Lazy<object>) x.Value, true);
|
||||
|
||||
// if T is an interface remove anything that implements that interface
|
||||
// otherwise remove exact types (not inherited types)
|
||||
@@ -151,6 +172,10 @@ namespace Umbraco.Core.Cache
|
||||
.ToArray())
|
||||
RemoveEntry((string) entry.Key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheObjectTypes<T>(Func<string, T, bool> predicate)
|
||||
@@ -158,8 +183,9 @@ namespace Umbraco.Core.Cache
|
||||
var typeOfT = typeof(T);
|
||||
var isInterface = typeOfT.IsInterface;
|
||||
var plen = CacheItemPrefix.Length + 1;
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
foreach (var entry in GetDictionaryEntries()
|
||||
.Where(x =>
|
||||
{
|
||||
@@ -167,7 +193,7 @@ namespace Umbraco.Core.Cache
|
||||
// remove null values as well, does not hurt
|
||||
// compare on exact type, don't use "is"
|
||||
// get non-created as NonCreatedValue & exceptions as null
|
||||
var value = GetSafeLazyValue((Lazy<object>)x.Value, true);
|
||||
var value = GetSafeLazyValue((Lazy<object>) x.Value, true);
|
||||
if (value == null) return true;
|
||||
|
||||
// if T is an interface remove anything that implements that interface
|
||||
@@ -178,30 +204,44 @@ namespace Umbraco.Core.Cache
|
||||
}))
|
||||
RemoveEntry((string) entry.Key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheByKeySearch(string keyStartsWith)
|
||||
{
|
||||
var plen = CacheItemPrefix.Length + 1;
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
foreach (var entry in GetDictionaryEntries()
|
||||
.Where(x => ((string)x.Key).Substring(plen).InvariantStartsWith(keyStartsWith))
|
||||
.ToArray())
|
||||
RemoveEntry((string) entry.Key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheByKeyExpression(string regexString)
|
||||
{
|
||||
var plen = CacheItemPrefix.Length + 1;
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
foreach (var entry in GetDictionaryEntries()
|
||||
.Where(x => Regex.IsMatch(((string)x.Key).Substring(plen), regexString))
|
||||
.ToArray())
|
||||
RemoveEntry((string) entry.Key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -212,12 +252,18 @@ namespace Umbraco.Core.Cache
|
||||
{
|
||||
var plen = CacheItemPrefix.Length + 1;
|
||||
IEnumerable<DictionaryEntry> entries;
|
||||
using (ReadLock)
|
||||
try
|
||||
{
|
||||
EnterReadLock();
|
||||
entries = GetDictionaryEntries()
|
||||
.Where(x => ((string)x.Key).Substring(plen).InvariantStartsWith(keyStartsWith))
|
||||
.ToArray(); // evaluate while locked
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitReadLock();
|
||||
}
|
||||
|
||||
return entries
|
||||
.Select(x => GetSafeLazyValue((Lazy<object>)x.Value)) // return exceptions as null
|
||||
.Where(x => x != null); // backward compat, don't store null values in the cache
|
||||
@@ -228,12 +274,17 @@ namespace Umbraco.Core.Cache
|
||||
const string prefix = CacheItemPrefix + "-";
|
||||
var plen = prefix.Length;
|
||||
IEnumerable<DictionaryEntry> entries;
|
||||
using (ReadLock)
|
||||
try
|
||||
{
|
||||
EnterReadLock();
|
||||
entries = GetDictionaryEntries()
|
||||
.Where(x => Regex.IsMatch(((string)x.Key).Substring(plen), regexString))
|
||||
.ToArray(); // evaluate while locked
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitReadLock();
|
||||
}
|
||||
return entries
|
||||
.Select(x => GetSafeLazyValue((Lazy<object>)x.Value)) // return exceptions as null
|
||||
.Where(x => x != null); // backward compat, don't store null values in the cache
|
||||
@@ -243,10 +294,15 @@ namespace Umbraco.Core.Cache
|
||||
{
|
||||
cacheKey = GetCacheKey(cacheKey);
|
||||
Lazy<object> result;
|
||||
using (ReadLock)
|
||||
try
|
||||
{
|
||||
EnterReadLock();
|
||||
result = GetEntry(cacheKey) as Lazy<object>; // null if key not found
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitReadLock();
|
||||
}
|
||||
return result == null ? null : GetSafeLazyValue(result); // return exceptions as null
|
||||
}
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace Umbraco.Core.Cache
|
||||
}
|
||||
|
||||
// does NOT clone anything, so be nice with the returned values
|
||||
private IEnumerable<TEntity> GetAllCached(Func<TId[], IEnumerable<TEntity>> performGetAll)
|
||||
internal IEnumerable<TEntity> GetAllCached(Func<TId[], IEnumerable<TEntity>> performGetAll)
|
||||
{
|
||||
// try the cache first
|
||||
var all = Cache.GetCacheItem<DeepCloneableList<TEntity>>(GetEntityTypeCacheKey());
|
||||
|
||||
@@ -79,24 +79,26 @@ namespace Umbraco.Core.Cache
|
||||
|
||||
#region Lock
|
||||
|
||||
protected override IDisposable ReadLock
|
||||
private bool _entered;
|
||||
|
||||
protected override void EnterReadLock() => EnterWriteLock();
|
||||
|
||||
protected override void EnterWriteLock()
|
||||
{
|
||||
// there's no difference between ReadLock and WriteLock here
|
||||
get { return WriteLock; }
|
||||
if (HasContextItems)
|
||||
{
|
||||
System.Threading.Monitor.Enter(ContextItems.SyncRoot, ref _entered);
|
||||
}
|
||||
}
|
||||
|
||||
protected override IDisposable WriteLock
|
||||
{
|
||||
// NOTE
|
||||
// could think about just overriding base.Locker to return a different
|
||||
// object but then we'd create a ReaderWriterLockSlim per request,
|
||||
// which is less efficient than just using a basic monitor lock.
|
||||
protected override void ExitReadLock() => ExitWriteLock();
|
||||
|
||||
get
|
||||
protected override void ExitWriteLock()
|
||||
{
|
||||
if (_entered)
|
||||
{
|
||||
return HasContextItems
|
||||
? (IDisposable) new MonitorLock(ContextItems.SyncRoot)
|
||||
: new NoopLocker();
|
||||
_entered = false;
|
||||
System.Threading.Monitor.Exit(ContextItems.SyncRoot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,8 +115,9 @@ namespace Umbraco.Core.Cache
|
||||
|
||||
Lazy<object> result;
|
||||
|
||||
using (WriteLock)
|
||||
try
|
||||
{
|
||||
EnterWriteLock();
|
||||
result = ContextItems[cacheKey] as Lazy<object>; // null if key not found
|
||||
|
||||
// cannot create value within the lock, so if result.IsValueCreated is false, just
|
||||
@@ -127,6 +130,10 @@ namespace Umbraco.Core.Cache
|
||||
ContextItems[cacheKey] = result;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
ExitWriteLock();
|
||||
}
|
||||
|
||||
// using GetSafeLazy and GetSafeLazyValue ensures that we don't cache
|
||||
// exceptions (but try again and again) and silently eat them - however at
|
||||
|
||||
@@ -50,14 +50,26 @@ namespace Umbraco.Core.Cache
|
||||
|
||||
#region Lock
|
||||
|
||||
protected override IDisposable ReadLock
|
||||
protected override void EnterReadLock()
|
||||
{
|
||||
get { return new ReadLock(_locker); }
|
||||
_locker.EnterReadLock();
|
||||
}
|
||||
|
||||
protected override IDisposable WriteLock
|
||||
protected override void EnterWriteLock()
|
||||
{
|
||||
get { return new WriteLock(_locker); }
|
||||
_locker.EnterWriteLock();;
|
||||
}
|
||||
|
||||
protected override void ExitReadLock()
|
||||
{
|
||||
if (_locker.IsReadLockHeld)
|
||||
_locker.ExitReadLock();
|
||||
}
|
||||
|
||||
protected override void ExitWriteLock()
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -118,10 +130,16 @@ namespace Umbraco.Core.Cache
|
||||
// reads. We first try with a normal ReadLock for maximum concurrency and take the penalty of
|
||||
// having to re-lock in case there's no value. Would need to benchmark to figure out whether
|
||||
// it's worth it, though...
|
||||
using (new ReadLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterReadLock();
|
||||
result = _cache.Get(cacheKey) as Lazy<object>; // null if key not found
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsReadLockHeld)
|
||||
_locker.ExitReadLock();
|
||||
}
|
||||
var value = result == null ? null : GetSafeLazyValue(result);
|
||||
if (value != null) return value;
|
||||
|
||||
@@ -195,11 +213,17 @@ namespace Umbraco.Core.Cache
|
||||
var absolute = isSliding ? System.Web.Caching.Cache.NoAbsoluteExpiration : (timeout == null ? System.Web.Caching.Cache.NoAbsoluteExpiration : DateTime.Now.Add(timeout.Value));
|
||||
var sliding = isSliding == false ? System.Web.Caching.Cache.NoSlidingExpiration : (timeout ?? System.Web.Caching.Cache.NoSlidingExpiration);
|
||||
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
//NOTE: 'Insert' on System.Web.Caching.Cache actually does an add or update!
|
||||
_cache.Insert(cacheKey, result, dependency, absolute, sliding, priority, removedCallback);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertCacheItem(string cacheKey, Func<object> getCacheItem, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
|
||||
|
||||
@@ -37,20 +37,32 @@ namespace Umbraco.Core.Cache
|
||||
|
||||
public virtual void ClearAllCache()
|
||||
{
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
MemoryCache.DisposeIfDisposable();
|
||||
MemoryCache = new MemoryCache("in-memory");
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheItem(string key)
|
||||
{
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
if (MemoryCache[key] == null) return;
|
||||
MemoryCache.Remove(key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheObjectTypes(string typeName)
|
||||
@@ -58,8 +70,9 @@ namespace Umbraco.Core.Cache
|
||||
var type = TypeFinder.GetTypeByName(typeName);
|
||||
if (type == null) return;
|
||||
var isInterface = type.IsInterface;
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
foreach (var key in MemoryCache
|
||||
.Where(x =>
|
||||
{
|
||||
@@ -76,12 +89,18 @@ namespace Umbraco.Core.Cache
|
||||
.ToArray()) // ToArray required to remove
|
||||
MemoryCache.Remove(key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheObjectTypes<T>()
|
||||
{
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
var typeOfT = typeof (T);
|
||||
var isInterface = typeOfT.IsInterface;
|
||||
foreach (var key in MemoryCache
|
||||
@@ -101,12 +120,18 @@ namespace Umbraco.Core.Cache
|
||||
.ToArray()) // ToArray required to remove
|
||||
MemoryCache.Remove(key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheObjectTypes<T>(Func<string, T, bool> predicate)
|
||||
{
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
var typeOfT = typeof(T);
|
||||
var isInterface = typeOfT.IsInterface;
|
||||
foreach (var key in MemoryCache
|
||||
@@ -127,30 +152,47 @@ namespace Umbraco.Core.Cache
|
||||
.ToArray()) // ToArray required to remove
|
||||
MemoryCache.Remove(key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheByKeySearch(string keyStartsWith)
|
||||
{
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
foreach (var key in MemoryCache
|
||||
.Where(x => x.Key.InvariantStartsWith(keyStartsWith))
|
||||
.Select(x => x.Key)
|
||||
.ToArray()) // ToArray required to remove
|
||||
MemoryCache.Remove(key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void ClearCacheByKeyExpression(string regexString)
|
||||
{
|
||||
using (new WriteLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterWriteLock();
|
||||
foreach (var key in MemoryCache
|
||||
.Where(x => Regex.IsMatch(x.Key, regexString))
|
||||
.Select(x => x.Key)
|
||||
.ToArray()) // ToArray required to remove
|
||||
MemoryCache.Remove(key);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsWriteLockHeld)
|
||||
_locker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -160,12 +202,18 @@ namespace Umbraco.Core.Cache
|
||||
public IEnumerable<object> GetCacheItemsByKeySearch(string keyStartsWith)
|
||||
{
|
||||
KeyValuePair<string, object>[] entries;
|
||||
using (new ReadLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterReadLock();
|
||||
entries = MemoryCache
|
||||
.Where(x => x.Key.InvariantStartsWith(keyStartsWith))
|
||||
.ToArray(); // evaluate while locked
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsReadLockHeld)
|
||||
_locker.ExitReadLock();
|
||||
}
|
||||
return entries
|
||||
.Select(x => DictionaryCacheProviderBase.GetSafeLazyValue((Lazy<object>)x.Value)) // return exceptions as null
|
||||
.Where(x => x != null) // backward compat, don't store null values in the cache
|
||||
@@ -175,12 +223,18 @@ namespace Umbraco.Core.Cache
|
||||
public IEnumerable<object> GetCacheItemsByKeyExpression(string regexString)
|
||||
{
|
||||
KeyValuePair<string, object>[] entries;
|
||||
using (new ReadLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterReadLock();
|
||||
entries = MemoryCache
|
||||
.Where(x => Regex.IsMatch(x.Key, regexString))
|
||||
.ToArray(); // evaluate while locked
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsReadLockHeld)
|
||||
_locker.ExitReadLock();
|
||||
}
|
||||
return entries
|
||||
.Select(x => DictionaryCacheProviderBase.GetSafeLazyValue((Lazy<object>)x.Value)) // return exceptions as null
|
||||
.Where(x => x != null) // backward compat, don't store null values in the cache
|
||||
@@ -190,10 +244,16 @@ namespace Umbraco.Core.Cache
|
||||
public object GetCacheItem(string cacheKey)
|
||||
{
|
||||
Lazy<object> result;
|
||||
using (new ReadLock(_locker))
|
||||
try
|
||||
{
|
||||
_locker.EnterReadLock();
|
||||
result = MemoryCache.Get(cacheKey) as Lazy<object>; // null if key not found
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_locker.IsReadLockHeld)
|
||||
_locker.ExitReadLock();
|
||||
}
|
||||
return result == null ? null : DictionaryCacheProviderBase.GetSafeLazyValue(result); // return exceptions as null
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Collections
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a composite key of (string, string) for fast dictionaries.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The string parts of the key are case-insensitive.</para>
|
||||
/// <para>Null is a valid value for both parts.</para>
|
||||
/// </remarks>
|
||||
public struct CompositeNStringNStringKey : IEquatable<CompositeNStringNStringKey>
|
||||
{
|
||||
private readonly string _key1;
|
||||
private readonly string _key2;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CompositeNStringNStringKey"/> struct.
|
||||
/// </summary>
|
||||
public CompositeNStringNStringKey(string key1, string key2)
|
||||
{
|
||||
_key1 = key1?.ToLowerInvariant() ?? "NULL";
|
||||
_key2 = key2?.ToLowerInvariant() ?? "NULL";
|
||||
}
|
||||
|
||||
public bool Equals(CompositeNStringNStringKey other)
|
||||
=> _key2 == other._key2 && _key1 == other._key1;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
=> obj is CompositeNStringNStringKey other && _key2 == other._key2 && _key1 == other._key1;
|
||||
|
||||
public override int GetHashCode()
|
||||
=> _key2.GetHashCode() * 31 + _key1.GetHashCode();
|
||||
|
||||
public static bool operator ==(CompositeNStringNStringKey key1, CompositeNStringNStringKey key2)
|
||||
=> key1._key2 == key2._key2 && key1._key1 == key2._key1;
|
||||
|
||||
public static bool operator !=(CompositeNStringNStringKey key1, CompositeNStringNStringKey key2)
|
||||
=> key1._key2 != key2._key2 || key1._key1 != key2._key1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Collections
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a composite key of (string, string) for fast dictionaries.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The string parts of the key are case-insensitive.</para>
|
||||
/// <para>Null is NOT a valid value for neither parts.</para>
|
||||
/// </remarks>
|
||||
public struct CompositeStringStringKey : IEquatable<CompositeStringStringKey>
|
||||
{
|
||||
private readonly string _key1;
|
||||
private readonly string _key2;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CompositeStringStringKey"/> struct.
|
||||
/// </summary>
|
||||
public CompositeStringStringKey(string key1, string key2)
|
||||
{
|
||||
_key1 = key1?.ToLowerInvariant() ?? throw new ArgumentNullException(nameof(key1));
|
||||
_key2 = key2?.ToLowerInvariant() ?? throw new ArgumentNullException(nameof(key2));
|
||||
}
|
||||
|
||||
public bool Equals(CompositeStringStringKey other)
|
||||
=> _key2 == other._key2 && _key1 == other._key1;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
=> obj is CompositeStringStringKey other && _key2 == other._key2 && _key1 == other._key1;
|
||||
|
||||
public override int GetHashCode()
|
||||
=> _key2.GetHashCode() * 31 + _key1.GetHashCode();
|
||||
|
||||
public static bool operator ==(CompositeStringStringKey key1, CompositeStringStringKey key2)
|
||||
=> key1._key2 == key2._key2 && key1._key1 == key2._key1;
|
||||
|
||||
public static bool operator !=(CompositeStringStringKey key1, CompositeStringStringKey key2)
|
||||
=> key1._key2 != key2._key2 || key1._key1 != key2._key1;
|
||||
}
|
||||
}
|
||||
@@ -50,10 +50,16 @@ namespace Umbraco.Core.Collections
|
||||
/// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param><exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
|
||||
public bool Remove(T item)
|
||||
{
|
||||
using (new WriteLock(_instanceLocker))
|
||||
try
|
||||
{
|
||||
_instanceLocker.EnterWriteLock();
|
||||
return _innerSet.Remove(item);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_instanceLocker.IsWriteLockHeld)
|
||||
_instanceLocker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,10 +92,16 @@ namespace Umbraco.Core.Collections
|
||||
/// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param><exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.</exception>
|
||||
public void Add(T item)
|
||||
{
|
||||
using (new WriteLock(_instanceLocker))
|
||||
try
|
||||
{
|
||||
_instanceLocker.EnterWriteLock();
|
||||
_innerSet.Add(item);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_instanceLocker.IsWriteLockHeld)
|
||||
_instanceLocker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -101,13 +113,20 @@ namespace Umbraco.Core.Collections
|
||||
{
|
||||
var clone = GetThreadSafeClone();
|
||||
if (clone.Contains(item)) return false;
|
||||
using (new WriteLock(_instanceLocker))
|
||||
try
|
||||
{
|
||||
_instanceLocker.EnterWriteLock();
|
||||
|
||||
//double check
|
||||
if (_innerSet.Contains(item)) return false;
|
||||
_innerSet.Add(item);
|
||||
return true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_instanceLocker.IsWriteLockHeld)
|
||||
_instanceLocker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -116,10 +135,16 @@ namespace Umbraco.Core.Collections
|
||||
/// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only. </exception>
|
||||
public void Clear()
|
||||
{
|
||||
using (new WriteLock(_instanceLocker))
|
||||
try
|
||||
{
|
||||
_instanceLocker.EnterWriteLock();
|
||||
_innerSet.Clear();
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_instanceLocker.IsWriteLockHeld)
|
||||
_instanceLocker.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -147,10 +172,16 @@ namespace Umbraco.Core.Collections
|
||||
private HashSet<T> GetThreadSafeClone()
|
||||
{
|
||||
HashSet<T> clone = null;
|
||||
using (new WriteLock(_instanceLocker))
|
||||
try
|
||||
{
|
||||
_instanceLocker.EnterWriteLock();
|
||||
clone = new HashSet<T>(_innerSet, _innerSet.Comparer);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (_instanceLocker.IsWriteLockHeld)
|
||||
_instanceLocker.ExitWriteLock();
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ namespace Umbraco.Core.Composing.CompositionRoots
|
||||
container.RegisterSingleton<IPartialViewRepository, PartialViewRepository>();
|
||||
container.RegisterSingleton<IScriptRepository, ScriptRepository>();
|
||||
container.RegisterSingleton<IStylesheetRepository, StylesheetRepository>();
|
||||
container.RegisterSingleton<IXsltFileRepository, XsltFileRepository>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace Umbraco.Core.Composing
|
||||
private static ILogger _logger;
|
||||
private static IProfiler _profiler;
|
||||
private static ProfilingLogger _profilingLogger;
|
||||
private static IPublishedValueFallback _publishedValueFallback;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the DI container.
|
||||
@@ -63,6 +64,7 @@ namespace Umbraco.Core.Composing
|
||||
_logger = null;
|
||||
_profiler = null;
|
||||
_profilingLogger = null;
|
||||
_publishedValueFallback = null;
|
||||
|
||||
Resetted?.Invoke(null, EventArgs.Empty);
|
||||
}
|
||||
@@ -153,6 +155,9 @@ namespace Umbraco.Core.Composing
|
||||
public static IPublishedContentTypeFactory PublishedContentTypeFactory
|
||||
=> Container.GetInstance<IPublishedContentTypeFactory>();
|
||||
|
||||
public static IPublishedValueFallback PublishedValueFallback
|
||||
=> _publishedValueFallback ?? Container.GetInstance<IPublishedValueFallback>() ?? new NoopPublishedValueFallback();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,15 +311,15 @@ namespace Umbraco.Core.Composing
|
||||
// we HAVE to let LightInject throw - and catch at THE OUTERMOST if InvalidOperationException in LightInject.Anything!
|
||||
|
||||
return factory.GetInstance(tService, serviceName, args);
|
||||
try
|
||||
{
|
||||
return factory.GetInstance(tService, serviceName, args);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LightInjectException.TryThrow(e, implementingType);
|
||||
throw;
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// return factory.GetInstance(tService, serviceName, args);
|
||||
//}
|
||||
//catch (Exception e)
|
||||
//{
|
||||
// LightInjectException.TryThrow(e, implementingType);
|
||||
// throw;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ContentElement : UmbracoConfigurationElement, IContentSection
|
||||
{
|
||||
private const string DefaultPreviewBadge = @"<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>";
|
||||
private const string DefaultPreviewBadge = @"<a id=""umbracoPreviewBadge"" style=""position: absolute; top: 0; right: 0; border: 0; width: 149px; height: 149px; background: url('{0}/assets/img/preview-mode-badge.png') no-repeat;"" href=""{0}/endPreview.aspx?redir={1}""><span style=""display:none;"">In Preview Mode - click to end</span></a>";
|
||||
|
||||
[ConfigurationProperty("imaging")]
|
||||
internal ContentImagingElement Imaging => (ContentImagingElement) this["imaging"];
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class DeveloperElement : ConfigurationElement, IDeveloperSection
|
||||
{
|
||||
private AppCodeFileExtensionsElement _default;
|
||||
|
||||
[ConfigurationProperty("appCodeFileExtensions")]
|
||||
internal AppCodeFileExtensionsElement AppCodeFileExtensions
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_default != null)
|
||||
{
|
||||
return _default;
|
||||
}
|
||||
|
||||
//here we need to check if this element is defined, if it is not then we'll setup the defaults
|
||||
var prop = Properties["appCodeFileExtensions"];
|
||||
var autoFill = this[prop] as ConfigurationElement;
|
||||
if (autoFill != null && autoFill.ElementInformation.IsPresent == false)
|
||||
{
|
||||
var collection = new AppCodeFileExtensionsCollection
|
||||
{
|
||||
new FileExtensionElement {RawValue = "cs"},
|
||||
new FileExtensionElement {RawValue = "vb"}
|
||||
};
|
||||
_default = new AppCodeFileExtensionsElement
|
||||
{
|
||||
AppCodeFileExtensionsCollection = collection
|
||||
};
|
||||
|
||||
return _default;
|
||||
}
|
||||
|
||||
return (AppCodeFileExtensionsElement)base["appCodeFileExtensions"];
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable<IFileExtension> IDeveloperSection.AppCodeFileExtensions
|
||||
{
|
||||
get { return AppCodeFileExtensions.AppCodeFileExtensionsCollection; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class DistributedCallElement : ConfigurationElement, IDistributedCallSection
|
||||
{
|
||||
[ConfigurationProperty("enable", DefaultValue = false)]
|
||||
internal bool Enabled
|
||||
{
|
||||
get { return (bool)base["enable"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("user")]
|
||||
internal InnerTextConfigurationElement<int> UserId
|
||||
{
|
||||
get
|
||||
{
|
||||
return new OptionalInnerTextConfigurationElement<int>(
|
||||
(InnerTextConfigurationElement<int>)this["user"],
|
||||
//set the default
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationCollection(typeof(ServerCollection), AddItemName = "server")]
|
||||
[ConfigurationProperty("servers", IsDefaultCollection = true)]
|
||||
internal ServerCollection Servers
|
||||
{
|
||||
get { return (ServerCollection)base["servers"]; }
|
||||
}
|
||||
|
||||
bool IDistributedCallSection.Enabled
|
||||
{
|
||||
get { return Enabled; }
|
||||
}
|
||||
|
||||
int IDistributedCallSection.UserId
|
||||
{
|
||||
get { return UserId; }
|
||||
}
|
||||
|
||||
IEnumerable<IServer> IDistributedCallSection.Servers
|
||||
{
|
||||
get { return Servers; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IDeveloperSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IFileExtension> AppCodeFileExtensions { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IDistributedCallSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool Enabled { get; }
|
||||
|
||||
int UserId { get; }
|
||||
|
||||
IEnumerable<IServer> Servers { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("This is no longer used and will be removed in future versions")]
|
||||
public interface ILink
|
||||
{
|
||||
string Application { get; }
|
||||
|
||||
string ApplicationUrl { get; }
|
||||
|
||||
string Language { get; }
|
||||
|
||||
string UserType { get; }
|
||||
|
||||
string HelpUrl { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
|
||||
public interface IRepositoriesSection : IUmbracoConfigurationSection
|
||||
{
|
||||
IEnumerable<IRepository> Repositories { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IRepository
|
||||
{
|
||||
string Name { get; }
|
||||
Guid Id { get; }
|
||||
string RepositoryUrl { get; }
|
||||
string WebServiceUrl { get; }
|
||||
bool HasCustomWebServiceUrl { get; }
|
||||
string RestApiUrl { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface IServer
|
||||
{
|
||||
string ForcePortnumber { get; }
|
||||
string ForceProtocol { get; }
|
||||
string ServerAddress { get; }
|
||||
|
||||
string AppId { get; }
|
||||
string ServerName { get; }
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public interface ITemplatesSection : IUmbracoConfigurationSection
|
||||
{
|
||||
bool UseAspNetMasterPages { get; }
|
||||
|
||||
bool EnableSkinSupport { get; }
|
||||
|
||||
RenderingEngine DefaultRenderingEngine { get; }
|
||||
|
||||
[Obsolete("This has no affect and will be removed in future versions")]
|
||||
bool EnableTemplateFolders { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,18 +14,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
IRequestHandlerSection RequestHandler { get; }
|
||||
|
||||
ITemplatesSection Templates { get; }
|
||||
|
||||
IDeveloperSection Developer { get; }
|
||||
|
||||
|
||||
|
||||
ILoggingSection Logging { get; }
|
||||
|
||||
IScheduledTasksSection ScheduledTasks { get; }
|
||||
|
||||
IDistributedCallSection DistributedCall { get; }
|
||||
|
||||
IRepositoriesSection PackageRepositories { get; }
|
||||
|
||||
IProvidersSection Providers { get; }
|
||||
|
||||
IWebRoutingSection WebRouting { get; }
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class RepositoriesCollection : ConfigurationElementCollection, IEnumerable<IRepository>
|
||||
{
|
||||
internal void Add(RepositoryElement item)
|
||||
{
|
||||
BaseAdd(item);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new RepositoryElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((RepositoryElement)element).Id;
|
||||
}
|
||||
|
||||
IEnumerator<IRepository> IEnumerable<IRepository>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IRepository;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class RepositoriesElement : ConfigurationElement, IRepositoriesSection
|
||||
{
|
||||
|
||||
[ConfigurationCollection(typeof(RepositoriesCollection), AddItemName = "repository")]
|
||||
[ConfigurationProperty("", IsDefaultCollection = true)]
|
||||
internal RepositoriesCollection Repositories
|
||||
{
|
||||
get { return (RepositoriesCollection) base[""]; }
|
||||
set { base[""] = value; }
|
||||
}
|
||||
|
||||
IEnumerable<IRepository> IRepositoriesSection.Repositories
|
||||
{
|
||||
get { return Repositories; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
public static class RepositoryConfigExtensions
|
||||
{
|
||||
//Our package repo
|
||||
private static readonly Guid RepoGuid = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66");
|
||||
|
||||
public static IRepository GetDefault(this IRepositoriesSection repos)
|
||||
{
|
||||
var found = repos.Repositories.FirstOrDefault(x => x.Id == RepoGuid);
|
||||
if (found == null)
|
||||
throw new InvalidOperationException("No default package repository found with id " + RepoGuid);
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class RepositoryElement : ConfigurationElement, IRepository
|
||||
{
|
||||
[ConfigurationProperty("name", IsRequired = true)]
|
||||
public string Name
|
||||
{
|
||||
get { return (string)base["name"]; }
|
||||
set { base["name"] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("guid", IsRequired = true)]
|
||||
public Guid Id
|
||||
{
|
||||
get { return (Guid)base["guid"]; }
|
||||
set { base["guid"] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("repositoryurl", DefaultValue = "http://packages.umbraco.org")]
|
||||
public string RepositoryUrl
|
||||
{
|
||||
get { return (string)base["repositoryurl"]; }
|
||||
set { base["repositoryurl"] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("webserviceurl", DefaultValue = "/umbraco/webservices/api/repository.asmx")]
|
||||
public string WebServiceUrl
|
||||
{
|
||||
get { return (string)base["webserviceurl"]; }
|
||||
set { base["webserviceurl"] = value; }
|
||||
}
|
||||
|
||||
public bool HasCustomWebServiceUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
var prop = Properties["webserviceurl"];
|
||||
return (string) prop.DefaultValue != (string) this[prop];
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("restapiurl", DefaultValue = "https://our.umbraco.org/webapi/packages/v1")]
|
||||
public string RestApiUrl
|
||||
{
|
||||
get { return (string)base["restapiurl"]; }
|
||||
set { base["restapiurl"] = value; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
[ConfigurationProperty("authCookieName")]
|
||||
internal InnerTextConfigurationElement<string> AuthCookieName
|
||||
{
|
||||
get { return GetOptionalTextElement("authCookieName", Constants.Web.AuthCookieName); }
|
||||
get { return GetOptionalTextElement("authCookieName", "UMB_UCONTEXT"); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("authCookieDomain")]
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ServerCollection : ConfigurationElementCollection, IEnumerable<IServer>
|
||||
{
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new ServerElement();
|
||||
}
|
||||
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((ServerElement)element).Value;
|
||||
}
|
||||
|
||||
IEnumerator<IServer> IEnumerable<IServer>.GetEnumerator()
|
||||
{
|
||||
for (var i = 0; i < Count; i++)
|
||||
{
|
||||
yield return BaseGet(i) as IServer;
|
||||
}
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
|
||||
{
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class ServerElement : InnerTextConfigurationElement<string>, IServer
|
||||
{
|
||||
public string ForcePortnumber
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("forcePortnumber") == null
|
||||
? null
|
||||
: RawXml.Attribute("forcePortnumber").Value;
|
||||
}
|
||||
}
|
||||
|
||||
public string ForceProtocol
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("forceProtocol") == null
|
||||
? null
|
||||
: RawXml.Attribute("forceProtocol").Value;
|
||||
}
|
||||
}
|
||||
|
||||
string IServer.ServerAddress
|
||||
{
|
||||
get { return Value; }
|
||||
}
|
||||
|
||||
public string AppId
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("appId") == null
|
||||
? null
|
||||
: RawXml.Attribute("appId").Value;
|
||||
}
|
||||
}
|
||||
public string ServerName
|
||||
{
|
||||
get
|
||||
{
|
||||
return RawXml.Attribute("serverName") == null
|
||||
? null
|
||||
: RawXml.Attribute("serverName").Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,50 +5,16 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
internal class TemplatesElement : UmbracoConfigurationElement, ITemplatesSection
|
||||
{
|
||||
[ConfigurationProperty("useAspNetMasterPages")]
|
||||
internal InnerTextConfigurationElement<bool> UseAspNetMasterPages
|
||||
{
|
||||
get { return GetOptionalTextElement("useAspNetMasterPages", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("enableSkinSupport")]
|
||||
internal InnerTextConfigurationElement<bool> EnableSkinSupport
|
||||
{
|
||||
get { return GetOptionalTextElement("enableSkinSupport", true); }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("defaultRenderingEngine", IsRequired = true)]
|
||||
internal InnerTextConfigurationElement<RenderingEngine> DefaultRenderingEngine
|
||||
{
|
||||
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 GetOptionalTextElement("enableTemplateFolders", false); }
|
||||
}
|
||||
|
||||
bool ITemplatesSection.UseAspNetMasterPages
|
||||
{
|
||||
get { return UseAspNetMasterPages; }
|
||||
}
|
||||
|
||||
bool ITemplatesSection.EnableSkinSupport
|
||||
{
|
||||
get { return EnableSkinSupport; }
|
||||
}
|
||||
|
||||
|
||||
RenderingEngine ITemplatesSection.DefaultRenderingEngine
|
||||
{
|
||||
get { return DefaultRenderingEngine; }
|
||||
}
|
||||
|
||||
[Obsolete("This has no affect and will be removed in future versions")]
|
||||
bool ITemplatesSection.EnableTemplateFolders
|
||||
{
|
||||
get { return EnableTemplateFolders; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
internal BackOfficeElement BackOffice
|
||||
{
|
||||
get { return (BackOfficeElement)this["backOffice"]; }
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("content")]
|
||||
internal ContentElement Content
|
||||
@@ -37,14 +37,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
get { return (TemplatesElement)this["templates"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("developer")]
|
||||
internal DeveloperElement Developer
|
||||
{
|
||||
get { return (DeveloperElement)this["developer"]; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ConfigurationProperty("logging")]
|
||||
internal LoggingElement Logging
|
||||
{
|
||||
@@ -57,55 +50,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
get { return (ScheduledTasksElement)this["scheduledTasks"]; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty("distributedCall")]
|
||||
internal DistributedCallElement DistributedCall
|
||||
{
|
||||
get { return (DistributedCallElement)this["distributedCall"]; }
|
||||
}
|
||||
|
||||
private RepositoriesElement _defaultRepositories;
|
||||
|
||||
[ConfigurationProperty("repositories")]
|
||||
internal RepositoriesElement PackageRepositories
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
if (_defaultRepositories != null)
|
||||
{
|
||||
return _defaultRepositories;
|
||||
}
|
||||
|
||||
//here we need to check if this element is defined, if it is not then we'll setup the defaults
|
||||
var prop = Properties["repositories"];
|
||||
var repos = this[prop] as ConfigurationElement;
|
||||
if (repos != null && repos.ElementInformation.IsPresent == false)
|
||||
{
|
||||
var collection = new RepositoriesCollection
|
||||
{
|
||||
new RepositoryElement() {Name = "Umbraco package Repository", Id = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66")}
|
||||
};
|
||||
|
||||
|
||||
_defaultRepositories = new RepositoriesElement()
|
||||
{
|
||||
Repositories = collection
|
||||
};
|
||||
|
||||
return _defaultRepositories;
|
||||
}
|
||||
|
||||
//now we need to ensure there is *always* our umbraco repo! its hard coded in the codebase!
|
||||
var reposElement = (RepositoriesElement)base["repositories"];
|
||||
if (reposElement.Repositories.All(x => x.Id != new Guid("65194810-1f85-11dd-bd0b-0800200c9a66")))
|
||||
{
|
||||
reposElement.Repositories.Add(new RepositoryElement() { Name = "Umbraco package Repository", Id = new Guid("65194810-1f85-11dd-bd0b-0800200c9a66") });
|
||||
}
|
||||
|
||||
return reposElement;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("providers")]
|
||||
internal ProvidersElement Providers
|
||||
{
|
||||
@@ -141,11 +85,6 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
IBackOfficeSection IUmbracoSettingsSection.BackOffice
|
||||
{
|
||||
get { return BackOffice; }
|
||||
}
|
||||
|
||||
IDeveloperSection IUmbracoSettingsSection.Developer
|
||||
{
|
||||
get { return Developer; }
|
||||
}
|
||||
|
||||
ILoggingSection IUmbracoSettingsSection.Logging
|
||||
@@ -157,17 +96,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
|
||||
{
|
||||
get { return ScheduledTasks; }
|
||||
}
|
||||
|
||||
IDistributedCallSection IUmbracoSettingsSection.DistributedCall
|
||||
{
|
||||
get { return DistributedCall; }
|
||||
}
|
||||
|
||||
IRepositoriesSection IUmbracoSettingsSection.PackageRepositories
|
||||
{
|
||||
get { return PackageRepositories; }
|
||||
}
|
||||
|
||||
|
||||
IProvidersSection IUmbracoSettingsSection.Providers
|
||||
{
|
||||
get { return Providers; }
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Umbraco.Core.Configuration
|
||||
/// <summary>
|
||||
/// Gets the version comment of the executing code (eg "beta").
|
||||
/// </summary>
|
||||
public static string CurrentComment => "alpha.32";
|
||||
public static string CurrentComment => "alpha.37";
|
||||
|
||||
/// <summary>
|
||||
/// Gets the assembly version of Umbraco.Code.dll.
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
/// <summary>
|
||||
/// alias for the packages tree
|
||||
/// </summary>
|
||||
public const string Packages = "packager";
|
||||
public const string Packages = "packages";
|
||||
|
||||
/// <summary>
|
||||
/// alias for the dictionary tree.
|
||||
@@ -121,9 +121,7 @@
|
||||
public const string Templates = "templates";
|
||||
|
||||
public const string RelationTypes = "relationTypes";
|
||||
|
||||
public const string Xslt = "xslt";
|
||||
|
||||
|
||||
public const string Languages = "languages";
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
public const string StylesheetFileSystem = "StylesheetFileSystem";
|
||||
public const string MasterpageFileSystem = "MasterpageFileSystem";
|
||||
public const string ViewFileSystem = "ViewFileSystem";
|
||||
public const string XsltFileSystem = "XsltFileSystem";
|
||||
public const string JavascriptLibraryFileSystem = "JavascriptLibraryFileSystem";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the constants used for the Umbraco package repository
|
||||
/// </summary>
|
||||
public static class PackageRepository
|
||||
{
|
||||
public const string RestApiBaseUrl = "https://our.umbraco.org/webapi/packages/v1";
|
||||
public const string DefaultRepositoryName = "Umbraco package Repository";
|
||||
public const string DefaultRepositoryId = "65194810-1f85-11dd-bd0b-0800200c9a66";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,16 +68,16 @@ namespace Umbraco.Core
|
||||
/// DropDown List.
|
||||
/// </summary>
|
||||
public const string DropDownListFlexible = "Umbraco.DropDown.Flexible";
|
||||
|
||||
/// <summary>
|
||||
/// Folder Browser.
|
||||
/// </summary>
|
||||
public const string FolderBrowser = "Umbraco.FolderBrowser";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid.
|
||||
/// </summary>
|
||||
public const string Grid = "Umbraco.Grid";
|
||||
public const string Grid = "Umbraco.Grid";
|
||||
|
||||
/// <summary>
|
||||
/// Grid.
|
||||
/// </summary>
|
||||
public const string Grid2 = "Umbraco.Grid2";
|
||||
|
||||
/// <summary>
|
||||
/// Image Cropper.
|
||||
@@ -193,17 +193,7 @@ namespace Umbraco.Core
|
||||
/// Upload Field.
|
||||
/// </summary>
|
||||
public const string UploadField = "Umbraco.UploadField";
|
||||
|
||||
/// <summary>
|
||||
/// XPatch Checkbox List.
|
||||
/// </summary>
|
||||
public const string XPathCheckBoxList = "Umbraco.XPathCheckBoxList";
|
||||
|
||||
/// <summary>
|
||||
/// XPath DropDown List.
|
||||
/// </summary>
|
||||
public const string XPathDropDownList = "Umbraco.XPathDropDownList";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Email Address.
|
||||
/// </summary>
|
||||
|
||||
@@ -23,13 +23,6 @@ namespace Umbraco.Core
|
||||
|
||||
public const string InstallerCookieName = "umb_installId";
|
||||
|
||||
/// <summary>
|
||||
/// The auth cookie name
|
||||
/// </summary>
|
||||
[Obsolete("DO NOT USE THIS, USE ISecuritySection.AuthCookieName, this will be removed in future versions")]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public const string AuthCookieName = "UMB_UCONTEXT";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods for various enumerations.
|
||||
/// </summary>
|
||||
public static class EnumExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Determines whether a variation has all flags set.
|
||||
/// </summary>
|
||||
public static bool Has(this ContentVariation variation, ContentVariation values)
|
||||
=> (variation & values) == values;
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a variation has at least a flag set.
|
||||
/// </summary>
|
||||
public static bool HasAny(this ContentVariation variation, ContentVariation values)
|
||||
=> (variation & values) != ContentVariation.Unknown;
|
||||
}
|
||||
}
|
||||
@@ -92,21 +92,6 @@ namespace Umbraco.Core
|
||||
}
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("Use a normal foreach loop instead, this adds more allocations than necessary")]
|
||||
public static IEnumerable<TItem> ForEach<TItem>(this IEnumerable<TItem> items, Action<TItem> action)
|
||||
{
|
||||
if (items != null)
|
||||
{
|
||||
foreach (TItem item in items)
|
||||
{
|
||||
action(item);
|
||||
}
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
/// <summary>The flatten list.</summary>
|
||||
/// <param name="e">The items.</param>
|
||||
/// <param name="f">The select child.</param>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Events
|
||||
/// <summary>
|
||||
/// Filename, file path, fully qualified class name, or other key used by the macro engine to do it's processing of the faulting macro.
|
||||
/// </summary>
|
||||
public string ItemKey { get; set; }
|
||||
public string MacroSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Exception raised.
|
||||
|
||||
@@ -26,10 +26,8 @@ namespace Umbraco.Core.IO
|
||||
private ShadowWrapper _partialViewsFileSystem;
|
||||
private ShadowWrapper _stylesheetsFileSystem;
|
||||
private ShadowWrapper _scriptsFileSystem;
|
||||
private ShadowWrapper _xsltFileSystem;
|
||||
private ShadowWrapper _masterPagesFileSystem;
|
||||
private ShadowWrapper _mvcViewsFileSystem;
|
||||
private ShadowWrapper _javaScriptLibraryFileSystem;
|
||||
|
||||
// well-known file systems lazy initialization
|
||||
private object _wkfsLock = new object();
|
||||
@@ -103,16 +101,7 @@ namespace Umbraco.Core.IO
|
||||
return _scriptsFileSystem;
|
||||
}
|
||||
}
|
||||
|
||||
public IFileSystem XsltFileSystem
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Volatile.Read(ref _wkfsInitialized) == false) EnsureWellKnownFileSystems();
|
||||
return _xsltFileSystem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public IFileSystem MasterPagesFileSystem
|
||||
{
|
||||
get
|
||||
@@ -163,7 +152,6 @@ namespace Umbraco.Core.IO
|
||||
var partialViewsFileSystem = new PhysicalFileSystem(SystemDirectories.PartialViews);
|
||||
var stylesheetsFileSystem = new PhysicalFileSystem(SystemDirectories.Css);
|
||||
var scriptsFileSystem = new PhysicalFileSystem(SystemDirectories.Scripts);
|
||||
var xsltFileSystem = new PhysicalFileSystem(SystemDirectories.Xslt);
|
||||
var masterPagesFileSystem = new PhysicalFileSystem(SystemDirectories.Masterpages);
|
||||
var mvcViewsFileSystem = new PhysicalFileSystem(SystemDirectories.MvcViews);
|
||||
var javaScriptLibraryFileSystem = new PhysicalFileSystem(SystemDirectories.JavaScriptLibrary);
|
||||
@@ -172,7 +160,6 @@ namespace Umbraco.Core.IO
|
||||
_partialViewsFileSystem = new ShadowWrapper(partialViewsFileSystem, "Views/Partials", () => IsScoped());
|
||||
_stylesheetsFileSystem = new ShadowWrapper(stylesheetsFileSystem, "css", () => IsScoped());
|
||||
_scriptsFileSystem = new ShadowWrapper(scriptsFileSystem, "scripts", () => IsScoped());
|
||||
_xsltFileSystem = new ShadowWrapper(xsltFileSystem, "xslt", () => IsScoped());
|
||||
_masterPagesFileSystem = new ShadowWrapper(masterPagesFileSystem, "masterpages", () => IsScoped());
|
||||
_mvcViewsFileSystem = new ShadowWrapper(mvcViewsFileSystem, "Views", () => IsScoped());
|
||||
_javascriptLibraryFileSystem = new ShadowWrapper(javaScriptLibraryFileSystem, "Lib", () => IsScoped());
|
||||
@@ -366,14 +353,13 @@ namespace Umbraco.Core.IO
|
||||
if (Volatile.Read(ref _wkfsInitialized) == false) EnsureWellKnownFileSystems();
|
||||
|
||||
var typed = _wrappers.ToArray();
|
||||
var wrappers = new ShadowWrapper[typed.Length + 7];
|
||||
var wrappers = new ShadowWrapper[typed.Length + 6];
|
||||
var i = 0;
|
||||
while (i < typed.Length) wrappers[i] = typed[i++];
|
||||
wrappers[i++] = _macroPartialFileSystem;
|
||||
wrappers[i++] = _partialViewsFileSystem;
|
||||
wrappers[i++] = _stylesheetsFileSystem;
|
||||
wrappers[i++] = _scriptsFileSystem;
|
||||
wrappers[i++] = _xsltFileSystem;
|
||||
wrappers[i++] = _masterPagesFileSystem;
|
||||
wrappers[i] = _mvcViewsFileSystem;
|
||||
|
||||
|
||||
@@ -27,13 +27,7 @@ namespace Umbraco.Core.IO
|
||||
{
|
||||
return _masterPageFileSystem.FileExists(GetFilePath(t));
|
||||
}
|
||||
|
||||
[Obsolete("This is only used for legacy purposes and will be removed in future versions")]
|
||||
internal string GetPhysicalFilePath(ITemplate t)
|
||||
{
|
||||
return _masterPageFileSystem.GetFullPath(GetFilePath(t.Alias));
|
||||
}
|
||||
|
||||
|
||||
private string GetFilePath(ITemplate t)
|
||||
{
|
||||
return GetFilePath(t.Alias);
|
||||
|
||||
@@ -335,35 +335,35 @@ namespace Umbraco.Core.IO
|
||||
|
||||
// fixme - what's below belongs to the upload property editor, not the media filesystem!
|
||||
|
||||
public void SetUploadFile(IContentBase content, string propertyTypeAlias, string filename, Stream filestream, int? languageId = null, string segment = null)
|
||||
public void SetUploadFile(IContentBase content, string propertyTypeAlias, string filename, Stream filestream, string culture = null, string segment = null)
|
||||
{
|
||||
var property = GetProperty(content, propertyTypeAlias);
|
||||
var oldpath = property.GetValue(languageId, segment) is string svalue ? GetRelativePath(svalue) : null;
|
||||
var oldpath = property.GetValue(culture, segment) is string svalue ? GetRelativePath(svalue) : null;
|
||||
var filepath = StoreFile(content, property.PropertyType, filename, filestream, oldpath);
|
||||
property.SetValue(GetUrl(filepath), languageId, segment);
|
||||
SetUploadFile(content, property, filepath, filestream, languageId, segment);
|
||||
property.SetValue(GetUrl(filepath), culture, segment);
|
||||
SetUploadFile(content, property, filepath, filestream, culture, segment);
|
||||
}
|
||||
|
||||
public void SetUploadFile(IContentBase content, string propertyTypeAlias, string filepath, int? languageId = null, string segment = null)
|
||||
public void SetUploadFile(IContentBase content, string propertyTypeAlias, string filepath, string culture = null, string segment = null)
|
||||
{
|
||||
var property = GetProperty(content, propertyTypeAlias);
|
||||
// fixme delete?
|
||||
var oldpath = property.GetValue(languageId, segment) is string svalue ? GetRelativePath(svalue) : null;
|
||||
var oldpath = property.GetValue(culture, segment) is string svalue ? GetRelativePath(svalue) : null;
|
||||
if (string.IsNullOrWhiteSpace(oldpath) == false && oldpath != filepath)
|
||||
DeleteFile(oldpath);
|
||||
property.SetValue(GetUrl(filepath), languageId, segment);
|
||||
property.SetValue(GetUrl(filepath), culture, segment);
|
||||
using (var filestream = OpenFile(filepath))
|
||||
{
|
||||
SetUploadFile(content, property, filepath, filestream, languageId, segment);
|
||||
SetUploadFile(content, property, filepath, filestream, culture, segment);
|
||||
}
|
||||
}
|
||||
|
||||
// sets a file for the FileUpload property editor
|
||||
// ie generates thumbnails and populates autofill properties
|
||||
private void SetUploadFile(IContentBase content, Property property, string filepath, Stream filestream, int? languageId = null, string segment = null)
|
||||
private void SetUploadFile(IContentBase content, Property property, string filepath, Stream filestream, string culture = null, string segment = null)
|
||||
{
|
||||
// will use filepath for extension, and filestream for length
|
||||
UploadAutoFillProperties.Populate(content, property.Alias, filepath, filestream, languageId, segment);
|
||||
UploadAutoFillProperties.Populate(content, property.Alias, filepath, filestream, culture, segment);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -46,8 +46,6 @@ namespace Umbraco.Core.IO
|
||||
|
||||
public static string WebServices => IOHelper.ReturnPath("umbracoWebservicesPath", Umbraco.EnsureEndsWith("/") + "webservices");
|
||||
|
||||
public static string Xslt => IOHelper.ReturnPath("umbracoXsltPath", "~/xslt");
|
||||
|
||||
//by default the packages folder should exist in the data folder
|
||||
public static string Packages => IOHelper.ReturnPath("umbracoPackagesPath", Data + IOHelper.DirSepChar + "packages");
|
||||
|
||||
|
||||
@@ -67,10 +67,9 @@ namespace Umbraco.Core.IO
|
||||
modelNamespaceAlias = "ContentModels";
|
||||
|
||||
// either
|
||||
// @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
|
||||
// @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ModelClass>
|
||||
// @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.ModelClass>
|
||||
content.Append("@inherits Umbraco.Web.Mvc.UmbracoTemplatePage");
|
||||
// @inherits Umbraco.Web.Mvc.UmbracoViewPage
|
||||
// @inherits Umbraco.Web.Mvc.UmbracoViewPage<ModelClass>
|
||||
content.Append("@inherits Umbraco.Web.Mvc.UmbracoViewPage");
|
||||
if (modelClassName.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
content.Append("<");
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
// fixme - remove this file
|
||||
//using log4net.Core;
|
||||
//using log4net.Util;
|
||||
//using System;
|
||||
//using System.Collections.Concurrent;
|
||||
//using System.Threading;
|
||||
//using System.Threading.Tasks;
|
||||
|
||||
//namespace Umbraco.Core.Logging
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// An asynchronous appender based on <see cref="BlockingCollection{T}"/>
|
||||
// /// </summary>
|
||||
// /// <remarks>
|
||||
// /// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
|
||||
// /// </remarks>
|
||||
// [Obsolete("Use the Log4Net.Async.ParallelForwardingAppender instead this will be removed in future versions")]
|
||||
// public class ParallelForwardingAppender : Log4Net.Async.ParallelForwardingAppender
|
||||
// {
|
||||
// }
|
||||
//}
|
||||
@@ -179,7 +179,7 @@ namespace Umbraco.Core.Macros
|
||||
// Check whether it's a single tag (<?.../>) or a tag with children (<?..>...</?...>)
|
||||
if (tag.Substring(tag.Length - 2, 1) != "/" && tag.IndexOf(" ") > -1)
|
||||
{
|
||||
String closingTag = "</" + (tag.Substring(1, tag.IndexOf(" ") - 1)) + ">";
|
||||
string closingTag = "</" + (tag.Substring(1, tag.IndexOf(" ") - 1)) + ">";
|
||||
// Tag with children are only used when a macro is inserted by the umbraco-editor, in the
|
||||
// following format: "<?UMBRACO_MACRO ...><IMG SRC="..."..></?UMBRACO_MACRO>", so we
|
||||
// need to delete extra information inserted which is the image-tag and the closing
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace Umbraco.Core.Macros
|
||||
{
|
||||
/// <summary>
|
||||
/// Encapsulates what an xslt extension object is when used for macros
|
||||
/// </summary>
|
||||
internal sealed class XsltExtension
|
||||
{
|
||||
public XsltExtension(string ns, object extensionObject)
|
||||
{
|
||||
Namespace = ns;
|
||||
ExtensionObject = extensionObject;
|
||||
}
|
||||
|
||||
public string Namespace { get; private set; }
|
||||
public object ExtensionObject { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Security.Permissions;
|
||||
using System.Web;
|
||||
|
||||
namespace Umbraco.Core.Macros
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows App_Code XSLT extensions to be declared using the [XsltExtension] class attribute.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// An optional XML namespace can be specified using [XsltExtension("MyNamespace")].
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class XsltExtensionAttribute : Attribute
|
||||
{
|
||||
public XsltExtensionAttribute()
|
||||
{
|
||||
Namespace = String.Empty;
|
||||
}
|
||||
|
||||
public XsltExtensionAttribute(string ns)
|
||||
{
|
||||
Namespace = ns;
|
||||
}
|
||||
|
||||
public string Namespace { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Namespace;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Composing;
|
||||
|
||||
namespace Umbraco.Core.Macros
|
||||
{
|
||||
internal class XsltExtensionCollection : BuilderCollectionBase<XsltExtension>
|
||||
{
|
||||
public XsltExtensionCollection(IEnumerable<XsltExtension> items)
|
||||
: base(items)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using LightInject;
|
||||
using Umbraco.Core.Composing;
|
||||
|
||||
namespace Umbraco.Core.Macros
|
||||
{
|
||||
// that one is special since it's not initialized with XsltExtension types, but with Xslt extension object types,
|
||||
// which are then wrapped in an XsltExtension object when the collection is created. so, cannot really inherit
|
||||
// from (Lazy)CollectionBuilderBase and have to re-implement it. but almost everything is copied from CollectionBuilderBase.
|
||||
|
||||
internal class XsltExtensionCollectionBuilder : ICollectionBuilder<XsltExtensionCollection, XsltExtension>
|
||||
{
|
||||
private readonly IServiceContainer _container;
|
||||
private readonly List<Func<IEnumerable<Type>>> _producers = new List<Func<IEnumerable<Type>>>();
|
||||
private readonly object _locker = new object();
|
||||
private ServiceRegistration[] _registrations;
|
||||
|
||||
public XsltExtensionCollectionBuilder(IServiceContainer container)
|
||||
{
|
||||
_container = container;
|
||||
|
||||
// register the collection
|
||||
container.Register(_ => CreateCollection(), new PerContainerLifetime());
|
||||
}
|
||||
|
||||
public static XsltExtensionCollectionBuilder Register(IServiceContainer container)
|
||||
{
|
||||
// register the builder - per container
|
||||
var builderLifetime = new PerContainerLifetime();
|
||||
container.Register<XsltExtensionCollectionBuilder>(builderLifetime);
|
||||
return container.GetInstance<XsltExtensionCollectionBuilder>();
|
||||
}
|
||||
|
||||
public XsltExtensionCollectionBuilder AddExtensionObjectProducer(Func<IEnumerable<Type>> producer)
|
||||
{
|
||||
lock (_locker)
|
||||
{
|
||||
if (_registrations != null)
|
||||
throw new InvalidOperationException("Cannot configure a collection builder after its types have been resolved.");
|
||||
_producers.Add(producer);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
private void RegisterTypes()
|
||||
{
|
||||
lock (_locker)
|
||||
{
|
||||
if (_registrations != null) return;
|
||||
|
||||
var prefix = GetType().FullName + "_";
|
||||
var i = 0;
|
||||
foreach (var type in _producers.SelectMany(x => x()).Distinct())
|
||||
{
|
||||
var name = $"{prefix}{i++:00000}";
|
||||
_container.Register(type, type, name);
|
||||
}
|
||||
|
||||
_registrations = _container.AvailableServices
|
||||
.Where(x => x.ServiceName.StartsWith(prefix))
|
||||
.OrderBy(x => x.ServiceName)
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public XsltExtensionCollection CreateCollection()
|
||||
{
|
||||
RegisterTypes(); // will do it only once
|
||||
|
||||
var exts = _registrations.SelectMany(r => r.ServiceType.GetCustomAttributes<XsltExtensionAttribute>(true)
|
||||
.Select(a => new XsltExtension(a.Namespace.IfNullOrWhiteSpace(r.ServiceType.FullName), _container.GetInstance(r.ServiceType, r.ServiceName))));
|
||||
|
||||
return new XsltExtensionCollection(exts);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Media
|
||||
{
|
||||
// note: because this interface is obsolete is is *not* IDiscoverable, and in case the
|
||||
// TypeLoader is asked to find types implementing this interface it will fall back
|
||||
// to a complete scan.
|
||||
|
||||
[Obsolete("IImageUrlProvider is no longer used and will be removed in future versions")]
|
||||
public interface IImageUrlProvider // IDiscoverable
|
||||
{
|
||||
string Name { get; }
|
||||
string GetImageUrlFromMedia(int mediaId, IDictionary<string, string> parameters);
|
||||
string GetImageUrlFromFileName(string specifiedSrc, IDictionary<string, string> parameters);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.Media
|
||||
{
|
||||
// note: because this interface is obsolete is is *not* IDiscoverable, and in case the
|
||||
// TypeLoader is asked to find types implementing this interface it will fall back
|
||||
// to a complete scan.
|
||||
|
||||
[Obsolete("Thumbnails are generated by ImageProcessor, use that instead")]
|
||||
public interface IThumbnailProvider // : IDiscoverable
|
||||
{
|
||||
bool CanProvideThumbnail(string fileUrl);
|
||||
string GetThumbnailUrl(string fileUrl);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,9 +41,9 @@ namespace Umbraco.Core.Media
|
||||
/// </summary>
|
||||
/// <param name="content">The content item.</param>
|
||||
/// <param name="propertyTypeAlias">The property type alias.</param>
|
||||
/// <param name="languageId">Variation language.</param>
|
||||
/// <param name="culture">Variation language.</param>
|
||||
/// <param name="segment">Variation segment.</param>
|
||||
public void Reset(IContentBase content, string propertyTypeAlias, int? languageId, string segment)
|
||||
public void Reset(IContentBase content, string propertyTypeAlias, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (propertyTypeAlias == null) throw new ArgumentNullException(nameof(propertyTypeAlias));
|
||||
@@ -53,7 +53,7 @@ namespace Umbraco.Core.Media
|
||||
if (autoFillConfig == null) return; // nothing
|
||||
|
||||
// reset
|
||||
Reset(content, autoFillConfig, languageId, segment);
|
||||
Reset(content, autoFillConfig, culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -61,14 +61,14 @@ namespace Umbraco.Core.Media
|
||||
/// </summary>
|
||||
/// <param name="content">The content item.</param>
|
||||
/// <param name="autoFillConfig">The auto-fill configuration.</param>
|
||||
/// <param name="languageId">Variation language.</param>
|
||||
/// <param name="culture">Variation language.</param>
|
||||
/// <param name="segment">Variation segment.</param>
|
||||
public void Reset(IContentBase content, IImagingAutoFillUploadField autoFillConfig, int? languageId, string segment)
|
||||
public void Reset(IContentBase content, IImagingAutoFillUploadField autoFillConfig, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (autoFillConfig == null) throw new ArgumentNullException(nameof(autoFillConfig));
|
||||
|
||||
ResetProperties(content, autoFillConfig, languageId, segment);
|
||||
ResetProperties(content, autoFillConfig, culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -77,9 +77,9 @@ namespace Umbraco.Core.Media
|
||||
/// <param name="content">The content item.</param>
|
||||
/// <param name="propertyTypeAlias">The property type alias.</param>
|
||||
/// <param name="filepath">The filesystem-relative filepath, or null to clear properties.</param>
|
||||
/// <param name="languageId">Variation language.</param>
|
||||
/// <param name="culture">Variation language.</param>
|
||||
/// <param name="segment">Variation segment.</param>
|
||||
public void Populate(IContentBase content, string propertyTypeAlias, string filepath, int? languageId, string segment)
|
||||
public void Populate(IContentBase content, string propertyTypeAlias, string filepath, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (propertyTypeAlias == null) throw new ArgumentNullException(nameof(propertyTypeAlias));
|
||||
@@ -92,7 +92,7 @@ namespace Umbraco.Core.Media
|
||||
if (autoFillConfig == null) return; // nothing
|
||||
|
||||
// populate
|
||||
Populate(content, autoFillConfig, filepath, languageId, segment);
|
||||
Populate(content, autoFillConfig, filepath, culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -102,9 +102,9 @@ namespace Umbraco.Core.Media
|
||||
/// <param name="propertyTypeAlias">The property type alias.</param>
|
||||
/// <param name="filepath">The filesystem-relative filepath, or null to clear properties.</param>
|
||||
/// <param name="filestream">The stream containing the file data.</param>
|
||||
/// <param name="languageId">Variation language.</param>
|
||||
/// <param name="culture">Variation language.</param>
|
||||
/// <param name="segment">Variation segment.</param>
|
||||
public void Populate(IContentBase content, string propertyTypeAlias, string filepath, Stream filestream, int? languageId, string segment)
|
||||
public void Populate(IContentBase content, string propertyTypeAlias, string filepath, Stream filestream, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (propertyTypeAlias == null) throw new ArgumentNullException(nameof(propertyTypeAlias));
|
||||
@@ -117,7 +117,7 @@ namespace Umbraco.Core.Media
|
||||
if (autoFillConfig == null) return; // nothing
|
||||
|
||||
// populate
|
||||
Populate(content, autoFillConfig, filepath, filestream, languageId, segment);
|
||||
Populate(content, autoFillConfig, filepath, filestream, culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -127,9 +127,9 @@ namespace Umbraco.Core.Media
|
||||
/// <param name="autoFillConfig">The auto-fill configuration.</param>
|
||||
/// <param name="filepath">The filesystem path to the uploaded file.</param>
|
||||
/// <remarks>The <paramref name="filepath"/> parameter is the path relative to the filesystem.</remarks>
|
||||
/// <param name="languageId">Variation language.</param>
|
||||
/// <param name="culture">Variation language.</param>
|
||||
/// <param name="segment">Variation segment.</param>
|
||||
public void Populate(IContentBase content, IImagingAutoFillUploadField autoFillConfig, string filepath, int? languageId, string segment)
|
||||
public void Populate(IContentBase content, IImagingAutoFillUploadField autoFillConfig, string filepath, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (autoFillConfig == null) throw new ArgumentNullException(nameof(autoFillConfig));
|
||||
@@ -137,7 +137,7 @@ namespace Umbraco.Core.Media
|
||||
// no file = reset, file = auto-fill
|
||||
if (filepath.IsNullOrWhiteSpace())
|
||||
{
|
||||
ResetProperties(content, autoFillConfig, languageId, segment);
|
||||
ResetProperties(content, autoFillConfig, culture, segment);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -148,13 +148,13 @@ namespace Umbraco.Core.Media
|
||||
{
|
||||
var extension = (Path.GetExtension(filepath) ?? "").TrimStart('.');
|
||||
var size = _mediaFileSystem.IsImageFile(extension) ? (Size?) _mediaFileSystem.GetDimensions(filestream) : null;
|
||||
SetProperties(content, autoFillConfig, size, filestream.Length, extension, languageId, segment);
|
||||
SetProperties(content, autoFillConfig, size, filestream.Length, extension, culture, segment);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(typeof(UploadAutoFillProperties), $"Could not populate upload auto-fill properties for file \"{filepath}\".", ex);
|
||||
ResetProperties(content, autoFillConfig, languageId, segment);
|
||||
ResetProperties(content, autoFillConfig, culture, segment);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,9 +166,9 @@ namespace Umbraco.Core.Media
|
||||
/// <param name="autoFillConfig"></param>
|
||||
/// <param name="filepath">The filesystem-relative filepath, or null to clear properties.</param>
|
||||
/// <param name="filestream">The stream containing the file data.</param>
|
||||
/// <param name="languageId">Variation language.</param>
|
||||
/// <param name="culture">Variation language.</param>
|
||||
/// <param name="segment">Variation segment.</param>
|
||||
public void Populate(IContentBase content, IImagingAutoFillUploadField autoFillConfig, string filepath, Stream filestream, int? languageId, string segment)
|
||||
public void Populate(IContentBase content, IImagingAutoFillUploadField autoFillConfig, string filepath, Stream filestream, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (autoFillConfig == null) throw new ArgumentNullException(nameof(autoFillConfig));
|
||||
@@ -176,50 +176,50 @@ namespace Umbraco.Core.Media
|
||||
// no file = reset, file = auto-fill
|
||||
if (filepath.IsNullOrWhiteSpace() || filestream == null)
|
||||
{
|
||||
ResetProperties(content, autoFillConfig, languageId, segment);
|
||||
ResetProperties(content, autoFillConfig, culture, segment);
|
||||
}
|
||||
else
|
||||
{
|
||||
var extension = (Path.GetExtension(filepath) ?? "").TrimStart('.');
|
||||
var size = _mediaFileSystem.IsImageFile(extension) ? (Size?)_mediaFileSystem.GetDimensions(filestream) : null;
|
||||
SetProperties(content, autoFillConfig, size, filestream.Length, extension, languageId, segment);
|
||||
SetProperties(content, autoFillConfig, size, filestream.Length, extension, culture, segment);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetProperties(IContentBase content, IImagingAutoFillUploadField autoFillConfig, Size? size, long length, string extension, int? languageId, string segment)
|
||||
private static void SetProperties(IContentBase content, IImagingAutoFillUploadField autoFillConfig, Size? size, long length, string extension, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (autoFillConfig == null) throw new ArgumentNullException(nameof(autoFillConfig));
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.WidthFieldAlias))
|
||||
content.Properties[autoFillConfig.WidthFieldAlias].SetValue(size.HasValue ? size.Value.Width.ToInvariantString() : string.Empty, languageId, segment);
|
||||
content.Properties[autoFillConfig.WidthFieldAlias].SetValue(size.HasValue ? size.Value.Width.ToInvariantString() : string.Empty, culture, segment);
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.HeightFieldAlias))
|
||||
content.Properties[autoFillConfig.HeightFieldAlias].SetValue(size.HasValue ? size.Value.Height.ToInvariantString() : string.Empty, languageId, segment);
|
||||
content.Properties[autoFillConfig.HeightFieldAlias].SetValue(size.HasValue ? size.Value.Height.ToInvariantString() : string.Empty, culture, segment);
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.LengthFieldAlias))
|
||||
content.Properties[autoFillConfig.LengthFieldAlias].SetValue(length, languageId, segment);
|
||||
content.Properties[autoFillConfig.LengthFieldAlias].SetValue(length, culture, segment);
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.ExtensionFieldAlias))
|
||||
content.Properties[autoFillConfig.ExtensionFieldAlias].SetValue(extension, languageId, segment);
|
||||
content.Properties[autoFillConfig.ExtensionFieldAlias].SetValue(extension, culture, segment);
|
||||
}
|
||||
|
||||
private static void ResetProperties(IContentBase content, IImagingAutoFillUploadField autoFillConfig, int? languageId, string segment)
|
||||
private static void ResetProperties(IContentBase content, IImagingAutoFillUploadField autoFillConfig, string culture, string segment)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
if (autoFillConfig == null) throw new ArgumentNullException(nameof(autoFillConfig));
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.WidthFieldAlias))
|
||||
content.Properties[autoFillConfig.WidthFieldAlias].SetValue(string.Empty, languageId, segment);
|
||||
content.Properties[autoFillConfig.WidthFieldAlias].SetValue(string.Empty, culture, segment);
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.HeightFieldAlias))
|
||||
content.Properties[autoFillConfig.HeightFieldAlias].SetValue(string.Empty, languageId, segment);
|
||||
content.Properties[autoFillConfig.HeightFieldAlias].SetValue(string.Empty, culture, segment);
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.LengthFieldAlias))
|
||||
content.Properties[autoFillConfig.LengthFieldAlias].SetValue(string.Empty, languageId, segment);
|
||||
content.Properties[autoFillConfig.LengthFieldAlias].SetValue(string.Empty, culture, segment);
|
||||
|
||||
if (content.Properties.Contains(autoFillConfig.ExtensionFieldAlias))
|
||||
content.Properties[autoFillConfig.ExtensionFieldAlias].SetValue(string.Empty, languageId, segment);
|
||||
content.Properties[autoFillConfig.ExtensionFieldAlias].SetValue(string.Empty, culture, segment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,9 @@ namespace Umbraco.Core.Migrations.Install
|
||||
typeof (KeyValueDto),
|
||||
typeof (UserLoginDto),
|
||||
typeof (ConsentDto),
|
||||
typeof (AuditEntryDto)
|
||||
typeof (AuditEntryDto),
|
||||
typeof (ContentVersionCultureVariationDto),
|
||||
typeof (DocumentCultureVariationDto)
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -116,9 +116,12 @@ namespace Umbraco.Core.Migrations.Upgrade
|
||||
Chain<SuperZero>("{9DF05B77-11D1-475C-A00A-B656AF7E0908}");
|
||||
Chain<PropertyEditorsMigration>("{6FE3EF34-44A0-4992-B379-B40BC4EF1C4D}");
|
||||
Chain<LanguageColumns>("{7F59355A-0EC9-4438-8157-EB517E6D2727}");
|
||||
Chain<AddVariationTables1A>("{66B6821A-0DE3-4DF8-A6A4-65ABD211EDDE}");
|
||||
Chain<AddVariationTables2>("{49506BAE-CEBB-4431-A1A6-24AD6EBBBC57}");
|
||||
Chain<RefactorMacroColumns>("{083A9894-903D-41B7-B6B3-9EAF2D4CCED0}");
|
||||
|
||||
// must chain to v8 final state (see at end of file)
|
||||
Chain("{79591E91-01EA-43F7-AC58-7BD286DB1E77}");
|
||||
Chain("{A7540C58-171D-462A-91C5-7A9AA5CB8BFD}");
|
||||
|
||||
|
||||
// UPGRADE FROM 7, MORE RECENT
|
||||
@@ -199,10 +202,20 @@ namespace Umbraco.Core.Migrations.Upgrade
|
||||
// mergin from 7.10.0
|
||||
Chain<RenamePreviewFolder>("{79591E91-01EA-43F7-AC58-7BD286DB1E77}");
|
||||
|
||||
// 8.0.0
|
||||
// AddVariationTables1 has been superceeded by AddVariationTables2
|
||||
//Chain<AddVariationTables1>("{941B2ABA-2D06-4E04-81F5-74224F1DB037}");
|
||||
Chain<AddVariationTables2>("{76DF5CD7-A884-41A5-8DC6-7860D95B1DF5}");
|
||||
|
||||
// however, need to take care of ppl in post-AddVariationTables1 state
|
||||
Add<AddVariationTables1A>("{941B2ABA-2D06-4E04-81F5-74224F1DB037}", "{76DF5CD7-A884-41A5-8DC6-7860D95B1DF5}");
|
||||
|
||||
Chain<RefactorMacroColumns>("{A7540C58-171D-462A-91C5-7A9AA5CB8BFD}");
|
||||
|
||||
// FINAL STATE - MUST MATCH LAST ONE ABOVE !
|
||||
// whenever this changes, update all references in this file!
|
||||
|
||||
Add(string.Empty, "{79591E91-01EA-43F7-AC58-7BD286DB1E77}");
|
||||
Add(string.Empty, "{A7540C58-171D-462A-91C5-7A9AA5CB8BFD}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Umbraco.Core.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
{
|
||||
public class AddVariationTables1A : MigrationBase
|
||||
{
|
||||
public AddVariationTables1A(IMigrationContext context)
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
// note - original AddVariationTables1 just did
|
||||
// Create.Table<ContentVersionCultureVariationDto>().Do();
|
||||
//
|
||||
// this is taking care of ppl left in this state
|
||||
|
||||
public override void Migrate()
|
||||
{
|
||||
// note - original AddVariationTables1 just did
|
||||
// Create.Table<ContentVersionCultureVariationDto>().Do();
|
||||
//
|
||||
// it's been deprecated, not part of the main upgrade path,
|
||||
// but we need to take care of ppl caught into the state
|
||||
|
||||
// was not used
|
||||
Delete.Column("available").FromTable(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation).Do();
|
||||
|
||||
// was not used
|
||||
Delete.Column("availableDate").FromTable(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation).Do();
|
||||
|
||||
//special trick to add the column without constraints and return the sql to add them later
|
||||
AddColumn<ContentVersionCultureVariationDto>("date", out var sqls);
|
||||
//now we need to update the new column with some values because this column doesn't allow NULL values
|
||||
Update.Table(ContentVersionCultureVariationDto.TableName).Set(new {date = DateTime.Now}).AllRows().Do();
|
||||
//now apply constraints (NOT NULL) to new table
|
||||
foreach (var sql in sqls) Execute.Sql(sql).Do();
|
||||
|
||||
// name, languageId are now non-nullable
|
||||
AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "name");
|
||||
AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "languageId");
|
||||
|
||||
Create.Table<DocumentCultureVariationDto>().Do();
|
||||
|
||||
// fixme - data migration?
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Umbraco.Core.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
{
|
||||
public class AddVariationTables2 : MigrationBase
|
||||
{
|
||||
public AddVariationTables2(IMigrationContext context)
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
{
|
||||
Create.Table<ContentVersionCultureVariationDto>().Do();
|
||||
Create.Table<DocumentCultureVariationDto>().Do();
|
||||
|
||||
// fixme - data migration?
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence.Dtos;
|
||||
|
||||
namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
{
|
||||
public class RefactorMacroColumns : MigrationBase
|
||||
{
|
||||
public RefactorMacroColumns(IMigrationContext context)
|
||||
: base(context)
|
||||
{ }
|
||||
|
||||
public override void Migrate()
|
||||
{
|
||||
if (ColumnExists(Constants.DatabaseSchema.Tables.Macro, "macroXSLT"))
|
||||
{
|
||||
//special trick to add the column without constraints and return the sql to add them later
|
||||
AddColumn<MacroDto>("macroType", out var sqls1);
|
||||
//now we need to update the new column with some values because this column doesn't allow NULL values
|
||||
Update.Table(Constants.DatabaseSchema.Tables.Macro).Set(new { macroType = (int)MacroTypes.Unknown}).AllRows().Do();
|
||||
//now apply constraints (NOT NULL) to new table
|
||||
foreach (var sql in sqls1) Execute.Sql(sql).Do();
|
||||
|
||||
//special trick to add the column without constraints and return the sql to add them later
|
||||
AddColumn<MacroDto>("macroSource", out var sqls2);
|
||||
|
||||
//populate the new macroSource column with legacy data
|
||||
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroXSLT, macroType = {(int)MacroTypes.Unknown} WHERE macroXSLT IS NOT NULL").Do();
|
||||
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroScriptAssembly, macroType = {(int)MacroTypes.Unknown} WHERE macroScriptAssembly IS NOT NULL").Do();
|
||||
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroScriptType, macroType = {(int)MacroTypes.UserControl} WHERE macroScriptType IS NOT NULL").Do();
|
||||
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.Macro} SET macroSource = macroPython, macroType = {(int)MacroTypes.PartialView} WHERE macroPython IS NOT NULL").Do();
|
||||
|
||||
//now apply constraints (NOT NULL) to new table
|
||||
foreach (var sql in sqls2) Execute.Sql(sql).Do();
|
||||
|
||||
//now remove these old columns
|
||||
Delete.Column("macroXSLT").FromTable(Constants.DatabaseSchema.Tables.Macro).Do();
|
||||
Delete.Column("macroScriptAssembly").FromTable(Constants.DatabaseSchema.Tables.Macro).Do();
|
||||
Delete.Column("macroScriptType").FromTable(Constants.DatabaseSchema.Tables.Macro).Do();
|
||||
Delete.Column("macroPython").FromTable(Constants.DatabaseSchema.Tables.Macro).Do();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,13 +67,6 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
.Do();
|
||||
}
|
||||
|
||||
private bool ColumnExists(string tableName, string columnName)
|
||||
{
|
||||
// that's ok even on MySql
|
||||
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).Distinct().ToArray();
|
||||
return columns.Any(x => x.TableName.InvariantEquals(tableName) && x.ColumnName.InvariantEquals(columnName));
|
||||
}
|
||||
|
||||
private void RemoveDuplicates()
|
||||
{
|
||||
const string sql = @"delete from cmsPreviewXml where versionId in (
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Exceptions;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
@@ -19,7 +20,8 @@ namespace Umbraco.Core.Models
|
||||
private PublishedState _publishedState;
|
||||
private DateTime? _releaseDate;
|
||||
private DateTime? _expireDate;
|
||||
private string _nodeName;//NOTE Once localization is introduced this will be the non-localized Node Name.
|
||||
private Dictionary<string, (string Name, DateTime Date)> _publishInfos;
|
||||
private HashSet<string> _edited;
|
||||
|
||||
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
|
||||
|
||||
@@ -29,8 +31,8 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="name">Name of the content</param>
|
||||
/// <param name="parent">Parent <see cref="IContent"/> object</param>
|
||||
/// <param name="contentType">ContentType for the current Content object</param>
|
||||
public Content(string name, IContent parent, IContentType contentType)
|
||||
: this(name, parent, contentType, new PropertyCollection())
|
||||
public Content(string name, IContent parent, IContentType contentType, string culture = null)
|
||||
: this(name, parent, contentType, new PropertyCollection(), culture)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
@@ -40,8 +42,8 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="parent">Parent <see cref="IContent"/> object</param>
|
||||
/// <param name="contentType">ContentType for the current Content object</param>
|
||||
/// <param name="properties">Collection of properties</param>
|
||||
public Content(string name, IContent parent, IContentType contentType, PropertyCollection properties)
|
||||
: base(name, parent, contentType, properties)
|
||||
public Content(string name, IContent parent, IContentType contentType, PropertyCollection properties, string culture = null)
|
||||
: base(name, parent, contentType, properties, culture)
|
||||
{
|
||||
_contentType = contentType ?? throw new ArgumentNullException(nameof(contentType));
|
||||
_publishedState = PublishedState.Unpublished;
|
||||
@@ -54,8 +56,8 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="name">Name of the content</param>
|
||||
/// <param name="parentId">Id of the Parent content</param>
|
||||
/// <param name="contentType">ContentType for the current Content object</param>
|
||||
public Content(string name, int parentId, IContentType contentType)
|
||||
: this(name, parentId, contentType, new PropertyCollection())
|
||||
public Content(string name, int parentId, IContentType contentType, string culture = null)
|
||||
: this(name, parentId, contentType, new PropertyCollection(), culture)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
@@ -65,8 +67,8 @@ namespace Umbraco.Core.Models
|
||||
/// <param name="parentId">Id of the Parent content</param>
|
||||
/// <param name="contentType">ContentType for the current Content object</param>
|
||||
/// <param name="properties">Collection of properties</param>
|
||||
public Content(string name, int parentId, IContentType contentType, PropertyCollection properties)
|
||||
: base(name, parentId, contentType, properties)
|
||||
public Content(string name, int parentId, IContentType contentType, PropertyCollection properties, string culture = null)
|
||||
: base(name, parentId, contentType, properties, culture)
|
||||
{
|
||||
_contentType = contentType ?? throw new ArgumentNullException(nameof(contentType));
|
||||
_publishedState = PublishedState.Unpublished;
|
||||
@@ -80,7 +82,6 @@ namespace Umbraco.Core.Models
|
||||
public readonly PropertyInfo PublishedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.Published);
|
||||
public readonly PropertyInfo ReleaseDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ReleaseDate);
|
||||
public readonly PropertyInfo ExpireDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ExpireDate);
|
||||
public readonly PropertyInfo NodeNameSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.NodeName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -161,7 +162,6 @@ namespace Umbraco.Core.Models
|
||||
[IgnoreDataMember]
|
||||
public bool Edited { get; internal set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The date this Content should be released and thus be published
|
||||
/// </summary>
|
||||
@@ -182,19 +182,6 @@ namespace Umbraco.Core.Models
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _expireDate, Ps.Value.ExpireDateSelector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Name of the Node (non-localized).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This Property is kept internal until localization is introduced.
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
internal string NodeName
|
||||
{
|
||||
get => _nodeName;
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _nodeName, Ps.Value.NodeNameSelector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ContentType used by this content object
|
||||
/// </summary>
|
||||
@@ -213,6 +200,111 @@ namespace Umbraco.Core.Models
|
||||
[IgnoreDataMember]
|
||||
public string PublishName { get; internal set; }
|
||||
|
||||
// sets publish infos
|
||||
// internal for repositories
|
||||
// clear by clearing name
|
||||
internal void SetPublishInfos(string culture, string name, DateTime date)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
throw new ArgumentNullOrEmptyException(nameof(name));
|
||||
|
||||
// this is the only place where we set PublishName (apart from factories etc), and we must ensure
|
||||
// that we do have an invariant name, as soon as we have a variant name, else we would end up not
|
||||
// being able to publish - and not being able to change the name, as PublishName is readonly.
|
||||
// see also: DocumentRepository.EnsureInvariantNameValues() - which deals with Name.
|
||||
// see also: U4-11286
|
||||
if (culture == null || string.IsNullOrEmpty(PublishName))
|
||||
{
|
||||
PublishName = name;
|
||||
PublishDate = date;
|
||||
}
|
||||
|
||||
if (culture != null)
|
||||
{
|
||||
// private method, assume that culture is valid
|
||||
|
||||
if (_publishInfos == null)
|
||||
_publishInfos = new Dictionary<string, (string Name, DateTime Date)>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
_publishInfos[culture] = (name, date);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[IgnoreDataMember]
|
||||
public IReadOnlyDictionary<string, string> PublishNames => _publishInfos?.ToDictionary(x => x.Key, x => x.Value.Name, StringComparer.OrdinalIgnoreCase) ?? NoNames;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string GetPublishName(string culture)
|
||||
{
|
||||
if (culture == null) return PublishName;
|
||||
if (_publishInfos == null) return null;
|
||||
return _publishInfos.TryGetValue(culture, out var infos) ? infos.Name : null;
|
||||
}
|
||||
|
||||
// clears a publish name
|
||||
private void ClearPublishName(string culture)
|
||||
{
|
||||
if (culture == null)
|
||||
{
|
||||
PublishName = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_publishInfos == null) return;
|
||||
_publishInfos.Remove(culture);
|
||||
if (_publishInfos.Count == 0)
|
||||
_publishInfos = null;
|
||||
}
|
||||
|
||||
// clears all publish names
|
||||
private void ClearPublishNames()
|
||||
{
|
||||
PublishName = null;
|
||||
_publishInfos = null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCulturePublished(string culture)
|
||||
=> !string.IsNullOrWhiteSpace(GetPublishName(culture));
|
||||
|
||||
/// <inheritdoc />
|
||||
public DateTime GetCulturePublishDate(string culture)
|
||||
{
|
||||
if (_publishInfos != null && _publishInfos.TryGetValue(culture, out var infos))
|
||||
return infos.Date;
|
||||
throw new InvalidOperationException($"Culture \"{culture}\" is not published.");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> PublishedCultures => _publishInfos?.Keys ?? Enumerable.Empty<string>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCultureEdited(string culture)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(GetPublishName(culture)) || (_edited != null && _edited.Contains(culture));
|
||||
}
|
||||
|
||||
// sets a publish edited
|
||||
internal void SetCultureEdited(string culture)
|
||||
{
|
||||
if (_edited == null)
|
||||
_edited = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
_edited.Add(culture);
|
||||
}
|
||||
|
||||
// sets all publish edited
|
||||
internal void SetCultureEdited(IEnumerable<string> cultures)
|
||||
{
|
||||
_edited = new HashSet<string>(cultures, StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> EditedCultures => Names.Keys.Where(IsCultureEdited);
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<string> AvailableCultures => Names.Keys;
|
||||
|
||||
[IgnoreDataMember]
|
||||
public int PublishedVersionId { get; internal set; }
|
||||
|
||||
@@ -220,37 +312,83 @@ namespace Umbraco.Core.Models
|
||||
public bool Blueprint { get; internal set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual bool PublishAllValues()
|
||||
internal virtual bool TryPublishAllValues()
|
||||
{
|
||||
if (ValidateAll().Any())
|
||||
return false;
|
||||
// the values we want to publish should be valid
|
||||
if (ValidateAllProperties().Any())
|
||||
return false; //fixme this should return an attempt with error results
|
||||
|
||||
// Name and PublishName are managed by the repository, but Names and PublishNames
|
||||
// must be managed here as they depend on the existing / supported variations.
|
||||
if (string.IsNullOrWhiteSpace(Name))
|
||||
throw new InvalidOperationException($"Cannot publish invariant culture without a name.");
|
||||
PublishName = Name;
|
||||
var now = DateTime.Now;
|
||||
foreach (var (culture, name) in Names)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
return false; //fixme this should return an attempt with error results
|
||||
|
||||
SetPublishInfos(culture, name, now);
|
||||
}
|
||||
|
||||
// property.PublishAllValues only deals with supported variations (if any)
|
||||
foreach (var property in Properties)
|
||||
property.PublishAllValues();
|
||||
|
||||
_publishedState = PublishedState.Publishing;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual bool PublishValues(int? languageId = null, string segment = null)
|
||||
public virtual bool TryPublishValues(string culture = null, string segment = null)
|
||||
{
|
||||
if (Validate(languageId, segment).Any())
|
||||
return false;
|
||||
// the variation should be supported by the content type
|
||||
ContentType.ValidateVariation(culture, segment, throwIfInvalid: true);
|
||||
|
||||
// the values we want to publish should be valid
|
||||
if (ValidateProperties(culture, segment).Any())
|
||||
return false; //fixme this should return an attempt with error results
|
||||
|
||||
// Name and PublishName are managed by the repository, but Names and PublishNames
|
||||
// must be managed here as they depend on the existing / supported variations.
|
||||
if (segment == null)
|
||||
{
|
||||
var name = GetName(culture);
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
return false; //fixme this should return an attempt with error results
|
||||
|
||||
SetPublishInfos(culture, name, DateTime.Now);
|
||||
}
|
||||
|
||||
// property.PublishValue throws on invalid variation, so filter them out
|
||||
foreach (var property in Properties.Where(x => x.PropertyType.ValidateVariation(culture, segment, throwIfInvalid: false)))
|
||||
property.PublishValue(culture, segment);
|
||||
|
||||
foreach (var property in Properties)
|
||||
property.PublishValue(languageId, segment);
|
||||
_publishedState = PublishedState.Publishing;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual bool PublishCultureValues(int? languageId = null)
|
||||
{
|
||||
if (ValidateCulture(languageId).Any())
|
||||
internal virtual bool PublishCultureValues(string culture = null)
|
||||
{
|
||||
//fixme - needs API review as this is not used apart from in tests
|
||||
|
||||
// the values we want to publish should be valid
|
||||
if (ValidatePropertiesForCulture(culture).Any())
|
||||
return false;
|
||||
|
||||
// Name and PublishName are managed by the repository, but Names and PublishNames
|
||||
// must be managed here as they depend on the existing / supported variations.
|
||||
var name = GetName(culture);
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
throw new InvalidOperationException($"Cannot publish {culture ?? "invariant"} culture without a name.");
|
||||
SetPublishInfos(culture, name, DateTime.Now);
|
||||
|
||||
// property.PublishCultureValues only deals with supported variations (if any)
|
||||
foreach (var property in Properties)
|
||||
property.PublishCultureValues(languageId);
|
||||
property.PublishCultureValues(culture);
|
||||
|
||||
_publishedState = PublishedState.Publishing;
|
||||
return true;
|
||||
}
|
||||
@@ -258,24 +396,45 @@ namespace Umbraco.Core.Models
|
||||
/// <inheritdoc />
|
||||
public virtual void ClearAllPublishedValues()
|
||||
{
|
||||
// property.ClearPublishedAllValues only deals with supported variations (if any)
|
||||
foreach (var property in Properties)
|
||||
property.ClearPublishedAllValues();
|
||||
|
||||
// Name and PublishName are managed by the repository, but Names and PublishNames
|
||||
// must be managed here as they depend on the existing / supported variations.
|
||||
ClearPublishNames();
|
||||
|
||||
_publishedState = PublishedState.Publishing;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void ClearPublishedValues(int? languageId = null, string segment = null)
|
||||
public virtual void ClearPublishedValues(string culture = null, string segment = null)
|
||||
{
|
||||
foreach (var property in Properties)
|
||||
property.ClearPublishedValue(languageId, segment);
|
||||
// the variation should be supported by the content type
|
||||
ContentType.ValidateVariation(culture, segment, throwIfInvalid: true);
|
||||
|
||||
// property.ClearPublishedValue throws on invalid variation, so filter them out
|
||||
foreach (var property in Properties.Where(x => x.PropertyType.ValidateVariation(culture, segment, throwIfInvalid: false)))
|
||||
property.ClearPublishedValue(culture, segment);
|
||||
|
||||
// Name and PublishName are managed by the repository, but Names and PublishNames
|
||||
// must be managed here as they depend on the existing / supported variations.
|
||||
ClearPublishName(culture);
|
||||
|
||||
_publishedState = PublishedState.Publishing;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void ClearCulturePublishedValues(int? languageId = null)
|
||||
public virtual void ClearCulturePublishedValues(string culture = null)
|
||||
{
|
||||
// property.ClearPublishedCultureValues only deals with supported variations (if any)
|
||||
foreach (var property in Properties)
|
||||
property.ClearPublishedCultureValues(languageId);
|
||||
property.ClearPublishedCultureValues(culture);
|
||||
|
||||
// Name and PublishName are managed by the repository, but Names and PublishNames
|
||||
// must be managed here as they depend on the existing / supported variations.
|
||||
ClearPublishName(culture);
|
||||
|
||||
_publishedState = PublishedState.Publishing;
|
||||
}
|
||||
|
||||
@@ -301,8 +460,8 @@ namespace Umbraco.Core.Models
|
||||
// clear all existing properties
|
||||
foreach (var property in Properties)
|
||||
foreach (var pvalue in property.Values)
|
||||
if (property.PropertyType.ValidateVariation(pvalue.LanguageId, pvalue.Segment, false))
|
||||
property.SetValue(null, pvalue.LanguageId, pvalue.Segment);
|
||||
if (property.PropertyType.ValidateVariation(pvalue.Culture, pvalue.Segment, false))
|
||||
property.SetValue(null, pvalue.Culture, pvalue.Segment);
|
||||
|
||||
// copy other properties
|
||||
var otherProperties = other.Properties;
|
||||
@@ -311,16 +470,22 @@ namespace Umbraco.Core.Models
|
||||
var alias = otherProperty.PropertyType.Alias;
|
||||
foreach (var pvalue in otherProperty.Values)
|
||||
{
|
||||
if (!otherProperty.PropertyType.ValidateVariation(pvalue.LanguageId, pvalue.Segment, false))
|
||||
if (!otherProperty.PropertyType.ValidateVariation(pvalue.Culture, pvalue.Segment, false))
|
||||
continue;
|
||||
var value = published ? pvalue.PublishedValue : pvalue.EditedValue;
|
||||
SetValue(alias, value, pvalue.LanguageId, pvalue.Segment);
|
||||
SetValue(alias, value, pvalue.Culture, pvalue.Segment);
|
||||
}
|
||||
}
|
||||
|
||||
// copy names
|
||||
ClearNames();
|
||||
foreach (var (culture, name) in other.Names)
|
||||
SetName(name, culture);
|
||||
Name = other.Name;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void CopyValues(IContent other, int? languageId = null, string segment = null)
|
||||
public virtual void CopyValues(IContent other, string culture = null, string segment = null)
|
||||
{
|
||||
if (other.ContentTypeId != ContentTypeId)
|
||||
throw new InvalidOperationException("Cannot copy values from a different content type.");
|
||||
@@ -335,28 +500,31 @@ namespace Umbraco.Core.Models
|
||||
// clear all existing properties
|
||||
foreach (var property in Properties)
|
||||
{
|
||||
if (!property.PropertyType.ValidateVariation(languageId, segment, false))
|
||||
if (!property.PropertyType.ValidateVariation(culture, segment, false))
|
||||
continue;
|
||||
|
||||
foreach (var pvalue in property.Values)
|
||||
if (pvalue.LanguageId == languageId && pvalue.Segment == segment)
|
||||
property.SetValue(null, pvalue.LanguageId, pvalue.Segment);
|
||||
if (pvalue.Culture.InvariantEquals(culture) && pvalue.Segment.InvariantEquals(segment))
|
||||
property.SetValue(null, pvalue.Culture, pvalue.Segment);
|
||||
}
|
||||
|
||||
// copy other properties
|
||||
var otherProperties = other.Properties;
|
||||
foreach (var otherProperty in otherProperties)
|
||||
{
|
||||
if (!otherProperty.PropertyType.ValidateVariation(languageId, segment, false))
|
||||
if (!otherProperty.PropertyType.ValidateVariation(culture, segment, false))
|
||||
continue;
|
||||
|
||||
var alias = otherProperty.PropertyType.Alias;
|
||||
SetValue(alias, otherProperty.GetValue(languageId, segment, published), languageId, segment);
|
||||
SetValue(alias, otherProperty.GetValue(culture, segment, published), culture, segment);
|
||||
}
|
||||
|
||||
// copy name
|
||||
SetName(other.GetName(culture), culture);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void CopyCultureValues(IContent other, int? languageId = null)
|
||||
public virtual void CopyCultureValues(IContent other, string culture = null)
|
||||
{
|
||||
if (other.ContentTypeId != ContentTypeId)
|
||||
throw new InvalidOperationException("Cannot copy values from a different content type.");
|
||||
@@ -368,8 +536,8 @@ namespace Umbraco.Core.Models
|
||||
// clear all existing properties
|
||||
foreach (var property in Properties)
|
||||
foreach (var pvalue in property.Values)
|
||||
if (pvalue.LanguageId == languageId && property.PropertyType.ValidateVariation(pvalue.LanguageId, pvalue.Segment, false))
|
||||
property.SetValue(null, pvalue.LanguageId, pvalue.Segment);
|
||||
if (pvalue.Culture.InvariantEquals(culture) && property.PropertyType.ValidateVariation(pvalue.Culture, pvalue.Segment, false))
|
||||
property.SetValue(null, pvalue.Culture, pvalue.Segment);
|
||||
|
||||
// copy other properties
|
||||
var otherProperties = other.Properties;
|
||||
@@ -378,12 +546,15 @@ namespace Umbraco.Core.Models
|
||||
var alias = otherProperty.PropertyType.Alias;
|
||||
foreach (var pvalue in otherProperty.Values)
|
||||
{
|
||||
if (pvalue.LanguageId != languageId || !otherProperty.PropertyType.ValidateVariation(pvalue.LanguageId, pvalue.Segment, false))
|
||||
if (pvalue.Culture != culture || !otherProperty.PropertyType.ValidateVariation(pvalue.Culture, pvalue.Segment, false))
|
||||
continue;
|
||||
var value = published ? pvalue.PublishedValue : pvalue.EditedValue;
|
||||
SetValue(alias, value, pvalue.LanguageId, pvalue.Segment);
|
||||
SetValue(alias, value, pvalue.Culture, pvalue.Segment);
|
||||
}
|
||||
}
|
||||
|
||||
// copy name
|
||||
SetName(other.GetName(culture), culture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web;
|
||||
using Umbraco.Core.Exceptions;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
@@ -19,23 +19,20 @@ namespace Umbraco.Core.Models
|
||||
[DebuggerDisplay("Id: {Id}, Name: {Name}, ContentType: {ContentTypeBase.Alias}")]
|
||||
public abstract class ContentBase : TreeEntityBase, IContentBase
|
||||
{
|
||||
protected static readonly Dictionary<string, string> NoNames = new Dictionary<string, string>();
|
||||
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
|
||||
|
||||
private int _contentTypeId;
|
||||
protected IContentTypeComposition ContentTypeBase;
|
||||
private int _writerId;
|
||||
|
||||
// fixme need to deal with localized names, how?
|
||||
// for the time being, this is the node text = unique
|
||||
private string _name;
|
||||
|
||||
private PropertyCollection _properties;
|
||||
private Dictionary<string, (string Name, DateTime Date)> _cultureInfos;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ContentBase"/> class.
|
||||
/// </summary>
|
||||
protected ContentBase(string name, int parentId, IContentTypeComposition contentType, PropertyCollection properties)
|
||||
: this(name, contentType, properties)
|
||||
protected ContentBase(string name, int parentId, IContentTypeComposition contentType, PropertyCollection properties, string culture = null)
|
||||
: this(name, contentType, properties, culture)
|
||||
{
|
||||
if (parentId == 0) throw new ArgumentOutOfRangeException(nameof(parentId));
|
||||
ParentId = parentId;
|
||||
@@ -44,14 +41,14 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ContentBase"/> class.
|
||||
/// </summary>
|
||||
protected ContentBase(string name, IContentBase parent, IContentTypeComposition contentType, PropertyCollection properties)
|
||||
: this(name, contentType, properties)
|
||||
protected ContentBase(string name, IContentBase parent, IContentTypeComposition contentType, PropertyCollection properties, string culture = null)
|
||||
: this(name, contentType, properties, culture)
|
||||
{
|
||||
if (parent == null) throw new ArgumentNullException(nameof(parent));
|
||||
SetParent(parent);
|
||||
}
|
||||
|
||||
private ContentBase(string name, IContentTypeComposition contentType, PropertyCollection properties)
|
||||
private ContentBase(string name, IContentTypeComposition contentType, PropertyCollection properties, string culture = null)
|
||||
{
|
||||
ContentTypeBase = contentType ?? throw new ArgumentNullException(nameof(contentType));
|
||||
|
||||
@@ -59,7 +56,8 @@ namespace Umbraco.Core.Models
|
||||
Id = 0; // no identity
|
||||
VersionId = 0; // no versions
|
||||
|
||||
Name = _name = name;
|
||||
SetName(name, culture);
|
||||
|
||||
_contentTypeId = contentType.Id;
|
||||
_properties = properties ?? throw new ArgumentNullException(nameof(properties));
|
||||
_properties.EnsurePropertyTypes(PropertyTypes);
|
||||
@@ -71,6 +69,7 @@ namespace Umbraco.Core.Models
|
||||
public readonly PropertyInfo DefaultContentTypeIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ContentTypeId);
|
||||
public readonly PropertyInfo PropertyCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentBase, PropertyCollection>(x => x.Properties);
|
||||
public readonly PropertyInfo WriterSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.WriterId);
|
||||
public readonly PropertyInfo NamesSelector = ExpressionHelper.GetPropertyInfo<ContentBase, IReadOnlyDictionary<string, string>>(x => x.Names);
|
||||
}
|
||||
|
||||
protected void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
@@ -138,6 +137,110 @@ namespace Umbraco.Core.Models
|
||||
[IgnoreDataMember]
|
||||
public IEnumerable<PropertyType> PropertyTypes => ContentTypeBase.CompositionPropertyTypes;
|
||||
|
||||
#region Cultures
|
||||
|
||||
/// <inheritdoc />
|
||||
[DataMember]
|
||||
public virtual IReadOnlyDictionary<string, string> Names => _cultureInfos?.ToDictionary(x => x.Key, x => x.Value.Name, StringComparer.OrdinalIgnoreCase) ?? NoNames;
|
||||
|
||||
// sets culture infos
|
||||
// internal for repositories
|
||||
// clear by clearing name
|
||||
internal void SetCultureInfos(string culture, string name, DateTime date)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
throw new ArgumentNullOrEmptyException(nameof(name));
|
||||
|
||||
if (culture == null)
|
||||
{
|
||||
Name = name;
|
||||
return;
|
||||
}
|
||||
|
||||
// private method, assume that culture is valid
|
||||
|
||||
if (_cultureInfos == null)
|
||||
_cultureInfos = new Dictionary<string, (string Name, DateTime Date)>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
_cultureInfos[culture] = (name, date);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void SetName(string name, string culture)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
ClearName(culture);
|
||||
return;
|
||||
}
|
||||
|
||||
if (culture == null)
|
||||
{
|
||||
Name = name;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ContentTypeBase.Variations.HasAny(ContentVariation.CultureNeutral | ContentVariation.CultureSegment))
|
||||
throw new NotSupportedException("Content type does not support varying name by culture.");
|
||||
|
||||
if (_cultureInfos == null)
|
||||
_cultureInfos = new Dictionary<string, (string Name, DateTime Date)>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
_cultureInfos[culture] = (name, DateTime.Now);
|
||||
OnPropertyChanged(Ps.Value.NamesSelector);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual string GetName(string culture)
|
||||
{
|
||||
if (culture == null) return Name;
|
||||
if (_cultureInfos == null) return null;
|
||||
return _cultureInfos.TryGetValue(culture, out var infos) ? infos.Name : null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsCultureAvailable(string culture)
|
||||
=> !string.IsNullOrWhiteSpace(GetName(culture));
|
||||
|
||||
private void ClearName(string culture)
|
||||
{
|
||||
if (culture == null)
|
||||
{
|
||||
Name = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ContentTypeBase.Variations.HasAny(ContentVariation.CultureNeutral | ContentVariation.CultureSegment))
|
||||
throw new NotSupportedException("Content type does not support varying name by culture.");
|
||||
|
||||
if (_cultureInfos == null) return;
|
||||
if (!_cultureInfos.ContainsKey(culture))
|
||||
throw new InvalidOperationException($"Cannot unpublish culture {culture}, the document contains only cultures {string.Join(", ", _cultureInfos.Keys)}");
|
||||
|
||||
_cultureInfos.Remove(culture);
|
||||
if (_cultureInfos.Count == 0)
|
||||
_cultureInfos = null;
|
||||
}
|
||||
|
||||
protected virtual void ClearNames()
|
||||
{
|
||||
if (!ContentTypeBase.Variations.HasAny(ContentVariation.CultureNeutral | ContentVariation.CultureSegment))
|
||||
throw new NotSupportedException("Content type does not support varying name by culture.");
|
||||
|
||||
_cultureInfos = null;
|
||||
OnPropertyChanged(Ps.Value.NamesSelector);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public DateTime GetCultureDate(string culture)
|
||||
{
|
||||
if (_cultureInfos != null && _cultureInfos.TryGetValue(culture, out var infos))
|
||||
return infos.Date;
|
||||
throw new InvalidOperationException($"Culture \"{culture}\" is not available.");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Has, Get, Set, Publish Property Value
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -145,29 +248,29 @@ namespace Umbraco.Core.Models
|
||||
=> Properties.Contains(propertyTypeAlias);
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual object GetValue(string propertyTypeAlias, int? languageId = null, string segment = null, bool published = false)
|
||||
public virtual object GetValue(string propertyTypeAlias, string culture = null, string segment = null, bool published = false)
|
||||
{
|
||||
return Properties.TryGetValue(propertyTypeAlias, out var property)
|
||||
? property.GetValue(languageId, segment, published)
|
||||
? property.GetValue(culture, segment, published)
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual TValue GetValue<TValue>(string propertyTypeAlias, int? languageId = null, string segment = null, bool published = false)
|
||||
public virtual TValue GetValue<TValue>(string propertyTypeAlias, string culture = null, string segment = null, bool published = false)
|
||||
{
|
||||
if (!Properties.TryGetValue(propertyTypeAlias, out var property))
|
||||
return default;
|
||||
|
||||
var convertAttempt = property.GetValue(languageId, segment, published).TryConvertTo<TValue>();
|
||||
var convertAttempt = property.GetValue(culture, segment, published).TryConvertTo<TValue>();
|
||||
return convertAttempt.Success ? convertAttempt.Result : default;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual void SetValue(string propertyTypeAlias, object value, int? languageId = null, string segment = null)
|
||||
public virtual void SetValue(string propertyTypeAlias, object value, string culture = null, string segment = null)
|
||||
{
|
||||
if (Properties.Contains(propertyTypeAlias))
|
||||
{
|
||||
Properties[propertyTypeAlias].SetValue(value, languageId, segment);
|
||||
Properties[propertyTypeAlias].SetValue(value, culture, segment);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -176,7 +279,7 @@ namespace Umbraco.Core.Models
|
||||
throw new InvalidOperationException($"No PropertyType exists with the supplied alias \"{propertyTypeAlias}\".");
|
||||
|
||||
var property = propertyType.CreateProperty();
|
||||
property.SetValue(value, languageId, segment);
|
||||
property.SetValue(value, culture, segment);
|
||||
Properties.Add(property);
|
||||
}
|
||||
|
||||
@@ -187,36 +290,60 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Sets the posted file value of a property.
|
||||
/// </summary>
|
||||
public virtual void SetValue(string propertyTypeAlias, HttpPostedFile value, int? languageId = null, string segment = null)
|
||||
public virtual void SetValue(string propertyTypeAlias, HttpPostedFile value, string culture = null, string segment = null)
|
||||
{
|
||||
ContentExtensions.SetValue(this, propertyTypeAlias, new HttpPostedFileWrapper(value), languageId, segment);
|
||||
ContentExtensions.SetValue(this, propertyTypeAlias, new HttpPostedFileWrapper(value), culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the posted file value of a property.
|
||||
/// </summary>
|
||||
public virtual void SetValue(string propertyTypeAlias, HttpPostedFileBase value, int? languageId = null, string segment = null)
|
||||
public virtual void SetValue(string propertyTypeAlias, HttpPostedFileBase value, string culture = null, string segment = null)
|
||||
{
|
||||
ContentExtensions.SetValue(this, propertyTypeAlias, value, languageId, segment);
|
||||
ContentExtensions.SetValue(this, propertyTypeAlias, value, culture, segment);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Validation
|
||||
|
||||
public virtual Property[] ValidateAll()
|
||||
{
|
||||
internal virtual Property[] ValidateAllProperties()
|
||||
{
|
||||
//fixme - needs API review as this is not used apart from in tests
|
||||
|
||||
return Properties.Where(x => !x.IsAllValid()).ToArray();
|
||||
}
|
||||
|
||||
public virtual Property[] Validate(int? languageId = null, string segment = null)
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsValid(string culture = null, string segment = null)
|
||||
{
|
||||
var name = GetName(culture);
|
||||
if (name.IsNullOrWhiteSpace()) return false;
|
||||
return ValidateProperties(culture, segment).Length == 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public virtual Property[] ValidateProperties(string culture = null, string segment = null)
|
||||
{
|
||||
return Properties.Where(x => !x.IsValid(languageId, segment)).ToArray();
|
||||
return Properties.Where(x =>
|
||||
{
|
||||
if (!culture.IsNullOrWhiteSpace() && !x.PropertyType.Variations.HasAny(ContentVariation.CultureNeutral | ContentVariation.CultureSegment))
|
||||
return false; //has a culture, this prop is only culture invariant, ignore
|
||||
if (culture.IsNullOrWhiteSpace() && !x.PropertyType.Variations.HasAny(ContentVariation.InvariantNeutral | ContentVariation.InvariantSegment))
|
||||
return false; //no culture, this prop is only culture variant, ignore
|
||||
if (!segment.IsNullOrWhiteSpace() && !x.PropertyType.Variations.HasAny(ContentVariation.InvariantSegment | ContentVariation.CultureSegment))
|
||||
return false; //has segment, this prop is only segment neutral, ignore
|
||||
if (segment.IsNullOrWhiteSpace() && !x.PropertyType.Variations.HasAny(ContentVariation.InvariantNeutral | ContentVariation.CultureNeutral))
|
||||
return false; //no segment, this prop is only non segment neutral, ignore
|
||||
return !x.IsValid(culture, segment);
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
public virtual Property[] ValidateCulture(int? languageId = null)
|
||||
{
|
||||
return Properties.Where(x => !x.IsCultureValid(languageId)).ToArray();
|
||||
internal virtual Property[] ValidatePropertiesForCulture(string culture = null)
|
||||
{
|
||||
//fixme - needs API review as this is not used apart from in tests
|
||||
|
||||
return Properties.Where(x => !x.IsCultureValid(culture)).ToArray();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -301,7 +428,7 @@ namespace Umbraco.Core.Models
|
||||
var propertyTypes = Properties.Where(x => x.WasDirty()).Select(x => x.Alias);
|
||||
return instanceProperties.Concat(propertyTypes);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Umbraco.Core.Models
|
||||
return Current.Services.MediaService.GetById(media.ParentId);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Removes characters that are not valide XML characters from all entity properties
|
||||
/// of type string. See: http://stackoverflow.com/a/961504/5018
|
||||
@@ -271,7 +271,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Sets the posted file value of a property.
|
||||
/// </summary>
|
||||
public static void SetValue(this IContentBase content, string propertyTypeAlias, HttpPostedFileBase value, int? languageId = null, string segment = null)
|
||||
public static void SetValue(this IContentBase content, string propertyTypeAlias, HttpPostedFileBase value, string culture = null, string segment = null)
|
||||
{
|
||||
// ensure we get the filename without the path in IE in intranet mode
|
||||
// http://stackoverflow.com/questions/382464/httppostedfile-filename-different-from-ie
|
||||
@@ -290,7 +290,7 @@ namespace Umbraco.Core.Models
|
||||
if (string.IsNullOrWhiteSpace(filename)) return;
|
||||
filename = filename.ToLower(); // fixme - er... why?
|
||||
|
||||
MediaFileSystem.SetUploadFile(content, propertyTypeAlias, filename, value.InputStream, languageId, segment);
|
||||
MediaFileSystem.SetUploadFile(content, propertyTypeAlias, filename, value.InputStream, culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -299,7 +299,7 @@ namespace Umbraco.Core.Models
|
||||
/// <remarks>This really is for FileUpload fields only, and should be obsoleted. For anything else,
|
||||
/// you need to store the file by yourself using Store and then figure out
|
||||
/// how to deal with auto-fill properties (if any) and thumbnails (if any) by yourself.</remarks>
|
||||
public static void SetValue(this IContentBase content, string propertyTypeAlias, string filename, Stream filestream, int? languageId = null, string segment = null)
|
||||
public static void SetValue(this IContentBase content, string propertyTypeAlias, string filename, Stream filestream, string culture = null, string segment = null)
|
||||
{
|
||||
if (filename == null || filestream == null) return;
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace Umbraco.Core.Models
|
||||
if (string.IsNullOrWhiteSpace(filename)) return;
|
||||
filename = filename.ToLower(); // fixme - er... why?
|
||||
|
||||
MediaFileSystem.SetUploadFile(content, propertyTypeAlias, filename, filestream, languageId, segment);
|
||||
MediaFileSystem.SetUploadFile(content, propertyTypeAlias, filename, filestream, culture, segment);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -19,9 +19,6 @@ namespace Umbraco.Core.Models
|
||||
[DebuggerDisplay("Id: {Id}, Name: {Name}, Alias: {Alias}")]
|
||||
public abstract class ContentTypeBase : TreeEntityBase, IContentTypeBase
|
||||
{
|
||||
//fixme this should be invariant by default but for demo purposes and until the UI is updated to support changing a property type we'll make this neutral by default
|
||||
private const ContentVariation DefaultVaryBy = ContentVariation.CultureNeutral;
|
||||
|
||||
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
|
||||
|
||||
private string _alias;
|
||||
@@ -49,7 +46,7 @@ namespace Umbraco.Core.Models
|
||||
_propertyTypes = new PropertyTypeCollection(IsPublishing);
|
||||
_propertyTypes.CollectionChanged += PropertyTypesChanged;
|
||||
|
||||
_variations = DefaultVaryBy;
|
||||
_variations = ContentVariation.InvariantNeutral;
|
||||
}
|
||||
|
||||
protected ContentTypeBase(IContentTypeBase parent)
|
||||
@@ -70,7 +67,7 @@ namespace Umbraco.Core.Models
|
||||
_propertyTypes = new PropertyTypeCollection(IsPublishing);
|
||||
_propertyTypes.CollectionChanged += PropertyTypesChanged;
|
||||
|
||||
_variations = DefaultVaryBy;
|
||||
_variations = ContentVariation.InvariantNeutral;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -204,6 +201,35 @@ namespace Umbraco.Core.Models
|
||||
set => SetPropertyValueAndDetectChanges(value, ref _variations, Ps.Value.VaryBy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates that a variation is valid for the content type.
|
||||
/// </summary>
|
||||
public bool ValidateVariation(string culture, string segment, bool throwIfInvalid)
|
||||
{
|
||||
ContentVariation variation;
|
||||
if (culture != null)
|
||||
{
|
||||
variation = segment != null
|
||||
? ContentVariation.CultureSegment
|
||||
: ContentVariation.CultureNeutral;
|
||||
}
|
||||
else if (segment != null)
|
||||
{
|
||||
variation = ContentVariation.InvariantSegment;
|
||||
}
|
||||
else
|
||||
{
|
||||
variation = ContentVariation.InvariantNeutral;
|
||||
}
|
||||
if (!Variations.Has(variation))
|
||||
{
|
||||
if (throwIfInvalid)
|
||||
throw new NotSupportedException($"Variation {variation} is invalid for content type \"{Alias}\".");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List of PropertyGroups available on this ContentType
|
||||
/// </summary>
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
namespace Umbraco.Core.Models.Entities
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Models.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements <see cref="IDocumentEntitySlim"/>.
|
||||
/// </summary>
|
||||
public class DocumentEntitySlim : ContentEntitySlim, IDocumentEntitySlim
|
||||
{
|
||||
private static readonly IReadOnlyDictionary<string, string> Empty = new Dictionary<string, string>();
|
||||
private IReadOnlyDictionary<string, string> _cultureNames;
|
||||
public IReadOnlyDictionary<string, string> CultureNames
|
||||
{
|
||||
get => _cultureNames ?? Empty;
|
||||
set => _cultureNames = value;
|
||||
}
|
||||
|
||||
public ContentVariation Variations { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Published { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Edited { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ namespace Umbraco.Core.Models.Entities
|
||||
/// Gets an entity representing "root".
|
||||
/// </summary>
|
||||
public static readonly IEntitySlim Root = new EntitySlim { Path = "-1", Name = "root", HasChildren = true };
|
||||
|
||||
|
||||
|
||||
// implement IEntity
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
namespace Umbraco.Core.Models.Entities
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Models.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a lightweight document entity, managed by the entity service.
|
||||
/// </summary>
|
||||
public interface IDocumentEntitySlim : IContentEntitySlim
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the document is published.
|
||||
/// </summary>
|
||||
bool Published { get; }
|
||||
//fixme we need to supply more information than this and change this property name. This will need to include Published/Editor per variation since we need this information for the tree
|
||||
IReadOnlyDictionary<string, string> CultureNames { get; }
|
||||
|
||||
ContentVariation Variations { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the document has edited properties.
|
||||
/// At least one variation is published
|
||||
/// </summary>
|
||||
bool Edited { get; }
|
||||
/// <remarks>
|
||||
/// If the document is invariant, this simply means there is a published version
|
||||
/// </remarks>
|
||||
bool Published { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// At least one variation has pending changes
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If the document is invariant, this simply means there is pending changes
|
||||
/// </remarks>
|
||||
bool Edited { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,13 +146,7 @@ namespace Umbraco.Core.Models
|
||||
/// Gets or sets the file's virtual path (i.e. the file path relative to the root of the website)
|
||||
/// </summary>
|
||||
public string VirtualPath { get; set; }
|
||||
|
||||
[Obsolete("This is no longer used and will be removed from the codebase in future versions")]
|
||||
public virtual bool IsValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// this exists so that class that manage name and alias differently, eg Template,
|
||||
// can implement their own cloning - (though really, not sure it's even needed)
|
||||
protected virtual void DeepCloneNameAndAlias(File clone)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public class Grid2Cell
|
||||
{
|
||||
public int Colspan { get; set; }
|
||||
|
||||
public IPublishedElement Settings { get; set; }
|
||||
|
||||
public IEnumerable<IPublishedElement> Items { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public class Grid2Row
|
||||
{
|
||||
public string Alias { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public IPublishedElement Settings { get; set; }
|
||||
|
||||
public IEnumerable<Grid2Cell> Cells { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public class Grid2Value
|
||||
{
|
||||
public int Columns { get; set; }
|
||||
|
||||
public IEnumerable<Grid2Row> Rows { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Content object
|
||||
/// Represents a document.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>A document can be published, rendered by a template.</para>
|
||||
/// </remarks>
|
||||
public interface IContent : IContentBase
|
||||
{
|
||||
/// <summary>
|
||||
@@ -56,7 +59,7 @@ namespace Umbraco.Core.Models
|
||||
/// Gets the date and time the content was published.
|
||||
/// </summary>
|
||||
DateTime? PublishDate { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time the content item should be published.
|
||||
/// </summary>
|
||||
@@ -77,6 +80,64 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
ContentStatus Status { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a given culture is published.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>A culture becomes published whenever values for this culture are published,
|
||||
/// and the content published name for this culture is non-null. It becomes non-published
|
||||
/// whenever values for this culture are unpublished.</para>
|
||||
/// </remarks>
|
||||
bool IsCulturePublished(string culture);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the date a culture was published.
|
||||
/// </summary>
|
||||
DateTime GetCulturePublishDate(string culture);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicated whether a given culture is edited.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>A culture is edited when it is not published, or when it is published but
|
||||
/// it has changes.</para>
|
||||
/// </remarks>
|
||||
bool IsCultureEdited(string culture);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the published version of the content for a given culture.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>When editing the content, the name can change, but this will not until the content is published.</para>
|
||||
/// <para>When <paramref name="culture"/> is <c>null</c>, gets the invariant
|
||||
/// language, which is the value of the <see cref="PublishName"/> property.</para>
|
||||
/// </remarks>
|
||||
string GetPublishName(string culture);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the published names of the content.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Because a dictionary key cannot be <c>null</c> this cannot get the invariant
|
||||
/// name, which must be get via the <see cref="PublishName"/> property.</para>
|
||||
/// </remarks>
|
||||
IReadOnlyDictionary<string, string> PublishNames { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the available cultures.
|
||||
/// </summary>
|
||||
IEnumerable<string> AvailableCultures { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the published cultures.
|
||||
/// </summary>
|
||||
IEnumerable<string> PublishedCultures { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the edited cultures.
|
||||
/// </summary>
|
||||
IEnumerable<string> EditedCultures { get; }
|
||||
|
||||
// fixme - these two should move to some kind of service
|
||||
|
||||
/// <summary>
|
||||
@@ -106,9 +167,11 @@ namespace Umbraco.Core.Models
|
||||
/// <returns>A value indicating whether the values could be published.</returns>
|
||||
/// <remarks>
|
||||
/// <para>The document must then be published via the content service.</para>
|
||||
/// <para>Values are not published if they are not valie.</para>
|
||||
/// <para>Values are not published if they are not valid.</para>
|
||||
/// </remarks>
|
||||
bool PublishAllValues();
|
||||
//fixme return an Attempt with some error results if it doesn't work
|
||||
//fixme - needs API review as this is not used apart from in tests
|
||||
//bool TryPublishAllValues();
|
||||
|
||||
/// <summary>
|
||||
/// Publishes values.
|
||||
@@ -118,7 +181,8 @@ namespace Umbraco.Core.Models
|
||||
/// <para>The document must then be published via the content service.</para>
|
||||
/// <para>Values are not published if they are not valid.</para>
|
||||
/// </remarks>
|
||||
bool PublishValues(int? languageId = null, string segment = null);
|
||||
//fixme return an Attempt with some error results if it doesn't work
|
||||
bool TryPublishValues(string culture = null, string segment = null);
|
||||
|
||||
/// <summary>
|
||||
/// Publishes the culture/any values.
|
||||
@@ -127,8 +191,9 @@ namespace Umbraco.Core.Models
|
||||
/// <remarks>
|
||||
/// <para>The document must then be published via the content service.</para>
|
||||
/// <para>Values are not published if they are not valie.</para>
|
||||
/// </remarks>
|
||||
bool PublishCultureValues(int? languageId = null);
|
||||
/// </remarks>
|
||||
//fixme - needs API review as this is not used apart from in tests
|
||||
//bool PublishCultureValues(string culture = null);
|
||||
|
||||
/// <summary>
|
||||
/// Clears all published values.
|
||||
@@ -138,12 +203,12 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Clears published values.
|
||||
/// </summary>
|
||||
void ClearPublishedValues(int? languageId = null, string segment = null);
|
||||
void ClearPublishedValues(string culture = null, string segment = null);
|
||||
|
||||
/// <summary>
|
||||
/// Clears the culture/any published values.
|
||||
/// </summary>
|
||||
void ClearCulturePublishedValues(int? languageId = null);
|
||||
void ClearCulturePublishedValues(string culture = null);
|
||||
|
||||
/// <summary>
|
||||
/// Copies values from another document.
|
||||
@@ -153,11 +218,11 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Copies values from another document.
|
||||
/// </summary>
|
||||
void CopyValues(IContent other, int? languageId = null, string segment = null);
|
||||
void CopyValues(IContent other, string culture = null, string segment = null);
|
||||
|
||||
/// <summary>
|
||||
/// Copies culture/any values from another document.
|
||||
/// </summary>
|
||||
void CopyCultureValues(IContent other, int? languageId = null);
|
||||
void CopyCultureValues(IContent other, string culture = null);
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user