Compare commits

..

496 Commits

Author SHA1 Message Date
Lars-Erik Aabech 350f60c056 Grid 2: All current tests pass! \o/ 2018-05-22 10:47:33 +02:00
Lars-Erik Aabech 954b5ac296 Merge branch 'temp8-grid2-extended' into temp8-grid2 2018-05-21 18:31:57 +02:00
Lars-Erik Aabech 12787f0bd2 Grid 2: UniqueIDs on rows and items for events. 2018-05-21 18:30:03 +02:00
Shannon 6cf15f42a8 icon placeholder for controls with no inline view 2018-05-21 16:50:23 +02:00
Shannon b5b971a189 Fixes the editors that load 2018-05-21 16:32:13 +02:00
Lars-Erik Aabech 26a026b17a Extension points for the grid 2018-05-21 15:55:15 +02:00
leekelleher 9054b84c50 Grid2: Amends to the value-converter 2018-05-21 14:36:26 +01:00
Lars-Erik Aabech 5cb5f13d08 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-21 12:54:36 +02:00
Lars-Erik Aabech 89468fce97 Grid 2: Respecting allowed editors by udi 2018-05-21 12:54:04 +02:00
leekelleher a1997291ab Grid2: Switch to using Bootstrap4 grid layout
#opinionated
2018-05-21 11:47:22 +01:00
Lars-Erik Aabech 1f8fae0dd4 Grid 2: Switching for UDI for scaffold 2018-05-21 12:39:48 +02:00
Lars-Erik Aabech 3bd2f766ef Grid 2: Fixed typo in tests 2018-05-21 12:39:48 +02:00
Shannon f8ed341eec Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-21 12:39:21 +02:00
Shannon f3b745f5b3 change to udi 2018-05-21 12:39:04 +02:00
Callum Whyte 8d23a9b480 Changing grid editor picker on row settings in prevalue to show doctype details 2018-05-21 11:13:51 +01:00
Shannon c2e89ed955 Grid 2: Refactored grid editor to use new model and property editors w/ @lars-erik 2018-05-21 11:54:13 +02:00
mattbrailsford 782fc26723 A working grid value converter 2018-05-21 10:49:51 +01:00
Callum Whyte 378c2f727c Changing Id to UDI on Grid Content Type to follow convention 2018-05-21 10:33:49 +01:00
Callum Whyte 5c983bce5f Cleanup of Grid Controller 2018-05-21 10:03:47 +01:00
Callum Whyte 4eb18855e9 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-21 10:02:18 +01:00
Callum Whyte 2200839bfa Restricting grid cells to selected available editors 2018-05-21 10:01:36 +01:00
Mads Rasmussen 796cb9c35b Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-21 10:49:25 +02:00
Mads Rasmussen ac0d21cb3d load only grid editors in grid editor picker 2018-05-21 10:48:47 +02:00
leekelleher 70951317c5 Grid2: Refactored the GridTemplateExtensions methods
- Put the default property-alias and framework in a local constant
- Removed the obsolete methods
2018-05-21 09:32:28 +01:00
Mads Rasmussen 4270a6c440 add grid editor picker 2018-05-21 10:31:22 +02:00
mattbrailsford 030688f1a2 Fleshed out Grid2 Value Converter (untested) 2018-05-21 08:50:00 +01:00
Callum Whyte b11b2c0a71 Adjusting grid prevalue editor layout for a better user experience 2018-05-21 08:46:06 +01:00
Callum Whyte 7680ce4ef1 Fixing issue with storing content type UDIs for allowed types in Grid v2 prevalue editor 2018-05-21 08:41:41 +01:00
leekelleher ab872b7ca4 Grid2: Refactored the GetGridHtml methods
The entry point for the "Grid" partial-view folder was defined in multiple places,
now they all ultimately go through a single entry point, (the `GetGridHtml` with HtmlHelper, IPublishedProperty and framework)
Easier to maintain if/when the partial-view path changes.
2018-05-20 18:03:20 +01:00
leekelleher 8533210761 Grid2: Refactored the partial-view templates 2018-05-20 17:42:56 +01:00
leekelleher 673575594d Grid2: More work on the the partial-view templates 2018-05-20 17:42:56 +01:00
leekelleher 4702bdab33 Grid2: Reverted GridValue amends, as this is used specifically for Grid v1 with Deploy. 2018-05-20 17:42:56 +01:00
leekelleher ab08f1fc06 Grid2: Made a start with strongly-typed partial-view templates
Copied over the partial-views from the "Grid" folder (renamed to "Grid2")
2018-05-20 17:42:56 +01:00
Lars-Erik Aabech 6b29bbc9e7 Simple grid 2 tests pass. 2018-05-20 18:42:09 +02:00
Lars-Erik Aabech 80f92311dc Stubbed gridresource w/scaffold 2018-05-20 18:25:08 +02:00
Callum Whyte c1723cbda6 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 17:24:11 +01:00
Callum Whyte 5ee0311371 Updating grid v2 prevalue editor config to use doctypes 2018-05-20 17:23:12 +01:00
Callum Whyte d6c7ba03e6 Changing grid v2 row config editor to use correct namespaces 2018-05-20 17:21:23 +01:00
Callum Whyte 32ecf932a6 Changing Grid content types to use UDIs 2018-05-20 17:16:49 +01:00
Lars-Erik Aabech 26d16e3897 Mapping in the controller 2018-05-20 18:14:31 +02:00
Lars-Erik Aabech ab0074e07c Added *.log to gitignore 2018-05-20 18:11:29 +02:00
Lars-Erik Aabech 71c8e20a79 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 18:10:33 +02:00
Lars-Erik Aabech 58bd7e8453 Modifying models in the tests 2018-05-20 18:10:14 +02:00
Shannon d57c168f82 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 18:09:09 +02:00
Shannon 4a5a7068bc Allows rendering property editors inside the grid 2018-05-20 18:08:59 +02:00
Lars-Erik Aabech d34649ab1a Mapping from grid view model to persistable model (in spec for now) 2018-05-20 17:44:25 +02:00
mattbrailsford 24407ead18 Merge remote-tracking branch 'origin/temp8-grid2' into temp8-grid2 2018-05-20 16:39:58 +01:00
mattbrailsford ad4f0cf9d1 Merge remote-tracking branch 'origin/temp8-grid2' into temp8-grid2
# Conflicts:
#	src/Umbraco.Core/PropertyEditors/ValueConverters/Grid2ValueConverter.cs
#	src/Umbraco.Core/Umbraco.Core.csproj
2018-05-20 16:38:43 +01:00
mattbrailsford f5efb7609a Added todo reminders 2018-05-20 16:29:20 +01:00
mattbrailsford ab82d3b053 Added Grid2Value model 2018-05-20 16:23:15 +01:00
Mads Rasmussen 36e0673c83 set row name and alias through editor header 2018-05-20 16:48:32 +02:00
Mads Rasmussen 9d27e7386e convert row configuration dialog into an infinite editor 2018-05-20 16:29:23 +02:00
Lars-Erik Aabech 8502e10900 changed schema for grid data in spec to what we're aiming at 2018-05-20 16:14:22 +02:00
Lars-Erik Aabech 0a701d0c64 Tests adding editors to cells 2018-05-20 16:14:22 +02:00
Lars-Erik Aabech ceaa15aa82 Tests adding default layout and row. 2018-05-20 16:14:22 +02:00
Lars-Erik Aabech 2445e0cbcb Grid controller initial test 2018-05-20 16:14:22 +02:00
Shannon 5a5ad350d6 oops 2018-05-20 15:57:58 +02:00
Shannon 40e986d5dc Adds grid.resource 2018-05-20 15:56:40 +02:00
Shannon c81b68e9a8 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 15:43:18 +02:00
Shannon 8e9f1bc949 Updates controller to check for special inline.html views for property editors 2018-05-20 15:43:09 +02:00
leekelleher e8b7ffd6f5 Grid2: initial commit for the strongly-typed model - value converter 2018-05-20 14:26:54 +01:00
Callum Whyte b12eecfb1d Refactoring out legacy grid default config and RTE styles 2018-05-20 14:25:05 +01:00
Callum Whyte 06ca34f434 Removing RTE settings from grid v2 prevalue editor 2018-05-20 14:09:26 +01:00
Mads Rasmussen 5880b1b612 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 15:00:14 +02:00
Mads Rasmussen 12fc88aca9 load correct views and controller for grid2 2018-05-20 14:59:45 +02:00
Shannon e56db8baa4 Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 14:50:54 +02:00
Shannon c7aae533ad Creates c# controller for getting grid cell scaffold and meta data 2018-05-20 14:47:20 +02:00
Mads Rasmussen acaa062b7d remove config of layouts 2018-05-20 12:41:07 +02:00
Shannon f9928906fa changes pre value path 2018-05-20 12:34:22 +02:00
Callum Whyte d3719122ce Merge branch 'temp8-grid2' of https://github.com/umbraco/Umbraco-CMS into temp8-grid2 2018-05-20 11:19:51 +01:00
Mads Rasmussen 1e3fbf4e2f Merge 2018-05-20 12:16:50 +02:00
Shannon fc8130987c fixes view path 2018-05-20 12:15:41 +02:00
Shannon f3dc8f592b removes grid editor files 2018-05-20 12:14:20 +02:00
Shannon 8fda46f0ad Deprecates old grid editor 2018-05-20 12:12:18 +02:00
Mads Rasmussen 8d3c9caafb add one layout by default 2018-05-20 12:09:55 +02:00
Callum Whyte 23031a64d1 Fixing issue with serialising Grid Configuration 2018-05-20 11:09:54 +01:00
Shannon 37b27f5e73 copies new grid editor 2018-05-20 12:02:11 +02:00
Stephan 129e094b09 Fix Umbraco.Web.UI references 2018-05-18 15:24:12 +02:00
Mads Rasmussen c3c24eba4f Merge branch 'temp8' of https://github.com/umbraco/Umbraco-CMS into temp8 2018-05-18 12:33:16 +02:00
Mads Rasmussen 145858a302 hide culture dropdown in culture and hostnames dialog 2018-05-18 11:07:54 +02:00
Stephan c13e3ec220 Version 8.0.0-alpha.37 2018-05-18 09:39:02 +02:00
Stephan 6ce24bf1a1 Various fixes 2018-05-17 17:24:30 +02:00
Stephan 6c61eb2d69 Fix tests 2018-05-17 16:34:11 +02:00
Stephan 76bf84f8ea Forgot to update binding redirects 2018-05-17 16:34:05 +02:00
Stephan a8ba8598f2 Merge branch origin/temp8 into temp8-xbuild 2018-05-17 15:34:27 +02:00
Stephan 6e7bb41190 Version 8.0.0-alpha.36 2018-05-17 15:33:38 +02:00
Stephan 7387379aea Upgrade to ModelsBuilder -alpha.18 2018-05-17 15:32:27 +02:00
Shannon 50659787ee fixes published content Url for invariant 2018-05-17 15:26:06 +02:00
Shannon 3da120ce33 Adds Property Type to the published content model, fixes some web.config versions 2018-05-17 13:32:20 +02:00
Stephan de9f4f8d0b Cleanup references and dependencies 2018-05-17 13:19:35 +02:00
Stephan 20ecb6a779 Merge branch origin/temp8 into temp8-xbuild 2018-05-17 13:04:57 +02:00
Stephan 40f2558a70 Cleanup 2018-05-17 13:03:37 +02:00
Stephan f44c5ad757 Cleanup nuget, bindings, build 2018-05-17 12:17:42 +02:00
Shannon 1cf63bd471 missing checkin of package-lock 2018-05-17 11:29:21 +02:00
Shannon 07a263b794 Fixes validation check for variant nodes that don't have names assigned 2018-05-17 10:28:38 +02:00
Claus c2236b7b97 Merge pull request #2632 from umbraco/temp-U4-11218
Merge infinite editing UI branch to temp8
2018-05-17 09:16:01 +02:00
Claus 9e3db051c9 Merge remote-tracking branch 'origin/temp8' into temp-U4-11218
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html
#	src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html
#	src/Umbraco.Web.UI/web.Template.config
2018-05-17 08:26:02 +02:00
Claus 70d1bed396 Merge branch 'temp8' into temp-U4-11218 2018-05-17 08:16:17 +02:00
Stephan a6ea270d93 Cleanup build 2018-05-16 21:52:40 +02:00
Stephan a39a9b7a89 Cleanup nuspec 2018-05-16 16:02:51 +02:00
Stephan 8c815cf47e Git-ignore local directory 2018-05-16 15:54:08 +02:00
Stephan 2b7966dc55 Depend on Umbraco.SqlServerCE, package in net47 2018-05-16 15:54:07 +02:00
Stephan fe1a4f7d4f Depend on Umbraco.SqlServerCE 2018-05-16 15:54:07 +02:00
Stephan 9b17468c43 Cleanup solution 2018-05-16 15:53:22 +02:00
Stephan 6bedc1020b Cleanup solution and build wip 2018-05-16 15:46:51 +02:00
Stephan fc56126820 Cleanup Solution 2018-05-16 15:46:51 +02:00
Shannon c6fa0e560a Merge branch 'temp8' of https://github.com/umbraco/Umbraco-CMS into temp8 2018-05-16 15:21:35 +02:00
Shannon 34de58e0dc adjust assembly redirects 2018-05-16 15:21:23 +02:00
Shannon Deminick 056bcaff96 adds notes on what to work on 2018-05-16 13:51:59 +02:00
Shannon Deminick f38df3753c Adds quick start v8 link 2018-05-16 13:35:52 +02:00
Shannon Deminick 7fd78aaf2e adds link to quick start guide 2018-05-16 13:29:38 +02:00
Shannon Deminick 9bba6f4b9b adding get started guide for v8 2018-05-16 13:21:29 +02:00
Shannon Deminick 5128c23413 cross link to v7 branch 2018-05-16 12:57:13 +02:00
Shannon b565b8be77 disables redirect tracking for now until we fix it to work with variants 2018-05-16 11:25:57 +02:00
Shannon Deminick 2e2e76c92a Merge pull request #2624 from umbraco/temp-U4-11327
fixes: U4-11327 Remove styles for umb-era-button and use umb-button c…
2018-05-16 18:51:12 +10:00
Shannon 1bc3fdd07c Fixes package tree references 2018-05-16 10:49:43 +02:00
Shannon c1e0b86554 Merge branch 'temp8' into temp-U4-11327 2018-05-16 10:39:51 +02:00
Shannon bf7591aaa0 Merge branch 'temp8' of https://github.com/umbraco/Umbraco-CMS into temp8 2018-05-16 10:33:57 +02:00
Shannon 6c5abf14bd Removes legacy dialog client files 2018-05-16 10:33:46 +02:00
Claus 8044ccbf27 adding missing null check after navigating to parent. 2018-05-16 10:17:38 +02:00
Shannon 95c6de5534 Merge branch 'temp8' of https://github.com/umbraco/Umbraco-CMS into temp8 2018-05-16 10:15:57 +02:00
Stephan 2c124e87dd Merge pull request #2630 from umbraco/temp8-dependency-fixing
Temp8 dependency fixing
2018-05-16 10:15:45 +02:00
Shannon c655873b7d Cleanup canvas designer files, no more dotless dependency, cleans up preview, removes bloat 2018-05-16 10:13:55 +02:00
Shannon ea6c466323 Fixes up some warnings 2018-05-16 10:06:51 +02:00
MADSRASMUSSB4A1\madsrasmussen 6e647d87fa Merge branch 'temp8' into temp-U4-11218
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/controllers/main.controller.js
#	src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
2018-05-16 09:51:26 +02:00
Shannon 07e7068c22 removed too many assembly bindings 2018-05-15 18:07:48 +02:00
Shannon 971114e0fd Updates to 472 and re-targets to the original System.Threading.Tasks.Dataflow package against netstandard 1.3 but with 472 this completely fixes dependency outputs 2018-05-15 17:17:05 +02:00
Shannon 03977c4806 removed too much 2018-05-15 17:13:24 +02:00
Shannon 842d5049b5 Fixing dependencies so we aren't relying so much on netstandard 1.3 libs which require system runtime facade's 2018-05-15 17:02:06 +02:00
Shannon Deminick e4d1415627 Merge pull request #2621 from umbraco/temp8-U4-11282
U4-11282 - Publishing, unpublishing, saving drafts, for variant, non variant content types and property types
2018-05-15 20:29:10 +10:00
Mads Rasmussen 5dad26cb92 fixes: U4-11327 Remove styles for umb-era-button and use umb-button component instead 2018-05-11 11:59:32 +02:00
Mads Rasmussen 491ce00c17 remove console.log from unit test 2018-05-11 10:36:36 +02:00
Mads Rasmussen b7c7e8e84b make right side overlays go all the way to the top 2018-05-11 10:11:26 +02:00
Mads Rasmussen 095704d297 removing unnecessary print of number of open overlays 2018-05-11 10:05:57 +02:00
Shannon 09d03161ce fixes test 2018-05-11 00:09:31 +10:00
Shannon aa4dc64a57 Fixes ContentCache.GetRouteByIdInternal to ensure that no route is returned for any variant in the path of an unpublished variant of the same culture 2018-05-10 23:07:33 +10:00
Shannon d78fa85307 null check fix 2018-05-10 22:40:32 +10:00
Shannon 0ee056aafc null check fix 2018-05-10 22:38:10 +10:00
Shannon 68f0a64136 Fixes auth with AllowsCultureVariation and LanguageController post methods, fixes merge issues with navigation.controller 2018-05-10 19:16:46 +10:00
Warren Buckley f9f108ef33 Merge pull request #2620 from umbraco/temp-U4-11309
Temp u4 11309
2018-05-10 10:00:17 +01:00
Shannon 573b8a0701 Merge remote-tracking branch 'origin/temp8' into temp8-U4-11282
# Conflicts:
#	src/Umbraco.Tests/Routing/DomainsAndCulturesTests.cs
#	src/Umbraco.Web.UI.Client/src/controllers/navigation.controller.js
2018-05-10 18:55:39 +10:00
Shannon 4ce6f5c3b0 Fixes how the name is ensured on the content tree so that the media tree doesn't break. 2018-05-10 18:20:33 +10:00
Shannon f2b78c06ef FIxes issue where an invariant property type was being validated with a culture when that would always fail. Fixes issue when saving a content type to ensure that a property type is never both variant and invariant. Adds test. 2018-05-10 18:01:41 +10:00
Mads Rasmussen d27594d4af Update picked nodes which has been updated through the media picker 2018-05-09 16:19:54 +02:00
Mads Rasmussen 7239ce97aa only allow users to add and edit media if they have access to the media section 2018-05-09 11:09:26 +02:00
Mads Rasmussen 18b7581879 only parse in the media id for the infinite media editor 2018-05-09 09:46:15 +02:00
Mads Rasmussen 8535ff1d01 update media items in media picker if they are changed in the infinite media editor 2018-05-09 09:35:11 +02:00
Mads Rasmussen 4f366bbdda prepare media editor to support infinite mode 2018-05-09 09:34:11 +02:00
Mads Rasmussen 86c554e3d3 add option to prevent redirect of succesfull saves to new route 2018-05-09 09:20:23 +02:00
Mads Rasmussen d97d1c427e fixes some js errors in editor service 2018-05-09 09:18:45 +02:00
Mads Rasmussen 600979d129 Merge branch 'temp8' into temp-U4-11218 2018-05-09 08:51:34 +02:00
Shannon 8be861809a fixes filter 2018-05-09 15:52:06 +10:00
Shannon 8642a52a12 Fixes property model binding to display to show the invariant data if the property is non variant 2018-05-09 14:35:23 +10:00
Shannon d90ccbb7f0 no matter what you can always publish the current variant 2018-05-09 14:34:55 +10:00
Shannon 9c1451ecd3 Fixes LanguageRepository for deleting a lang, updates UrlProvider to have consistent method parameter order, updates UmbracoHelper to have culture params for getting URLs 2018-05-09 12:50:34 +10:00
Stephan c890421f55 Fix mixed properties (wip) 2018-05-08 17:09:26 +02:00
Stephan 6d1f42c9b6 Fixes 2018-05-08 16:41:37 +02:00
Stephan b1faade9b0 Revert various changes 2018-05-08 16:41:30 +02:00
Warren Buckley 5bc229801b Merge pull request #2618 from umbraco/temp8-U4-11284-2
Removes vertical and horizontal scroll bars on content tree language …
2018-05-08 12:20:22 +01:00
Robert f3e509ad55 Removes vertical and horizontal scroll bars on content tree language picker, updates languageCreated and languageDeleted event listeners to check for variant doctypes before populating the language list 2018-05-08 12:13:42 +02:00
Warren Buckley 9e8239f05b Merge pull request #2612 from umbraco/temp8-U4-11284
Fixes - U4-11284 When you don't have any doc types that are variant, the tree language drop downs should not be there
2018-05-08 10:28:54 +01:00
Stephan 6051891280 Fixes 2018-05-08 11:06:07 +02:00
Robert 70e4ea5502 Moved authenticated flag back to "app.ready" listener 2018-05-08 10:46:09 +02:00
Robert 216aaec7f2 Removed unneeded test 2018-05-08 10:00:28 +02:00
Robert db160cdc85 Merge pull request #2617 from umbraco/temp8-U4-11306
fixes: U4-11306 Add load indicators in doc type infinite editors
2018-05-08 09:00:02 +02:00
Claus d1191c0693 temporarily removing the packages tree - known issue it's not working. 2018-05-08 08:49:09 +02:00
Claus 9ac7df82ad fixing typo in packages tree. 2018-05-08 08:46:48 +02:00
Shannon 389fb100bb 'fixes' an issue where you can get any property value back due to the incorrect cache key being used 2018-05-08 16:01:20 +10:00
Shannon 7728dfa853 Ensures that the PublishedContent culture dictionary is CultureInvariantIgnoreCase and fixes the publish dialog to allow publishing the current culture if the user has edited it 2018-05-08 13:50:39 +10:00
Shannon 177bba5e73 REmoves null checks on PropertyData since this causes exceptions when creating this object and deserializing to this object 2018-05-08 13:03:19 +10:00
Shannon ee9f150483 Removes the AdditionalData properties for EntitySlim and moves them to real properties of IDocumentEntitySlim, renames PublishedCultureInfos to not be plural 2018-05-08 12:43:07 +10:00
Shannon 85c739aed4 Merge branch 'temp8-U4-11227' into temp8-U4-11282
# Conflicts:
#	src/Umbraco.Core/Models/ContentBase.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/EntityRepository.cs
#	src/Umbraco.Tests/Services/EntityServiceTests.cs
#	src/Umbraco.Web/PublishedCache/NuCache/ContentCache.cs
#	src/Umbraco.Web/PublishedContentExtensions.cs
#	src/Umbraco.Web/Trees/ContentTreeControllerBase.cs
2018-05-08 12:31:03 +10:00
Shannon 0e19ec7495 Fixes logic for determining if a domain is published and fixes logic for getting a url name for a variant taking into account it's published status 2018-05-08 11:21:14 +10:00
Shannon 6e61450788 Merge remote-tracking branch 'origin/temp8' into temp8-U4-11282 2018-05-08 10:36:53 +10:00
Mads Rasmussen 736190f93c rename class on dropdown property editor 2018-05-07 21:40:27 +02:00
Mads Rasmussen 02f95053b8 fixes: U4-11306 Add load indicators in doc type infinite editors 2018-05-07 21:14:35 +02:00
Stephan 3f73452bc7 Various fixes, and U4-11287 2018-05-07 18:51:18 +02:00
Stephan 5247a9d143 Merge branch temp8 into temp8-U4-11227 2018-05-07 18:27:30 +02:00
Stephan 912d89cdb3 Fix DomainHelper 2018-05-07 18:24:56 +02:00
Robert 1a82f93722 Fixes email property editor pre-value 2018-05-07 17:59:43 +02:00
Shannon 8a5ca2c4b4 Fixes being able to edit invariant content 2018-05-08 01:16:32 +10:00
Shannon b1eeb5b193 Merge remote-tracking branch 'origin/temp8' into temp8-U4-11282 2018-05-08 00:39:12 +10:00
Shannon 97cb752cda Ensures the whole doc gets unpublished if a mandatory culture is unpublished, updates content service Unpublish to have it's own status result enum since that is needed. 2018-05-08 00:37:41 +10:00
Shannon 5a991c9424 Fixes Publishing/Unpublishing variants and it's nuances 2018-05-07 23:22:52 +10:00
Robert ff505531c2 Merge pull request #2614 from umbraco/temp8-U4-11283
fixes - U4-11283 Cannot save content when a doc type is variant but a property type is invariant
2018-05-07 13:18:15 +02:00
Robert 1b2a964001 Fixed localization 2018-05-07 12:08:59 +02:00
Mads Rasmussen 1d5751a1e5 Merge branch 'temp8' into temp-U4-11218
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/common/directives/components/umbgroupsbuilder.directive.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/propertysettings/propertysettings.controller.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/contenttypeeditor/propertysettings/propertysettings.html
#	src/Umbraco.Web.UI.Client/src/views/content/edit.html
2018-05-07 11:25:38 +02:00
Robert b8c5a389d2 Merge pull request #2613 from umbraco/temp8-U4-11223
Temp8 u4 11223
2018-05-07 09:58:29 +02:00
Stephan 5d37df182a Fix tests 2018-05-07 09:36:51 +02:00
Stephan d13a6f5f58 Fixes 2018-05-07 08:26:10 +02:00
Stephan aa35b28349 Cleanup 2018-05-07 08:25:09 +02:00
Stephan 6104dcafd5 Merge branch 'temp8' into temp8-U4-11227 2018-05-07 08:21:58 +02:00
Stephan 71ed99f080 Fix some tests 2018-05-05 10:46:52 +02:00
Stephan bb0f6fe0e3 Cleanup benchmarks SqlCE nuget dependency 2018-05-05 10:02:04 +02:00
Stephan 73b5694aad Fix web.config transform 2018-05-04 18:35:01 +02:00
Mads Rasmussen 63d7768653 add bg box to code editors 2018-05-04 18:32:35 +02:00
Mads Rasmussen ed0886b040 add bg box to user details sidebar 2018-05-04 18:21:58 +02:00
Mads Rasmussen 9474c78de8 add bg boxes to content type editors 2018-05-04 18:21:04 +02:00
Stephan 8388eca503 Fix agressive cleanup 2018-05-04 15:00:10 +02:00
Robert cc7febcc6d Allows variant content item to save while having a invariant property, also fixes not being able to save invariant content item with invariant property 2018-05-04 13:51:35 +02:00
Robert c5de31cce3 Invariant property value should persist trough all variants of a content item 2018-05-04 13:44:04 +02:00
Robert 48c70604a9 Added localization for "Ready to publish?" publish overlay, added previously removed property which was still in use. 2018-05-04 13:42:33 +02:00
Mads Rasmussen 650441b1f6 don't add shadow to the default editor 2018-05-04 11:25:19 +02:00
Shannon 7a92691bf5 ok the routing is working, for realz this time 2018-05-04 16:07:05 +10:00
Shannon 506365b8ff OK, finally got the query string problem resolved 2018-05-04 13:17:56 +10:00
Mads Rasmussen a5bbf3d832 add will-change css property to prepare browser for the animations 2018-05-03 20:04:34 +02:00
Mads Rasmussen 101d92ca2d speed up animation 2018-05-03 20:03:05 +02:00
Shannon 912711bfa0 Fixing tree, navs, initializing, sequence of events, oh my. The init logic is much more stable but we have issues with tracking the mculture query string 2018-05-04 00:58:18 +10:00
Mads Rasmussen 677bf71a94 make icon picker as infinite editor 2018-05-03 16:11:32 +02:00
Stephan b35d28c568 Merge branch temp8 into temp8-U4-11227 2018-05-03 15:12:42 +02:00
Stephan 3495331005 Cleanup, get rid of warnings 2018-05-03 15:11:57 +02:00
Stephan bcf46eceb6 Cleanup, get rid of warnings 2018-05-03 15:11:52 +02:00
Stephan d04a573888 Refactor some locks, get rid of warnings 2018-05-03 15:11:41 +02:00
Stephan 41144bb7f7 Fix references and build 2018-05-03 15:11:33 +02:00
Stephan 5798d8e57b Enable src/preserve.belle to stop rebuilding Belle all the time 2018-05-03 15:11:25 +02:00
Mads Rasmussen e2478e5cd4 move new editors to infinite editor folder 2018-05-03 14:43:22 +02:00
Mads Rasmussen c4027898cb fix validation in property settings dialog 2018-05-03 14:21:43 +02:00
Mads Rasmussen 2704111497 move indent value to a variable 2018-05-03 13:44:07 +02:00
Robert 8a9caad23d Small fix to editors that had no config values defined. 2018-05-03 13:14:19 +02:00
Mads Rasmussen 1fc0b32fc2 submit property settings editor on enter 2018-05-03 10:55:27 +02:00
Mads Rasmussen 11a4040da7 remove unused umb-overlay component 2018-05-03 10:54:51 +02:00
Robert b5ec775833 Removed duplicate code and fixed bug where dropdown would not go away when there were no document types that allowed variations 2018-05-03 10:35:23 +02:00
Mads Rasmussen 329f90922c remove old content type overlays 2018-05-03 10:30:06 +02:00
Mads Rasmussen 4eca4ac291 use infinite editing in content type editors instead of overlays 2018-05-03 10:19:14 +02:00
Robert f447294c0b Adds new end point that returns true/false if current document types allows variations, display language dropdown if current content types allow variations. 2018-05-03 10:18:08 +02:00
Shannon 46c7290e4f Fixes JS tests 2018-05-03 15:16:23 +10:00
Shannon c33bdf1f27 Revert "Reverts change from merge in U4-11289 aka PR#2608 from Shan - that causes the Karma unit JS tests to fail - not sure why the chained version fails though & thus the Powershell ZIP & Nuget build output script"
This reverts commit 2246e5bc2f.
2018-05-03 14:40:56 +10:00
Stephan a545c3c333 Fix 2018-05-02 18:15:22 +02:00
Stephan aaa1ac0700 Merge branch temp8 into temp8-U4-11227 2018-05-02 17:50:58 +02:00
Stephan 93adda2e4a Cleanup 2018-05-02 17:44:14 +02:00
Stephan 5c96b32c64 Fix tests 2018-05-02 16:23:58 +02:00
Warren 2246e5bc2f Reverts change from merge in U4-11289 aka PR#2608 from Shan - that causes the Karma unit JS tests to fail - not sure why the chained version fails though & thus the Powershell ZIP & Nuget build output script 2018-05-02 14:03:00 +01:00
Stephan a5f1ad6da1 Merge branch temp8 into temp8-U4-11227 2018-05-02 13:43:12 +02:00
Stephan d56af5872d Implement basic fallback plumbing (in progress) 2018-05-02 13:38:45 +02:00
Sebastiaan Janssen a4cc67f732 Make NuGet package install work 2018-05-02 12:35:10 +02:00
Robert 64d467e071 Merge pull request #2608 from umbraco/temp8-U4-11289
U4-11289 Tracking the currently selected language in the main tree
2018-05-02 12:10:02 +02:00
Warren Buckley 394e7f3d6d Merge pull request #2609 from umbraco/temp8-U4-11173
Fixes - U4-11173 Update the publish dialog list to only show languages that have pending changes
2018-05-02 09:39:08 +01:00
Stephan 211267d500 Deal with FIXMEs 2018-05-02 09:31:30 +02:00
Stephan a695b8aed5 Test host-less domains 2018-05-02 08:55:21 +02:00
Shannon 6fe9c4d4df Fixes the null PublishName problem, ensures the quey strings are not replaced when selecting a doc type 2018-05-02 15:35:26 +10:00
Shannon 9843f3a5fd Ensures that domains assigned to non-published nodes are filtered when routing, ensures caches are cleared when content is deleted or langauges are changed, updates logic for dealing with null invariant content names, adds more validation for saving cultre variants. 2018-05-02 14:52:00 +10:00
Shannon efc56c015f Merge remote-tracking branch 'origin/temp8' into temp8-U4-11289 2018-05-02 13:22:32 +10:00
Shannon Deminick 638b6e9cdc Merge pull request #2607 from umbraco/temp8-U4-11291
U4-11291 Paging in the IContentService needs to work with variant data - for both names and property values
2018-05-02 13:22:07 +10:00
Shannon fb759e3923 Merge remote-tracking branch 'origin/temp8' into temp8-U4-11289 2018-05-02 13:11:19 +10:00
Mads Rasmussen c308b081a1 start on docs for editorService 2018-05-01 20:21:48 +02:00
Mads Rasmussen 6c77313a82 remove background color on modal footer 2018-05-01 17:12:40 +02:00
Mads Rasmussen 7c42d29eb0 remove margin on actions 2018-05-01 17:11:54 +02:00
Robert 106955f6c3 Adds localization keys for some text, removed duplicate loading indicator 2018-05-01 16:41:36 +02:00
Mads Rasmussen e3754fb62f remove indentation code from the editorService 2018-05-01 15:33:14 +02:00
Mads Rasmussen db2d75c3f5 temp remove animations 2018-05-01 15:31:03 +02:00
Robert adfc8769e6 Adding missing service injection which broke discard changes dialog 2018-05-01 13:16:13 +02:00
Stephan 6548154261 Fixes 2018-05-01 12:45:07 +02:00
Robert 630212f66f remove console log 2018-05-01 12:06:43 +02:00
Robert a4b5e08a73 Simplified the way we mark variants as drafts trough localization keys, show published languages in the overlay instead of hiding them 2018-05-01 12:03:34 +02:00
Shannon be4ea93d12 U4-11289 Tracking the currently selected language in the main tree 2018-05-01 18:17:07 +10:00
Warren 8f11edc17a Fix up csproj to remove reference to file that's been removed in cleanup - umbraco/developer/packages/installer.aspx 2018-05-01 09:12:07 +01:00
Robert fc860d5061 Merge branch 'temp8' into temp8-U4-11173 2018-05-01 08:27:45 +02:00
Robert 03c574a97c Merge pull request #2605 from umbraco/temp8-U4-11290
U4-11290 - Disables Open in List View link from variant/language switcher in node name
2018-05-01 08:11:54 +02:00
Shannon f407c3b2b3 Updates test to test for variant doc type with invariant property types 2018-05-01 13:43:27 +10:00
Shannon 39f9449dc7 Adds overloads for content ctors to pass in culture so we can more easily set the name in the API nicely, adds a unit test for paging queries with variant data. 2018-05-01 13:30:25 +10:00
Shannon 171a82e233 Adds more description to CustomRouteUrlProvider 2018-05-01 12:23:09 +10:00
Shannon 459479a7b8 Refactors how macros are stored in the DB 2018-05-01 12:12:26 +10:00
Shannon 1bdf064437 Removes the DistributedCall section along with CacheRefresher and the ConfigServerRegistrar, changes IServerMessenger to not have any servers parameters since we don't use that. 2018-05-01 10:39:04 +10:00
Stephan 92b9184706 Swap order of IContentBase.SetName parameters 2018-04-30 22:05:07 +02:00
Stephan ff7c74ec8a Rename accessors 2018-04-30 21:29:49 +02:00
Stephan dbf310caf1 Now use empty string for invariant in published 2018-04-30 21:03:43 +02:00
Shannon 2afd257838 more cleanup of unused files 2018-05-01 01:55:40 +10:00
Shannon 19edfdb2a4 Removes unused and obsoleted code 2018-05-01 01:30:36 +10:00
Shannon 6faa2ff177 Removes unused and obsoleted code 2018-05-01 01:27:25 +10:00
Shannon c8d2ea141b Removes more xslt, more very old code and configurations that aren't used anymore 2018-05-01 01:15:43 +10:00
Shannon 310a31b03e More xslt removal and other file cleanup 2018-05-01 01:01:24 +10:00
Shannon 0a18306d40 More xslt removal 2018-05-01 00:45:05 +10:00
Shannon 0a5db8f97b Fixes up macros and file trees 2018-05-01 00:35:49 +10:00
Robert a4b24bf198 Content language picker now contains (if needed) Draft state to be consistent with the Publish dialog 2018-04-30 16:23:32 +02:00
Robert 92d88d5a4c Publish dialog should show only variants in Draft state 2018-04-30 16:18:35 +02:00
Shannon 6db5ebf6f9 More xslt removal 2018-05-01 00:15:05 +10:00
Robert a7f9628b48 Updated ContentItemDisplay model to contain IsEdited property 2018-04-30 16:06:53 +02:00
Shannon 9a2797303b cleaning up files 2018-04-30 23:30:08 +10:00
Shannon 51d608125d updates editor config file with vs specific rules 2018-04-30 23:29:44 +10:00
Shannon 890b5f30a1 Merge remote-tracking branch 'origin/dev-v7' into temp8
# Conflicts:
#	src/Umbraco.Core/Configuration/UmbracoSettings/IRepositoriesSection.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/IRepository.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesCollection.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/RepositoriesElement.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryConfigExtensions.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/RepositoryElement.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/UmbracoSettingsSection.cs
#	src/Umbraco.Core/Services/PackagingService.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementDefaultTests.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/PackageRepositoriesElementTests.cs
#	src/Umbraco.Tests/Plugins/PluginManagerTests.cs
#	src/Umbraco.Web.UI.Client/lib/umbraco/Extensions.js
#	src/Umbraco.Web.UI/config/umbracoSettings.config
#	src/Umbraco.Web.UI/umbraco/developer/Packages/installer.aspx
#	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installer.aspx.cs
#	src/umbraco.cms/umbraco.cms.csproj
2018-04-30 23:25:07 +10:00
Stephan 038fc87a40 Cleanup, fix tests 2018-04-30 15:11:01 +02:00
Warren 954098eb7e Comments out & leaves comment about removing the open in split view link (otherwise we will forget) 2018-04-30 13:52:05 +01:00
Stephan bcd0c95ec1 Refactor getting urls 2018-04-30 09:14:14 +02:00
Stephan 7dd1efb29f Refactor content culture & variations 2018-04-30 09:14:14 +02:00
Stephan 6959e595f5 IPublishedContent.UrlSegment 2018-04-30 09:14:14 +02:00
Stephan ce8775b3e7 Cleanup IPublishedContent 2018-04-30 09:14:13 +02:00
Stephan 27390afe86 All tests green 2018-04-30 09:13:21 +02:00
Stephan 923fdf9199 ISystemDefaultCultureAccessor 2018-04-30 09:13:21 +02:00
Stephan 908589277a U4-11227 - default variations and fallback (wip) 2018-04-30 09:13:21 +02:00
Stephan 8873fa9dd4 Merge pull request #2600 from umbraco/temp8-U4-11220
U4-11220 Implement routing for variants
2018-04-30 09:04:33 +02:00
Shannon a26d7747b6 removes commented out code 2018-04-30 15:51:05 +10:00
Shannon 1a99d0e4d0 Merge remote-tracking branch 'origin/patch-v7' into dev-v7 2018-04-30 15:27:27 +10:00
Shannon Deminick da0fe5e5a3 Merge pull request #2602 from ProNotion/issues/U4-8516
Fixes U4-8516 Copied node now sets the current user as the creator of the new node.
2018-04-30 15:25:07 +10:00
Stephan 8f13fa3ae5 ISystemDefaultCultureProvider 2018-04-27 18:21:06 +02:00
Stephan aa46e1e282 Test nullref on NPocoSqlExtensions 2018-04-27 17:54:49 +02:00
Stephan dbf1b1e0d4 Refactor DomainHelper 2018-04-27 17:54:49 +02:00
Stephan 9407f75522 Fix importing test 2018-04-27 17:54:40 +02:00
Simon Dingley dbad0d261e Fixes U4-8516 Copied node now sets the current user as the creator of the new node. 2018-04-27 16:18:25 +01:00
Shannon 5b555d35d3 adds test 2018-04-27 15:35:11 +10:00
Shannon f6984438a0 Fixes cases where there are no domains assigned, ensures there can't be duplicate URLs returned to the UI 2018-04-27 15:26:50 +10:00
Shannon 335cf65663 fixes more of my test logic 2018-04-27 14:01:29 +10:00
Shannon c19dbeda23 Adds a couple of tests which yielded some other issues with getting urls by culture, those are now fixed 2018-04-27 13:27:15 +10:00
Shannon 73567ffdce Fixes IPublishedShapshot and friends 2018-04-27 11:38:50 +10:00
Shannon ad6a745681 Changes CultureInfo to string where required, fixes tests 2018-04-27 11:08:20 +10:00
Shannon 59b6665ff3 Removes NiceUrl methods, renames NiceUrl test cases 2018-04-27 10:57:51 +10:00
Shannon 3cdc0e1142 Removes IShortStringHelper.ReplaceMany, this should just be a normal string extension and removes the need to load in IUmbracoSettings for this simple purpose, this fixes some unit tests 2018-04-27 10:26:32 +10:00
Shannon 270f3a75ff Fixes more tests 2018-04-27 09:57:04 +10:00
Shannon 12d56cd201 fixes null check which fixes a whole lot of failing tests 2018-04-26 23:48:07 +10:00
Shannon cb3cba5b05 Updates DefaultUrlProvider so that hieararchy of nodes that are variant and invariant still generate URLs correctly 2018-04-26 23:34:06 +10:00
Shannon ffd85b4e94 Fixes more bugs and outbound routing for additional urls 2018-04-26 22:54:36 +10:00
Shannon 23c40cbf2c Fixes a couple issues, changes name from PublishValues to TryPublishValues 2018-04-26 21:37:29 +10:00
Shannon e99c519032 Merge remote-tracking branch 'origin/temp8' into temp8-U4-11220
# Conflicts:
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/BTree.cs
2018-04-26 19:18:14 +10:00
Shannon Deminick c435597d7e Merge pull request #2599 from umbraco/temp8-U4-11250
Refine Variants [U4-11250]
2018-04-26 16:32:17 +10:00
Mads Rasmussen c71d00cd7e wip closing editors 2018-04-25 17:55:27 +02:00
Stephan 40f94d23d4 Cleanup 2018-04-25 17:39:02 +02:00
Stephan f3bf5d86d2 Cleanup BTree 2018-04-25 17:39:02 +02:00
Stephan 16aac382d1 Merge branch 'temp8' into temp8-U4-11220 2018-04-25 17:38:36 +02:00
Mads Rasmussen ef3b3326fc always take up all available space when editor is not the last opened one 2018-04-25 14:44:20 +02:00
Mads Rasmussen 79f303ddcf wip animation experiments 2018-04-25 10:29:18 +02:00
Stephan 87f9e8c72e Merge branch temp8 into temp8-U4-11250 2018-04-24 19:21:12 +02:00
Stephan aba5e849c1 Fix tests 2018-04-24 18:56:03 +02:00
Stephan ef2fd52482 Cleanup 2018-04-24 17:59:26 +02:00
Stephan 7b82208677 Implement getting avail/edit/publish cultures 2018-04-24 17:43:08 +02:00
Stephan 23333710f5 Implement culture available/edited 2018-04-24 16:50:13 +02:00
Shannon 2e38f7b27b Fixes PublishedContent.cs when the property index doesn't contain the alias index (due to adding a new property type and the json not matchin) 2018-04-24 17:28:57 +10:00
Shannon c5ca61f249 Fixes PublishedContent.cs when the property index doesn't contain the alias index (due to adding a new property type and the json not matchin) 2018-04-24 17:15:35 +10:00
Shannon 6db75d4226 Fixes PublishedContent.cs when the property index doesn't contain the alias index (due to adding a new property type and the json not matchin) 2018-04-24 17:11:09 +10:00
Shannon 43ca9593d4 fixes AliasUrlProvider 2018-04-24 16:29:55 +10:00
Shannon a1cd80a0f6 Removes GetLanguageByCultureCode since it is kind of useless and the name is also very misleading 2018-04-24 15:59:16 +10:00
Shannon f49fa7b567 don't show the variation toggle on a property type if the content type doesn't have it enabled, ensure the default variation is set on a new property type based on the content type setting 2018-04-24 15:41:50 +10:00
Shannon d552d5dadb Updates UI and mapping to update a property type to allow being culture variant 2018-04-24 15:27:33 +10:00
Shannon de2784c281 Adds culture optional parameters to all GetUrl methods on UrlProvider 2018-04-24 14:51:27 +10:00
Shannon 7c05f2e86c fixes routing cache key 2018-04-24 14:39:52 +10:00
Shannon e9bfad3c09 Merge remote-tracking branch 'origin/temp8' into temp8-U4-11220 2018-04-24 13:18:34 +10:00
Shannon 9044c9328d Gets inbound routing working, reduces the amount of non injected dependencies, reduces the amount of DomainHelper instances 2018-04-24 13:07:18 +10:00
Shannon 48641166b9 WIP - gets 'inbound' routing working to generate culture specific URLs 2018-04-24 01:31:01 +10:00
Stephan 6dfb618efe Merge branch 'temp8' into HEAD 2018-04-23 12:57:12 +02:00
Mads Rasmussen 7e383ea961 fix issue with infinite mode and create route param in media editor 2018-04-23 11:13:01 +02:00
Robert 5e14af7d38 Merge pull request #2598 from umbraco/temp8-U4-11219
U4-11219 Wire up new APIs for Variant names
2018-04-23 11:09:18 +02:00
Mads Rasmussen 312b2ff435 Merge branch 'dev-v8' into temp-U4-11218 2018-04-23 09:43:22 +02:00
Stephan 6b9adfa929 Move IsCultureAvailable to IContentBase 2018-04-21 11:11:31 +02:00
Stephan a69019aea0 From int languageId to string culture 2018-04-21 09:57:28 +02:00
Sebastiaan Janssen d30ec335b8 Merge branch 'patch-v7' into dev-v7 2018-04-20 11:05:46 +02:00
Sebastiaan Janssen e820d2a4aa Merge branch 'patch-7.9.6' into dev-v7 2018-04-20 11:05:37 +02:00
Sebastiaan Janssen 5aa490cbff Merge branch 'patch-7.8.3' into dev-v7 2018-04-20 11:04:51 +02:00
Sebastiaan Janssen f1a8da2876 Bumps version to 7.9.6 2018-04-20 11:02:29 +02:00
Sebastiaan Janssen 27f6560a00 U4-11253 New Chrome 66 trimStart function is overriding the Umbraco Core trimStart polyfill 2018-04-20 11:00:49 +02:00
Sebastiaan Janssen 7a181bd281 Bump version to 7.8.3 2018-04-20 10:59:13 +02:00
Sebastiaan Janssen 4a0cd87a38 U4-11253 New Chrome 66 trimStart function is overriding the Umbraco Core trimStart polyfill 2018-04-20 10:51:28 +02:00
Sebastiaan Janssen 861e5908a7 U4-11253 New Chrome 66 trimStart function is overriding the Umbraco Core trimStart polyfill 2018-04-20 10:35:21 +02:00
Claus ae5a5bd2c0 Merge pull request #2596 from umbraco/temp-U4-11146
Removes Package repository config setting and related unnecessary code
2018-04-20 10:23:16 +02:00
Shannon 7d349ef518 Replaces instances of UmbracoTemplatePage with UmbracoViewPage 2018-04-20 17:40:01 +10:00
Robert 395575dbe4 Merge pull request #2597 from umbraco/temp-U4-11253
U4-11253 New Chrome 66 trimStart function is overriding the Umbraco C…
2018-04-20 09:39:15 +02:00
Shannon 5dfa0e7446 Updates EntityRepository to support normal get operations adds another unit tests, adds notes. 2018-04-20 16:07:34 +10:00
Shannon 9325d30e7c adds some notes to the setVariantStatusColor 2018-04-20 13:44:20 +10:00
Shannon d99beb0c8b Gets the tree to display the culture specific name 2018-04-20 13:26:45 +10:00
Shannon e9f0e98d2c Updates EntityRepository to get the variant names for content items ... for the non-paged query which we can use in the tree 2018-04-20 13:12:55 +10:00
Sebastiaan Janssen 6d6be4e6a4 Fixes last failing test 2018-04-19 20:29:46 +02:00
Sebastiaan Janssen fbc9c6aed6 Fixes even more (hopefully all) unit tests 2018-04-19 20:06:34 +02:00
Sebastiaan Janssen 386dc1a14d U4-11253 New Chrome 66 trimStart function is overriding the Umbraco Core trimStart polyfill 2018-04-19 19:54:53 +02:00
Sebastiaan Janssen 8fc33f6aea Fix unit tests 2018-04-19 19:36:44 +02:00
Sebastiaan Janssen 6c8e39876f These changes shouldn't have been checked in 2018-04-19 19:36:32 +02:00
Sebastiaan Janssen bfca8c555e Removes Package repository config setting and related unnecessary code 2018-04-19 19:12:42 +02:00
Shannon c84087e96b Gets the variant names working in the editor 2018-04-20 00:59:23 +10:00
Shannon d4252a3dc8 Merge branch 'dev-v8' into temp8-U4-11219 2018-04-20 00:12:31 +10:00
Shannon 6b12fe7c57 Merge branch 'dev-v8' of https://github.com/umbraco/Umbraco-CMS into dev-v8
# Conflicts:
#	src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs
2018-04-20 00:10:44 +10:00
Shannon 04da7cfd20 doh, fixes csproj merge 2018-04-20 00:09:12 +10:00
Shannon d5ebe12983 removes ununsed aliases 2018-04-20 00:05:45 +10:00
Stephan 5d1abaa713 Import missing parameter editor from v7 merge 2018-04-19 16:03:54 +02:00
Shannon e9e0274ad8 fixes MultipleContentPickerParameterEditor 2018-04-20 00:03:19 +10:00
Shannon 966de9b9f4 Merge branch 'dev-v8' into temp8-U4-11219 2018-04-19 23:49:06 +10:00
Shannon c46d4e9e43 Merge remote-tracking branch 'origin/dev-v7' into dev-v8
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/Persistence/Migrations/MigrationRunner.cs
#	src/Umbraco.Core/Persistence/PetaPoco.cs
#	src/Umbraco.Core/Scoping/NoScope.cs
#	src/Umbraco.Core/Scoping/ScopeProvider.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/IContentService.cs
#	src/Umbraco.Tests/Persistence/Migrations/MigrationStartupHandlerTests.cs
#	src/Umbraco.Tests/UI/LegacyDialogTests.cs
#	src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/contentpicker/contentpicker.controller.js
#	src/Umbraco.Web.UI/umbraco/config/create/UI.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/zh.xml
#	src/Umbraco.Web/BatchedDatabaseServerMessenger.cs
#	src/Umbraco.Web/Editors/ContentController.cs
#	src/Umbraco.Web/Editors/MediaTypeController.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs
#	src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyBasicConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyDisplayConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyDtoConverter.cs
#	src/Umbraco.Web/Models/Mapping/ContentPropertyModelMapper.cs
#	src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/ParameterEditors/MultipleContentPickerParameterEditor.cs
#	src/Umbraco.Web/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web/umbraco.presentation/umbraco/create/MemberGroupTasks.cs
2018-04-19 23:41:35 +10:00
Mads Rasmussen ee853f0189 Merge branch 'dev-v8' into temp-U4-11218 2018-04-19 15:15:10 +02:00
Shannon 1d0d6e78de fixes tree again 2018-04-19 22:32:48 +10:00
Shannon 8ae27ecc27 Updates doc type editor to be able to change update the doc type to support being culture variant 2018-04-19 22:06:02 +10:00
Shannon 642ce36f59 updates when the tree does it's initialization , fixes migration 2018-04-19 21:58:59 +10:00
Shannon Deminick db5ffd6b29 Merge pull request #2594 from umbraco/temp8-U4-11128
Manage content variations [U4-11128]
2018-04-19 21:49:13 +10:00
Robert 9384cd0f27 Merge pull request #2574 from umbraco/temp-U4-11195
fixes U4-11195 Mapping complex properties slow down some queries
2018-04-19 12:22:12 +02:00
Robert 0262b4aa76 Changed ContentPropertyDto modifier back to override which rendered content with tags unable to be saved 2018-04-19 12:10:39 +02:00
Shannon 158eb18de0 Merge remote-tracking branch 'origin/dev-v8' into temp8-U4-11128 2018-04-19 18:16:49 +10:00
Mads Rasmussen 03ac073c02 Merge branch 'dev-v8' into temp-U4-11218
# Conflicts:
#	src/Umbraco.Web.UI/umbraco/Views/Default.cshtml
2018-04-19 09:59:31 +02:00
Sebastiaan Janssen 96761efe4d Merge branch 'patch-v7' into dev-v7 2018-04-19 09:55:16 +02:00
Robert 8e02aad2bb Merge pull request #2590 from umbraco/temp-U4-11177
U4-11177 Update tree nodes with the new node names based on variant/language
2018-04-19 08:35:01 +02:00
Shannon 75fb070825 U4-11246 When user belongs to groups and none of them have browse access and one or more have a custom start node applied a YSOD occurs 2018-04-19 16:20:18 +10:00
Shannon Deminick 8a0f32e980 Merge pull request #2595 from umbraco/temp-U4-11208
U4-11208 Error : "An item with the same key has already been added." into "Umbraco.Core.Services.IdkMap.Populate" method
2018-04-19 15:27:00 +10:00
Stephan a68e37c67b Fix availability and names 2018-04-18 18:43:17 +02:00
Stephan dea47dfafe Fix availability and names 2018-04-18 18:28:47 +02:00
Sebastiaan Janssen f5163ed0c2 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2018-04-18 16:05:43 +02:00
Sebastiaan Janssen 694f3d71e2 Merge branch 'patch-v7' into dev-v7 2018-04-18 16:05:15 +02:00
Stephan 5b1bdd84ee Fix availability and content name (WIP) 2018-04-18 16:04:33 +02:00
Robert 15eb40aedb Removed code that populates content tree with duplicate start nodes. 2018-04-18 16:01:01 +02:00
Sebastiaan Janssen 49251271e9 Merge pull request #2591 from umbraco/temp-U4-10995
Removed code that populates content tree with duplicate start nodes.
2018-04-18 15:59:45 +02:00
Sebastiaan Janssen cc3e75dc63 U4-11208 Error : "An item with the same key has already been added." into "Umbraco.Core.Services.IdkMap.Populate" method 2018-04-18 15:14:16 +02:00
Stephan 4f17ecbdee Fix tests 2018-04-18 14:43:13 +02:00
Stephan ec7b038569 Variant names, availability, etc 2018-04-18 14:43:07 +02:00
Stephan d4244d3807 Fix faster languages 2018-04-18 14:42:20 +02:00
Sebastiaan Janssen eeaf17c857 Weird revert of a PR that was merged in before
(cherry picked from commit 94ed741dd5)
2018-04-18 12:18:44 +02:00
Stephan 46487fa466 Variant names, availability, etc 2018-04-18 11:14:08 +02:00
Dave Woestenborghs 21a8395142 U4-11216 Multiple Content Picker allows only one item when used as macro parameter (#2593)
U4-11216 set min and max number when used as parameter editor

(cherry picked from commit f25233ac2b)
2018-04-18 10:22:09 +02:00
Dave Woestenborghs f25233ac2b U4-11216 Multiple Content Picker allows only one item when used as macro parameter (#2593)
U4-11216 set min and max number when used as parameter editor
2018-04-18 10:21:12 +02:00
Shannon Deminick 415810ecfe Merge pull request #2589 from umbraco/temp-U4-11196
Fixes - U4-11196 Validation UI is not working for the content name field
2018-04-18 11:16:38 +10:00
Shannon fd3129f166 fixes TODOs 2018-04-18 09:42:30 +10:00
Stephan 58e4e2398a Variant names, availability, etc 2018-04-17 19:08:53 +02:00
Stephan 392965bb3a Faster languages 2018-04-17 19:08:44 +02:00
Sebastiaan Janssen 61cd59b237 Merge branch 'patch-v7' into dev-v7 2018-04-17 15:47:41 +02:00
Sebastiaan Janssen 7d171b1e95 Bumps version to 7.10.4 2018-04-17 15:46:39 +02:00
Sebastiaan Janssen d63061fade Merge pull request #2564 from leekelleher/U4-11184
U4-11184 - Nested Content PropertyValueEditor - return converted value, not update reference value
2018-04-17 15:33:14 +02:00
Sebastiaan Janssen 362261e879 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2018-04-17 15:16:46 +02:00
Sebastiaan Janssen af8c00d075 Merge remote-tracking branch 'origin/patch-7.10.3' into dev-v7 2018-04-17 15:16:21 +02:00
Sebastiaan Janssen 68b440e494 Merge remote-tracking branch 'origin/patch-7.9.5' into dev-v7 2018-04-17 15:15:44 +02:00
Sebastiaan Janssen 0c328ef30e Merge remote-tracking branch 'origin/patch-7.8.2' into dev-v7 2018-04-17 15:15:06 +02:00
Robert ef47e85741 Removed code that populates content tree with duplicate start nodes. 2018-04-17 15:07:59 +02:00
Stephan 26af63549f Fix vsts - wip 2018-04-17 10:52:32 +02:00
Stephan 70e3f895da Fix vsts - wip 2018-04-17 10:11:14 +02:00
Mads Rasmussen e6a69ccb0d add feature toggle for media grid edit button 2018-04-17 09:55:31 +02:00
Shannon f80a27f5d7 adds notes 2018-04-17 17:09:58 +10:00
Shannon f3d68276fe Fixes more angular promise chaining, fixes issue with the tree node UI not updating when sycn tree is called. 2018-04-17 17:04:52 +10:00
Claus 0c191a3ef7 updating to use includeProperties, fixing modifier keywords for methods, and passing includeProperties from list views. 2018-04-17 08:36:36 +02:00
Shannon 2872d0b0a2 Fixes tree init logic when user isn't logged in, moves sequential promise chaining to a helper funciton, updates the route promise chaining to actual chain. 2018-04-17 14:43:17 +10:00
Mads Rasmussen 97548df146 rename folder 2018-04-16 21:42:11 +02:00
Mads Rasmussen ebf3ab3a41 add helpers to open media picker and media editor 2018-04-16 21:27:07 +02:00
Stephan c97822a430 Fix vsts 2018-04-16 17:48:45 +02:00
Shannon 319bd783ff Merge remote-tracking branch 'origin/dev-v8' into temp-U4-11177 2018-04-17 01:45:32 +10:00
Shannon e234eb22f6 ensure the language tree changing is done after the digest 2018-04-17 01:41:06 +10:00
Shannon d45112f2ab Gets the content tree controller to return the names for items per language (with mock data), wires up the navigation.controller to re-build the tree for the new language 2018-04-17 01:37:35 +10:00
Stephan 6b3c6eba8d Fix csproj, nuspec 2018-04-16 17:04:23 +02:00
Shannon f7719773f2 fixes passing in the element and clicking on a root node 2018-04-17 00:38:32 +10:00
Stephan 15c6e28354 Fix nuspec 2018-04-16 16:29:37 +02:00
Shannon b5b643e04c fixes up the activeTree issue 2018-04-17 00:09:53 +10:00
Stephan dc589f9b96 Fix csproj, nuspec 2018-04-16 16:08:26 +02:00
Mads Rasmussen 7a4ff7b9c0 Merge pull request #2588 from umbraco/temp-v8-UI-infinite-editing
Temp v8 ui infinite editing
2018-04-16 15:38:33 +02:00
Shannon a92361bd00 Tree refactor, cleanup legacy support, remove odd jquery callback object, removes unused files, removes publish dialog 2018-04-16 23:07:00 +10:00
Robert f7ce8af24d Language picker is now included in the invalid field prompt (red border) so it makes sense aesthetically. 2018-04-16 14:58:54 +02:00
Shannon Deminick 9ac96f24aa Merge pull request #2587 from dawoe/temp-U4-11150
U4-11150 added culture property of tour to the docs
2018-04-16 16:48:25 +10:00
Dave Woestenborghs eca5b6e4e6 U4-11150 added culture property of tour to the docs 2018-04-16 08:35:05 +02:00
Sebastiaan Janssen 2dd7c5210f Merge pull request #2523 from tomfulton/u4-11133
U4-11133 - Fix access check for Unpublish button
2018-04-15 22:48:16 +02:00
Sebastiaan Janssen 3a854688e0 Merge branch 'dawoe-temp-U4-11150' into dev-v7 2018-04-15 22:38:22 +02:00
Sebastiaan Janssen 1594adf3ed Makes code a bit more readable and uses ToList instead of ToArray 2018-04-15 22:38:09 +02:00
Sebastiaan Janssen 23fcb38d69 Merge branch 'temp-U4-11150' of https://github.com/dawoe/Umbraco-CMS into dawoe-temp-U4-11150 2018-04-15 22:15:36 +02:00
Sebastiaan Janssen 7571949ad0 Merge pull request #2586 from bjarnef/dev-v7-U4-11215
U4-11215 - Fix icons in member create dialog
2018-04-15 22:11:24 +02:00
Bjarne Fyrstenborg d45c3520d4 Format document in media create dialog 2018-04-15 21:42:35 +02:00
Bjarne Fyrstenborg b7c04575fa Document media type resource save as in member type resource 2018-04-15 21:42:04 +02:00
Bjarne Fyrstenborg 588f5a3789 Fix some wrong descriptions 2018-04-15 21:41:23 +02:00
Bjarne Fyrstenborg b535a45898 Respect icon set on member type - by default the icon is "icon-user" 2018-04-15 21:39:46 +02:00
Robert aebfc33037 Class renamed in .less file to bring back UI validation for content name 2018-04-13 14:51:02 +02:00
Sebastiaan Janssen 1b56c55300 Merge pull request #2522 from tomfulton/u4-7757-client2
U4-7757 - Show notifications when Unpublishing event is canceled
2018-04-13 11:53:51 +02:00
Sebastiaan Janssen 29d9dcffb8 Manually applying PR: Three new healthchecks #1522 2018-04-12 18:38:00 +02:00
Sebastiaan Janssen b0f0a7afc4 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2018-04-12 18:01:43 +02:00
Sebastiaan Janssen 30f8885aa9 Merge branch 'u4-9983' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-u4-9983
# Conflicts:
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/zh.xml
#	src/Umbraco.Web/HealthCheck/Checks/Security/ClickJackingCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/HttpsCheck.cs
2018-04-12 17:59:11 +02:00
Sebastiaan Janssen 94ed741dd5 Weird revert of a PR that was merged in before 2018-04-12 17:50:44 +02:00
Sebastiaan Janssen b6d5ac6a01 Update CONTRIBUTING.md 2018-04-12 17:20:12 +02:00
Sebastiaan Janssen 4664266b8d Bumps version to 7.10.3 2018-04-12 16:40:10 +02:00
Sebastiaan Janssen c61fd65463 Bumps version to 7.9.5 2018-04-12 16:38:22 +02:00
Sebastiaan Janssen 1e2598a3a3 Bumps version to 7.8.2 2018-04-12 16:36:41 +02:00
Sebastiaan Janssen 5003a55aca Cherry picked - Fix scope leaks caused by database messenger [U4-11207] #2580 2018-04-12 16:32:34 +02:00
Sebastiaan Janssen b5415844b8 Cherry picked - Fix scope leaks caused by database messenger [U4-11207] #2580 2018-04-12 16:30:55 +02:00
Sebastiaan Janssen 19241995e8 Cherry picked - Fix scope leaks caused by database messenger [U4-11207] #2580 2018-04-12 16:23:33 +02:00
Shannon b53400ceca Fixes up promise chains for the tree, adds logic to the tree picker to track the deepest paths expanded and then when a language is changed, we reload the tree with the new language and also sync all paths so the user can continue where they left off but with the new language nodes. 2018-04-13 00:09:28 +10:00
Bjarne Fyrstenborg 828dbaedfb Indicate that a row is clickable and highlight with background color. (#1473) 2018-04-12 15:37:01 +02:00
Sebastiaan Janssen 52701f0056 Fix unit tests that were trying to "downgrade" from version 1 to version 2 2018-04-12 15:30:25 +02:00
Claus c802171f38 Merge pull request #2580 from umbraco/temp-u4-11207
Fix scope leaks caused by database messenger [U4-11207]
2018-04-12 14:43:03 +02:00
Claus 81c5c66e15 adding readonly. 2018-04-12 14:41:55 +02:00
Sebastiaan Janssen 79515cdae7 Merge branch 'martin-blackwell-U4-8927' into dev-v7 2018-04-12 14:36:21 +02:00
Sebastiaan Janssen 99ce7c0736 Throw error when "downgrading" to a higher version, make sure to give the results back in the correct order (newest version first, oldest last). 2018-04-12 14:35:34 +02:00
Claus d9b1598fa2 use scope when writing instructions. 2018-04-12 14:26:47 +02:00
Claus c630e5ef8e only warn if there's actually anything to warn about 2018-04-12 14:26:14 +02:00
Sebastiaan Janssen fe5896c85f Merge branch 'U4-8927' of https://github.com/martin-blackwell/Umbraco-CMS into martin-blackwell-U4-8927 2018-04-12 13:44:38 +02:00
Sebastiaan Janssen 28cbb0a517 Bumps version to 7.11.0 2018-04-12 13:41:56 +02:00
Sebastiaan Janssen 0597b43014 Merge branch 'patch-v7' into dev-v7 2018-04-12 13:39:09 +02:00
Sebastiaan Janssen a124d77670 Merge remote-tracking branch 'origin/patch-7.9.4' into dev-v7
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2018-04-12 13:38:53 +02:00
Stephan 1076b882fb U4-11207 - collect rogue/leaked NoScope instances 2018-04-12 11:56:56 +02:00
Stephan 4a47c5e129 U4-11207 - fix scope leaks caused by database messenger 2018-04-12 11:13:00 +02:00
mikkelhm 6d052aeeac Bump version to 7.9.4 2018-04-10 08:56:50 +02:00
Claus 5380b62504 fixes U4-11195 Mapping complex properties slow down some queries 2018-04-09 15:43:17 +02:00
Dave Woestenborghs 354505fde3 U4-11149 fixed error when creating new xslt file (#2540)
* U4-10659 added create task back for xslt files

* Add fix to UI.Release.xml as well
2018-04-09 14:47:09 +02:00
Dave Woestenborghs 9b33c8a0e2 U4-11149 fixed error when creating new xslt file (#2540)
* U4-10659 added create task back for xslt files

* Add fix to UI.Release.xml as well
2018-04-09 14:45:26 +02:00
Dave Woestenborghs 07fc6753f5 U4-11149 fixed error when creating new xslt file (#2540)
* U4-10659 added create task back for xslt files

* Add fix to UI.Release.xml as well
2018-04-09 14:04:02 +02:00
Sebastiaan Janssen 967178cb92 Manually applies U4-11155 fixed error when creating member groups #2545 2018-04-09 11:43:48 +02:00
Warren Buckley fe44494936 Merge pull request #2550 from dawoe/temp-U4-11161
U4-11161 fix for adding multiple items in a single content picker
2018-04-09 11:42:18 +02:00
Shannon Deminick 793c9470c2 Manually applies merge pull request #2556 from dawoe/temp-U4-11167
U4-11167 Fixes rare syncTree error
2018-04-09 11:39:07 +02:00
Sebastiaan Janssen 95d40049f5 Bumps version to 7.10.2 2018-04-09 08:30:39 +02:00
Sebastiaan Janssen f003c3602c Merge pull request #2545 from dawoe/temp-U4-11155
U4-11155 fixed error when creating member groups
2018-04-09 08:28:03 +02:00
Sebastiaan Janssen 862fdf27e4 Merge pull request #2545 from dawoe/temp-U4-11155
U4-11155 fixed error when creating member groups
2018-04-09 08:10:53 +02:00
leekelleher 7225ec29fe Nested Content - enabled support for property-editors:
- Umbraco.CheckBoxList
- Umbraco.DropDownMultiple
- Umbraco.MacroContainer
- Umbraco.RadioButtonList
- Umbraco.MultipleTextstring
2018-04-05 17:17:34 +01:00
leekelleher cf1069e0e1 NestedContentPropertyEditor - code tidy-up
A little tidy-up of these class method. I noticed we were calling `ToString()` twice in places,
and the `ConfigureForDisplay` prevalues are already available as a Dictionary, so there's no need for an additional `ToDictionary` allocation.
2018-04-05 17:16:34 +01:00
leekelleher 99ce88228c U4-11184 - Nested Content PropertyValueEditor - return converted value, not update reference value
ConvertDbToString

We were updating the `property.Value` reference, which was having adverse effects on the editor value.
In the majority of cases this wasn't an issue, but it did mean that any prevalue-ID-based editors (e.g. dropdown list) had problems.

I've removed the call to the base method, we don't need it - here's what it does...
https://github.com/umbraco/Umbraco-CMS/blob/release-7.4.0/src/Umbraco.Core/PropertyEditors/PropertyValueEditor.cs#L367

It attempts to convert the value to an XML-safe string, which is ultimately `ToString()` (if not null):
https://github.com/umbraco/Umbraco-CMS/blob/release-7.4.0/src/Umbraco.Core/ObjectExtensions.cs#L544

ConvertDbToEditor

Same as ConvertDbToString, we were updating the `property.Value` reference when we shouldn't be.
We should be returning the converted value, not updating the original reference value itself.

I've removed the call to the base method, we don't need it - it attempts to deserialize the JSON string that we've literally just serialized...
https://github.com/umbraco/Umbraco-CMS/blob/release-7.4.0/src/Umbraco.Core/PropertyEditors/PropertyValueEditor.cs#L283

So we can pass the List<object> value back, as this will be handled by Umbraco and handed by Angular.
2018-04-05 17:14:15 +01:00
Dave Woestenborghs cf871196f2 U4-11155 changed namespace back to previous value so creating member groups works again 2018-03-27 16:11:07 +02:00
Dave Woestenborghs 36d6b6a254 U4-11150 merged where statements in to one statement 2018-03-27 14:22:51 +02:00
Dave Woestenborghs 29bb86ea13 Filter tours based on current users culture 2018-03-23 16:37:13 +01:00
Dave Woestenborghs fa171e4553 Added culture property to Backoffice tour 2018-03-23 15:33:42 +01:00
Tom Fulton 0b63eb9430 U4-11133 - Adjust access check for Unpublish button
Require both Publish (assigned) and Unpublish (automatic, but could be removed during event) to show the button
2018-03-19 19:43:07 -06:00
Tom Fulton d7ddbfec35 U4-11133 - Fix access check for Unpublish button
The logic to show the Unpublish button was checking for "Publish" (U) permission rather than "Unpublish" (Z)
2018-03-19 19:30:51 -06:00
Tom Fulton d260a9dc88 U4-7757 - Show notifications when Unpublishing is canceled 2018-03-19 19:03:02 -06:00
AndyButland 6861453166 Added localised texts and renamed some to less specific names when used across checks 2017-06-04 14:35:37 +02:00
AndyButland 5f263ad851 Added check for X-Content-Type-Options and refactored existing HTTP header check to use common base class. 2017-06-04 14:34:37 +02:00
Martin Blackwell afc2363163 Resolution for U4-8927 2016-08-31 16:22:41 +01:00
1072 changed files with 22282 additions and 41657 deletions
+13
View File
@@ -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
View File
@@ -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
+20 -46
View File
@@ -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
View File
@@ -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.
+12
View File
@@ -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>
+4
View File
@@ -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)
+30
View File
@@ -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.
+50 -35
View File
@@ -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" />
+1 -3
View File
@@ -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" />
+2 -186
View File
@@ -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>
+22 -6
View File
@@ -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
View File
@@ -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())" `
-8
View File
@@ -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
View File
@@ -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")]
+2 -44
View File
@@ -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>();
}
}
}
+5
View File
@@ -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.
+2 -4
View File
@@ -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>
-1
View File
@@ -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";
}
}
}
+8 -18
View File
@@ -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>
-7
View File
@@ -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";
}
}
}
+22
View File
@@ -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;
}
}
-15
View File
@@ -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.
+2 -16
View File
@@ -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;
+1 -7
View File
@@ -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);
+10 -10
View File
@@ -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
-2
View File
@@ -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");
+3 -4
View File
@@ -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
// {
// }
//}
+1 -1
View File
@@ -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
-17
View File
@@ -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 (
+228 -57
View File
@@ -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>
+159 -32
View File
@@ -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
}
}
+5 -5
View File
@@ -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>
+31 -5
View File
@@ -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; }
}
}
}
+1 -7
View File
@@ -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)
+14
View File
@@ -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; }
}
}
+16
View File
@@ -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; }
}
}
+11
View File
@@ -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; }
}
}
+77 -12
View File
@@ -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