Compare commits

...

1033 Commits

Author SHA1 Message Date
Warren Buckley 7b1efa718e Internal Beta03 version bump - needed for Forms for access to [FileUploadCleanupFilter] 2017-03-21 15:50:13 +00:00
Warren Buckley f60ad15f70 Marks Forms access to internals in Umbraco.Web assembly - needed for [FileUploadCleanupFilter] in Forms 2017-03-21 15:42:30 +00:00
mikkelhm 836e1bba54 Revert "moves binding redirects to app pre init"
This reverts commit 5a953761b0.
2017-03-21 13:14:07 +01:00
Shannon 5a953761b0 moves binding redirects to app pre init 2017-03-21 20:41:07 +11:00
Shannon Deminick 1b17f4e9df Merge pull request #1804 from umbraco/temp-u4-9543
U4-9543 - fix shadow filesystem filter
2017-03-21 12:59:43 +11:00
Warren Buckley ac496b0cf6 Updates version to beta02 - after Warren forgot to merge & push AccessToInternals for Forms before public beta 2017-03-20 15:40:15 +00:00
Warren Buckley 6036136938 Merge branch 'dev-v7.6' of https://github.com/umbraco/Umbraco-CMS into dev-v7.6
# Conflicts:
#	build/UmbracoVersion.txt
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
2017-03-20 14:55:29 +00:00
Stephan 454aad2170 U4-9543 - fix shadow filesystem filter 2017-03-20 13:01:03 +01:00
Sebastiaan Janssen f4eb37d44d Missing null check (for unit test) 2017-03-17 12:11:28 +01:00
Sebastiaan Janssen c79aaa9c48 Bumps version 2017-03-17 11:49:42 +01:00
Sebastiaan Janssen e3bc6f148a New installer background image 2017-03-17 11:35:15 +01:00
Warren Buckley a43bd13e6a Merge pull request #1798 from umbraco/temp-U4-9621
Fixes: U4-9621 More UI color tweaks
2017-03-16 15:31:30 +00:00
Warren Buckley 6aa00c52dc Merge branch 'dev-v7.6' of https://github.com/umbraco/Umbraco-CMS into dev-v7.6 2017-03-16 15:08:33 +00:00
Mads Rasmussen 30d5bfa7b4 move nonode css to less file, update grunt build + update no node colors + font 2017-03-16 15:49:59 +01:00
Stephan 9b8db111dd Merge pull request #1790 from umbraco/temp-U4-9611
U4-9611 Create Property Value Converters for all new UDI Property Edi…
2017-03-16 14:36:17 +01:00
Stephan 7b506fadc6 U4-9611 - minor fix 2017-03-16 14:35:54 +01:00
Claus 1ce44565a3 Merge pull request #1764 from umbraco/temp-u4-9462
U4-9462 units of work cleanup
2017-03-16 13:12:32 +01:00
Stephan e70e651901 U4-9462 - minor fix 2017-03-16 13:10:53 +01:00
Mads Rasmussen 00b0515fc1 Revert "less bright and "dangerous" alerts, notifications and validation messages"
This reverts commit 691c13d1e1.
2017-03-16 10:31:48 +01:00
Morten Christensen d8c04b1f67 Merge pull request #1799 from umbraco/temp-U4-9632
U4-9632 Ensure GUID generation on updated entity types in v7.6 is unique
2017-03-16 10:09:31 +01:00
Shannon 172ef8c379 U4-7093 If allowManuallyChangingPassword=false on new install, installation doesn't work 2017-03-16 18:59:06 +11:00
Claus 7e1f045c09 U4-9632 Ensure GUID generation on updated entity types in v7.6 is unique
removing unused using statements from other migrations.
2017-03-16 08:19:03 +01:00
Sebastiaan Janssen d2fdf7b647 Check if MediaPicker is configured as single or multiple and give back appropriate result for each (IPublishedContent vs IEnumerable<IPublishedContent>) 2017-03-15 23:22:53 +01:00
Sebastiaan Janssen e1942d96d0 Incorporate Stephane's feedback: if we already know we're getting list of int or udi, we don't need to cast, or even test for the PropertyEditorAlias 2017-03-15 23:22:53 +01:00
Stephan 496e6c1711 U4-9462 - missed one safeXml.AcceptChanges 2017-03-15 14:50:42 +01:00
Mads Rasmussen c9fc0fbed1 Update installer gray buttons to purple buttons + align label with input 2017-03-15 14:35:11 +01:00
Stephan 3121ea6111 Merge branch 'dev-v7.6' into temp-u4-9462 2017-03-15 13:48:27 +01:00
Stephan 59ecc6e109 Merge branch 'dev-v7.6' into temp-U4-9611 2017-03-15 13:00:07 +01:00
Stephan eb42b9a4b6 Merge pull request #1796 from umbraco/temp-U4-6566
U4-6566 Membership provider `useLegacyEncoding` should default to `false`
2017-03-15 12:37:09 +01:00
Stephan 82660cf6af Merge branch 'dev-v7.6' into temp-U4-9611 2017-03-15 12:10:27 +01:00
Stephan 54afd3d954 Fix failing test 2017-03-15 12:08:52 +01:00
Mads Rasmussen 9ee3471153 add font smoothing to installer 2017-03-15 10:38:42 +01:00
Mads Rasmussen 691c13d1e1 less bright and "dangerous" alerts, notifications and validation messages 2017-03-15 10:26:05 +01:00
Sebastiaan Janssen 241ccf00a5 U4-6566 Membership provider useLegacyEncoding should default to false 2017-03-14 17:05:24 +01:00
Sebastiaan Janssen 1a0046df95 Merge pull request #1795 from umbraco/temp-U4-9498
U4-9498 LocalLinks as UDI
2017-03-14 15:54:03 +01:00
Warren Buckley 30f63eefb3 Merge branch 'dev-v7.6' of https://github.com/umbraco/Umbraco-CMS into dev-v7.6 2017-03-14 10:18:00 +00:00
Warren Buckley 6114193fd5 Bump version to alpha 75 2017-03-14 10:17:43 +00:00
Warren Buckley 82420605ef Allow Forms Assemblies to access internals in Umbraco.Core - Required to use AppContext.ScopeProvider for Scope Events for Deploy 2017-03-14 10:01:23 +00:00
Sebastiaan Janssen 3bddceb17b Put the rewrite section in system.webServer where it belongs 2017-03-14 11:00:41 +01:00
Sebastiaan Janssen a2ca753dd9 Use RelatedLink class instead of weird extra inline class, convert UDI values 2017-03-14 10:26:13 +01:00
Sebastiaan Janssen 6f516a15aa Boyscout cleanup 2017-03-14 10:25:10 +01:00
Sebastiaan Janssen 223ed41c53 Use the extension method to get published content item - consistent with other PVCs 2017-03-14 10:24:31 +01:00
Sebastiaan Janssen d2a3932626 Merge branch 'dev-v7.6' into temp-U4-9611 2017-03-14 10:22:39 +01:00
Sebastiaan Janssen 27fab61646 Merge pull request #1792 from umbraco/temp-U4-9497
U4-9497 Update Related Links Property Editor to support UDIs
2017-03-14 10:14:45 +01:00
Shannon 05f8870424 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-03-14 17:25:40 +11:00
Shannon 4a829154db Adds documentation link to IIS Rewrite rules 2017-03-14 17:10:39 +11:00
Shannon f8073f429f adds debug transforms to ensure that any urlrewriting stuff is removed when the sln is built 2017-03-14 16:36:15 +11:00
Shannon 0a3220df85 Fixes null check, adds another test case 2017-03-14 16:26:17 +11:00
Shannon Deminick 04d37c590b Merge pull request #1786 from umbraco/temp-U4-9004
U4-9004 Remove URLRewriting.net dependency
2017-03-14 16:25:41 +11:00
Shannon 9a57f463ce Updates LocalLinks to be UDI, this will support both INT and UDI as LocalLink but when a new LocalLink is picked, it will use the UDI so eventually the INT will be gone 2017-03-14 15:31:30 +11:00
Mads Rasmussen fdfae0f78a increase font size for template insert description 2017-03-13 22:43:24 +01:00
Mads Rasmussen 9ebe7f683a increase font size for validation label 2017-03-13 22:40:12 +01:00
Mads Rasmussen 185af08e75 increase header description font-size 2017-03-13 21:02:43 +01:00
Mads Rasmussen 874c679bfe update tree header 2017-03-13 20:53:55 +01:00
Mads Rasmussen 76a6449ffa increase font size on actions menu 2017-03-13 20:47:36 +01:00
Mads Rasmussen fd8e200bd7 make property editor placeholder lighter + increase font size 2017-03-13 20:38:02 +01:00
Mads Rasmussen aa7e739b0e increase sections label font size 2017-03-13 20:09:44 +01:00
Mads Rasmussen 97f379ff44 add more contrast to placeholder text 2017-03-13 20:06:57 +01:00
Sebastiaan Janssen 3904f9c503 Centralized getting an IPublishedContent item from a Udi in a single extension method so that we're not repeating that code all over the place all the time 2017-03-13 15:49:15 +01:00
Warren Buckley 7753993987 Adds in more checks for the UDI or int to be stored - as there is a similar call to open the dialog to pick content from another function name - unknown why
Same for persisting data
2017-03-13 13:48:13 +00:00
Shannon 8f48da8bb0 Gets the related links editor working with the old property value converter too, udpates the install script so that works and updates tests to reference the correct one, adds GUID overloads to the UrlProvider 2017-03-13 16:58:41 +11:00
Shannon aba325e109 Creates UDI Related Links Property Editor and deprecates the old one 2017-03-13 16:14:30 +11:00
Shannon 2dd31f0f05 reverts the change for the showing an error if the node doesn't exist - it was for a start node (i.e. based on a user), not for an existing picked node 2017-03-13 16:00:56 +11:00
Shannon d42d96e166 Fixes issue with new picker logic when a picked node no longer exist, this would result in a 404 error which would actually show the red error and the dialog would die, instead we handle the error and initialize the tree when were ready 2017-03-13 15:04:35 +11:00
Shannon 3571c238b4 Renames the new UDI pickers to still be suffixed with "PropertyEditor" to make things more consistent 2017-03-13 12:59:36 +11:00
Shannon 2087332b69 removes committed Deploy dashboard config 2017-03-13 12:58:44 +11:00
Shannon dc71f9cd5e Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2017-03-13 12:39:27 +11:00
Shannon 99ed4d6cb9 Makes umbraco.GlobalSettings.UmbracoMvcArea available since we haven't been able to get the GlobalSettings into the right public classes yet. 2017-03-13 12:38:08 +11:00
Shannon Deminick 3646cfb47e Merge pull request #1791 from soreng/patch-3
Removed weird comment
2017-03-12 21:37:44 +01:00
Søren Gregersen 1b7ce8bcde Removed weird comment
removed "this" as remark for NewPassword
2017-03-12 21:20:24 +01:00
Sebastiaan Janssen 89c84676dd U4-9611 Create Property Value Converters for all new UDI Property Editors 2017-03-11 16:44:57 +01:00
Shannon 1c7b374c42 Fixes new property value converters to shadow their old ones correctly 2017-03-10 12:27:29 +01:00
Shannon 7100a00ef1 fix merges 2017-03-10 12:22:44 +01:00
Shannon df04100ff6 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6
# Conflicts:
#	build/UmbracoVersion.txt
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/Persistence/Querying/ExpressionVisitorBase.cs
#	src/Umbraco.Core/Persistence/Querying/SqlExpressionExtensions.cs
#	src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/MediaRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/MemberRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/MediaService.cs
#	src/Umbraco.Core/Umbraco.Core.csproj
#	src/Umbraco.Tests/Persistence/DatabaseContextTests.cs
#	src/Umbraco.Tests/Umbraco.Tests.csproj
#	src/Umbraco.Web.UI.Client/src/less/tree.less
#	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Editors/MediaController.cs
2017-03-10 10:40:28 +01:00
Stephan b893df035b Files were committed by mistake 2017-03-10 08:48:26 +01:00
Sebastiaan Janssen 67c6146f96 Merge pull request #1787 from umbraco/temp-u4-9595
U4-9595 - improve log error msg on thread aborts on timeouts
2017-03-09 15:59:47 +01:00
Stephan 6439e2fdd0 Merge dev-v7.6 into temp-u4-9462 2017-03-09 15:29:26 +01:00
Sebastiaan Janssen 13aa615745 U4-9004 Remove URLRewriting.net dependency 2017-03-09 11:41:36 +01:00
Stephan b8c0d4c4ea U4-9595 - improve log error msg on thread aborts on timeouts 2017-03-09 11:35:06 +01:00
Stephan 6992b0319a Version 7.6-alpha074 2017-03-08 18:59:27 +01:00
Stephan d1111009e3 Fix SemVer lib version 2017-03-08 18:45:00 +01:00
Sebastiaan Janssen 6c624ca08a Merge pull request #1785 from CreunaAB/fix/add-missing-sv-translation
Adds missing swedish translation for document type without template
2017-03-08 15:21:55 +01:00
Shannon Deminick 1722831bf5 Merge pull request #1640 from umbraco/temp-u4-7318
Value Converters for All Core Property Editors
2017-03-08 14:29:40 +01:00
Shannon 5291558b23 Further refactoring, using attributes, moving and removing some classes, using DI where necessary. 2017-03-08 14:27:39 +01:00
Warren Buckley a3f6fb78f5 Bump version to alpha-73 after downgrade to .NET 4.5 2017-03-08 12:22:47 +00:00
Warren Buckley 736b3565d0 Merge pull request #1784 from umbraco/temp-deploy-257
deploy-257 Downgrade Core and Deploy to framework 4.5
2017-03-08 12:17:08 +00:00
Claus ed782998ef Merge pull request #1779 from umbraco/temp-U4-9521
U4-9521 MediaService.GetPagedChildren should only get children and not descendants
2017-03-08 13:13:23 +01:00
Claus 31d980b0c5 Merge pull request #1782 from umbraco/temp-u4-9605
U4-9605 - debug switch for uncompleted scopes
2017-03-08 13:07:03 +01:00
Claus 9f6e4d4fd5 updating nuspec. 2017-03-08 12:04:48 +01:00
Claus d90658d814 Merge pull request #1783 from umbraco/temp-u4-9588
u4-9588 - filesystems
2017-03-08 11:58:47 +01:00
Claus 7fa8f04b11 deploy-257 Downgrade Core and Deploy to framework 4.5 2017-03-08 11:20:48 +01:00
Stephan bf2232258e U4-9588 - filesystems manager tlc 2017-03-08 11:02:30 +01:00
nengberg 8a133938e6 Adds missing swedish translation for document type without template 2017-03-08 09:57:32 +01:00
hartvig c1b3f1977d Merge pull request #1768 from danieland/dev-v7
U4-9571: Legacy icons look weird
2017-03-07 18:58:13 +01:00
hartvig f086156d48 Merge pull request #1781 from majken92/dev-v7
Updating sv.xml with correct translation
2017-03-07 18:53:43 +01:00
hartvig 7080013dd6 Merge pull request #1777 from jamescoxhead/U4-9373
U4-9373 Fix for duplicate dashboards after upgrading
2017-03-07 18:45:50 +01:00
Stephan 5bbb44479f U4-9588 - expand filesystems manager 2017-03-07 17:57:45 +01:00
Warren Buckley 5218d31f23 Bumps version to alpha-072 2017-03-07 15:43:29 +00:00
Stephan 9e55f5835c U4-9605 - debug switch for uncompleted scopes 2017-03-07 12:42:44 +01:00
Michael Razmgah b080825bb2 Updating sv.xml with correct translation 2017-03-06 21:31:42 +01:00
Stephan 8bb696bf9a Merge pull request #1776 from umbraco/temp-U4-9587
U4-9587 RebuildXmlStructures doesn't clear out stale data so there is…
2017-03-06 14:51:50 +01:00
Shannon 55e8451513 changes to in groups of 2000 2017-03-06 14:44:41 +01:00
Shannon 7e4e2a1d5d Fixes query when rebuilding xml structures for a content type 2017-03-06 14:42:02 +01:00
Claus 1101fc199f Merge pull request #1585 from umbraco/temp-U4-9145
U4-9145 Updating TinyMCE to latest (4.4.3)
2017-03-06 12:14:18 +01:00
Emil Wangaa 6de76571d7 Adds a couple of tests for ContentService.GetPagedChildren 2017-03-03 14:56:41 +01:00
Emil Wangaa 0f535f233e ContentService.GetPagedChildren should also only get children 2017-03-03 14:15:04 +01:00
Emil Wangaa 56da13fa79 MediaService.GetPagedChildren now only gets children even if parent id is root node instead of also getting descendants 2017-03-03 13:45:21 +01:00
Stephan 79d4956b75 Merge branch 'dev-v7' into temp-U4-9587 2017-03-03 13:26:43 +01:00
Mads Rasmussen 05fa58694e Merge pull request #1773 from umbraco/temp-ui-colors
fixes: U4-9583 Update UI colours and typography
2017-03-03 09:50:28 +01:00
Mads Rasmussen ecc8575454 colour tweaks 2017-03-03 09:48:50 +01:00
James Coxhead 9acfd8f5d2 Updated dashboard config transform
Fix for dupicate dashboards after upgrading
2017-03-02 21:02:25 +00:00
Shannon 0b530ce181 Fixes rebuilding xml structures when a content type is specified, we need to filter on that when looking for orphaned items. 2017-03-02 19:17:39 +01:00
Shannon 402835d72d Merge branch 'Colletz-U4-9573' into dev-v7 2017-03-02 18:45:06 +01:00
Shannon 08d579ec87 Fixes a bunch of id assignments in PublicAccessRepository along with clearing out old entries that are flagged for removal, adds a lot more assertions for retrieving items and their rules. 2017-03-02 18:44:42 +01:00
Shannon 8b92755487 Merge branch 'U4-9573' of https://github.com/Colletz/Umbraco-CMS into Colletz-U4-9573 2017-03-02 17:55:16 +01:00
Shannon 01b48107f3 ensures that the content type is not used in the query when it is null. 2017-03-02 17:45:21 +01:00
Shannon a546803970 Need to also update the health check check not just the old endpoint for non trashed media. 2017-03-02 17:40:39 +01:00
Shannon 96c28c2611 U4-9587 RebuildXmlStructures doesn't clear out stale data so there is unpublished or trashed items remaining in the xml table, xml data integrity check is misleading due to the media lookup 2017-03-02 17:28:34 +01:00
Shannon 65a22417f7 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2017-03-02 16:54:37 +01:00
Shannon 6c271e7af9 Fixes issue with U4-9456 when we use the withCache flag we do not add that to the defs collection so an error would occur if one was resolved from cache. 2017-03-02 16:54:25 +01:00
Mads Rasmussen df93dfe63c Merge pull request #1766 from umbraco/temp-U4-9538
U4-9538 - Add Keyboard shortcut (overview & template editor)
2017-03-02 16:12:56 +01:00
Mads Rasmussen 711981adab remove comment 2017-03-02 16:10:41 +01:00
Mads Rasmussen 199c5a9606 add keyboard shortcuts to partial view editor 2017-03-02 16:05:31 +01:00
Claus 54efe86020 fixes broken tests... 2017-03-02 16:00:11 +01:00
mikkelhm 589704437f Bump version to alpha071 2017-03-02 15:46:06 +01:00
Mads Rasmussen 9a99ad1416 combine documentation for localize component and attribute directive 2017-03-02 15:28:40 +01:00
Mikkel Holck Madsen a4077df5b7 deploy-245 - Merge pull request #1775 from umbraco/template-virtualpath-fix
Fixes VirtualPath being null on template creation
2017-03-02 15:27:59 +01:00
Mads Rasmussen 5d298e4313 make sure overlays close after shortcut overlay has been opened 2017-03-02 14:45:08 +01:00
Morten Christensen 46ef9146c4 Setting the VirtualPath should be done before we return 2017-03-02 14:40:44 +01:00
Stephan 3c75693e20 Add a few (ignored) tests used for debugging 2017-03-02 14:01:58 +01:00
Mads Rasmussen b67286f40d make showOverlay optional 2017-03-02 13:52:56 +01:00
mikkelhm 32ad98cde2 Bump version to alpha070 2017-03-02 13:33:12 +01:00
Mads Rasmussen dabeaa26e6 fix documentation 2017-03-02 13:14:02 +01:00
Mads Rasmussen 6c3f1c0e32 add mac/win versions of keyboard shortcuts 2017-03-02 13:04:55 +01:00
Mikkel Holck Madsen f4b1df1ede U4-9575 - Merge pull request #1770 from umbraco/temp-cloud-env-title
Dev Night - Display Deploy Cloud Env in <title>
2017-03-02 12:55:08 +01:00
Stephan a85cafe7ab Merge pull request #1772 from umbraco/temp-U4-9577
U4-9577 Ability to store the xml content file in diff storage locatio…
2017-03-02 11:42:44 +01:00
Mads Rasmussen 13cf9f46e7 fix ace shortcut overwrites on mac 2017-03-02 11:29:52 +01:00
Mads Rasmussen d062b51326 fix reference to notificationsService 2017-03-02 11:20:08 +01:00
Stephan 41d91ae791 Merge pull request #1758 from umbraco/temp-U4-9536
Updates Content/Entity repos to deal with cases where there is corrupt newest/published flags
2017-03-02 11:17:56 +01:00
Shannon Deminick dca5a26fe4 Merge pull request #1774 from umbraco/temp-9586-async-content-xml-save
Removes async from filestream instance
2017-03-02 10:49:31 +01:00
Shannon 7e8f6d391f Just to be sure, moves the text replacement outside of the using - though that wouldn't make any diff 2017-03-02 10:48:11 +01:00
Shannon 7aa00ee6e0 Removes unused method that also uses the async flag for file stream - which we know in some cases causes fcn issues, fixes streams not being closed property if there are exceptions 2017-03-02 10:37:04 +01:00
Niels Hartvig 2e027e6195 Removes async from filestream instance 2017-03-02 10:33:00 +01:00
Shannon a9c5877e5b Merge branch 'refs/heads/dev-v7.6' into temp-u4-7318
# Conflicts:
#	src/Umbraco.Web.UI/config/umbracoSettings.config
#	src/Umbraco.Web/Umbraco.Web.csproj
2017-03-01 15:04:00 +01:00
Shannon 337ba4ef34 U4-9577 Ability to store the xml content file in diff storage locations: Default, Environment Temp or ASP.NET temp location 2017-02-28 23:53:12 +01:00
Warren Buckley 2b0f2577b5 Uppercases the Section name in the page <title> & if Deploy installed grab the CurrentWorkspace from the global JS obj 2017-02-28 21:56:30 +00:00
Mads Rasmussen c2aa137293 more colour tweaking 2017-02-28 21:20:42 +01:00
Colletz 0f32c2d680 PublicAccess - Ensure correct ordering on join
Ensured the correct order on JOIN for the subsequent mapping on AccessDto and AccessRuleDto.
2017-02-28 12:43:49 +01:00
Mads Rasmussen 555e0a2281 change blue button to green button 2017-02-27 21:21:38 +01:00
Mads Rasmussen 091a89b162 update colours 2017-02-27 21:21:20 +01:00
Mads Rasmussen 0eab0b606c remove border on reset password input 2017-02-27 21:20:32 +01:00
Mads Rasmussen 1fe06a0c9e update logo colour 2017-02-27 21:19:57 +01:00
Mads Rasmussen 6022c87540 clean up 2017-02-27 16:12:44 +01:00
Mads Rasmussen 06d7ae3861 update text colours / icon colours 2017-02-27 15:40:14 +01:00
Mads Rasmussen 3d4f999c07 small health check tweaks 2017-02-27 15:39:47 +01:00
Shannon 96a18ec8e9 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into temp-U4-9536
# Conflicts:
#	src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
2017-02-27 15:24:55 +01:00
Shannon 65c39a3117 Fixes issue with returning multiple versions and mapping their property values, adds more assertions 2017-02-27 15:19:59 +01:00
Mads Rasmussen 3b7a83ab14 small colour improvements 2017-02-27 15:10:11 +01:00
Mads Rasmussen 796d665913 update grid colours 2017-02-27 15:07:19 +01:00
Mads Rasmussen 458e890c08 update health check colours 2017-02-27 15:06:52 +01:00
Mads Rasmussen e32604183c update login colours 2017-02-27 15:05:57 +01:00
Mads Rasmussen 099b05dbbc update a loooot of gray colors 2017-02-27 13:26:28 +01:00
Claus 15150f9a16 Merge pull request #1763 from umbraco/temp-U4-9545
U4-9545 EntityRepository performs poorly for Media due to unnecessary outer joins
2017-02-27 12:00:06 +01:00
Claus 259879c964 just cleaning some using statements and fixing a few typos. 2017-02-27 11:59:19 +01:00
Daniel Sune Andreasen ed87789abe collides with .legacy-custom-file 2017-02-27 11:14:37 +01:00
Mads Rasmussen 4cf7ae4b4d increase base font size 2017-02-27 10:08:10 +01:00
Mads Rasmussen 757b720a68 increase all small font sizes 2017-02-24 13:55:41 +01:00
Mads Rasmussen c8968edd65 add margin bottom to item picker search field 2017-02-24 12:49:38 +01:00
Mads Rasmussen 58b4201eeb update query builder + insert code dialog 2017-02-24 12:45:34 +01:00
mikkelhm a39557a3a7 Bump version to alpha068 2017-02-24 12:31:59 +01:00
Mads Rasmussen 46eda4a3c3 update document type editor colours 2017-02-24 12:01:28 +01:00
Mads Rasmussen 89ebad2fbc fix colours + increase font-size in breadcrumb 2017-02-24 11:38:18 +01:00
Mads Rasmussen 815a288bcb update tree + sections 2017-02-24 11:37:40 +01:00
Mads Rasmussen 67bcd517bf test warmer version of turquoise 2017-02-24 11:36:07 +01:00
Mads Rasmussen 915503fb51 update content grid colours 2017-02-24 11:35:36 +01:00
Mads Rasmussen ddefdf2627 increase font size in notifications 2017-02-24 09:12:06 +01:00
Shannon 09492fa779 Ensures that the published data retrieved uses the latest content version PK instead of by date in case dates are exactly the same. 2017-02-24 14:14:28 +11:00
Shannon 8122c0b352 Simplifies the includeAllVersions check 2017-02-24 14:00:38 +11:00
Shannon 28f0ab1001 Fixes U4-9456, ensures that property sets are mapped to a content version instead of an Id, adds more unit tests, ensures that if this warning ever occurs in a test that the test will fail. 2017-02-24 13:51:14 +11:00
Shannon 266f82b6c5 Fixes issue with returning all versions, adds more tests/assertions, updates content and media repository to double check that the versions match before returning from cache. 2017-02-24 13:23:27 +11:00
Shannon 813a8956d3 Gets EntityRepository to deal with corrupted newest/published flags, adds tests and lots of assertions for each method 2017-02-24 12:27:36 +11:00
Stephan 2239316889 Fix RelationRepository, debugging 2017-02-23 19:00:42 +01:00
Mads Rasmussen 2289938486 update button colours 2017-02-23 16:01:58 +01:00
Mads Rasmussen 2b8db9d1b5 set preview button to style "info" 2017-02-23 14:56:51 +01:00
Mads Rasmussen 14c903f6a3 set colour on editor navigation to turquoise 2017-02-23 14:56:13 +01:00
Mads Rasmussen b8a50b8da3 increase border-width on checkmark circle in media section 2017-02-23 14:54:47 +01:00
Mads Rasmussen 09300bba71 make checkmark in content picker green 2017-02-23 14:54:04 +01:00
Mads Rasmussen f716479d01 increase font size + line-height on property help text 2017-02-23 14:53:35 +01:00
Mads Rasmussen fa5044b011 make labels black 2017-02-23 14:52:53 +01:00
Mads Rasmussen 0aefbc045d add Lato as main font family 2017-02-23 14:25:33 +01:00
Mads Rasmussen 09788f1ab4 update base button colours 2017-02-23 13:34:38 +01:00
Mads Rasmussen 3a58cb35f8 update base form colours 2017-02-23 13:33:55 +01:00
Mads Rasmussen 8f47722d7d update base font colour 2017-02-23 13:32:45 +01:00
Mads Rasmussen ebed7c40ed update tree item hover colour 2017-02-23 13:32:19 +01:00
Mads Rasmussen 8c54e65861 update color on locked field component 2017-02-23 12:49:55 +01:00
Mads Rasmussen 157f9f3285 update umb-node-preview colours 2017-02-23 12:22:41 +01:00
Mads Rasmussen f2cefac866 update colours for package repo + installed packages 2017-02-23 12:14:08 +01:00
Mads Rasmussen cbcbb895ec Update header input + search input colours 2017-02-23 10:40:41 +01:00
Mads Rasmussen b98e96f758 add grayscale variables 2017-02-23 10:38:57 +01:00
Mads Rasmussen 9b033a3204 update icon picker + cards hover color 2017-02-23 10:10:34 +01:00
Mads Rasmussen 235014c8ca use new green for progress bars 2017-02-23 09:29:16 +01:00
Mads Rasmussen d04947a2d3 remove text indent on button text 2017-02-23 09:27:45 +01:00
Shannon Deminick 0a8fa2be4d Merge pull request #1761 from abjerner/patch-16
Added support for ignoring HTTP errors directly from the Angular $http options
2017-02-23 15:50:22 +11:00
Anders Bjerner 6e347dd32c Added some extra validation 2017-02-22 17:28:40 +01:00
Per Ploug d3582e2296 An ID is required on all items edited in backoffice editors
The ID is required when an item is saved, as the routing will
automatically redirect based on this ID - files, does not have an ID -
so the filepath is used in the same as it is used for the tree
2017-02-22 15:47:36 +00:00
Sebastiaan Janssen 33c9e2b58d Merge pull request #1767 from umbraco/temp-u4-9560
U4-9560 - fix db issue
2017-02-22 16:27:20 +01:00
Stephan 16f8f6036c U4-9560 - fix db issue 2017-02-22 15:52:02 +01:00
Mads Rasmussen 49ff36155c update required field color 2017-02-22 13:38:04 +01:00
Mads Rasmussen 512de60693 update active tree item color 2017-02-22 13:37:28 +01:00
Mads Rasmussen a064ef4aa7 update media grid, folder grid + load indicator colours 2017-02-22 13:36:22 +01:00
Mads Rasmussen 2210bc3f79 update table colors 2017-02-22 13:35:21 +01:00
Warren Buckley b6bc83ba71 Moves the bulky JSON objects for shortcuts to show in the shortcut overviews into helper service so can be reused a bit easier 2017-02-22 11:53:36 +00:00
Warren Buckley 8f43e9450a Update JS editor to use simplier localizationMany as opposed to nested promises for sucess & error notifications 2017-02-22 11:01:05 +00:00
Warren Buckley f3242e8d6a Adds in keyboard shortcut dialog & generic keyboard shortcuts (common to all ACE editors) to the JS editor 2017-02-22 11:00:52 +00:00
Warren Buckley f9835d3ec5 Move snippets & completion out of onLoad callback out onto config object for the template editor 2017-02-22 11:00:27 +00:00
Warren Buckley 49bcf413a4 Adds the auto-complete & snippets for the JS/Scripts ACE Editor config 2017-02-22 11:00:17 +00:00
Warren Buckley bcfea6986c Updates the localizationService ugly nested promises to the new localizeMany function 2017-02-22 10:59:33 +00:00
Warren Buckley 29b297e072 Add in UI translation items 2017-02-22 10:59:12 +00:00
Warren Buckley 70accfa95a Uses new localizationService.format function for the shortcuts dialog 2017-02-22 10:58:57 +00:00
Warren Buckley b764a47e7e Adds in new format function to localizationService simialr to C# String.Format() usign %0% as tokens.
Documents the new functions added.
2017-02-22 10:58:27 +00:00
Warren Buckley fc7cba1da9 Add in localizeMany & concat to localizationService as dont like seeing nested promises in our code base to fetch two items to pass to notificationService 2017-02-22 10:58:07 +00:00
Warren Buckley 883980ab8d Update localizationService documentation about the usage of %0% tokens being replaced with passed in values 2017-02-22 10:57:52 +00:00
Warren Buckley 23abbdb288 Update Localize Directive (attribute & element) with some specifics in documentation about the format of the string for the key. Localize attribute now supports a key without having to be prefixed with @ 2017-02-22 10:57:32 +00:00
Warren Buckley 652a7a3655 Update more translation keys from Per's update to the template editor (Will need to merge in after this) 2017-02-22 10:56:46 +00:00
Warren Buckley 8f73514c1d An initial start of localising the keyboard shortcut dialog for template editor (Only adding keys into en.xml for now) 2017-02-22 10:56:18 +00:00
Warren Buckley 304b863b02 Adds in keyboard shortcuts to power the dialog/UI and adds in the custom keyboard bindings for opening our cusotm dialogs for inserting macros, partials etc 2017-02-22 10:55:59 +00:00
Warren Buckley f0bdb1a2e9 Updates ACE Editor Directive to load in the additional library that enables simple auto-complete 2017-02-22 10:55:44 +00:00
Warren Buckley 6fb3c91d3f Updates Keyboard Shorcut directive in template editor view to use the new attribute on the directive to pass in show overlay bool 2017-02-22 10:55:14 +00:00
Warren Buckley b9095629ed Update Keyboard Shortcut Directive to support a callback function being passed in & the bool thjat toggles the overlay/div from being shown 2017-02-22 10:54:54 +00:00
Mads Rasmussen f1ec692a73 update umb-overlay colours 2017-02-22 11:48:11 +01:00
Sebastiaan Janssen 76b696e3bf U4-9559 Security: files of type xhtml should not be allowed to be uploaded to the media section 2017-02-22 11:12:24 +01:00
Shannon 7cadbb6398 Backports some required EntityRepository changes, starts adding the custom collection to remove duplicate (throw err currently) 2017-02-22 21:09:25 +11:00
Mads Rasmussen 1a2814a964 update color on navigation border + resize navigation 2017-02-22 11:01:34 +01:00
Mads Rasmussen 28d6622269 update stand alone tab border color 2017-02-22 10:55:14 +01:00
Mads Rasmussen 86971179ee update tabs border color 2017-02-22 10:52:39 +01:00
Mads Rasmussen 9c4eacf330 update main editor header and footer colors 2017-02-22 10:39:26 +01:00
Mads Rasmussen 251a67d653 update section colors 2017-02-22 10:38:34 +01:00
Emil Wangaa bf22399aba Fixup linendings for EntityRepository 2017-02-22 10:34:46 +01:00
Sebastiaan Janssen 0b9a3ef68a Bump version 2017-02-22 10:26:37 +01:00
Mads Rasmussen abe92eabba update modals header + border colors 2017-02-22 10:20:37 +01:00
Mads Rasmussen 0e76b27a2d add new color variables 2017-02-22 10:06:22 +01:00
Stephan 1a37d88855 ShadowFS in App_Data/TEMP 2017-02-22 10:05:53 +01:00
Shannon f8d6c7e7d0 Fixes expression tree changes 2017-02-22 18:34:55 +11:00
Shannon 90ba9a1a3a Adds new overload to IMediaService.GetPagedChildren to filter on media type ids which turns out to be much easier than filtering on media type aliases, however i did all of the work to make that happen including unit tests and then it turned out to not be required but we now have the code if necessary, i've left comments about it. I've backported some updates from 7.6 for the SqlIn stuff for the ExpressionVisitor which we still use in the media type id filtering. I updated the JS to query for the folders which all works now. 2017-02-22 17:22:22 +11:00
Shannon 6815731da1 adds failing test that i'll need to fix 2017-02-22 13:31:04 +11:00
Claus 2d5ffabe1e adding missing files from last commits. 2017-02-21 18:15:11 +01:00
Stephan f61b7579a2 Version 7.6-alpha066 2017-02-21 17:13:34 +01:00
Stephan 86a3780c61 Cleanup IFileSource for Deploy/IFileSource 2017-02-21 16:01:01 +01:00
Stephan 4d24e7bef8 U4-9462 - more units of work cleanup 2017-02-21 13:19:58 +01:00
Stephan 8d5f7af780 U4-9462 - cleanup file unit of work 2017-02-21 13:19:58 +01:00
Stephan 08c8b84a10 U4-9462 - cleanup units of work, code, fixmes 2017-02-21 13:19:58 +01:00
Emil Wangaa 552909fde2 Merge pull request #1753 from umbraco/temp-U4-9293
Fixes: U4-9293 Search the entire media section in Media Picker when inserting an image into content
2017-02-21 12:00:26 +01:00
Emil Wangaa 7adae4d345 Merge pull request #1755 from umbraco/temp-U4-9470
U4-9470 Mini list view: only show expand option for nodes with children
2017-02-21 09:00:52 +01:00
Sebastiaan Janssen 52dce66598 Bump version 2017-02-21 08:49:34 +01:00
Emil Wangaa d747cf69c3 Fixes typo in comment 2017-02-21 08:23:21 +01:00
Shannon 255fec84bd Merge branch 'refs/heads/dev-v7' into temp-U4-9536 2017-02-21 17:56:39 +11:00
Shannon bc5e3b4d66 Fixes issue of moving an item to the root, it will throw a JS error because target.nodeType is null 2017-02-21 15:44:49 +11:00
Shannon febeb82d10 Fixes the EntityController.GetPagedDescendants to not return items in the recycle bin, added some tests. 2017-02-21 15:43:46 +11:00
Shannon 9142314d39 U4-9522 Media recycle bin does not show folders 2017-02-21 14:18:49 +11:00
Shannon 1c2b2c1409 Merge branch 'refs/heads/temp-U4-9470' into temp-U4-9293 2017-02-21 13:54:21 +11:00
Shannon b4eb9f333e Gets the member picker working with mini list views, falls back to Examine search for when searching on member types - since the EntityService doesn't support that currently, gets the icon mapped correctly for members, 2017-02-21 13:49:58 +11:00
Shannon af00a421cd Updates EntityController to deal with special Members root node id 2017-02-20 21:23:09 +11:00
Shannon 27164093ea FIxes: U4-9547, Fixes: U4-9546 even though GetChildFolders isn't used anymore i made it work slightly faster 2017-02-20 18:08:55 +11:00
Shannon 67312d03d0 Fixes media query in EntityRepository, it doesn't require outer joins to get the published version, this also enhances the content query to do an inner join on cmsDocument to get the newest instead of an outer join. 2017-02-20 17:24:10 +11:00
Stephan fed06c88e8 Version 7.6-alpha065 2017-02-17 14:28:26 +01:00
Stephan 5dec2861d9 Fix event name issue 2017-02-17 14:28:26 +01:00
Stephan 23b3bb37ee Scope - fix issue with EventMessages 2017-02-17 13:10:22 +01:00
Emil Wangaa 4dabb606e7 Fixes issue with the mediapicker search getting 404 and loading failing because of missing property values for folders 2017-02-17 09:53:23 +01:00
Mads Rasmussen d5f66ebe02 update image properties to match media grid component 2017-02-16 19:59:45 +01:00
Anders Bjerner ad9ae867c0 Added support for ignoring HTTP errors directly from the Angular $http options 2017-02-16 19:22:26 +01:00
Stephan c7783d1cd1 Merge pull request #1759 from umbraco/temp-deploy-214
deploy-214 Add a "pretty" name to the IEntity or lookup a name when one is not immediately available
2017-02-16 18:45:31 +01:00
Stephan 2104b109f2 Merge pull request #1746 from umbraco/temp-U4-9509
U4-9509 Fix bugs in shadow filesystem
2017-02-16 18:43:04 +01:00
Stephan 578ca7d41d Merge branch dev-v7.6 into temp-U4-9509 2017-02-16 18:38:22 +01:00
Emil Wangaa bd38dde1fc Adds GetPagedDescendants to EntityController
Implements GetPagedDescendants in the mediapicker Search
Removes duplicate ExamineSearch and Search endpoint code from MediaController
2017-02-16 14:41:50 +01:00
Claus 42c23da9f5 removing IPrettyArtifact and moving properties to IArtifact instead. 2017-02-16 12:54:42 +01:00
Emil Wangaa cab1536a30 Merge remote-tracking branch 'origin/temp-U4-9470' into temp-U4-9293 2017-02-16 12:46:35 +01:00
Claus bbd9e4f0fd updating tinymce to 4.5.3. 2017-02-16 12:16:11 +01:00
Claus bf9a408c50 U4-9145 Updating TinyMCE to latest (4.4.3) 2017-02-16 12:13:48 +01:00
Claus 33d35fd9f7 bumping version just to be sure. 2017-02-16 10:01:37 +01:00
Claus cc885c1231 Merge pull request #1750 from umbraco/deploy-219
deploy-219 - files management
2017-02-16 09:52:59 +01:00
Shannon af287c387e Adds test to show that the content repo can deal with corrupted data, this fix actually simplifies a bunch of logic too and should consume slightly less memory, have added some TODOs in the code and need to then write more tests and code to deal with this in the EntityRepository. 2017-02-16 18:54:44 +11:00
Sebastiaan Janssen acf10eeef0 U4-9532 logic in ContentRepository.ClearPublished is inefficient - cherry picked from 7.6.0 2017-02-16 08:11:35 +01:00
Shannon 422dd1a627 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-02-16 13:22:59 +11:00
Sebastiaan Janssen 759e444624 Merge pull request #1467 from ArnoldV/dev-v7
U4-8990 Updated Dutch Language File
2017-02-15 22:39:44 +01:00
Sebastiaan Janssen 2a7ef5de26 Merge pull request #1756 from umbraco/temp-U4-9512
U4-9512 Missing index on umbracoUser2NodePermission
2017-02-15 15:14:33 +01:00
Claus 43e892563d Merge branch 'aarym-u4-9491' into dev-v7.6 2017-02-15 14:17:43 +01:00
Shannon 4d1e64b279 U4-9512 Missing index on umbracoUser2NodePermission 2017-02-15 21:51:14 +11:00
Shannon 975c97cfb0 Doh! Changed update to Execute 2017-02-15 21:24:45 +11:00
Shannon 0c613347ae Updates ClearPublished logic to be done in a single SQL statement instead of several 2017-02-15 21:22:08 +11:00
Mads Rasmussen 83f75fdaff nested mini list views: use visibility hidden instead of ng-if to better align list items 2017-02-15 11:00:35 +01:00
Mads Rasmussen 487792920b only show published state for content 2017-02-15 10:40:24 +01:00
Shannon 6ae06ad2e0 Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-U4-9470
# Conflicts:
#	src/Umbraco.Web/Editors/EntityController.cs
2017-02-15 17:41:12 +11:00
Shannon 8387c435d4 Gets mini list view working so that only nodes with children show the arrow, added GetPagedChildren to EntityController 2017-02-15 17:40:10 +11:00
Shannon 5807bbccc4 revert change to petapoco, we will calc the total manually for this due to an outer join/aggregate, adds GetDescendents + tests for EntityService 2017-02-15 16:38:43 +11:00
Shannon 1bfc041bbe Adds Paged query to entity repo/service + tests, had to fix paged queries in petapoco to strip ending GROUP BY otherwise the COUNT is incorrect 2017-02-15 15:13:23 +11:00
Claus a5ca058cb2 adding another wildcard test for ShadowFileSystem. 2017-02-14 15:14:21 +01:00
Claus 88a1ad04aa ensuring filter is applied to the shadow filesystem when using GetFiles.
added tests for various filters.
2017-02-14 14:57:04 +01:00
Warren Buckley e619c402b4 Merge branch 'temp-U4-9310' into dev-v7.6
# Conflicts:
#	src/Umbraco.Core/UdiEntityType.cs
2017-02-14 11:53:38 +00:00
Warren Buckley c9294e5281 In the init DB creation the Media & Member Picker was inserted into the DB the wrong way round - now assigned with the correct name for the DataType 2017-02-14 11:37:42 +00:00
Stephan 0074f57970 Version 7.6-alpha063 2017-02-14 11:23:20 +01:00
Stephan 9b4a6f2761 Merge origin/dev-v7.6 into deploy-219 2017-02-14 11:22:03 +01:00
Stephan f889b5206c Scope - handle publishing events 2017-02-14 11:11:40 +01:00
Stephan 507d7dd4f0 Scope - forgot to complete some scopes 2017-02-14 11:11:40 +01:00
Stephan 55c5b41693 Scope - report completion 2017-02-14 11:11:39 +01:00
Stephan b58d8677b3 Scope - bugfixing 2017-02-14 11:11:39 +01:00
Shannon f30d7fc68c Fixes nuspec to be net45 as a min 2017-02-14 14:29:23 +11:00
aaron.morey f5a204d1de U4-9491 feedback to implement into core css, be more specific with class naming & with usage and to implement a lighter red color for appearance 2017-02-14 09:14:05 +11:00
Warren Buckley d504d8f54e Update Core Deploy EntityTypes for Forms (Workflow is part of main form artifact) and we dont deploy records. Changing to PreValue & DataSources 2017-02-13 15:54:39 +00:00
Mads Rasmussen 7c049b55a8 media picker - search media library instead of filter current folder 2017-02-13 14:36:39 +01:00
Claus b519d68e1a fixing PartialViewMacrosTree and ScriptTree in trees.Release.config. 2017-02-13 13:34:35 +01:00
Claus deb8d652c5 fixing PartialViewsTreeController reference in trees.Release.config. 2017-02-13 12:44:16 +01:00
Emil Wangaa 051b3f2e6a Allows get for search media endpoint 2017-02-13 11:23:21 +01:00
Emil Wangaa 21f947efbd Moves media search to MediaController and implements paging for the endpoint 2017-02-13 11:21:09 +01:00
Sebastiaan Janssen a68f4e284a Merge pull request #1752 from umbraco/temp-U4-9517
U4-9517 BackOfficeSignInManager doesn't automatically keep LastLoginD…
2017-02-13 10:38:41 +01:00
Shannon 90b43584d2 Oops, fixes issue with attemping to reduce code but the 'section' parameter isn't the same in the config 'type' so needs to be manually applied like it was before. Fixes MultipleMediaPickerPropertyEditor to be multiple by default (is a bug in current versions too) 2017-02-13 19:57:21 +11:00
Emil Wangaa 9461e35028 Adds endpoint for searching media for the mediapicker 2017-02-13 09:54:50 +01:00
Stephan 12dd01dd29 Scope - refactor call context 2017-02-13 09:05:33 +01:00
Stephan c64e3a8908 Scope - refactor event dispatching 2017-02-13 09:05:32 +01:00
Shannon d554417fde U4-9517 BackOfficeSignInManager doesn't automatically keep LastLoginDate set on users 2017-02-13 16:47:04 +11:00
Stephan 74e8390bda Scope - enable http vs call context switching 2017-02-11 09:56:15 +01:00
Stephan 4f9bbdf7f7 Scope - Fix BulkInsertRecords, ensure a db connection is open 2017-02-11 09:56:12 +01:00
Stephan 67fc8b6215 Scope - fix media files deletion 2017-02-11 09:55:32 +01:00
Sebastiaan Janssen 3840ac2fed Merge pull request #1743 from umbraco/temp-U4-9484
U4-9484 Implement correct tree menu logic for partialviews, partialviewmacros and scripts
2017-02-10 17:04:41 +01:00
Sebastiaan Janssen 7c64f1aa0d Merge pull request #1745 from umbraco/temp-U4-7385
Fixes: U4-7385 Improve UI for listview - Make it clearer that users can search children
2017-02-10 16:43:35 +01:00
Claus 771f8d92f2 adding in missing extension method stuff for some udis. 2017-02-10 14:44:56 +01:00
Stephan 82c18955b0 Version 7.6-alpha060 2017-02-10 14:38:50 +01:00
Claus eedcfc122b Merge pull request #1747 from umbraco/temp-U4-9513
U4-9513 Empty recycle bin SQL logic can SQL to timeout due to query i…
2017-02-10 11:42:14 +01:00
Claus 8cf3110708 fixing typo and missing file ref in csproj. 2017-02-10 11:41:46 +01:00
Mads Rasmussen 0dc0e68174 reset pagination when searching 2017-02-10 10:36:58 +01:00
Claus 5226762528 Merge branch 'temp-U4-9351' into dev-v7.6
Conflicts:
	src/Umbraco.Core/Events/ImportPackageEventArgs.cs
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Web/Editors/PackageInstallController.cs
2017-02-10 10:08:31 +01:00
Claus 7889f82a9a added a check so the 'ensure' wont fail if the path is already as it should be.
added unit test for this method.
2017-02-10 09:25:16 +01:00
Emil Wangaa aaa9c8f194 Fixes delete of folders in partialviews,partialviewmacros and scripts 2017-02-10 09:24:14 +01:00
Sebastiaan Janssen 3d1a44b32c Merge branch 'temp-U4-8998' into dev-v7.6
# Conflicts:
#	src/Umbraco.Core/Umbraco.Core.csproj
2017-02-10 08:25:52 +01:00
Sebastiaan Janssen 724ec9ab73 Merge pull request #1748 from umbraco/temp-U4-8835
U4-8835 cmsMember.LoginName needs a DB index
2017-02-10 08:22:36 +01:00
Shannon aa0eaf590c adds indexes to relation type 2017-02-10 15:51:41 +11:00
Shannon 2b82520067 U4-8998 umbracoRelation table needs unique index on columns: parentId, childId, relType 2017-02-10 15:38:53 +11:00
Shannon 5aed6334c4 missing file 2017-02-10 14:24:33 +11:00
Shannon 91157caf0e U4-8835 cmsMember.LoginName needs a DB index 2017-02-10 14:23:46 +11:00
Shannon dbe489c0f2 U4-9513 Empty recycle bin SQL logic can SQL to timeout due to query inefficiencies 2017-02-10 12:27:50 +11:00
Shannon 2652a583e0 updates mediapicker.controller pre value to not make an uneeded request 2017-02-10 10:48:43 +11:00
Shannon bc1758f569 Updates the content picker to not make an unneeded request 2017-02-10 10:45:35 +11:00
Shannon a898c2d697 Fixes ParameterSwapControllerActionSelector when there is an empty parameter (not null but without a value) 2017-02-10 10:36:48 +11:00
Shannon e612bcae58 Merge branch 'refs/heads/dev-v7.6' into temp-U4-9310 2017-02-10 10:04:58 +11:00
Shannon d27fee8a5b Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-02-10 09:38:03 +11:00
Sebastiaan Janssen 7aef8cbb67 Merge branch 'temp-U4-9481' into dev-v7.6
# Conflicts:
#	src/Umbraco.Core/Services/FileService.cs
2017-02-09 21:55:17 +01:00
Sebastiaan Janssen a7e28a97d9 Merge pull request #1715 from umbraco/temp-U4-9450
U4-9450 Paged data queries return all property data in the entire dat…
2017-02-09 21:02:15 +01:00
Stephan 308a61895e deploy-219 - implement filesystem CanAddPhysical, AddFile from physical path 2017-02-09 15:58:44 +01:00
Stephan 8e5c57eb60 U4-9322 - rename kabum in Scope.RobustExit 2017-02-09 15:58:17 +01:00
Claus 9c5526f281 adding test for GetUrl on shadow. 2017-02-09 15:00:38 +01:00
Claus 9c803cc234 more test and comments to existing tests. 2017-02-09 15:00:37 +01:00
Claus f24fd42a69 GetFullPath now uses ShadowFileSystem. 2017-02-09 15:00:37 +01:00
Claus 9b7f459c44 added more checks to shadow tests to ensure correct behavior. 2017-02-09 15:00:36 +01:00
Claus 273a5cef28 fixed bug in GetFiles with filter param.
test for shadow filesystem GetFiles.
2017-02-09 15:00:35 +01:00
Claus 57945fcec6 fixing broken build - referencing files that aren't committed. 2017-02-09 14:41:22 +01:00
Sebastiaan Janssen ade3c4ee6c Merge pull request #1732 from rsoeteman/U4-9493
U4 9493
2017-02-09 14:26:44 +01:00
Arnold Visser 7da7c1e5a1 Addes all new/missing fields since last edit
Checked against the English version
2017-02-09 13:47:31 +01:00
Sebastiaan Janssen 8fe904d780 Merge pull request #1744 from umbraco/temp-U4-9433
U4-9433 Add index to path column on umbracoNode
2017-02-09 13:43:44 +01:00
Mads Rasmussen 1901fbb6ed add markup for member picker and content picker 2017-02-09 10:42:15 +01:00
Mads Rasmussen 1de52482e3 fix back arrow alignment 2017-02-09 09:23:30 +01:00
Shannon 1c0d4001ab U4-9433 Add index to path column on umbracoNode 2017-02-09 17:27:23 +11:00
Shannon f04d70f2d9 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-02-09 17:04:41 +11:00
Shannon Deminick 55098deac0 Merge pull request #1728 from umbraco/temp-u4-9487
U4-9487 - optimize initialization of xml nodes
2017-02-09 16:56:05 +11:00
Shannon 58c5618d30 Adds benchmarks for XML perf testing - had to make the init xml code static with out params to test but that's ok. 2017-02-09 16:42:59 +11:00
Shannon d0cbeb4a0a Better optimized initialization of xml nodes with less allocations 2017-02-09 15:29:38 +11:00
Shannon ce0821e2d6 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	src/Umbraco.Tests/Umbraco.Tests.csproj
2017-02-09 13:20:33 +11:00
Shannon Deminick b6e9db7363 Merge pull request #1726 from umbraco/temp-u4-9322
Scope Scope Scope!
2017-02-09 12:30:58 +11:00
Shannon 9f710a957d Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-u4-9322
# Conflicts:
#	src/Umbraco.Core/Services/FileService.cs
2017-02-09 12:30:01 +11:00
Shannon b7578e2b98 fixes tests 2017-02-09 12:07:16 +11:00
Shannon 97e8973cbd Ensures that the RelateOnTrashHandler doesn't attempt to create a relationship for an item that doesn't exist 2017-02-09 11:40:13 +11:00
Shannon 2dc45c3b9f Tons of code duplication removed, streamlines the content, media and member repositories to use the same paged methods and filtering mechanism (much bettter), adds some tests, creates a marker interface for IContentServiceBase so we can use extension methods for now to de-duplicate some of the code between media and content services 2017-02-09 10:34:40 +11:00
Mads Rasmussen 49c2ae3673 cleanup 2017-02-08 23:37:48 +01:00
Mads Rasmussen 5f22c81994 fixes: U4-9467 Mini list view: don’t animate list view if it is a start node 2017-02-08 23:37:33 +01:00
Mads Rasmussen f13427f5fb fixes to breadcrumb 2017-02-08 22:49:16 +01:00
Mads Rasmussen 2785eaeda5 only show unpublished state for content 2017-02-08 20:22:54 +01:00
Sebastiaan Janssen bb31eb7c35 Emit only relative paths for files in a package 2017-02-08 16:19:47 +01:00
Emil Wangaa a31cfb86f8 Moved reload to be last menu option and added a separator for delete option to keep consistency 2017-02-08 15:57:53 +01:00
Shannon 4feb876463 Fixes issues of deleting a content item and the trashing events raised for content/media that is going to be deleted anyways, adds tests to support. Fixes MediaService to not delete the xml directly and instead rely on it's repository to do that (which is the correct way), streamlines both content/media service logic to be the same (need to start sharing code!) 2017-02-09 01:47:04 +11:00
Emil Wangaa e4802b592f Centralized the tree menu logic for partialviews, partialviewmacros and scripts to the FileSystemTreeController and implemented logic to match what we do for Document Types 2017-02-08 15:43:31 +01:00
Mikkel Holck Madsen a8914dcfdb Merge pull request #1740 from umbraco/temp-U4-9458
Adds unit tests for U4-9458 UmbracoExamine performance optimizations
2017-02-08 15:12:07 +01:00
Mads Rasmussen 548f9fd01f open mini list view before children are loaded 2017-02-08 15:02:03 +01:00
Mads Rasmussen 843796c9a4 refactor move logic from tree controller into to mini-list-view component 2017-02-08 14:58:54 +01:00
Sebastiaan Janssen 7648c76f6f List full path of each file installed 2017-02-08 14:45:07 +01:00
Sebastiaan Janssen 308ed3bba7 Removed files that are not found on disk don't get updated to list their full path 2017-02-08 14:44:48 +01:00
Sebastiaan Janssen 7bcb2b11f6 Makes the (un)install summary accessible to events 2017-02-08 14:43:59 +01:00
Shannon e06cda98e9 fixes SQL IN expression 2017-02-08 22:25:07 +11:00
Shannon fb02a5b06d Fixes issue of removing content types in bulk (like when removing a package) and having the trashed event being raised for what will end up being a deleted node, Fixes a bug with the (very silly) extension methods for content types, removes singleton accessors from these (very silly) extension methods - which actually never worked for media types! 2017-02-08 21:59:16 +11:00
Mads Rasmussen c060856782 fix breadcrumb for pickers with a startNode 2017-02-08 11:09:09 +01:00
Sebastiaan Janssen 311edd3279 Adds missing dependency (it's in dev-v7, must have been a merge where it was forgotten to be merged into dev-v7.6) 2017-02-08 10:36:36 +01:00
Claus 1c89f8c8dd Merge branch 'temp-U4-1324' into dev-v7.6 2017-02-08 09:54:12 +01:00
Mads Rasmussen 857063ebd8 fixes: U4-9465 Mini list view: don’t show expand arrow on list views in trees not supporting mini list view 2017-02-08 09:53:52 +01:00
Claus 24063c403a Merge remote-tracking branch 'origin/dev-v7.6' into temp-U4-1324
Conflicts:
	src/Umbraco.Core/packages.config
	src/Umbraco.Tests/packages.config
2017-02-08 09:14:27 +01:00
Claus 0f930d7342 Merge pull request #1741 from umbraco/temp-U4-9499
U4-9499 Update to latest Json.Net
2017-02-08 08:58:22 +01:00
Emil Wangaa c36000c4dd Adds create container endpoint for creation folders for scripts, partialviews, partialviewmacros 2017-02-08 08:52:36 +01:00
Mads Rasmussen 999de5ae1d add client side logic for partial view macros folder creation 2017-02-08 08:52:36 +01:00
Mads Rasmussen 00982d4278 add client side logic for partial views folder creation 2017-02-08 08:46:10 +01:00
Mads Rasmussen cda47ed536 add client side logic for scripts folder creation 2017-02-08 08:45:23 +01:00
Shannon f4f1f6774d U4-9499 Update to latest Json.Net 2017-02-08 17:47:32 +11:00
Shannon a20cc60c10 Updates new UDI pickers that have start nodes for pre-values to also store UDIs for their prevalues, this has a knock on effect in that we need to be able to inject some server side config for pre-value editors (otherwise we'd have to make diff udi prevalue editors but that isn't very re-usable), so have implemented that and then updated all of the logic to deal with the udi idType. 2017-02-08 16:15:27 +11:00
Shannon 846ac573cc Fixes tests, ensures we don't install test data that doesn't exist 2017-02-08 14:18:37 +11:00
Warren Buckley 92acc3d331 Merge pull request #1736 from umbraco/temp-U4-9429
U4-9429 Make new create dialogs for code files (or rethink snippets)
2017-02-07 21:28:43 +00:00
Warren Buckley ed4db61288 Merge pull request #1738 from umbraco/temp-U4-9314
U4-9314 Update to .Net Framework 4.6.2
2017-02-07 17:49:17 +00:00
Warren Buckley ba6705a706 Merge branch 'dev-v7.6' into temp-U4-9314 2017-02-07 17:27:07 +00:00
Mads Rasmussen dc980bd78e remove null 2017-02-07 16:41:01 +01:00
Mads Rasmussen c9f99d7f42 localise create items 2017-02-07 16:35:33 +01:00
Sebastiaan Janssen 73e219b23c Fix unit tests 2017-02-07 16:24:34 +01:00
Sebastiaan Janssen 07e0de5824 Adds unit tests for U4-9458 UmbracoExamine performance optimizations 2017-02-07 16:20:40 +01:00
Mads Rasmussen 79a103662f remove alerts 2017-02-07 16:09:36 +01:00
Mads Rasmussen 2ba5627e2c fixes: U4-9471 Mini list view: show breadcrumb instead of back button 2017-02-07 15:57:53 +01:00
Warren Buckley 122295c89f Sets MacroPicker aka MacroContainer as deperecated 2017-02-07 13:55:49 +00:00
Mads Rasmussen 2669c68df0 fixes: U4-9468 Mini list view: add empty state for no children + no search result 2017-02-07 11:55:45 +01:00
Sebastiaan Janssen 389b29599b U4-9495 ImageProcessor high CPU usage when trimCache=true 2017-02-07 10:29:11 +01:00
Mads Rasmussen 912a6a52cc fixes: U4-9472 Mini list view: show published/unpublished state of node 2017-02-07 10:10:37 +01:00
Claus 925c343a30 U4-9351 Add events for package install/uninstall 2017-02-07 10:00:34 +01:00
Shannon 351796fd6b Created test to verify problem with deleting content of content type in a loop (i.e. on package uninstall) 2017-02-07 15:46:50 +11:00
Shannon e58d9a9535 Fixing tests, fixes PublishingStrategy to hvae the scope provider passed in 2017-02-07 14:40:45 +11:00
Shannon 3fa7c4d7ef Removes POC class, fixes content service trash/move events so there's not ambiguous 2017-02-07 14:08:55 +11:00
Shannon b6b2a53361 Fixes publishing strategy to use the normal event messages collection since we haven't actually wired those up to the scope for now. 2017-02-07 14:07:01 +11:00
Shannon 4647ed2551 Merge branch 'refs/heads/dev-v7.6' into temp-u4-9322
# Conflicts:
#	src/Umbraco.Core/DatabaseContext.cs
#	src/Umbraco.Core/UmbracoApplicationBase.cs
2017-02-07 13:44:17 +11:00
Shannon e7e6ad6d0b Some adjustments for U4-9477 2017-02-07 13:36:32 +11:00
Shannon 0e727f91da Merge branch 'refs/heads/dev-v7.6' into temp-U4-9310
# Conflicts:
#	src/UmbracoExamine/UmbracoMemberIndexer.cs
2017-02-07 13:21:02 +11:00
Shannon a71ec8dd81 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-02-07 12:50:44 +11:00
Shannon f816a63b54 Ok, reverting the correct commit this time: Revert "Fixes database context issue during startup when there is no db configured" 2017-02-07 12:49:26 +11:00
Shannon 138991d951 OMG Re-rever "DOH! Revert "Fixes database context issue during startup when there is no db configured", i reverted the wrong commit on the wrong branch 2017-02-07 12:43:06 +11:00
Shannon 92ce064d30 DOH! Revert "Fixes database context issue during startup when there is no db configured" pushed to the wrong branch 2017-02-07 12:40:28 +11:00
Shannon ab3bfa4e92 Fixes database context issue during startup when there is no db configured 2017-02-07 12:39:35 +11:00
Shannon fa8f3985b8 Fixes database context issue during startup when there is no db configured 2017-02-07 12:33:37 +11:00
Shannon 179523224a Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-U4-9310 2017-02-07 12:15:54 +11:00
Shannon 19e4bee34e fixes test 2017-02-07 12:02:38 +11:00
Shannon f1709f6066 Fixes identity seed for db 2017-02-07 11:58:10 +11:00
Shannon f2be235f85 Fixes the db data type for UDI media picker, fixes the initial db installation data to use the new pickers. 2017-02-07 11:44:04 +11:00
Mikkel Holck Madsen 175c785705 Merge pull request #1722 from umbraco/temp-U4-9458
Changes IndexFieldPolicies to be a StaticFieldCollection which is a k…
2017-02-06 21:45:54 +01:00
Mikkel Holck Madsen 72aebd3ecf Merge branch 'dev-v7' into temp-U4-9458 2017-02-06 21:44:26 +01:00
Warren Buckley c8408760df Merge pull request #1737 from umbraco/temp-U4-9474
Fixes: U4-9474 Update macro picker to follow the new picker UI
2017-02-06 16:03:25 +00:00
Warren Buckley 5834649abc Merge pull request #1733 from umbraco/temp-U4-9466
fixes: U4-9466 Duplicate reorder links for Umbraco grid
2017-02-06 15:36:04 +00:00
Mads Rasmussen 2eda70542f rename macro container to macro picker 2017-02-06 16:16:26 +01:00
Mads Rasmussen a2a17faca1 Fixes: U4-9474 Update macro picker to follow the new picker UI 2017-02-06 16:11:51 +01:00
Shannon a6c2844d12 updates nuspec with correctly targeted framework 2017-02-07 01:03:50 +11:00
Mikkel Holck Madsen 802cbb82c4 Merge pull request #1723 from umbraco/temp-U4-9448
U4-9448 Slave Front End server requires write access to database when…
2017-02-06 15:01:30 +01:00
Shannon 6f16b98b32 regression issue from refactoring how media works with Deploy 2017-02-07 00:57:44 +11:00
Mikkel Holck Madsen 42f5507fe8 Merge pull request #1734 from umbraco/temp-U4-9492
U4-9492 Update to latest ImageProcessor
2017-02-06 14:39:01 +01:00
Shannon 72910cb35e Updates everything to .Net 4.6.2, had to update the semver reference too - no breaking changes though 2017-02-07 00:22:34 +11:00
Shannon 7be30ad6ac Moves all binding redirects via code to one place 2017-02-06 23:46:44 +11:00
Sebastiaan Janssen 5a8e37f5b4 U4-9492 Update to latest ImageProcessor 2017-02-06 13:46:10 +01:00
Shannon f87ccc0a53 Updates nuspec 2017-02-06 23:36:56 +11:00
Shannon 40ed77103f Updates to latest 1.x version of log4net (before the real 2.x version) with binding redirects and codebase binding redirects to redirect from non-signed to signed version 2017-02-06 23:07:20 +11:00
Mads Rasmussen 483762a984 fixes: U4-9466 Duplicate reorder links for Umbraco grid 2017-02-06 12:50:34 +01:00
Richard Soeteman a3c7b1fcfe Fixed issue U4-9494 2017-02-06 11:51:44 +01:00
Stephan 145ca54dcf Merge origin/dev-v7.6 into temp-u4-9322 2017-02-06 11:29:04 +01:00
Richard Soeteman 02785eea42 Fixed issue U4-9493 2017-02-06 11:26:58 +01:00
Stephan 1aecb66167 U4-9322 - restore DatabaseContext ctors, see U4-9477 2017-02-06 11:17:24 +01:00
Stephan 96244f9f7b U4-9322 - pushed DEBUG_SCOPES by mistake 2017-02-06 10:43:39 +01:00
Stephan e0cc59d212 Merge branch 'temp-u4-9322' of https://github.com/umbraco/Umbraco-CMS into temp-u4-9322 2017-02-06 10:09:31 +01:00
Stephan dd2946419b U4-9322 - fix broken DEBUG_SCOPES 2017-02-06 10:08:29 +01:00
Shannon d0ea8e83ad Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-02-06 19:49:00 +11:00
Shannon Deminick 3c7d3b2f63 Merge pull request #1724 from umbraco/temp-installer-url-update
Update NewInstallStep.cs
2017-02-06 19:42:23 +11:00
Shannon a65ad3c72a Adds equality members for all event args, updates equality check for EventDefinitionBase to include the args (since that is quite important!), creates an OrderedHashSet class which can deduplicate lists for us based on member equality and supports first in or last in + tests. 2017-02-06 18:46:23 +11:00
Shannon f6a7b25e87 Updates CacheRefresherEventHandler to have consistent events, adds logic to find the event based on definitions, adds tests to test them all 2017-02-06 17:26:06 +11:00
aaron.morey d97cc36c53 u4-9491 Added an asterisk with appropriate css class to the property editor next to the label in the back office to indicate to the user that the field is mandatory before saving. This is more intuitive to the user to see what fields need filling in before submitting. This was implemented in our solution which is used by hundreds of back end users. 2017-02-06 17:24:53 +11:00
Shannon 0e06245177 Adds notes for stephen to look at 2017-02-06 14:46:02 +11:00
Stephan 5a81a9eed7 U4-9322 - various fixes 2017-02-04 15:44:56 +01:00
Stephan 38e7d7e697 Merge remote-tracking branch 'origin/temp-u4-9322' into temp-u4-9322 2017-02-03 21:54:55 +01:00
Stephan 820069d5d5 U4-9322 - filesystems & cleanup 2017-02-03 20:01:43 +01:00
Stephan 49f3979d18 U4-9487 - optimize initialization of xml nodes 2017-02-03 19:28:43 +01:00
Emil Wangaa 055e209e0b Fixed the path and virtualpath when creating and scaffolding codefiles
Ensuring that javascript files are created with the .js extension
2017-02-03 12:06:49 +01:00
Shannon 5579563105 Creates a test (which fails) so that stephen can have a look 2017-02-03 14:56:08 +11:00
Shannon cda9d0f9f2 pretty big perf boost so that we aren't going to the services user cache everytime we want to know the user's culture, this will already be set on the thread! 2017-02-03 14:42:06 +11:00
Shannon 49b7f15e3d fixes tests 2017-02-03 13:32:22 +11:00
Shannon 8ae700eedf code formatting and merge fixing 2017-02-03 12:23:32 +11:00
Shannon 411bbcc192 Merge branch 'refs/heads/dev-v7.6' into temp-u4-9322
# Conflicts:
#	build/UmbracoVersion.txt
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/Services/ContentService.cs
#	src/Umbraco.Core/Services/ContentTypeService.cs
#	src/Umbraco.Core/Services/DataTypeService.cs
#	src/Umbraco.Core/Services/MacroService.cs
#	src/Umbraco.Core/Services/MediaService.cs
#	src/Umbraco.Core/Services/MemberService.cs
#	src/Umbraco.Core/Services/MemberTypeService.cs
#	src/Umbraco.Core/Services/UserService.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
2017-02-03 12:14:38 +11:00
Shannon d598fdce54 Updates to latest Examine release 2017-02-03 12:03:56 +11:00
Shannon db86f6e1ee Fixes up issues reported on review and adds a null check 2017-02-03 11:49:22 +11:00
Shannon c16ce4ce1f Merge branch 'dev-v7.6' of https://github.com/umbraco/Umbraco-CMS into dev-v7.6 2017-02-03 10:21:10 +11:00
Shannon 86021c5052 Adds remaining core methods to make 2FA providers work if you know how to wire it up 2017-02-03 00:47:28 +11:00
Mads Rasmussen de87701c95 remove option to create xml file 2017-02-02 14:46:23 +01:00
Shannon a03e0dfb53 Fixes tests 2017-02-02 22:21:36 +11:00
Shannon 5060e709d1 Fixed merge conflicts, adds required methods to auth controllers. 2017-02-02 22:11:34 +11:00
Emil Wangaa c073191f69 Fixes creation of codefiles in folders 2017-02-02 11:47:46 +01:00
Mads Rasmussen b4450ca7f2 add null check for startNode 2017-02-02 11:44:13 +01:00
Mads Rasmussen 7004765acf remove unused code 2017-02-02 11:40:53 +01:00
Mads Rasmussen 77a91bc017 fix entity look up 2017-02-02 11:28:56 +01:00
Mads Rasmussen 14b96da588 combine redundant resource code into one function 2017-02-02 11:19:56 +01:00
Emil Wangaa c21837e906 Merge remote-tracking branch 'origin/dev-v7.6' into temp-U4-9429
# Conflicts:
#	src/Umbraco.Web/Editors/CodeFileController.cs
2017-02-02 10:24:42 +01:00
Mads Rasmussen 99324035e5 clean up animation classes 2017-02-02 10:19:54 +01:00
Mads Rasmussen 8b9a5000be move back button styles to class 2017-02-02 10:09:31 +01:00
hartvig 32892cf5e0 Update NewInstallStep.cs 2017-02-02 10:05:14 +01:00
Mads Rasmussen c82bddb7dd remove fake list view search node 2017-02-02 09:51:13 +01:00
Stephan 478ca30948 U4-9322 fs - create scope option 2017-02-02 09:49:23 +01:00
Mads Rasmussen f2fd45576b speed up animations 2017-02-02 09:35:01 +01:00
Emil Wangaa 6bf5f4dbdf Fixed up tree menus for scripts, partialviews and partialviewmacros 2017-02-02 09:20:42 +01:00
Shannon 32d757b13c Updates the ContentRepository to not fetch the published version info in the same query when returning a collection of documents, instead we fetch the published version information in a separate query 2017-02-02 17:05:33 +11:00
Shannon 882d5ec7f5 missing null check 2017-02-02 16:02:29 +11:00
Shannon ce69497a68 Update code to have zero breaking changes for old public APIs 2017-02-02 14:16:39 +11:00
Shannon 1d43cf491b U4-9448 Slave Front End server requires write access to database when master performs unpublish 2017-02-02 14:09:49 +11:00
Mads Rasmussen d5a687cf3d start on code clean up - make ump-mini-list-view directive + move inline styles to classes 2017-02-01 23:12:49 +01:00
Emil Wangaa c9082ce511 Changed PostSave method in CodeFileController to create or update instead of only updating - this is for keeping consistency with how other new editors work 2017-02-01 15:46:22 +01:00
Claus 46c7737c17 Merge pull request #1714 from umbraco/temp-u4-9441
Fixes tree syncing issues
2017-02-01 14:04:18 +01:00
Claus 06c829eb27 initializing stringbuilder with text instead of appending after init.
trimming end instead of both beginning and end, since we know whats in the beginning.
2017-02-01 14:03:03 +01:00
Mads Rasmussen e439302b93 add support for getScaffold for scripts, partialViews and partialViewMacros editor 2017-02-01 13:54:16 +01:00
Emil Wangaa 6a1d7d2586 Adds GetScaffold in CodeFileController to simplify initial view in backoffice
Refactored the FileService a bit to be able to get content of the snippets without duplicate code
2017-02-01 12:33:20 +01:00
Shannon 27283754c0 Changes IndexFieldPolicies to be a StaticFieldCollection which is a keyed collection instead of using Linq and iterating to find the values in critical code 2017-02-01 16:48:09 +11:00
Shannon ff6ea0b42e Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-U4-9310
# Conflicts:
#	src/Umbraco.Core/Models/UmbracoObjectTypes.cs
2017-02-01 15:23:29 +11:00
Shannon 384a31e3c6 Gets member picker working with UDI, ensures that the GUID is indexed for all things - can't believe this wasn't being done, updates the search model mapper to return the UDI 2017-02-01 15:19:52 +11:00
Shannon 69b913c608 Gets MNTP working with UDI - updates EntityController to support all types of Ids for GetById 2017-02-01 14:07:13 +11:00
Shannon 83757c60b5 Adds UDI support for the content picker 2017-02-01 13:38:42 +11:00
Shannon 5b2212829c Small performance change which makes a fairly large impact when rebuilding very large indexes. 2017-02-01 13:02:22 +11:00
Mads Rasmussen 26acecb720 start on animation and nested list views 2017-02-01 00:28:40 +01:00
Stephan 4a6844b949 U4-9322 - repository caches, cleanup 2017-01-31 19:36:55 +01:00
Stephan ac9b484d3d U4-9322 - wire EventMessages, cleanup 2017-01-31 18:19:03 +01:00
Stephan 97a76d5ad4 U4-9322 - introduce ScopeContext that lives longer than Scope, now Xml does not multi-clone! 2017-01-31 16:42:01 +01:00
Mads Rasmussen d4fab66411 add UI for partial views create dialog 2017-01-31 15:00:37 +01:00
Mads Rasmussen 4cd287616e add UI for partial view macros create dialog 2017-01-31 14:44:52 +01:00
Mads Rasmussen d22afe07db add UI for scripts create dialog 2017-01-31 12:40:56 +01:00
Morten Christensen fa56f1a59d Merge branch 'dev-v7' into dev-v7.6 2017-01-31 12:27:40 +01:00
Morten Christensen 546209ddb5 Merge pull request #1716 from umbraco/temp-U4-9451
U4-9451 Package installation custom user control is not displayed aft…
2017-01-31 12:24:52 +01:00
Morten Christensen 1e7c44ead0 Merge remote-tracking branch 'origin/temp-U4-9451' into dev-v7.6 2017-01-31 11:38:41 +01:00
Per Ploug 90448f1c78 Added comments and made helper internal 2017-01-31 11:06:14 +01:00
Stephan 6dc34e1167 U4-9322 - cleanup EventExtensions 2017-01-31 10:37:37 +01:00
Warren Buckley 6956e01861 Merge pull request #1713 from umbraco/temp-U4-9413
U4-9413 moving links to document and media to top of generic properties.
2017-01-31 09:37:34 +00:00
Claus f3b364022a bumping version for deploy. 2017-01-31 10:33:57 +01:00
Claus 56ae2b709d adding deploy entity types for forms. 2017-01-31 10:31:45 +01:00
Mads Rasmussen 7c42cd26c2 clear minilistview data when leaving 2017-01-31 10:26:03 +01:00
Mads Rasmussen 13758418ac add better load indicators 2017-01-31 10:14:17 +01:00
Emil Wangaa 6bd1a77b96 Simple wiring up of the create menu for partialview, partialviewmacro and script 2017-01-31 10:10:05 +01:00
Mads Rasmussen 77b04d74d4 load mini list view for pickers with a start node 2017-01-31 10:00:44 +01:00
Shannon e95cb14d48 Gets FromJsonPath working for EntityController to have GetByIds with all types of Ids for both GET and POST 2017-01-31 19:11:05 +11:00
Shannon 86b2dac231 Needed to change the 2nd query to use a new PagingSqlQuery object due to the way that < SQL 2012 formats it's paging query which is just not compatible with how we were parsing the queries for properties... i don't actually think it was working for a long tme. 2017-01-31 17:20:44 +11:00
Shannon 54bda6f12a U4-9451 Package installation custom user control is not displayed after a package is installed 2017-01-31 15:40:02 +11:00
Shannon 2f67a485aa Ensures that the sqlIds query is used for paging when processing members/media 2017-01-31 14:52:48 +11:00
Shannon f192f241cf U4-9450 Paged data queries return all property data in the entire database, not just for the paged subset 2017-01-31 13:48:47 +11:00
Mads Rasmussen bf797bccc7 open list view on expand 2017-01-30 22:35:19 +01:00
Mads Rasmussen 4336f5201d show expand arrow for list views 2017-01-30 22:34:04 +01:00
Mads Rasmussen 0acc202740 Merge pull request #1712 from umbraco/temp-U4-9410
U4-9410 Hook up delete dialog for Code Files
2017-01-30 20:50:36 +01:00
Emil Wangaa 431f91b900 Adds an api endpoint for getting the available snippets in the Umbraco folder 2017-01-30 14:57:08 +01:00
Mads Rasmussen ed019a90e2 start on mini list view for pickers 2017-01-30 14:25:10 +01:00
Stephan d4acc2c79b U4-9322 - EventsDispatchMode, fix tests 2017-01-30 13:53:31 +01:00
Per Ploug b05c4711ce Fixes tree syncing issues 2017-01-30 13:33:05 +01:00
Claus 74c167ed03 U4-9413 moving links to document and media to top of generic properties. 2017-01-30 13:18:30 +01:00
Claus 4ad0c1bb89 cleaning usings. 2017-01-30 13:14:19 +01:00
Claus 67da15330e U4-9410 Hook up delete dialog for Code Files
delete dialogs for partialviews, partialviewmacros and scripts.
+ fixed codefileResource.
+ fixed comments in MemberTypesDeleteController.
2017-01-30 11:56:30 +01:00
Shannon 8d598cd37c Gets EntityController working with UDIs, INT and GUID for GetByIds 2017-01-30 20:40:45 +11:00
Sebastiaan Janssen 690af8e494 Merge pull request #1711 from umbraco/temp-U4-9444
U4-9444 SessionState is not available when rendering macro contents i…
2017-01-30 10:00:40 +01:00
Shannon 30c2f95844 Merge branch 'refs/heads/dev-v7.6' into temp-U4-9310 2017-01-30 16:55:38 +11:00
Shannon a458e7daf0 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6
# Conflicts:
#	build/UmbracoVersion.txt
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
#	src/Umbraco.Web/Umbraco.Web.csproj
2017-01-30 16:55:12 +11:00
Shannon 0078a5d8cc Getting the media picker wired up for udi 2017-01-30 16:54:01 +11:00
Shannon 09085e3bcf Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-U4-9310 2017-01-30 16:52:42 +11:00
Shannon a31b03b3e2 Lazily loads all known UdiType's based on reading through the known constants 2017-01-30 15:59:42 +11:00
Shannon 9d06ce53a4 U4-9444 SessionState is not available when rendering macro contents in the Rich Text Editor 2017-01-30 13:22:47 +11:00
Stephan d0e8e77fc5 Fix FileSystemProviderManagerTests 2017-01-28 10:05:19 +01:00
Stephan d85cb9e15e Fix FileSystemProviderManagerTests 2017-01-28 10:04:43 +01:00
Stephan 798105998e U4-9322 - begin refactoring and fixing events 2017-01-27 18:17:21 +01:00
Shannon 9ef53536bf Updates the base editor models to include a readonly UDI, updates all model mappers to map the UDI, 2017-01-28 01:14:24 +11:00
Shannon 547351a719 Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-U4-9310 2017-01-28 00:25:25 +11:00
Shannon 371c4ae1a3 Starts creating new UDI picker property editors 2017-01-28 00:22:12 +11:00
Shannon 060137c798 Merge remote-tracking branch 'refs/remotes/origin/dev-v7.6' into temp-U4-9310 2017-01-27 23:07:48 +11:00
Stephan f4994a5133 Merge temp-u4-9322 (Shan Events) into temp-u4-9322a (Steph) - builds 2017-01-27 11:42:54 +01:00
Mads Rasmussen 19a4cf774b Merge pull request #1680 from umbraco/temp-U4-9352
Implements CodeFileController
2017-01-27 10:49:07 +01:00
Mads Rasmussen ab00ba8a12 Merge branch 'dev-v7.6' into temp-U4-9352
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js
2017-01-27 10:39:31 +01:00
Claus 57e2a19023 changing parameter name for IGridCellValueConnector.IsConnector. 2017-01-27 10:16:01 +01:00
Claus daa80a7bf6 Merge pull request #1709 from umbraco/temp-U4-9435-2
U4-9435 Fix breaking change made in U4-9312
2017-01-27 09:05:47 +01:00
Shannon 8152e7cb92 Doh, forgot a file change for tests - fixes build 2017-01-27 16:55:29 +11:00
Shannon Deminick adccb4161e Merge pull request #1707 from umbraco/temp-u4-9438
U4-9438 - fix nasty issue with reading properties in VersionableRepos…
2017-01-27 16:52:10 +11:00
Shannon 72a0187295 Writes unit test to confirm the correct property data iteration in GetPropertyCollection 2017-01-27 16:50:44 +11:00
Shannon 24d6287918 Adds string overloads just in case 2017-01-27 16:21:01 +11:00
Shannon 55900a3464 Updates MediaController and MediaTypeController to have the same method signature supporting both INT and GUID with a custom action selector to handle the ambiguity 2017-01-27 16:09:35 +11:00
Sebastiaan Janssen a5a42854ef Bump version to alpha055 2017-01-26 22:02:18 +01:00
Warren Buckley 784c84a166 Merge pull request #1474 from umbraco/temp-U4-8963
U4-8963 Updates for ImageProcessor parameters to support background c…
2017-01-26 20:45:35 +00:00
Sebastiaan Janssen f5d78a4d04 Merge pull request #1708 from umbraco/temp-U4-9440
Fixes: U4-9440 Update the last few Danish translations for template e…
2017-01-26 19:51:54 +01:00
Mads Rasmussen b334e0ccb2 Fixes: U4-9440 Update the last few Danish translations for template editor 2017-01-26 19:45:05 +01:00
Stephan 6bbfb65100 Merge temp-u4-9322 (Shan Events) into temp-u4-9322a (Steph) 2017-01-26 18:30:00 +01:00
Sebastiaan Janssen 0a2e5badd0 Merge branch 'temp-template-editor' into dev-v7.6 2017-01-26 18:27:10 +01:00
Sebastiaan Janssen 90b0bf9d82 Merge branch 'dev-v7.6' into temp-template-editor 2017-01-26 18:26:32 +01:00
Sebastiaan Janssen 6bcd1e44f9 If translation is not done yet, better to leave it English so at least it kind of makes sense 2017-01-26 18:24:56 +01:00
Sebastiaan Janssen 36e9bb4d78 Merge pull request #1705 from umbraco/temp-v758-recyclebin-fix
Fixes U4-9437
2017-01-26 17:31:31 +01:00
Warren Buckley 4c06ead056 Merge pull request #1698 from umbraco/temp-U4-9419
fixes: U4-9419 The new content picker adds picked items in a random o…
2017-01-26 16:21:03 +00:00
Sebastiaan Janssen 639d04381e Bump version 2017-01-26 14:48:19 +01:00
mikkelhm 031340a2ac Adds case for IDictionaryItem when trying to get the Udi from an entity 2017-01-26 13:41:04 +01:00
Warren Buckley 2465eb233e Adds in same workaround as other trees like DataTypes & DocTypes where Folders/Containers set an inline piece of JS that does nothing & returns 2017-01-26 11:32:13 +00:00
Stephan 7f905bce0e U4-9438 - fix nasty issue with reading properties in VersionableRepositoryBase 2017-01-26 11:49:52 +01:00
Niels Hartvig 205ea22daa Fixes U4-9437 2017-01-25 17:34:34 +01:00
Stephan cca3b9032f U4-9322 - cleanup 2017-01-25 14:18:33 +01:00
Stephan 4fc3398e49 U4-9322 - refactor UnitOfWork pattern 2017-01-25 13:34:41 +01:00
Shannon 2d5254e169 Makes ScopedEventManager aware of it's outer manager (if any) so it knows when to raise events (if configured) 2017-01-25 20:17:39 +11:00
Shannon c5033710ca Updates all ambigous event raising when the event finder cannot determine the name based on the args, all tests pass apart from 3 now 2017-01-25 18:44:29 +11:00
Shannon c824d27728 Updates remaining services to use the event manager to emit events correctly 2017-01-25 16:52:32 +11:00
Shannon ac54affa57 Refactor IPublishingStrategy, create IPublishingStrategy2 as a work around, adds EventMessages to IScopeUnitOfWork, ensures all events raised with IPublishingStrategy are done with uow 2017-01-25 16:49:44 +11:00
Shannon f7d7a43720 Fixes BulkInsertRecords to not require a trans , removes inner trans from PermissionRepository, fixes up events in PermissionRepository and MemberGroupRepository, fixes up uow in UserService 2017-01-25 15:15:28 +11:00
Shannon 6028907a02 Fixes up relation service with correct even emitting and no nested uow 2017-01-25 14:45:49 +11:00
Shannon e14ca4f3d0 Fixes up memberservice service with correct even emitting and no nested uow and removes inner transactions in MemberGroupRepository 2017-01-25 14:40:24 +11:00
Claus 501cef665f version bump alpha054 2017-01-24 15:18:31 +01:00
Claus 8b65968ac9 when modifying dependencies after constructing an artifact they should also be ordered correctly. 2017-01-24 15:14:44 +01:00
Claus 16e9bf265d bumping version. 2017-01-24 14:46:20 +01:00
Claus 9bdd080cfb ensuring Udi's are comparable. 2017-01-24 14:38:22 +01:00
Claus a3e7153bca bumping version to alpha052. 2017-01-24 11:38:00 +01:00
Claus 408232c9ac moving over some interfaces that was lost in merge. 2017-01-24 11:11:50 +01:00
Claus 56bc47302c Merge remote-tracking branch 'origin/dev-v7' into dev-v7.6 2017-01-24 09:59:03 +01:00
Claus 417e004b23 Merge pull request #1690 from umbraco/temp-deploy-176
Migrate code from the Deploy project that should be in Umbraco core
2017-01-24 09:53:31 +01:00
Claus b08e38f9ed Merge branch 'dev-v7.6' into temp-deploy-176
Conflicts:
	build/UmbracoVersion.txt
	src/Umbraco.Tests/Umbraco.Tests.csproj
2017-01-24 09:51:59 +01:00
Stephan a97b566065 U4-9422 - complete implementing scoped xml cache 2017-01-24 07:59:46 +01:00
Stephan 26a95a8ca1 U4-9322 - cont. implementing scoped xml cache 2017-01-23 18:03:38 +01:00
Stephan e3308e86f0 U4-9322 - begin implementing scoped xml cache 2017-01-23 18:03:08 +01:00
Warren Buckley c1fcb37642 Adds keys for DA file but appends them with DA to try & make it clear they need some translation love as my Danish is to be desired :) 2017-01-23 16:08:38 +00:00
Warren Buckley 0bba68a7f5 Added keys needed in EN lang files 2017-01-23 16:06:37 +00:00
Warren Buckley 47e4c12395 Adds in translations into the JSON objects we send back from the API as the display name (not the aliases for querying) 2017-01-23 16:04:14 +00:00
Warren Buckley 25822a7564 Fix up orderby translation in view and use our new JSON properties for display the tranlsated value for asc & desc 2017-01-23 16:01:05 +00:00
Warren Buckley 072f0d1520 Adds in some extra propeties on JSON to store localization label for ascending & descending & use correct key for MyWebstie/WebSite Root that was already in lang file 2017-01-23 15:53:18 +00:00
Stephan 1d98507785 TEMP 2017-01-23 15:39:46 +01:00
Shannon 096c3aeec6 started fixing up MemberService but this one is odd.... 2017-01-23 23:56:39 +11:00
Shannon 7ca5c48ae7 Fixes up membergroup service with correct even emitting and no nested uow 2017-01-23 23:30:47 +11:00
Shannon 4a1a216b3c Fixes up macro service with correct even emitting and no nested uow 2017-01-23 23:28:50 +11:00
Shannon f96d6aed9d Fixes up localization service with correct even emitting and no nested uow 2017-01-23 23:25:39 +11:00
Shannon 192aae71a2 Fixes up file service with correct even emitting and no nested uow and fixes up strange thing with RepositoryFactory and stylesheets 2017-01-23 23:21:53 +11:00
Shannon bd8af539b4 Fixes up data type service with correct even emitting and no nested uow 2017-01-23 22:55:16 +11:00
Shannon 479d859a75 Fixes up member type service with correct even emitting and no nested uow 2017-01-23 22:48:52 +11:00
Shannon 1050af5376 Updates ContentTypeService with the correct event emitting and no nested uows 2017-01-23 22:45:45 +11:00
Shannon 82dbfb769e Updated media service with correct usage of emitting events and having non nested uow 2017-01-23 22:29:38 +11:00
Shannon 55eb996c19 Adds a couple needed hack methods, updates ContentService to have the proper event emmitting without any nested uow's and ensuring that readonly uow's are committed. 2017-01-23 22:16:27 +11:00
Shannon ac4de99f30 Initial commit of changing all IsRaisedEventCancelled to use the event manager and inside of a uow 2017-01-23 20:48:51 +11:00
Stephan a3150b7d4e U4-9322 - missing files 2017-01-20 18:33:21 +01:00
Stephan 1701eb2450 u4-9322 - events cleanup 2017-01-20 17:05:22 +01:00
Stephan 20ac21aef2 Merge origin/temp-U4-9322 into temp-u4-9322 2017-01-20 16:51:25 +01:00
Stephan 4ac20de1dd U4-9322 - complete scope repository caches 2017-01-20 16:29:13 +01:00
Stephan 848eaf5e27 U4-9322 - cont. implementing scoped repository caches 2017-01-20 12:08:55 +01:00
Warren Buckley f3e78e990f Fix up failing unit test for the number of Trees found - this has gone down due this test is for implementing interface ITree which is the legacy type of Trees, where the new PartialViews & PartialView Macros now use TreeController 2017-01-20 09:52:23 +00:00
Shannon a6996922b7 Adds more support for auto-finding event names, adds tests to support with examples of how to interrogate queued events 2017-01-20 17:45:46 +11:00
Stephan 434703f4ec U4-9322 - begin implementing scoped repository caches 2017-01-19 19:47:09 +01:00
Warren Buckley 2f7b532209 Adds in code summaries for C# doc generation. Removes unused references & some tidying up (mostly sensible R# suggestions) 2017-01-19 15:43:29 +00:00
Warren Buckley abebb40461 Update some copy/paste typos in code comments 2017-01-19 15:18:12 +00:00
Warren Buckley 3b54db9b49 Update main templat editor to use a localised notification 2017-01-19 15:14:46 +00:00
Warren Buckley 1defc1e0e4 Changed key for saving scripts - as it mentioned 'script view' Whats that?! So changed to more generic file 2017-01-19 15:14:14 +00:00
Warren Buckley a7e626f4a7 Localisation notification message for saving scripts 2017-01-19 15:05:05 +00:00
Warren Buckley 04f6a01196 Forgot to remove the old notification - as was display two 2017-01-19 15:04:36 +00:00
Warren Buckley ef64fbb839 Same change for the partialview editor - to display a localized success notifcation 2017-01-19 15:01:14 +00:00
Warren Buckley 2424a1c04b Adds in localised sucess notification when saving partial view macros 2017-01-19 14:57:23 +00:00
Warren Buckley c8c7de065d Forgot to update the var name in codeFileResource 2017-01-19 14:56:25 +00:00
Warren Buckley 61d71d0552 Update codeFileResource docs 2017-01-19 14:40:10 +00:00
Mads Rasmussen b8734e5eea fixes: U4-9419 The new content picker adds picked items in a random order 2017-01-19 15:11:37 +01:00
Per Ploug eefd13547c More localization of querybuilder 2017-01-19 12:53:39 +01:00
Claus 29d86b8675 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.6 2017-01-19 12:08:23 +01:00
Mads Rasmussen a09755ef7f remove unused code in partial view editor 2017-01-19 11:19:34 +01:00
Niels Hartvig afae06a866 Adds support for icons and encoding of directories for Code files 2017-01-19 10:41:08 +01:00
Warren Buckley 736cf94155 Merge pull request #1687 from umbraco/temp-U4-9354
Fixes: U4-9354 SPIKE Update content picker UI
2017-01-19 09:35:49 +00:00
Mads Rasmussen 86ffd66c8a update danish translations 2017-01-19 09:50:18 +01:00
Niels Hartvig 051af5c48e Wire up the editors and controllers 2017-01-19 09:49:27 +01:00
Niels Hartvig 1fb05fcca7 Merge remote-tracking branch 'refs/remotes/origin/temp-file-editors' into temp-U4-9352 2017-01-19 08:45:23 +01:00
Shannon b51e571803 Adds unit tests and fixes others 2017-01-19 18:25:45 +11:00
Shannon a275567dba Adds equality members to the EventDefinitionBase so they are tracked by their unique id, makes IEventManager disposable and disposes it on scope end. 2017-01-19 17:34:15 +11:00
Shannon 2a95ed3c7a no need for explicit implementation for this since we changed the old one 2017-01-19 17:29:36 +11:00
Shannon 9965aa461a Updates ContentService to raise events all with the EventManager 2017-01-19 17:18:06 +11:00
Shannon 8de8b53039 missing interface implementation 2017-01-19 16:58:10 +11:00
Shannon 27eeb383b4 Updates all repos to use IScopeUnitOfWork 2017-01-19 16:51:39 +11:00
Shannon 4f5347fa4d Creates IEventManager, IEventDefinition uses explicit implementation and 'new' keyword to force already existing uow providers to be IScopeUnitOfWork, creates extensions for the event manager so there's less work to do to wire it all up 2017-01-19 16:31:59 +11:00
Shannon 994f91e496 Creates IScopeUnitOfWork and IScopeUnitOfWorkProvider as internal along with ScopeRepositoryService which all services inherit from, this is maintaining backwards compat too 2017-01-19 15:37:17 +11:00
Stephan 4ab7f768fa U4-9322 - backport repository cache policy changes from v8 2017-01-18 18:48:13 +01:00
Stephan a020a02b26 U4-9322 - more fixes 2017-01-18 17:44:16 +01:00
Mads Rasmussen 49d24dada7 add partial views macros editor 2017-01-18 15:39:08 +01:00
Mads Rasmussen ef9dd6d803 add scripts editor 2017-01-18 15:38:40 +01:00
Stephan ca777b26de U4-9322 - manage isolation levels, cleanup tests 2017-01-18 14:53:24 +01:00
Mads Rasmussen 1fd98dba30 make launch mini editor service return a promise so we can update a node when it is saved 2017-01-18 14:50:51 +01:00
Warren Buckley 40ea54007f Update the usage of GetUrl - to just use the raw string value as opposed to a JSON object. Updated related JS object mock as well 2017-01-18 12:34:58 +00:00
Warren Buckley fc5bf81991 Returns a string as opposed to a Dynamic object - however cannot return a string object from this method as the result is wrapped in quotes hence we use a HttpResponseMessage & StringContent to return a raw string from the API endpoint 2017-01-18 12:33:43 +00:00
Stephan 1f636d05d1 U4-9322 - fix scope leaks 2017-01-18 10:36:11 +01:00
Shannon fd1da492cc fixes range test 2017-01-18 19:18:19 +11:00
Mads Rasmussen 698f0e975a remove option to open media items in mini editor 2017-01-17 23:01:40 +01:00
Mads Rasmussen c6ed4eaff6 only sort lists with more than one item 2017-01-17 21:27:24 +01:00
Mads Rasmussen 2964f9a1c7 clean up redundant code 2017-01-17 20:48:00 +01:00
Mads Rasmussen 4612183b13 fix unit test typo 2017-01-17 19:27:39 +01:00
Mads Rasmussen 4fe12d8930 clean up dependencies in content picker controller 2017-01-17 19:26:00 +01:00
Mads Rasmussen a54f4aeffd added documentation for umb-node-preview component 2017-01-17 19:10:22 +01:00
Stephan 7495cd3f2c U4-9322 - cleanup 2017-01-17 16:46:34 +01:00
Stephan 5f68f26d2f U4-9322 - scope and database, getting tests to run 2017-01-17 16:32:40 +01:00
Mads Rasmussen 01f50a243b translate master template and no macros 2017-01-17 14:13:20 +01:00
Mads Rasmussen 907afa11ad combine "open" end "edit" prevalues into one setting (open in dialog) + remove "show path on hover" setting because it is not used anymore 2017-01-17 11:11:20 +01:00
Shannon a5af5ba1a9 Adds new property to PropertyEditor's to mark them as deprecated so they don't show up in the data type list unless they are already selected 2017-01-17 18:54:50 +11:00
Shannon 44732e5f52 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6
# Conflicts:
#	build/UmbracoVersion.txt
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Core/DatabaseContext.cs
#	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
2017-01-17 18:21:45 +11:00
Shannon 256ebe7c14 bumps version for MyGet 2017-01-17 15:29:58 +11:00
Shannon 038b155aea Fixes constants and internalsvisibleto 2017-01-17 14:42:30 +11:00
Shannon deaa2d939a Moves GridValue to Models 2017-01-17 12:38:54 +11:00
Mads Rasmussen bf4ad25cad remove ng-title 2017-01-16 21:16:31 +01:00
Mads Rasmussen c58957dc7b fix unit tests 2017-01-16 20:52:07 +01:00
Mads Rasmussen 7b616cf719 add a bit padding on the sides 2017-01-16 20:50:56 +01:00
Mads Rasmussen cca0f4c293 clean up 2017-01-16 20:13:43 +01:00
Mads Rasmussen bbe68cc224 better styling of mini editor 2017-01-16 20:13:17 +01:00
Stephan 1261f6b159 U4-9322 - getting tests to run 2017-01-16 19:54:09 +01:00
Niels Hartvig a162f21a70 Fixing missing mapping - let the green build lights appear 2017-01-16 19:49:57 +01:00
Niels Hartvig ace111aefb Adding support for get, save and rename to new Partial View editor 2017-01-16 16:50:22 +01:00
Mads Rasmussen 3bdc2e63ab get url for items + set published/unpublished state 2017-01-16 14:45:50 +01:00
Shannon d24541fce4 second commit of everything that we want to add to core for Deploy, have moved stuff to where they should go, probably need to review if the GridValue should be in models though or if we already have this. 2017-01-16 20:45:08 +11:00
Per Ploug 7a0ac625ff Last remaining dk translation strings
This needs a review by the dynamic writing duo vera and martin.
2017-01-16 10:13:32 +01:00
Mads Rasmussen 198edec4f4 add fallback icons 2017-01-16 10:09:53 +01:00
Shannon d2837b9649 Initial commit of all UDI related things and tests, now to import the remaining items tagged for Core 2017-01-16 20:03:59 +11:00
Niels Hartvig dfe3798aab More merge 2017-01-16 09:59:00 +01:00
Shannon 3ad729824e Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6 2017-01-16 18:08:34 +11:00
Mads Rasmussen 361f5093c7 align width with input fields 2017-01-13 14:42:36 +01:00
Niels Hartvig 975535a9e2 Merge of insert overlay view 2017-01-13 13:33:55 +01:00
Niels Hartvig e7f7631d1e Fixes merge conflicts (needs updated ng-if in insert overlay) 2017-01-13 13:22:43 +01:00
Per Ploug 99f66fe6a3 The danish language files - WIP
The danish language has such elements when used to discusssed
semi-technical-english terms
2017-01-13 13:21:37 +01:00
Per Ploug b413a6eeae English translations 2017-01-13 13:20:49 +01:00
Per Ploug 9b9db23461 Replaces the last static strings with language keys 2017-01-13 13:20:38 +01:00
Mads Rasmussen 4fa36cd424 fine tuning 2017-01-13 13:16:47 +01:00
Mads Rasmussen eba8181d0c use new umb node preview component in member picker 2017-01-13 11:17:28 +01:00
Mads Rasmussen 21714f0eac use new umb node preview component in member group picker 2017-01-13 11:16:59 +01:00
Mads Rasmussen 8e79e15c71 use new umb node preview component in content picker 2017-01-13 11:16:15 +01:00
Mads Rasmussen 0c709d144b move mini editor launch logic to helper service so we can open it without the directive - it is needed for the content picker 2017-01-13 10:40:03 +01:00
Mads Rasmussen 4e7d2f668b add node preview component 2017-01-13 10:26:43 +01:00
Stephan 5446e4b0fc U4-9322 - IScopeProviderInternal 2017-01-12 19:32:44 +01:00
Stephan 79c2400d27 U4-9322 - scope 2017-01-12 18:28:25 +01:00
Warren Buckley 5041a459d4 Merge pull request #1681 from umbraco/temp-template-editor
Temp template editor
2017-01-12 15:56:08 +00:00
Mads Rasmussen 04f79ffaf1 lazy load ace editor source file - change to an isolated scope and don't rely on ngModel to get it working 2017-01-12 15:31:21 +01:00
Per Ploug 32abebd0a0 Main template editor translated 2017-01-12 11:33:31 +01:00
Mads Rasmussen 34b06dc350 update docs for template resource 2017-01-12 11:07:37 +01:00
Mads Rasmussen 16d8c55fa7 tree picker search only works for content, media and members so hide for everything else 2017-01-12 10:11:03 +01:00
Per Ploug 2085063231 Fixes issue with creating template below a parent template 2017-01-12 10:07:44 +01:00
Per Ploug 73f77df5ad Ensures VirtualPath is reset if a template alias is changed 2017-01-12 09:47:42 +01:00
Shannon 8a11b0f7a8 publisizes a constant (moves it to where it should be), publicizes another required class for deploy, bumps version 2017-01-12 17:33:30 +11:00
Shannon 5a2836eb6d bumps version 2017-01-12 13:45:17 +11:00
Shannon cfd8d39878 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6
# Conflicts:
#	build/NuSpecs/UmbracoCms.nuspec
#	src/Umbraco.Tests/Umbraco.Tests.csproj
2017-01-12 13:39:15 +11:00
Mads Rasmussen e8e0b10559 fix issue with inserting partials from folders 2017-01-11 14:26:56 +01:00
Mads Rasmussen 98279052e6 remove lorem ipsum from the sections dialog 2017-01-11 10:07:43 +01:00
Per Ploug 0b7f60c0f8 Fixes to issues with query generation
Ensures its typed content and children is called as a method
2017-01-10 16:55:30 +01:00
Per Ploug d563eb07a2 Adds .FirstChild(string alias) extension to Model.Content 2017-01-10 16:55:03 +01:00
Per Ploug f036bc90c3 Fixes failing mapper test 2017-01-10 16:54:46 +01:00
Mads Rasmussen 23304aca0b add unit tests for template helper 2017-01-10 15:16:16 +01:00
Mads Rasmussen 845dd4673c Add client side file for partial view editor 2017-01-10 15:15:56 +01:00
Niels Hartvig 14e402878a Merge conflict fixes 2017-01-10 14:49:19 +01:00
Niels Hartvig 5a2687d520 Merge of temp-template-editor 2017-01-10 14:47:33 +01:00
Claus 905eed518f Merge pull request #1677 from umbraco/temp-deploy-102
deploy-102 - guid the relation types
2017-01-10 14:08:46 +01:00
Mads Rasmussen c46f38c73b Merge pull request #1673 from umbraco/temp-U4-9324
Fixes: U4-9324 New template editor is lacking all validation (both client side and server side)
2017-01-10 12:23:35 +01:00
Mads Rasmussen 9718324e6e add check for master not being equal to template 2017-01-10 12:22:18 +01:00
Mads Rasmussen 4c461a733b remove inline validation on name 2017-01-10 12:16:12 +01:00
Mads Rasmussen 82ab7c4a01 Merge branch 'temp-template-editor' into temp-U4-9324
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js
2017-01-10 11:52:03 +01:00
Shannon 77d47f0b28 fixes error with server side validation + data tyep editor, ensures template controller and data type controller inherit from BackOfficeNotificationsController, ensures BackOfficeNotificationsController is attributed with PrefixlessBodyModelValidator 2017-01-10 12:29:30 +11:00
Shannon d66c57cfd0 Ensures that the Name field shows validation correctly with server side validation - needs Mads to verify this is ok. 2017-01-10 12:05:48 +11:00
Niels Hartvig 4c330c8654 Implements CodeFileController 2017-01-09 22:54:28 +01:00
Stephan 2074affd5e Merge branch 'dev-v7.6' into temp-deploy-102 2017-01-09 17:50:29 +01:00
Stephan 17c9d19ebb deploy-150 - wire GetSize in services 2017-01-09 17:50:06 +01:00
Stephan cfd8435d68 deploy-150 - wire GetSize in services 2017-01-09 17:49:12 +01:00
Stephan 844d6c9972 Merge branch 'dev-v7.6' into temp-deploy-102 2017-01-09 15:35:54 +01:00
Stephan 5e6f1a92ca Merge branch origin/dev-v7 into dev-v7.6 2017-01-09 15:31:41 +01:00
Warren Buckley b2815d5e63 Remove commented code 2017-01-09 13:34:20 +00:00
Warren Buckley 5b88c57d94 Replace RequiredForPersistance with Required 2017-01-09 13:05:20 +00:00
Stephan 7ebf51abb7 deploy-102 - guid the relation types 2017-01-05 14:58:05 +01:00
Per Ploug 12e48d069b Fixes issue with DateTime values and strongly typed queries 2017-01-05 11:34:38 +01:00
Sebastiaan Janssen 770f96b6d5 Merge branch 'dev-v7' into dev-v7.6
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
2017-01-05 09:47:51 +01:00
Per Ploug dbdb1cbd06 Merge branch 'temp-template-editor' of https://github.com/umbraco/Umbraco-CMS into temp-template-editor 2017-01-05 08:45:28 +01:00
Per Ploug 8b479b57e5 Change query condition from name to alias 2017-01-05 08:45:04 +01:00
Warren Buckley 663b0f3931 Merge pull request #1674 from umbraco/temp-U4-9338
fixes: U4-9338 Add focus to code editor on load and after closing dia…
2017-01-04 15:17:13 +00:00
Warren Buckley 1300764770 Adding in server side validation - but need to clarify that this is the 'right' way to do it that wires up correctly/magically back to the UI components 2017-01-04 14:12:45 +00:00
Mads Rasmussen 18d8223d7e fixes: U4-9338 Add focus to code editor on load and after closing dialogs 2017-01-04 13:04:48 +01:00
Warren Buckley 1a215f3176 Merge pull request #1648 from umbraco/temp-U4-9273
Fixes: U4-9273 Add date picker to query builder
2017-01-04 11:16:10 +00:00
Mads Rasmussen 42841824bf add client side validation 2017-01-04 11:31:46 +01:00
Mads Rasmussen ddad642a88 fix callbacks 2017-01-04 10:45:40 +01:00
Mads Rasmussen 339957bd91 remove unnecessary dependencies 2017-01-04 10:43:56 +01:00
Per Ploug 051801f337 Couple of copy updates for the render section 2017-01-03 13:10:54 +01:00
Claus d866f1d74a Merge branch 'dev-v7' into dev-v7.6 2017-01-03 11:58:23 +01:00
Stephan d8b70d79e8 Version 7.6.0-alpha044 on MyGet 2017-01-03 09:29:22 +01:00
Shannon Deminick 46922dd259 Merge pull request #1664 from umbraco/temp-U4-9328
Fixes: U4-9328 UI: It shouldn’t be possible to select the current tem…
2017-01-03 14:41:28 +11:00
Shannon Deminick e2adb25da0 Merge pull request #1665 from umbraco/temp-U4-9325
fixes: U4-9325 New template editor stays in a $dirty state if you cha…
2017-01-03 14:38:30 +11:00
Shannon 6b038186be Fixes SignalR registration, the mapping was registered in the wrong place and too early so security was not working, bumps version for MyGet 2017-01-03 13:11:05 +11:00
Shannon 95187becaf bumps to next alpha for MyGet 2017-01-03 11:50:29 +11:00
Shannon 790e30defd Simplifies all creation of UrlHelper, creates GetUmbracoApiServiceBaseUrl extensions for WebApi 2017-01-03 11:13:38 +11:00
Mads Rasmussen 5146658e0f fixes: U4-9325 New template editor stays in a $dirty state if you change and then save 2017-01-02 13:03:15 +01:00
Mads Rasmussen dece680221 Fixes: U4-9328 UI: It shouldn’t be possible to select the current template or the selected master template in the master template picker. 2016-12-30 11:36:20 +01:00
Mads Rasmussen 48ee9d6b0e Merge pull request #1663 from umbraco/temp-U4-9274
fixes: U4-9274 Master template is not saved
2016-12-30 10:53:10 +01:00
Shannon ee925692e5 Bumps version to put on MyGet 2016-12-30 16:06:40 +11:00
Shannon 0832220d61 publicizes some APIs needed for Deploy 2016-12-30 12:07:03 +11:00
Shannon 3e82a48f4d Fixes tree syncing and fixes server side code to reset the master template if it's cleared 2016-12-30 11:38:27 +11:00
Shannon bd448ef05a U4-9326 Removing a master template from a Template does not update the Template's path correctly 2016-12-30 11:27:55 +11:00
Mads Rasmussen 82efa14b7a add UI to remove master template 2016-12-29 13:50:57 +01:00
Mads Rasmussen 61f25edafc sync tree 2016-12-29 13:50:11 +01:00
Shannon 436875e8ec fixes null check with setting master template 2016-12-29 14:02:15 +11:00
Shannon ac087a87d3 Merge branch 'refs/heads/dev-v7.6' into temp-template-editor 2016-12-29 13:58:14 +11:00
Shannon 903ce09426 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7.6
# Conflicts:
#	build/UmbracoVersion.txt
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoVersion.cs
#	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
2016-12-29 13:57:55 +11:00
Shannon 02dc510078 Merge branch 'refs/heads/dev-v7.6' into temp-template-editor 2016-12-29 13:56:11 +11:00
Shannon ffefe417db bumps version 2016-12-29 12:23:30 +11:00
Per Ploug 00adffc8b3 Merge remote-tracking branch 'origin/temp-template-editor' into temp-template-editor
# Conflicts:
#	src/Umbraco.Web/Editors/TemplateQueryController.cs
#	src/Umbraco.Web/Models/TemplateQuery/QueryCondition.cs
2016-12-29 02:16:58 +01:00
Per Ploug 2ec3278637 Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into temp-template-editor 2016-12-29 01:51:10 +01:00
Per Ploug 1f52a0c186 Changes the querybuilder to use the correct Where syntax 2016-12-29 01:50:43 +01:00
Shannon 40f7d820a6 publicizes a few APIs and adds more API docs 2016-12-29 11:36:39 +11:00
mikkelhm 19f7e6bd88 When Querying we need to use the Alias to search for, in stead of the name, this is due to names like "Created Date" and "Last Updated Date", who has aliases like "CreateDate", and "UpdateDate" 2016-12-28 14:07:22 +01:00
mikkelhm dea3553885 Change back to using CurrentPage.Site() when queuing with the Query Builder, as Model.Content.Site(), doesnt support the queries the Query Builder creates 2016-12-28 14:04:40 +01:00
Shannon d83d23803a fixes build 2016-12-28 19:11:45 +11:00
Shannon fae5dd517e bumps version to next alpha 2016-12-28 18:57:25 +11:00
Shannon 247c96ac6e makes public the MigrationBase.Context property 2016-12-28 17:22:36 +11:00
Shannon Deminick 360e06bbc5 Merge pull request #1660 from umbraco/deploy-157
deploy-157 - simplify tables creation in migrations
2016-12-28 15:51:04 +11:00
Stephan ef48baf7ae deploy-157 - simplify tables creation in migrations 2016-12-23 10:31:14 +01:00
Shannon 8e06a88a2c bumps version, publicizes method 2016-12-23 14:52:18 +11:00
Shannon Deminick 6898d9b270 Merge pull request #1657 from umbraco/temp-u4-9250
U4-9250 - Guid all the Macros
2016-12-23 10:24:12 +11:00
Shannon 0aa8a5c243 more whitespace fixing 2016-12-23 09:41:23 +11:00
Shannon c5326fc5c9 fixes whitespace in version file 2016-12-23 09:31:54 +11:00
Stephan 9431e878f3 Version 7.6.0-alpha035 2016-12-22 11:34:33 +01:00
Stephan 3ac71a37e8 U4-9250 - add more tests 2016-12-22 11:24:01 +01:00
Stephan 0ac5e0daf4 U4-9250 - rename GetAllAll method - yea that was bad 2016-12-22 11:14:09 +01:00
Stephan f3a7ada586 U4-9250 - add keys to ctors 2016-12-22 11:10:45 +01:00
Mads Rasmussen d835008c67 Fixes: U4-9275 Show correct render section in “Sections” dialog 2016-12-22 10:57:07 +01:00
Shannon bd4f3ad0d9 bumps umb version so the build works. 2016-12-22 18:44:47 +11:00
Shannon 8083edddb9 Adds check to DetermineInstalledVersion to detect if it's 7.6 based on the new DB changes 2016-12-22 16:36:25 +11:00
Shannon 886942c4e8 Updated MacroServiceTests to include testing for the Key 2016-12-22 15:24:54 +11:00
Stephan 7576c8138e U4-9250 - fix tests 2016-12-21 16:47:32 +01:00
Mads Rasmussen 296adf70b4 remove lorem ipsum 2016-12-21 16:15:26 +01:00
Stephan b3a6c70ae7 U4-9250 - revert some changes 2016-12-21 15:34:17 +01:00
Stephan ef28173511 U4-9250 - fixes 2016-12-21 15:23:23 +01:00
Stephan b25cb9995f U4-9250 - Guid the IMacroService 2016-12-21 15:23:22 +01:00
Stephan 38e8e1cf9c U4-9250 - fix migration 2016-12-21 15:23:22 +01:00
Stephan f25641b2a7 U4-9250 - Guid all the Macros 2016-12-21 15:23:22 +01:00
Mads Rasmussen 4101a1cb17 add umbraco version number to umbdatepicker docs 2016-12-21 14:04:59 +01:00
Mads Rasmussen 4911c2718c add better spacing between filters 2016-12-21 13:51:01 +01:00
Mads Rasmussen aa5ad746eb fix issue with date not updating properly 2016-12-21 13:00:45 +01:00
Sebastiaan Janssen c88ee55e8d Merge pull request #1656 from umbraco/temp-u4-9240
U4-9240 - kill umbracoDeployChecksum
2016-12-21 09:14:10 +01:00
Stephan 01340e0316 U4-9240 - kill umbracoDeployChecksum 2016-12-20 11:26:34 +01:00
Mads Rasmussen 219f855d86 remove unused then from promise 2016-12-15 14:57:06 +01:00
Mads Rasmussen 46c4f9d3a1 add support for hide, show and update events 2016-12-15 14:39:40 +01:00
Per Ploug 17011a1e76 Fixes issue with saving master 2016-12-15 13:55:59 +01:00
Per Ploug 9ceb5305d5 Enables sections to wrapped around selected code 2016-12-15 13:55:45 +01:00
Per Ploug c8a92434af Fixes issue with inserting macros + updates the dialog ui 2016-12-15 13:55:26 +01:00
Per Ploug 9aea19cee5 Updates copy in dialogs 2016-12-15 13:54:54 +01:00
Per Ploug 0c0c60b83f Fixes: U4-9276 update copy in insert dialog 2016-12-15 09:28:48 +01:00
Mads Rasmussen df10358088 Fix weird looking save and publish button group in content section 2016-12-13 11:53:41 +01:00
Mads Rasmussen 7cbfe01c0b use umbDateTimePicker component in query builder 2016-12-13 10:58:24 +01:00
Stephan 4863052a08 Revert "deploy-11 - implement DeployVersionAttribute"
This reverts commit f51a086137.
2016-12-13 10:58:19 +01:00
Mads Rasmussen e97e8caab8 add umbDateTimePicker component 2016-12-13 10:57:19 +01:00
Stephan cb09681cb0 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.6 2016-12-13 10:36:33 +01:00
Stephan b9b7c9f965 More database fixing (sqlCE) 2016-12-13 10:35:37 +01:00
Emil Wangaa 5936f72263 Merge pull request #1643 from umbraco/temp-u4-9249
U4-9249 - fix member type standard properties
2016-12-07 12:25:01 +01:00
Stephan ba27c7e8e8 U4-9249 - fix member type standard properties 2016-12-06 15:46:17 +01:00
Stephan 44b90bd4f3 Merge branch 'dev-v7.6' into temp-u4-7318 2016-12-05 17:08:19 +01:00
Stephan b4ef37a61a More database fixing 2016-12-05 16:39:20 +01:00
Jeavon 3e558af18f Merge branch 'dev-v7' into temp-u4-7318 2016-12-05 12:21:02 +00:00
Jeavon 3774d4fc62 Adding comments to the Slider, Tags & Multiple Media picker values converters about the need to cache the prevalues 2016-12-05 12:16:43 +00:00
Jeavon a24acdb8ce Added value converter for the slider property editor and and Range class to be returned when range mode is enabled 2016-12-05 12:13:47 +00:00
Stephan 6c4185dc01 Version 7.6.0-alpha032 2016-12-05 12:13:11 +01:00
Stephan f51a086137 deploy-11 - implement DeployVersionAttribute 2016-12-05 11:58:17 +01:00
Jeavon f91d5b53c1 Added a basic value converter for the tags property editor 2016-12-05 10:58:09 +00:00
Stephan b8ff4a5906 Merge remote-tracking branch 'origin/dev-v7' into dev-v7.6 2016-12-05 11:58:00 +01:00
Stephan f79e63a13b Fix background-thread-safe database usage 2016-12-02 18:15:42 +01:00
Stephan b0aae7248c Import DatabaseDebugHelper (disabled) 2016-12-02 18:15:16 +01:00
Stephan 467b12491c Merge dev-v7 into dev-v7.6 2016-12-02 12:01:31 +01:00
Mads Rasmussen 286907b89e fix unit tests 2016-11-30 12:13:04 +01:00
Mads Rasmussen bd0c1cd932 clean up umb-era-button + add button style to template editor buttons 2016-11-30 10:38:04 +01:00
Mads Rasmussen daaa2bf911 replace yellow buttons in query builder with blue 2016-11-29 15:24:02 +01:00
Stephan bdb6b48e3f Merge remote-tracking branch 'origin/dev-v7' into dev-v7.6 2016-11-28 13:08:22 +01:00
Stephan f97bc0fbb6 Merge origin/dev-v7 into dev-v7.6 2016-11-28 12:57:20 +01:00
Stephan f7aee1c12f Version 7.6.0-alpha031 2016-11-28 12:49:55 +01:00
Stephan 48dbd5c570 Ensure CacheRefresherEventHandler triggers first 2016-11-28 11:00:58 +01:00
Sebastiaan Janssen 51397d7c28 Merge branch 'dev-v7' into dev-v7.6 2016-11-28 10:49:37 +01:00
Shannon Deminick 69a8cb71ea Merge pull request #1628 from umbraco/temp-u4-9201
temp-u4-9201
2016-11-28 10:42:37 +01:00
Stephan 184a01b64d U4-9201 - fixes 2016-11-28 10:09:45 +01:00
Stephan 0689bf4f31 U4-9201 - fix it all 2016-11-23 15:26:41 +01:00
Stephan 3300dbbe5e Merge branch 'dev-v7.6' into temp-u4-9201 2016-11-23 11:56:53 +01:00
Stephan 5784ea96e7 UnRevert "Backport SafeCallContext, DefaultDatabaseFactory fixes from 7.6"
This reverts commit 8ba6cb3abf.
2016-11-23 11:26:30 +01:00
Stephan a77763ee89 Merge origin/dev-v7 into dev-v7.6 2016-11-23 11:03:52 +01:00
Stephan ef409298e8 Merge branch 'dev-v7.6' into temp-u4-9201 2016-11-18 15:23:47 +01:00
Stephan bad0d15c1c U4-9201 - troubleshoot 2016-11-18 13:32:56 +01:00
Stephan 35aac2cdec Merge origin/dev-v7 into dev-v7.6 2016-11-18 09:52:45 +01:00
Stephan 6101b4edde U4-9201 - use UsingSafeDatabase where appropriate 2016-11-18 09:43:10 +01:00
Stephan 13ed3757da U4-9201 - properly manage database instances 2016-11-18 09:43:10 +01:00
Stephan d086244820 U4-9201 - expose PetaPoco Database type + dispose 2016-11-18 09:43:00 +01:00
Mads Rasmussen 597a10fc5d small fixes to overlay buttons + insert order 2016-11-17 10:33:15 +01:00
Mads Rasmussen 1a80e94bca clean up insert field overlay 2016-11-17 09:31:35 +01:00
Stephan 27eaa8d4af Inject filesystems into partial repositories 2016-11-16 15:19:15 +01:00
Shannon Deminick e0eb8473ee Merge pull request #1454 from umbraco/dev-v7-deploy
U4-8909 - Merge dev-v7-deploy into dev-v7
2016-11-16 13:06:41 +01:00
Mads Rasmussen 6c5d2c8057 fix header 2016-11-16 12:22:03 +01:00
Mads Rasmussen c3fc21a2b3 remove organise overlay 2016-11-16 12:21:52 +01:00
Mads Rasmussen 2596043a94 restructure organize overlay so master template picker is available in the editor and sections are in their own dialog 2016-11-16 11:19:57 +01:00
Stephan 7ea156d422 IEventMessagesFactory without HttpContext 2016-11-16 09:57:24 +01:00
Stephan 28fe2f7d22 Merge remote-tracking branch 'origin/dev-v7' into dev-v7-deploy 2016-11-15 18:43:14 +01:00
Stephan 0478f01113 Fix merge 2016-11-15 14:08:30 +01:00
Stephan ddf29c5875 Merge dev-v7.6 into dev-v7-deploy 2016-11-15 13:59:19 +01:00
Stephan ad82270dcc Merge branch origin/dev-v7 into dev-v7.6 2016-11-15 13:48:01 +01:00
Stephan 6c8a033a56 Fix build.bat 2016-11-15 13:46:49 +01:00
Mads Rasmussen 44ff0e16e6 add titles in insert dialog 2016-11-15 09:43:58 +01:00
Mads Rasmussen c00120bb9a set font size to 14px 2016-11-15 09:43:28 +01:00
Stephan d800a4198d fix meh 2016-11-15 09:14:55 +01:00
Mads Rasmussen 1f3d305a55 remove $scope watch 2016-11-14 20:20:03 +01:00
Mads Rasmussen addad5b7dc fix http request 2016-11-14 19:57:55 +01:00
Mads Rasmussen 22204a62d4 move http requests to resource file 2016-11-14 19:22:49 +01:00
Stephan 9d2fb0dd03 Fix after merges 2016-11-14 19:01:44 +01:00
Stephan 2b9ffdb6b9 Merge branch origin/dev-v7 into dev-v7-deploy 2016-11-14 18:53:53 +01:00
Sebastiaan Janssen 0439e5782e Merge pull request #1542 from umbraco/temp-u4-9115
U4-9115 - move locks to umbracoLocks table
2016-11-14 16:18:48 +01:00
Sebastiaan Janssen 740abb1426 We don't support C# 6 yet 2016-11-14 16:18:20 +01:00
Stephan df12f19c53 U4-9115 - fix issue 2016-11-14 16:08:21 +01:00
Mads Rasmussen 9470892118 query builder overlay: use overlay directive instead of dialogservice to open contentPicker 2016-11-14 13:21:42 +01:00
Mads Rasmussen 91b925f95c change white-space on pre elements so line wraps 2016-11-14 13:07:26 +01:00
Mads Rasmussen b3e9617aff query builder overlay first refactor: use controllerAs syntax + move css to .less file instead of inline + fix indention 2016-11-14 13:06:45 +01:00
Mads Rasmussen d7aeae3d26 bind open partial view overlay function to view model 2016-11-14 11:16:53 +01:00
Mads Rasmussen f6d8a980a6 Merge branch 'dev-v7' into temp-template-editor
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/belle.less
#	src/Umbraco.Web.UI.Client/src/views/components/editor/umb-editor-header.html
#	src/Umbraco.Web/Umbraco.Web.csproj
2016-11-14 11:04:15 +01:00
Stephan 8fa1499a2f Merge origin/dev-v7 into dev-v7-deploy 2016-11-04 12:18:39 +01:00
Stephan 74e0a4d999 7.6 merge review fixes 2016-11-03 19:20:42 +01:00
Jeavon c053adc9b2 Move the Upload editor value converter from Lars to Core from Web 2016-11-03 17:06:26 +00:00
Jeavon e3bc588164 Merge pull request #1555 from lars-erik/temp-u4-7318
Added converter for upload field
2016-11-03 17:01:58 +00:00
Jeavon 392319d26c Adding check for converter enablement to James's converters that need it 2016-11-03 16:43:23 +00:00
Jeavon 584638977c Merge pull request #1570 from jamescoxhead/U4-7318
U4-7318 Core property value converters
2016-11-03 15:08:29 +00:00
Jeavon be8632db1c Adding EnablePropertyValueConverters setting to umbracoSettings.config so that all the new converters can be disabled.
Readded existing JArray converter for RelatedLinks but renamed to LegacyRelatedLinksEditorValueConvertor
2016-11-03 13:30:41 +00:00
Jeavon 094514b91a Merge branch 'dev-v7' into temp-u4-7318
# Conflicts:
#	src/Umbraco.Web/Umbraco.Web.csproj
2016-11-03 11:31:42 +00:00
James Coxhead 3c43f4f3c5 Added member picker value converter 2016-11-02 23:37:32 +00:00
James Coxhead 12f9392db9 Added user picker value converter 2016-11-02 21:52:27 +00:00
James Coxhead d787cb6ad9 Added radio button list converter 2016-11-02 21:35:42 +00:00
James Coxhead db02c3b73c Added member group picker value converter 2016-11-02 21:26:41 +00:00
James Coxhead a10214d82b Added dropdown with keys value converter 2016-11-01 23:53:55 +00:00
James Coxhead bc61054931 Added dropdown list value converter 2016-11-01 23:46:32 +00:00
James Coxhead 0becdccb68 Added dropdown list multiple with keys value converter 2016-11-01 23:38:05 +00:00
James Coxhead cee92518ea Added dropdown list multiple value converter 2016-11-01 21:44:17 +00:00
James Coxhead a34a8e180d Added checkbox list converter 2016-10-29 23:32:56 +01:00
James Coxhead f9f48753de Updated colour picker converter to return string 2016-10-29 22:51:36 +01:00
James Coxhead c9af13df78 Added email address converter 2016-10-29 22:45:48 +01:00
Lars-Erik Aabech f66b456d7c Added converter for upload field 2016-10-29 09:44:45 +02:00
Stephan c58cffe4a2 Add tests for locks 2016-10-25 10:38:38 +02:00
Stephan 95af144ae9 Migrate locks to their own umbracoLocks table 2016-10-25 10:38:05 +02:00
Stephan 1aade7c27c Version 7.6.0-alpha028 2016-10-20 13:30:52 +02:00
Stephan e8538cc035 Merge remote-tracking branch 'origin/dev-v7' into dev-v7-deploy 2016-10-20 12:23:22 +02:00
Stephan 65ef97d9ba deploy-91 - make MediaExtensions public (why not) 2016-10-20 12:04:30 +02:00
Stephan 20fc78419e Refactor / fix SignalR integration, add nuspec dependency 2016-10-19 15:07:48 +02:00
Stephan dda988f0ea Merge remote-tracking branch 'origin/dev-v7' into dev-v7-deploy 2016-10-18 12:25:31 +02:00
Stephan ac42c8ae26 Fix 2eb050e, broke Xslt edit 2016-10-17 14:06:08 +02:00
Stephan c5c974e996 Merge branch 'dev-v7' into dev-v7.6 2016-10-17 11:21:19 +02:00
Claus a6948d492a Merge remote-tracking branch 'origin/dev-v7' into dev-v7-deploy 2016-10-06 13:17:43 +02:00
Shannon b3e6f0fd22 Merge branch 'refs/heads/dev-v7' into dev-v7-deploy
# Conflicts:
#	src/Umbraco.Core/IO/FileSystemExtensions.cs
2016-10-06 10:35:45 +02:00
Stephan ca60b1e24d More BackgroundTaskRunner troubleshooting 2016-10-05 15:07:47 +02:00
Stephan a279be1b47 Build TLC 2016-10-05 14:35:44 +02:00
Stephan 198fff508d Version 7.6.0-alpha027 2016-10-05 09:57:45 +02:00
Stephan 3fd918d381 Refacetor BackgroundTaskRunner, fix async issues 2016-10-04 14:12:06 +02:00
Stephan 35c7fb60fd Refactor BackgroundTaskRunner, support cancellation of current task 2016-10-03 15:15:51 +02:00
Stephan 79623a8a67 Fix BackgroundTaskRunner for tests without an app context 2016-09-29 16:04:27 +02:00
Per Ploug d34dcb0b27 Load template editor correct without massive ace deps 2016-09-29 13:26:25 +02:00
Stephan 37d8b71d5d Version 7.6.0-alpha021 2016-09-29 11:13:42 +02:00
Stephan 81f44024f7 Publicize ImageHelper 2016-09-29 09:06:47 +02:00
Stephan e477c8b0b3 Merge branch origin/dev-v7 into dev-v7-deploy 2016-09-29 09:03:56 +02:00
Stephan 76461e866b Version 7.6.0-alpha020 2016-09-23 17:25:53 +02:00
Stephan 3f22e727f6 Some things need to be public/adjusted for Deploy 2016-09-23 16:42:42 +02:00
Stephan c606314c0f Remove InternalsVisibleTo Umbraco.Deploy 2016-09-23 13:55:27 +02:00
Stephan 37e12cd0be Fix unit tests interferences 2016-09-22 22:18:05 +02:00
Stephan b063928732 Version 7.6.0-alpha0016 2016-09-22 21:46:23 +02:00
Stephan 111a3ca6ac Refactor Shadow FileSystems 2016-09-22 21:45:59 +02:00
Stephan 7176c99264 Merge branch origin/dev-v7 into dev-v7-deploy 2016-09-21 16:03:17 +02:00
Stephan 30c32da5e6 Version 7.6.0-alpha014 2016-09-21 16:02:32 +02:00
Stephan 23608ca70c Merge branch 'dev-v7-deploy' of https://github.com/umbraco/Umbraco-CMS into dev-v7-deploy 2016-09-21 12:40:44 +02:00
Stephan 3ab01a2164 Implement shadow filesystems, IFileSystem2.GetSize 2016-09-21 12:40:29 +02:00
Claus d9e608329d removing a using statement. 2016-09-21 12:30:33 +02:00
Claus 367ad70be7 adding signalr to core. 2016-09-21 12:27:32 +02:00
Stephan e868a57979 Fix TemplateRepository so it initializes VirtualPath 2016-09-16 13:31:34 +02:00
Stephan ab3b04c165 Fix SqlHelper so it uses to current db connection 2016-09-15 12:14:25 +02:00
Stephan 5cd7cba4fb Fix content repo to respect dates if forced 2016-09-13 19:48:38 +02:00
Stephan 6b0377bb71 Cleanup SafeCallContext 2016-09-13 10:14:27 +02:00
Stephan 1589f9105c Bugfix SafeCallContext 2016-09-13 08:33:04 +02:00
Stephan 597b9bbfcb Introduce SafeCallContext to fix breaking test
(wondering if using logical call context a breaking change)
2016-09-13 08:01:45 +02:00
Stephan d84cfe001f Merge branch origin/dev-v7.6 into dev-v7-deploy 2016-09-12 14:07:02 +02:00
Stephan 6cccf84043 Merge branch 'dev-v7' into dev-v7.6 2016-09-12 14:03:41 +02:00
Claus abfa20ec31 Merge pull request #1475 from umbraco/temp-U4-8965
U4-8965 Updates for ImageProcessor parameters to support new crop mod…
2016-09-12 14:03:25 +02:00
Claus b40a1fa613 U4-8963 Updates for ImageProcessor parameters to support background color 2016-09-12 12:47:12 +02:00
Claus 3f65ec3318 fileservice getting and setting xslt file content. 2016-09-09 13:36:34 +02:00
Claus b67855b7a3 xslt file repository and methods for getting xslt files in FileService. 2016-09-09 13:33:14 +02:00
Claus 0299de4fdd adding in stream methods for partial views. 2016-09-09 13:31:43 +02:00
Claus ba09e945f0 changes to partialview repositories initialization.
adding methods for getting/setting partialview macro files.
2016-09-09 13:28:30 +02:00
Claus 2eb050e663 removing a checkbox that didnt do anything at all. 2016-09-09 12:49:08 +02:00
Claus 7499c9a19c fixing typos and a rename. 2016-09-09 11:09:42 +02:00
Stephan e309afa1a0 Merge branch 'dev-v7-deploy' of https://github.com/umbraco/Umbraco-CMS into dev-v7-deploy 2016-09-09 09:28:46 +02:00
Stephan 5d71df36bd Fix Entity to respect dates if forced 2016-09-09 09:28:25 +02:00
Claus 7be76f10d6 accessing file streams for ScriptRepository and StylesheetRepository.
changed naming of existing file service methods to conform.
2016-09-09 09:26:29 +02:00
Stephan 22a62421f0 Merge branch origin/dev-v7 into dev-v7-deploy 2016-09-08 16:58:57 +02:00
Stephan be3032192a Add WhereAnyIn sql extension 2016-09-08 15:23:48 +02:00
Stephan 37dc9989c4 Fix DefaultDatabaseFactory non-http instance 2016-09-08 15:23:28 +02:00
Stephan eb7a0cb85d U4-8954 - fix WhereIn issue with non-value-types 2016-09-08 10:40:36 +02:00
Stephan 36188f00b0 Fix exceptions (more explicit) 2016-09-07 13:24:49 +02:00
Arnold Visser ca1f43d048 Merge pull request #1 from ArnoldV/Dutch-Language-Update
Dutch Languagefile Update
2016-09-06 10:53:49 +02:00
Arnold Visser e962a48138 Dutch Languagefile Update
This updates the Dutch language file with new/missing translations and fixes some wrong translations used by the grid.
2016-09-06 10:53:09 +02:00
Stephan 3fc76f61d0 MainDom - fixing application identifier 2016-09-05 12:33:26 +02:00
Stephan 0e7ac68c24 Deploy - clear dashboard.config 2016-09-01 16:52:12 +02:00
Stephan 0d3a413708 Merge remote-tracking branch 'origin/dev-v7' into dev-v7-deploy 2016-09-01 16:01:03 +02:00
Stephan 41fafaf7ae Merge branch origin/dev-v7 into dev-v7-deploy 2016-08-26 13:20:53 +02:00
Stephan 0789295701 Temp - 7.6.0-alpha003 - even with internals visible to, need IBackgroundTask to be public 2016-08-24 10:11:38 +02:00
Stephan bb81298e84 Temp - 7.6.0-alpha002 + internals visible to deploy 2016-08-23 09:40:02 +02:00
Stephan bd6e2477b5 Post-merge 2016-08-18 13:02:52 +02:00
Stephan acae05d287 Merge branch origin/dev-v7 into dev-v7-deploy 2016-08-18 12:38:38 +02:00
Jeavon 6d722c5591 Merge branch 'temp-u4-7318' of https://github.com/umbraco/Umbraco-CMS into temp-u4-7318 2016-08-17 10:24:28 +01:00
Jeavon 9ed9aef1d3 Merge branch 'dev-v7' into temp-u4-7318
# Conflicts:
#	src/Umbraco.Web/Umbraco.Web.csproj
2016-08-17 10:16:05 +01:00
Stephan 0cc398130d Merge pull request #1311 from Jeavon/temp-u4-7318
U4-7318 - Initial import of core value converters for Stephan
2016-08-16 15:29:17 +02:00
Jeavon 927f48985e Latest updates from Core Value Converters package including massive simplification of RelatedLinks and exclusion of special property aliases in MNTP 2016-08-03 20:45:01 +01:00
Jeavon 3b31b92f1f Adding a type converter for RelatedLinks so that implementations using JArray (from official docs) still work (e.g. Model.Content.GetPropertyValue<JArray>("relatedLinks")) 2016-06-21 15:20:17 +01:00
Jeavon aaf725a498 Adding Id to the Related Link model 2016-06-21 12:49:45 +01:00
Shannon Deminick c81488c3fe Merge pull request #1327 from lars-erik/temp-template-editor
Unit test for template editor.
2016-06-20 10:58:03 +02:00
Per Ploug 2688e281a7 insert partial view dialog 2016-06-14 01:07:41 +02:00
Lars-Erik Aabech b853b8e89f Tests pass with karma. Won't run with R# testrunner without uncommenting stub modules, but breaks running with karma. 2016-06-14 01:03:57 +02:00
Lars-Erik Aabech 0558fbd7ff Unit test for template editor. Currently testing that masterpage and layout is set. 2016-06-13 20:51:58 +02:00
Per Ploug 8471339578 merge 2016-06-13 20:36:30 +02:00
Per Ploug 3d95c3a744 partial view dialog 2016-06-13 20:35:00 +02:00
Per Ploug 523a093776 Adds partial view picker 2016-06-13 20:12:17 +02:00
hemraker 49d5e9a29e Add page field to overview 2016-06-13 19:58:02 +02:00
hemraker 221438c5fc Fixe merge confusion 2016-06-13 19:44:05 +02:00
hemraker a29de2f910 Close pageFieldOverlay on submit 2016-06-13 19:40:54 +02:00
hemraker 8de155c1a4 Merge remote-tracking branch 'refs/remotes/origin/temp-template-editor'
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js
	src/Umbraco.Web.UI.Client/src/views/templates/edit.html
2016-06-13 19:36:50 +02:00
hemraker 846da6763a Add page field overlay 2016-06-13 19:31:40 +02:00
Per Ploug 40c9357adb merge 2016-06-13 19:12:01 +02:00
Per Ploug fba91b203c merge 2016-06-13 19:04:22 +02:00
Per Ploug 93891a6a71 Make the template tree use the new view for create 2016-06-13 19:03:06 +02:00
Per Ploug 5091f60bb2 create template tweaks 2016-06-13 19:03:06 +02:00
Mads Rasmussen 1bbcf47d07 add "insert overlay" with insert dictionary item and insert macro 2016-06-13 18:48:26 +02:00
Lars-Erik Aabech 7ef98207cb Organize dialog can now insert sections, rendersections, renderbody, and select master.
Cursor stays where it was before editor was blurred.
2016-06-13 17:27:57 +02:00
Per Ploug 646b3c6efb Insert dictionary item dialog
Includes a way to override the tree picker as it currently thinks
everything is an entity, which it isn't
2016-06-13 17:22:11 +02:00
Jeavon Leopold 36aa166a95 Converters and models to support existing GetPropertyValue<int> and GetPropertyValue<string> code 2016-06-13 16:16:12 +02:00
Lars-Erik Aabech aef659cc92 merge the merge of the fork of the fork 2016-06-13 16:05:07 +02:00
Lars-Erik Aabech a0660c6696 merged 2016-06-13 16:03:43 +02:00
Per Ploug eb0166ae7a Merge remote-tracking branch 'origin/temp-template-editor' into temp-template-editor
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/templates/edit.html
2016-06-13 16:01:31 +02:00
Lars-Erik Aabech 44cde95b47 organize controller added with list of templates for master selection 2016-06-13 16:00:33 +02:00
Per Ploug 746072a65d sample use of insert layout 2016-06-13 15:49:57 +02:00
Per Ploug f17aadccda adds setLayout to the editor 2016-06-13 15:49:00 +02:00
Per Ploug b2ea92940e Moves querybuilder to a overlay 2016-06-13 15:48:47 +02:00
Mads Rasmussen e18a668e13 add toolbar 2016-06-13 15:22:13 +02:00
Mads Rasmussen db2dafd40c make it possible to lock a description in the editor header 2016-06-13 15:19:30 +02:00
hemraker a3614fee0d Added ace to gruntFile.js 2016-06-13 13:08:33 +02:00
Per Ploug 8a66943f4a Makes template tree load the new angular editor 2016-06-12 18:49:19 +02:00
Per Ploug 2368ea7cf8 Serverside template services 2016-06-12 18:49:05 +02:00
Per Ploug ebd2bf149c Basic editor + macro dialog implemented 2016-06-12 18:48:46 +02:00
Jeavon Leopold e7754d313e Initially adding the Core Value Converters package into Core! Currently this will break all the existing things but it makes views insanely simple with ModelsBuilder!! 2016-06-12 16:36:26 +02:00
Mads Rasmussen 7dfc288f93 setup view + load ace editor 2016-06-12 12:26:08 +02:00
Stephan 01990394dd Merge dev-v7 into dev-v7-deploy 2016-04-26 10:10:45 +02:00
Stephan bec9923c6a deploy-30 - revert unwanted change 2016-04-26 10:09:46 +02:00
Stephan 52f29a5fa1 deploy-30 - fixes 2016-04-18 12:09:32 +02:00
Stephan 179f36e2a2 deploy-30 - fixes 2016-04-15 16:36:53 +02:00
Stephan 378e8f5cd9 deploy-30 - fixes 2016-04-15 13:25:11 +02:00
Stephan 523283acd0 Merge branch 'dev-v7' into dev-v7-deploy 2016-04-14 18:28:46 +02:00
Stephan 4e9578bed4 Merge release-7.4.2 into dev-v7-deploy 2016-03-30 09:30:27 +02:00
Stephan 14adc2a3b3 deploy-30 refactoring 2016-01-26 14:18:30 +01:00
Stephan 7117414fb1 Merge origin/dev-v7 into dev-v7-deploy 2016-01-26 10:52:02 +01:00
Stephan d37cbe6309 Merge branch 'dev-v7' into dev-v7-deploy 2016-01-25 16:21:20 +01:00
Stephan ebae2ceb73 Merge 7.4.0 into dev-v7-deploy 2016-01-13 12:15:23 +01:00
Stephan f4c2437e53 Merge origin/7.4.0 into dev-v7-deploy
Conflicts:
	src/Umbraco.Core/IO/UmbracoMediaFile.cs
	src/Umbraco.Core/Media/ImageHelper.cs
	src/Umbraco.Web/Editors/ImagesController.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs
2015-12-18 18:44:57 +01:00
Stephan a05c71ec85 Fix files and medias upload 2015-12-16 17:22:34 +01:00
Stephan 02fd789f20 Sanitize UniqueId 2015-12-16 17:22:33 +01:00
Stephan e68dda81d2 Try to make sense of files and medias for Deploy 2015-12-09 16:45:40 +01:00
Stephan d3faf1d10a Merge 7.4.0 into dev-v7-deploy 2015-12-03 12:57:18 +01:00
Stephan 3e8ba73af2 Merge branch 'dev-v7-deploy' of https://github.com/umbraco/Umbraco-CMS into dev-v7-deploy 2015-12-03 12:23:13 +01:00
Stephan ee08552ad6 Merge remote-tracking branch 'origin/7.4.0' into dev-v7-deploy 2015-12-03 12:21:01 +01:00
Stephan 5772bcc7f2 Implement GetXxxFileStream for Deploy 2015-11-30 16:39:27 +01:00
Shannon b6c62af015 fixes upgrade script 2015-11-26 17:14:22 +01:00
1047 changed files with 43803 additions and 12968 deletions
+1
View File
@@ -142,3 +142,4 @@ build/ui-docs.zip
build/csharp-docs.zip
build/msbuild.log
.vs/
src/packages/
+15 -14
View File
@@ -2,21 +2,23 @@ version: '{build}'
shallow_clone: true
build_script:
- cmd: >-
cd build
SET SLN=%CD%
SET SRC=%SLN%\src
SET PACKAGES=%SRC%\packages
CD build
SET "release="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
SET nuGetFolder=C:\Users\appveyor\.nuget\packages
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
IF EXIST ..\src\umbraco.businesslogic\packages.config ..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
ECHO "Restoring NuGet into %PACKAGES%"
%SRC%\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
%SRC%\.nuget\NuGet.exe restore %SRC%\umbraco.sln -Verbosity Quiet -NonInteractive -PackagesDirectory %PACKAGES%
ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER%
@@ -24,13 +26,12 @@ build_script:
SET MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe"
XCOPY "..\src\Umbraco.Tests\unit-test-log4net.CI.config" "..\src\Umbraco.Tests\unit-test-log4net.config" /Y
XCOPY "%SRC%\Umbraco.Tests\unit-test-log4net.CI.config" "%SRC%\Umbraco.Tests\unit-test-log4net.config" /Y
%MSBUILD% "..\src\Umbraco.Tests\Umbraco.Tests.csproj" /consoleloggerparameters:Summary;ErrorsOnly
%MSBUILD% "%SLN%/src/Umbraco.Tests/Umbraco.Tests.csproj" /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /p:NugetPackagesDirectory=%PACKAGES%
build.bat nopause %release% build%APPVEYOR_BUILD_NUMBER%
build.bat -integration -release:%release% -comment:build%APPVEYOR_BUILD_NUMBER% -nugetfolder:%PACKAGES%
ECHO %PATH%
test:
assemblies: src\Umbraco.Tests\bin\Debug\Umbraco.Tests.dll
artifacts:
+109 -30
View File
@@ -1,31 +1,95 @@
@ECHO OFF
:: UMBRACO BUILD FILE
:: ensure we have UmbracoVersion.txt
IF NOT EXIST UmbracoVersion.txt (
ECHO UmbracoVersion.txt missing!
GOTO :showerror
ECHO UmbracoVersion.txt is missing!
GOTO error
)
REM Get the version and comment from UmbracoVersion.txt lines 2 and 3
SET "release="
SET "comment="
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"
SET RELEASE=
SET COMMENT=
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED RELEASE SET RELEASE=%%i
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED COMMENT SET COMMENT=%%i
REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%2] NEQ [] (SET release=%2)
IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment="))
REM process args
REM Get the "is continuous integration" from the parameters
SET "isci=0"
IF [%1] NEQ [] (SET isci=1)
SET INTEGRATION=0
SET nuGetFolder=%CD%\..\src\packages
SET SKIPNUGET=0
SET version=%release%
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
:processArgs
ECHO.
ECHO Building Umbraco %version%
ECHO.
:: grab the first parameter as a whole eg "/action:start"
:: end if no more parameter
SET SWITCHPARSE=%1
IF [%SWITCHPARSE%] == [] goto endProcessArgs
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%
:: get switch and value
SET SWITCH=
SET VALUE=
FOR /F "tokens=1,* delims=: " %%a IN ("%SWITCHPARSE%") DO SET SWITCH=%%a& SET VALUE=%%b
:: route arg
IF '%SWITCH%'=='/release' GOTO argRelease
IF '%SWITCH%'=='-release' GOTO argRelease
IF '%SWITCH%'=='/comment' GOTO argComment
IF '%SWITCH%'=='-comment' GOTO argComment
IF '%SWITCH%'=='/integration' GOTO argIntegration
IF '%SWITCH%'=='-integration' GOTO argIntegration
IF '%SWITCH%'=='/nugetfolder' GOTO argNugetFolder
IF '%SWITCH%'=='-nugetfolder' GOTO argNugetFolder
IF '%SWITCH%'=='/skipnuget' GOTO argSkipNuget
IF '%SWITCH%'=='-skipnuget' GOTO argSkipNuget
ECHO "Invalid switch %SWITCH%"
GOTO error
:: handle each arg
:argRelease
set RELEASE=%VALUE%
SHIFT
goto processArgs
:argComment
SET COMMENT=%VALUE%
SHIFT
GOTO processArgs
:argIntegration
SET INTEGRATION=1
SHIFT
GOTO processArgs
:argNugetFolder
SET nuGetFolder=%VALUE%
SHIFT
GOTO processArgs
:argSkipNuget
SET SKIPNUGET=1
SHIFT
GOTO processArgs
:endProcessArgs
REM run
SET VERSION=%RELEASE%
IF [%COMMENT%] EQU [] (SET VERSION=%RELEASE%) ELSE (SET VERSION=%RELEASE%-%COMMENT%)
ECHO ################################################################
ECHO Building Umbraco %VERSION%
ECHO ################################################################
SET MSBUILDPATH=C:\Program Files (x86)\MSBuild\14.0\Bin
SET MSBUILD="%MSBUILDPATH%\MsBuild.exe"
SET PATH="%MSBUILDPATH%";%PATH%
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %RELEASE%
ECHO.
ECHO Removing the belle build folder and bower_components folder to make sure everything is clean as a whistle
@@ -35,10 +99,10 @@ RD ..\src\Umbraco.Web.UI.Client\bower_components /Q /S
ECHO.
ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput
DEL /F /Q UmbracoCms.*.zip
DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt
DEL /F /Q UmbracoCms.*.zip 2>NUL
DEL /F /Q UmbracoExamine.*.zip 2>NUL
DEL /F /Q UmbracoCms.*.nupkg 2>NUL
DEL /F /Q webpihash.txt 2>NUL
ECHO.
ECHO Making sure Git is in the path so that the build can succeed
@@ -47,11 +111,21 @@ CALL InstallGit.cmd
REM Adding the default Git path so that if it's installed it can actually be found
REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git,
REM but the path setting is lost due to SETLOCAL
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
SET PATH="C:\Program Files (x86)\Git\cmd";"C:\Program Files\Git\cmd";%PATH%
ECHO.
ECHO Making sure we have a web.config
IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config
IF NOT EXIST "%CD%\..\src\Umbraco.Web.UI\web.config" COPY "%CD%\..\src\Umbraco.Web.UI\web.Template.config" "%CD%\..\src\Umbraco.Web.UI\web.config"
ECHO.
ECHO Reporting NuGet version
"%CD%\..\src\.nuget\NuGet.exe" help | findstr "^NuGet Version:"
ECHO.
ECHO Restoring NuGet packages
ECHO Into %nuGetFolder%
"%CD%\..\src\.nuget\NuGet.exe" restore "%CD%\..\src\umbraco.sln" -Verbosity Quiet -NonInteractive -PackagesDirectory "%nuGetFolder%"
IF ERRORLEVEL 1 GOTO :error
ECHO.
ECHO.
@@ -60,13 +134,15 @@ ECHO This takes a few minutes and logging is set to report warnings
ECHO and errors only so it might seems like nothing is happening for a while.
ECHO You can check the msbuild.log file for progress.
ECHO.
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger
IF ERRORLEVEL 1 GOTO :error
%MSBUILD% "Build.proj" /p:BUILD_RELEASE=%RELEASE% /p:BUILD_COMMENT=%COMMENT% /p:NugetPackagesDirectory="%nuGetFolder%" /consoleloggerparameters:Summary;ErrorsOnly /fileLogger
IF ERRORLEVEL 1 GOTO error
ECHO.
ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules
IF %SKIPNUGET% EQU 1 GOTO success
ECHO.
ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
@@ -74,22 +150,25 @@ REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
ECHO.
ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet
IF ERRORLEVEL 1 GOTO :error
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %VERSION% -Symbols -Verbosity quiet
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %VERSION% -Verbosity quiet
IF ERRORLEVEL 1 GOTO error
:success
ECHO.
ECHO No errors were detected!
ECHO There may still be some in the output, which you would need to investigate.
ECHO Warnings are usually normal.
ECHO.
ECHO.
GOTO :EOF
:error
ECHO.
ECHO Errors were detected!
ECHO.
REM don't pause if continuous integration else the build server waits forever
REM before cancelling the build (and, there is noone to read the output anyways)
IF isci NEQ 1 PAUSE
IF %INTEGRATION% NEQ 1 PAUSE
+18 -20
View File
@@ -1,8 +1,8 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
<!--
****************************************************
INCLUDES
INCLUDES
*****************************************************
-->
@@ -35,9 +35,9 @@
{
using (var cryptoProvider = new SHA1CryptoServiceProvider())
{
var fileHash = cryptoProvider.ComputeHash(stream);
using (TextWriter w = new StreamWriter(OutputFile, false))
{
w.WriteLine(string.Join("", fileHash.Select(b => b.ToString("x2"))));
@@ -52,9 +52,9 @@
</UsingTask>
<!--
<!--
****************************************************
VARIABLES
VARIABLES
*****************************************************
-->
@@ -102,9 +102,9 @@
<SystemFolders Include="$(WebAppFolder)Views" />
</ItemGroup>
<!--
<!--
****************************************************
TARGETS
TARGETS
*****************************************************
-->
@@ -155,7 +155,7 @@
<Message Text="Finished zipping to build\$(BuildFolder)\$(buildDate)-$(BuildZipFileName)" Importance="high" />
</Target>
<Target Name="CreateSystemFolders" DependsOnTargets="CopyBelleBuild" Inputs="@(SystemFolders)" Outputs="%(Identity).Dummy">
<MakeDir Directories="@(SystemFolders)" />
</Target>
@@ -231,7 +231,7 @@
DestinationFiles="@(CustomLanguageFiles->'$(ConfigsFolder)Lang\%(RecursiveDir)%(Filename)%(Extension)')"
OverwriteReadOnlyFiles="true"
SkipUnchangedFiles="false" />
<Copy SourceFiles="@(WebConfigTransformFile)"
DestinationFiles="$(ConfigsFolder)Web.config.transform"
OverwriteReadOnlyFiles="true"
@@ -264,14 +264,12 @@
<Message Text="Compiling web project to build\$(BuildFolder)" Importance="high" />
<!-- For UseWPP_CopyWebApplication=True see http://stackoverflow.com/questions/1983575/copywebapplication-with-web-config-transformations -->
<!-- Build the Umbraco.Web.UI project -->
<MSBuild Projects="..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False;OutDir=$(SolutionBinFolderAbsolutePath);WebProjectOutputDir=$(WebAppFolderAbsolutePath);Verbosity=minimal" Targets="Clean;Rebuild;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
</MSBuild>
<MSBuild Projects="..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False;OutDir=$(SolutionBinFolderAbsolutePath);WebProjectOutputDir=$(WebAppFolderAbsolutePath);Verbosity=minimal" Targets="Clean;Rebuild;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False" />
<!-- DONE -->
<Message Text="Finished compiling projects" Importance="high" />
</Target>
<Target Name="SetVersionNumber" Condition="'$(BUILD_RELEASE)'!=''">
<PropertyGroup>
<NewVersion>$(BUILD_RELEASE)</NewVersion>
@@ -307,34 +305,34 @@
ReplacementText="AssemblyFileVersion(&quot;$(BUILD_RELEASE)&quot;)"/>
<!--This updates the AssemblyInformationalVersion for the solution to the umbraco version and comment-->
<FileUpdate
<FileUpdate
Condition="'$(BUILD_COMMENT)'!=''"
Files="..\src\SolutionInfo.cs"
Regex="AssemblyInformationalVersion\(&quot;(.+)?&quot;\)"
ReplacementText="AssemblyInformationalVersion(&quot;$(BUILD_RELEASE)-$(BUILD_COMMENT)&quot;)"/>
<FileUpdate
<FileUpdate
Condition="'$(BUILD_COMMENT)'==''"
Files="..\src\SolutionInfo.cs"
Regex="AssemblyInformationalVersion\(&quot;(.+)?&quot;\)"
ReplacementText="AssemblyInformationalVersion(&quot;$(BUILD_RELEASE)&quot;)"/>
<FileUpdate
<FileUpdate
Condition="'$(BUILD_NIGHTLY)'!=''"
Files="..\src\SolutionInfo.cs"
Regex="AssemblyInformationalVersion\(&quot;(.+)?&quot;\)"
ReplacementText="AssemblyInformationalVersion(&quot;$(BUILD_RELEASE)-$(BUILD_NIGHTLY)&quot;)"/>
<FileUpdate
<FileUpdate
Condition="'$(BUILD_COMMENT)'!='' AND '$(BUILD_NIGHTLY)'!=''"
Files="..\src\SolutionInfo.cs"
Regex="AssemblyInformationalVersion\(&quot;(.+)?&quot;\)"
ReplacementText="AssemblyInformationalVersion(&quot;$(BUILD_RELEASE)-$(BUILD_COMMENT)-$(BUILD_NIGHTLY)&quot;)"/>
<FileUpdate
<FileUpdate
Condition="'$(BUILD_COMMENT)'=='' AND '$(BUILD_NIGHTLY)'==''"
Files="..\src\SolutionInfo.cs"
Regex="AssemblyInformationalVersion\(&quot;(.+)?&quot;\)"
ReplacementText="AssemblyInformationalVersion(&quot;$(BUILD_RELEASE)&quot;)"/>
<!--This updates the copyright year-->
<FileUpdate
<FileUpdate
Files="..\src\SolutionInfo.cs"
Regex="AssemblyCopyright\(&quot;Copyright © Umbraco (\d{4})&quot;\)"
ReplacementText="AssemblyCopyright(&quot;Copyright © Umbraco $([System.DateTime]::Now.ToString(`yyyy`))&quot;)"/>
+3 -3
View File
@@ -1,18 +1,18 @@
@ECHO OFF
SETLOCAL
:: SETLOCAL is on, so changes to the path not persist to the actual user's path
REM SETLOCAL is on, so changes to the path not persist to the actual user's path
git.exe --version
IF %ERRORLEVEL%==9009 GOTO :trydefaultpath
REM OK, DONE
GOTO :EOF
:: Git is installed, no need to to anything else
:trydefaultpath
PATH=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
git.exe --version
IF %ERRORLEVEL%==9009 GOTO :showerror
REM OK, DONE
GOTO :EOF
:: Git is installed, no need to to anything else
:showerror
ECHO Git is not in your path and could not be found in C:\Program Files (x86)\Git\cmd nor in C:\Program Files\Git\cmd
+42 -41
View File
@@ -15,6 +15,8 @@
<language>en-US</language>
<tags>umbraco</tags>
<dependencies>
<!--Must be this way because 2.0.5 is actually 1.2.15.0 and 2.0.6 is actually 2.0.6 !-->
<dependency id="log4net" version="[2.0.5,2.0.6)" />
<dependency id="Microsoft.AspNet.Mvc" version="[5.2.3,6.0.0)" />
<dependency id="Microsoft.AspNet.WebApi" version="[5.2.3,6.0.0)" />
<dependency id="Microsoft.AspNet.Identity.Owin" version="[2.2.1, 3.0.0)" />
@@ -22,57 +24,56 @@
<dependency id="Microsoft.Owin.Security.OAuth" version="[3.0.1, 4.0.0)" />
<dependency id="Microsoft.Owin.Host.SystemWeb" version="[3.0.1, 4.0.0)" />
<dependency id="MiniProfiler" version="[2.1.0, 3.0.0)" />
<dependency id="HtmlAgilityPack" version="[1.4.9, 2.0.0)" />
<dependency id="HtmlAgilityPack" version="[1.4.9.5, 2.0.0)" />
<dependency id="Lucene.Net" version="[2.9.4.1, 3.0.0.0)" />
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
<dependency id="MySql.Data" version="[6.9.8, 7.0.0)" />
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
<dependency id="ClientDependency" version="[1.9.2, 2.0.0)" />
<dependency id="ClientDependency-Mvc5" version="[1.8.0, 2.0.0)" />
<!-- AutoMapper can not be updated due to: https://github.com/AutoMapper/AutoMapper/issues/373#issuecomment-127644405 -->
<dependency id="ClientDependency-Mvc5" version="[1.8.0.0, 2.0.0)" />
<dependency id="AutoMapper" version="[3.3.1, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 10.0.0)" />
<dependency id="Examine" version="[0.1.80, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.5.1, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.8.0, 5.0.0)" />
<dependency id="semver" version="[1.1.2, 2.0.0)" />
<dependency id="UrlRewritingNet" version="[2.0.7, 3.0.0)" />
<dependency id="Newtonsoft.Json" version="[9.0.1, 10.0.0)" />
<dependency id="Examine" version="[0.1.81, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.5.2, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.8.2, 5.0.0)" />
<dependency id="semver" version="[2.0.4, 3.0.0)" />
<!-- Markdown can not be updated due to: https://github.com/hey-red/markdownsharp/issues/71#issuecomment-233585487 -->
<dependency id="Markdown" version="[1.14.4, 2.0.0)" />
<dependency id="Markdown" version="[1.14.7, 2.0.0)" />
<dependency id="System.Threading.Tasks.Dataflow" version="[4.6.0, 5.0.0)" />
</dependencies>
</metadata>
<files>
<file src="..\_BuildOutput\WebApp\bin\businesslogic.dll" target="lib\businesslogic.dll" />
<file src="..\_BuildOutput\WebApp\bin\businesslogic.xml" target="lib\businesslogic.xml" />
<file src="..\_BuildOutput\WebApp\bin\cms.dll" target="lib\cms.dll" />
<file src="..\_BuildOutput\WebApp\bin\cms.xml" target="lib\cms.xml" />
<file src="..\_BuildOutput\WebApp\bin\controls.dll" target="lib\controls.dll" />
<file src="..\_BuildOutput\WebApp\bin\controls.xml" target="lib\controls.xml" />
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\interfaces.dll" />
<file src="..\_BuildOutput\WebApp\bin\interfaces.xml" target="lib\interfaces.xml" />
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\log4net.dll" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.dll" target="lib\SQLCE4Umbraco.dll" />
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.xml" target="lib\SQLCE4Umbraco.xml" />
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\System.Data.SqlServerCe.dll" />
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\System.Data.SqlServerCe.Entity.dll" />
<file src="..\_BuildOutput\WebApp\bin\TidyNet.dll" target="lib\TidyNet.dll" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.dll" target="lib\Umbraco.Core.dll" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.xml" target="lib\Umbraco.Core.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.dll" target="lib\umbraco.DataLayer.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.xml" target="lib\umbraco.DataLayer.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.dll" target="lib\umbraco.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.xml" target="lib\umbraco.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.dll" target="lib\umbraco.editorControls.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.xml" target="lib\umbraco.editorControls.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.dll" target="lib\umbraco.MacroEngines.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.xml" target="lib\umbraco.MacroEngines.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.xml" target="lib\umbraco.providers.xml" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.xml" target="lib\Umbraco.Web.UI.xml" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.xml" target="lib\UmbracoExamine.xml" />
<file src="..\_BuildOutput\WebApp\bin\businesslogic.dll" target="lib\net45\businesslogic.dll" />
<file src="..\_BuildOutput\WebApp\bin\businesslogic.xml" target="lib\net45\businesslogic.xml" />
<file src="..\_BuildOutput\WebApp\bin\cms.dll" target="lib\net45\cms.dll" />
<file src="..\_BuildOutput\WebApp\bin\cms.xml" target="lib\net45\cms.xml" />
<file src="..\_BuildOutput\WebApp\bin\controls.dll" target="lib\net45\controls.dll" />
<file src="..\_BuildOutput\WebApp\bin\controls.xml" target="lib\net45\controls.xml" />
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\net45\interfaces.dll" />
<file src="..\_BuildOutput\WebApp\bin\interfaces.xml" target="lib\net45\interfaces.xml" />
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\net45\log4net.dll" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\net45\Microsoft.ApplicationBlocks.Data.dll" />
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.dll" target="lib\net45\SQLCE4Umbraco.dll" />
<file src="..\_BuildOutput\WebApp\bin\SQLCE4Umbraco.xml" target="lib\net45\SQLCE4Umbraco.xml" />
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.dll" target="lib\net45\System.Data.SqlServerCe.dll" />
<file src="..\_BuildOutput\WebApp\bin\System.Data.SqlServerCe.Entity.dll" target="lib\net45\System.Data.SqlServerCe.Entity.dll" />
<file src="..\_BuildOutput\WebApp\bin\TidyNet.dll" target="lib\net45\TidyNet.dll" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.dll" target="lib\net45\Umbraco.Core.dll" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Core.xml" target="lib\net45\Umbraco.Core.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.dll" target="lib\net45\umbraco.DataLayer.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.DataLayer.xml" target="lib\net45\umbraco.DataLayer.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.dll" target="lib\net45\umbraco.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.xml" target="lib\net45\umbraco.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.dll" target="lib\net45\umbraco.editorControls.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.editorControls.xml" target="lib\net45\umbraco.editorControls.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.dll" target="lib\net45\umbraco.MacroEngines.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.MacroEngines.xml" target="lib\net45\umbraco.MacroEngines.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\net45\umbraco.providers.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.xml" target="lib\net45\umbraco.providers.xml" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\net45\Umbraco.Web.UI.dll" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.xml" target="lib\net45\Umbraco.Web.UI.xml" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\net45\UmbracoExamine.dll" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.xml" target="lib\net45\UmbracoExamine.xml" />
<file src="tools\install.core.ps1" target="tools\install.ps1" />
<!-- Added to be able to produce a symbols package -->
+4 -2
View File
@@ -16,9 +16,10 @@
<tags>umbraco</tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="[$version$]" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 10.0.0)" />
<dependency id="Newtonsoft.Json" version="[9.0.1, 10.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.5, 4.0.0)" />
<dependency id="ImageProcessor.Web.Config" version="[2.3.0, 3.0.0)" />
<dependency id="Microsoft.AspNet.SignalR.Core" version="[2.2.1, 3.0.0)" />
<dependency id="ImageProcessor.Web.Config" version="[2.3.0, 3.0.0)" />
</dependencies>
</metadata>
<files>
@@ -45,6 +46,7 @@
<file src="tools\umbracoSettings.config.install.xdt" target="Content\config\umbracoSettings.config.install.xdt" />
<file src="tools\Views.Web.config.install.xdt" target="Views\Web.config.install.xdt" />
<file src="tools\processing.config.install.xdt" target="Content\Config\imageprocessor\processing.config.install.xdt" />
<file src="tools\cache.config.install.xdt" target="Content\Config\imageprocessor\cache.config.install.xdt" />
<file src="build\**" target="build" />
</files>
</package>
@@ -41,16 +41,6 @@
views/dashboard/developer/examinemanagement.html
</control>
</tab>
<tab caption="Health Check" xdt:Transform="InsertIfMissing" xdt:Locator="Match(caption)">
<control>
views/dashboard/developer/healthcheck.html
</control>
</tab>
<tab caption="Redirect URL Management" xdt:Transform="InsertIfMissing" xdt:Locator="Match(caption)">
<control>
views/dashboard/developer/redirecturls.html
</control>
</tab>
</section>
<section alias="StartupMediaDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
@@ -80,4 +70,26 @@
<tab caption="Change Password" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
<tab caption="Last Edits" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
</section>
<section alias="RedirectUrlManagement" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
<areas>
<area>content</area>
</areas>
<tab caption="Redirect URL Management">
<control>
views/dashboard/developer/redirecturls.html
</control>
</tab>
</section>
<section alias="UmbracoHealthCheck" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
<areas>
<area>developer</area>
</areas>
<tab caption="Health Check">
<control>
views/dashboard/developer/healthcheck.html
</control>
</tab>
</section>
</dashBoard>
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<caching xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<caches>
<cache name="DiskCache" trimCache="false" xdt:Transform="SetAttributes(trimCache)" xdt:Locator="Match(name)" />
</caches>
</caching>
-1
View File
@@ -53,7 +53,6 @@ if ($project) {
if(Test-Path $umbracoBinFolder\umbraco.providers.dll) { Remove-Item $umbracoBinFolder\umbraco.providers.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Umbraco.Web.UI.dll) { Remove-Item $umbracoBinFolder\Umbraco.Web.UI.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\UmbracoExamine.dll) { Remove-Item $umbracoBinFolder\UmbracoExamine.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\UrlRewritingNet.UrlRewriter.dll) { Remove-Item $umbracoBinFolder\UrlRewritingNet.UrlRewriter.dll -Force -Confirm:$false }
# Delete files Umbraco depends upon
$amd64Folder = Join-Path $umbracoBinFolder "amd64"
+2 -1
View File
@@ -1,2 +1,3 @@
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
7.5.8
7.6.0
beta03
Binary file not shown.
+3 -1
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -49,9 +49,11 @@
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
+24 -11
View File
@@ -180,12 +180,16 @@ namespace SqlCE4Umbraco
/// <returns>The return value of the command.</returns>
protected override object ExecuteScalar(string commandText, SqlCeParameter[] parameters)
{
#if DEBUG && DebugDataLayer
#if DEBUG && DebugDataLayer
// Log Query Execution
Trace.TraceInformation(GetType().Name + " SQL ExecuteScalar: " + commandText);
#endif
return SqlCeApplicationBlock.ExecuteScalar(ConnectionString, CommandType.Text, commandText, parameters);
#endif
using (var cc = UseCurrentConnection)
{
return SqlCeApplicationBlock.ExecuteScalar(
(SqlCeConnection) cc.Connection, (SqlCeTransaction) cc.Transaction,
CommandType.Text, commandText, parameters);
}
}
/// <summary>
@@ -198,12 +202,17 @@ namespace SqlCE4Umbraco
/// </returns>
protected override int ExecuteNonQuery(string commandText, SqlCeParameter[] parameters)
{
#if DEBUG && DebugDataLayer
#if DEBUG && DebugDataLayer
// Log Query Execution
Trace.TraceInformation(GetType().Name + " SQL ExecuteNonQuery: " + commandText);
#endif
#endif
return SqlCeApplicationBlock.ExecuteNonQuery(ConnectionString, CommandType.Text, commandText, parameters);
using (var cc = UseCurrentConnection)
{
return SqlCeApplicationBlock.ExecuteNonQuery(
(SqlCeConnection) cc.Connection, (SqlCeTransaction) cc.Transaction,
CommandType.Text, commandText, parameters);
}
}
/// <summary>
@@ -216,13 +225,17 @@ namespace SqlCE4Umbraco
/// </returns>
protected override IRecordsReader ExecuteReader(string commandText, SqlCeParameter[] parameters)
{
#if DEBUG && DebugDataLayer
#if DEBUG && DebugDataLayer
// Log Query Execution
Trace.TraceInformation(GetType().Name + " SQL ExecuteReader: " + commandText);
#endif
#endif
return new SqlCeDataReaderHelper(SqlCeApplicationBlock.ExecuteReader(ConnectionString, CommandType.Text,
commandText, parameters));
using (var cc = UseCurrentConnection)
{
return new SqlCeDataReaderHelper(SqlCeApplicationBlock.ExecuteReader(
(SqlCeConnection) cc.Connection, (SqlCeTransaction) cc.Transaction,
CommandType.Text, commandText, parameters));
}
}
+173 -91
View File
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlServerCe;
using System.Data;
using System.Diagnostics;
@@ -26,30 +24,61 @@ namespace SqlCE4Umbraco
params SqlCeParameter[] commandParameters
)
{
object retVal;
try
{
using (SqlCeConnection conn = SqlCeContextGuardian.Open(connectionString))
using (var conn = SqlCeContextGuardian.Open(connectionString))
{
using (SqlCeCommand cmd = new SqlCeCommand(commandText, conn))
{
AttachParameters(cmd, commandParameters);
Debug.WriteLine("---------------------------------SCALAR-------------------------------------");
Debug.WriteLine(commandText);
Debug.WriteLine("----------------------------------------------------------------------------");
retVal = cmd.ExecuteScalar();
}
return ExecuteScalarTry(conn, null, commandText, commandParameters);
}
return retVal;
}
catch (Exception ee)
{
throw new SqlCeProviderException("Error running Scalar: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee.ToString());
throw new SqlCeProviderException("Error running Scalar: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee);
}
}
public static object ExecuteScalar(
SqlCeConnection conn, SqlCeTransaction trx,
CommandType commandType,
string commandText,
params SqlCeParameter[] commandParameters)
{
try
{
return ExecuteScalarTry(conn, trx, commandText, commandParameters);
}
catch (Exception ee)
{
throw new SqlCeProviderException("Error running Scalar: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee);
}
}
public static object ExecuteScalar(
SqlCeConnection conn,
CommandType commandType,
string commandText,
params SqlCeParameter[] commandParameters)
{
return ExecuteScalar(conn, null, commandType, commandText, commandParameters);
}
private static object ExecuteScalarTry(
SqlCeConnection conn, SqlCeTransaction trx,
string commandText,
params SqlCeParameter[] commandParameters)
{
object retVal;
using (var cmd = trx == null ? new SqlCeCommand(commandText, conn) : new SqlCeCommand(commandText, conn, trx))
{
AttachParameters(cmd, commandParameters);
Debug.WriteLine("---------------------------------SCALAR-------------------------------------");
Debug.WriteLine(commandText);
Debug.WriteLine("----------------------------------------------------------------------------");
retVal = cmd.ExecuteScalar();
}
return retVal;
}
/// <summary>
///
/// </summary>
@@ -66,49 +95,10 @@ namespace SqlCE4Umbraco
{
try
{
int rowsAffected;
using (SqlCeConnection conn = SqlCeContextGuardian.Open(connectionString))
using (var conn = SqlCeContextGuardian.Open(connectionString))
{
// this is for multiple queries in the installer
if (commandText.Trim().StartsWith("!!!"))
{
commandText = commandText.Trim().Trim('!');
string[] commands = commandText.Split('|');
string currentCmd = String.Empty;
foreach (string cmd in commands)
{
try
{
currentCmd = cmd;
if (!String.IsNullOrWhiteSpace(cmd))
{
SqlCeCommand c = new SqlCeCommand(cmd, conn);
c.ExecuteNonQuery();
}
}
catch (Exception e)
{
Debug.WriteLine("*******************************************************************");
Debug.WriteLine(currentCmd);
Debug.WriteLine(e);
Debug.WriteLine("*******************************************************************");
}
}
return 1;
}
else
{
Debug.WriteLine("----------------------------------------------------------------------------");
Debug.WriteLine(commandText);
Debug.WriteLine("----------------------------------------------------------------------------");
SqlCeCommand cmd = new SqlCeCommand(commandText, conn);
AttachParameters(cmd, commandParameters);
rowsAffected = cmd.ExecuteNonQuery();
}
return ExecuteNonQueryTry(conn, null, commandText, commandParameters);
}
return rowsAffected;
}
catch (Exception ee)
{
@@ -116,6 +106,74 @@ namespace SqlCE4Umbraco
}
}
public static int ExecuteNonQuery(
SqlCeConnection conn,
CommandType commandType,
string commandText,
params SqlCeParameter[] commandParameters
)
{
return ExecuteNonQuery(conn, null, commandType, commandText, commandParameters);
}
public static int ExecuteNonQuery(
SqlCeConnection conn, SqlCeTransaction trx,
CommandType commandType,
string commandText,
params SqlCeParameter[] commandParameters
)
{
try
{
return ExecuteNonQueryTry(conn, trx, commandText, commandParameters);
}
catch (Exception ee)
{
throw new SqlCeProviderException("Error running NonQuery: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee.ToString());
}
}
private static int ExecuteNonQueryTry(
SqlCeConnection conn, SqlCeTransaction trx,
string commandText,
params SqlCeParameter[] commandParameters)
{
// this is for multiple queries in the installer
if (commandText.Trim().StartsWith("!!!"))
{
commandText = commandText.Trim().Trim('!');
var commands = commandText.Split('|');
var currentCmd = string.Empty;
foreach (var command in commands)
{
try
{
currentCmd = command;
if (string.IsNullOrWhiteSpace(command)) continue;
var c = trx == null ? new SqlCeCommand(command, conn) : new SqlCeCommand(command, conn, trx);
c.ExecuteNonQuery();
}
catch (Exception e)
{
Debug.WriteLine("*******************************************************************");
Debug.WriteLine(currentCmd);
Debug.WriteLine(e);
Debug.WriteLine("*******************************************************************");
}
}
return 1;
}
Debug.WriteLine("----------------------------------------------------------------------------");
Debug.WriteLine(commandText);
Debug.WriteLine("----------------------------------------------------------------------------");
var cmd = new SqlCeCommand(commandText, conn);
AttachParameters(cmd, commandParameters);
var rowsAffected = cmd.ExecuteNonQuery();
return rowsAffected;
}
/// <summary>
///
/// </summary>
@@ -133,25 +191,8 @@ namespace SqlCE4Umbraco
{
try
{
Debug.WriteLine("---------------------------------READER-------------------------------------");
Debug.WriteLine(commandText);
Debug.WriteLine("----------------------------------------------------------------------------");
SqlCeDataReader reader;
SqlCeConnection conn = SqlCeContextGuardian.Open(connectionString);
try
{
SqlCeCommand cmd = new SqlCeCommand(commandText, conn);
AttachParameters(cmd, commandParameters);
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch
{
conn.Close();
throw;
}
return reader;
var conn = SqlCeContextGuardian.Open(connectionString);
return ExecuteReaderTry(conn, null, commandText, commandParameters);
}
catch (Exception ee)
{
@@ -159,30 +200,71 @@ namespace SqlCE4Umbraco
}
}
public static bool VerifyConnection(string connectionString)
public static SqlCeDataReader ExecuteReader(
SqlCeConnection conn,
CommandType commandType,
string commandText,
params SqlCeParameter[] commandParameters
)
{
bool isConnected = false;
using (SqlCeConnection conn = SqlCeContextGuardian.Open(connectionString))
{
isConnected = conn.State == ConnectionState.Open;
}
return isConnected;
return ExecuteReader(conn, commandType, commandText, commandParameters);
}
private static void AttachParameters(SqlCeCommand command, SqlCeParameter[] commandParameters)
public static SqlCeDataReader ExecuteReader(
SqlCeConnection conn, SqlCeTransaction trx,
CommandType commandType,
string commandText,
params SqlCeParameter[] commandParameters
)
{
foreach (SqlCeParameter parameter in commandParameters)
try
{
return ExecuteReaderTry(conn, trx, commandText, commandParameters);
}
catch (Exception ee)
{
throw new SqlCeProviderException("Error running Reader: \nSQL Statement:\n" + commandText + "\n\nException:\n" + ee.ToString());
}
}
private static SqlCeDataReader ExecuteReaderTry(
SqlCeConnection conn, SqlCeTransaction trx,
string commandText,
params SqlCeParameter[] commandParameters)
{
Debug.WriteLine("---------------------------------READER-------------------------------------");
Debug.WriteLine(commandText);
Debug.WriteLine("----------------------------------------------------------------------------");
try
{
var cmd = trx == null ? new SqlCeCommand(commandText, conn) : new SqlCeCommand(commandText, conn, trx);
AttachParameters(cmd, commandParameters);
return cmd.ExecuteReader();
}
catch
{
conn.Close();
throw;
}
}
public static bool VerifyConnection(string connectionString)
{
using (var conn = SqlCeContextGuardian.Open(connectionString))
{
return conn.State == ConnectionState.Open;
}
}
private static void AttachParameters(SqlCeCommand command, IEnumerable<SqlCeParameter> commandParameters)
{
foreach (var parameter in commandParameters)
{
if ((parameter.Direction == ParameterDirection.InputOutput) && (parameter.Value == null))
{
parameter.Value = DBNull.Value;
}
command.Parameters.Add(parameter);
}
}
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
@@ -32,4 +32,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup></configuration>
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.5.8")]
[assembly: AssemblyInformationalVersion("7.5.8")]
[assembly: AssemblyFileVersion("7.6.0")]
[assembly: AssemblyInformationalVersion("7.6.0-beta03")]
+15 -4
View File
@@ -1,12 +1,11 @@
using System;
using System.Configuration;
using System.Threading;
using System.Threading.Tasks;
using System.Web;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.ObjectResolution;
using Umbraco.Core.Profiling;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Sync;
@@ -162,6 +161,11 @@ namespace Umbraco.Core
/// </summary>
public static ApplicationContext Current { get; internal set; }
/// <summary>
/// Gets the scope provider.
/// </summary>
internal IScopeProvider ScopeProvider { get { return _databaseContext == null ? null : _databaseContext.ScopeProvider; } }
/// <summary>
/// Returns the application wide cache accessor
/// </summary>
@@ -296,7 +300,7 @@ namespace Umbraco.Core
// if we have a db context available, if we don't then we are not installed anyways
if (DatabaseContext.IsDatabaseConfigured && DatabaseContext.CanConnect)
{
var found = Services.MigrationEntryService.FindEntry(GlobalSettings.UmbracoMigrationName, UmbracoVersion.GetSemanticVersion());
var found = Services.MigrationEntryService.FindEntry(Constants.System.UmbracoMigrationName, UmbracoVersion.GetSemanticVersion());
if (found == null)
{
//we haven't executed this migration in this environment, so even though the config versions match,
@@ -418,10 +422,17 @@ namespace Umbraco.Core
this.ApplicationCache = null;
if (_databaseContext != null) //need to check the internal field here
{
if (_databaseContext.ScopeProvider.AmbientScope != null)
{
var scope = _databaseContext.ScopeProvider.AmbientScope;
scope.Dispose();
}
/*
if (DatabaseContext.IsDatabaseConfigured && DatabaseContext.Database != null)
{
DatabaseContext.Database.Dispose();
}
}
*/
}
this.DatabaseContext = null;
this.Services = null;
+48
View File
@@ -0,0 +1,48 @@
using System;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Web;
using Umbraco.Core;
namespace Umbraco.Core
{
/// <summary>
/// Manages any assembly binding redirects that cannot be done via config
/// </summary>
internal class BindingRedirects
{
public static void Initialize()
{
// this only gets called when an assembly can't be resolved
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
}
private static readonly Regex Log4NetAssemblyPattern = new Regex("log4net, Version=([\\d\\.]+?), Culture=neutral, PublicKeyToken=null", RegexOptions.Compiled);
private const string Log4NetReplacement = "log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a";
/// <summary>
/// This is used to do an assembly binding redirect via code - normally required due to signature changes in assemblies
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
/// <returns></returns>
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
//log4net:
// Use regex to match and replace
if (Log4NetAssemblyPattern.IsMatch(args.Name) && args.Name != Log4NetReplacement)
{
return Assembly.Load(Log4NetAssemblyPattern.Replace(args.Name, Log4NetReplacement));
}
//AutoMapper:
// ensure the assembly is indeed AutoMapper and that the PublicKeyToken is null before trying to Load again
// do NOT just replace this with 'return Assembly', as it will cause an infinite loop -> stackoverflow
if (args.Name.StartsWith("AutoMapper") && args.Name.EndsWith("PublicKeyToken=null"))
return Assembly.Load(args.Name.Replace(", PublicKeyToken=null", ", PublicKeyToken=be96cd2c38ef1005"));
return null;
}
}
}
+39
View File
@@ -0,0 +1,39 @@
namespace Umbraco.Core
{
public static class ByteArrayExtensions
{
private static readonly char[] BytesToHexStringLookup = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
public static string ToHexString(this byte[] bytes)
{
int i = 0, p = 0, bytesLength = bytes.Length;
var chars = new char[bytesLength * 2];
while (i < bytesLength)
{
var b = bytes[i++];
chars[p++] = BytesToHexStringLookup[b / 0x10];
chars[p++] = BytesToHexStringLookup[b % 0x10];
}
return new string(chars, 0, chars.Length);
}
public static string ToHexString(this byte[] bytes, char separator, int blockSize, int blockCount)
{
int p = 0, bytesLength = bytes.Length, count = 0, size = 0;
var chars = new char[bytesLength * 2 + blockCount];
for (var i = 0; i < bytesLength; i++)
{
var b = bytes[i++];
chars[p++] = BytesToHexStringLookup[b / 0x10];
chars[p++] = BytesToHexStringLookup[b % 0x10];
if (count == blockCount) continue;
if (++size < blockSize) continue;
chars[p++] = '/';
size = 0;
count++;
}
return new string(chars, 0, chars.Length);
}
}
}
@@ -1,268 +1,250 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
/// <summary>
/// The default cache policy for retrieving a single entity
/// Represents the default cache policy.
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TId"></typeparam>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <typeparam name="TId">The type of the identifier.</typeparam>
/// <remarks>
/// This cache policy uses sliding expiration and caches instances for 5 minutes. However if allow zero count is true, then we use the
/// default policy with no expiry.
/// <para>The default cache policy caches entities with a 5 minutes sliding expiration.</para>
/// <para>Each entity is cached individually.</para>
/// <para>If options.GetAllCacheAllowZeroCount then a 'zero-count' array is cached when GetAll finds nothing.</para>
/// <para>If options.GetAllCacheValidateCount then we check against the db when getting many entities.</para>
/// </remarks>
internal class DefaultRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private static readonly TEntity[] EmptyEntities = new TEntity[0]; // const
private readonly RepositoryCachePolicyOptions _options;
public DefaultRepositoryCachePolicy(IRuntimeCacheProvider cache, RepositoryCachePolicyOptions options)
: base(cache)
{
{
if (options == null) throw new ArgumentNullException("options");
_options = options;
_options = options;
}
protected string GetCacheIdKey(object id)
public override IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope)
{
return new ScopedRepositoryCachePolicy<TEntity, TId>(this, runtimeCache, scope);
}
protected string GetEntityCacheKey(object id)
{
if (id == null) throw new ArgumentNullException("id");
return string.Format("{0}{1}", GetCacheTypeKey(), id);
return GetEntityTypeCacheKey() + id;
}
protected string GetCacheTypeKey()
protected string GetEntityTypeCacheKey()
{
return string.Format("uRepo_{0}_", typeof(TEntity).Name);
}
public override void CreateOrUpdate(TEntity entity, Action<TEntity> persistMethod)
protected virtual void InsertEntity(string cacheKey, TEntity entity)
{
Cache.InsertCacheItem(cacheKey, () => entity, TimeSpan.FromMinutes(5), true);
}
protected virtual void InsertEntities(TId[] ids, TEntity[] entities)
{
if (ids.Length == 0 && entities.Length == 0 && _options.GetAllCacheAllowZeroCount)
{
// getting all of them, and finding nothing.
// if we can cache a zero count, cache an empty array,
// for as long as the cache is not cleared (no expiration)
Cache.InsertCacheItem(GetEntityTypeCacheKey(), () => EmptyEntities);
}
else
{
// individually cache each item
foreach (var entity in entities)
{
var capture = entity;
Cache.InsertCacheItem(GetEntityCacheKey(entity.Id), () => capture, TimeSpan.FromMinutes(5), true);
}
}
}
/// <inheritdoc />
public override void Create(TEntity entity, Action<TEntity> persistNew)
{
if (entity == null) throw new ArgumentNullException("entity");
if (persistMethod == null) throw new ArgumentNullException("persistMethod");
try
{
persistMethod(entity);
persistNew(entity);
//set the disposal action
SetCacheAction(() =>
// just to be safe, we cannot cache an item without an identity
if (entity.HasIdentity)
{
//just to be safe, we cannot cache an item without an identity
if (entity.HasIdentity)
{
Cache.InsertCacheItem(GetCacheIdKey(entity.Id), () => entity,
timeout: TimeSpan.FromMinutes(5),
isSliding: true);
}
//If there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetCacheTypeKey());
});
Cache.InsertCacheItem(GetEntityCacheKey(entity.Id), () => entity, TimeSpan.FromMinutes(5), true);
}
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetEntityTypeCacheKey());
}
catch
{
//set the disposal action
SetCacheAction(() =>
{
//if an exception is thrown we need to remove the entry from cache, this is ONLY a work around because of the way
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
Cache.ClearCacheItem(GetCacheIdKey(entity.Id));
// if an exception is thrown we need to remove the entry from cache,
// this is ONLY a work around because of the way
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
Cache.ClearCacheItem(GetEntityCacheKey(entity.Id));
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetEntityTypeCacheKey());
//If there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetCacheTypeKey());
});
throw;
}
}
public override void Remove(TEntity entity, Action<TEntity> persistMethod)
/// <inheritdoc />
public override void Update(TEntity entity, Action<TEntity> persistUpdated)
{
if (entity == null) throw new ArgumentNullException("entity");
if (persistMethod == null) throw new ArgumentNullException("persistMethod");
try
{
persistMethod(entity);
}
finally
{
//set the disposal action
var cacheKey = GetCacheIdKey(entity.Id);
SetCacheAction(() =>
persistUpdated(entity);
// just to be safe, we cannot cache an item without an identity
if (entity.HasIdentity)
{
Cache.ClearCacheItem(cacheKey);
//If there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetCacheTypeKey());
});
Cache.InsertCacheItem(GetEntityCacheKey(entity.Id), () => entity, TimeSpan.FromMinutes(5), true);
}
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetEntityTypeCacheKey());
}
catch
{
// if an exception is thrown we need to remove the entry from cache,
// this is ONLY a work around because of the way
// that we cache entities: http://issues.umbraco.org/issue/U4-4259
Cache.ClearCacheItem(GetEntityCacheKey(entity.Id));
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetEntityTypeCacheKey());
throw;
}
}
public override TEntity Get(TId id, Func<TId, TEntity> getFromRepo)
/// <inheritdoc />
public override void Delete(TEntity entity, Action<TEntity> persistDeleted)
{
if (getFromRepo == null) throw new ArgumentNullException("getFromRepo");
if (entity == null) throw new ArgumentNullException("entity");
var cacheKey = GetCacheIdKey(id);
try
{
persistDeleted(entity);
}
finally
{
// whatever happens, clear the cache
var cacheKey = GetEntityCacheKey(entity.Id);
Cache.ClearCacheItem(cacheKey);
// if there's a GetAllCacheAllowZeroCount cache, ensure it is cleared
Cache.ClearCacheItem(GetEntityTypeCacheKey());
}
}
/// <inheritdoc />
public override TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
var cacheKey = GetEntityCacheKey(id);
var fromCache = Cache.GetCacheItem<TEntity>(cacheKey);
// if found in cache then return else fetch and cache
if (fromCache != null)
return fromCache;
var entity = getFromRepo(id);
var entity = performGet(id);
//set the disposal action
SetCacheAction(cacheKey, entity);
if (entity != null && entity.HasIdentity)
InsertEntity(cacheKey, entity);
return entity;
}
public override TEntity Get(TId id)
/// <inheritdoc />
public override TEntity GetCached(TId id)
{
var cacheKey = GetCacheIdKey(id);
var cacheKey = GetEntityCacheKey(id);
return Cache.GetCacheItem<TEntity>(cacheKey);
}
public override bool Exists(TId id, Func<TId, bool> getFromRepo)
/// <inheritdoc />
public override bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
if (getFromRepo == null) throw new ArgumentNullException("getFromRepo");
var cacheKey = GetCacheIdKey(id);
// if found in cache the return else check
var cacheKey = GetEntityCacheKey(id);
var fromCache = Cache.GetCacheItem<TEntity>(cacheKey);
return fromCache != null || getFromRepo(id);
return fromCache != null || performExists(id);
}
public override TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> getFromRepo)
/// <inheritdoc />
public override TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
if (getFromRepo == null) throw new ArgumentNullException("getFromRepo");
if (ids.Any())
if (ids.Length > 0)
{
var entities = ids.Select(Get).ToArray();
if (ids.Length.Equals(entities.Length) && entities.Any(x => x == null) == false)
return entities;
// try to get each entity from the cache
// if we can find all of them, return
var entities = ids.Select(GetCached).WhereNotNull().ToArray();
if (ids.Length.Equals(entities.Length))
return entities; // no need for null checks, we are not caching nulls
}
else
{
var allEntities = GetAllFromCache();
if (allEntities.Any())
// get everything we have
var entities = Cache.GetCacheItemsByKeySearch<TEntity>(GetEntityTypeCacheKey())
.ToArray(); // no need for null checks, we are not caching nulls
if (entities.Length > 0)
{
// if some of them were in the cache...
if (_options.GetAllCacheValidateCount)
{
//Get count of all entities of current type (TEntity) to ensure cached result is correct
// need to validate the count, get the actual count and return if ok
var totalCount = _options.PerformCount();
if (allEntities.Length == totalCount)
return allEntities;
if (entities.Length == totalCount)
return entities;
}
else
{
return allEntities;
// no need to validate, just return what we have and assume it's all there is
return entities;
}
}
else if (_options.GetAllCacheAllowZeroCount)
{
//if the repository allows caching a zero count, then check the zero count cache
if (HasZeroCountCache())
{
//there is a zero count cache so return an empty list
return new TEntity[] {};
}
// if none of them were in the cache
// and we allow zero count - check for the special (empty) entry
var empty = Cache.GetCacheItem<TEntity[]>(GetEntityTypeCacheKey());
if (empty != null) return empty;
}
}
//we need to do the lookup from the repo
var entityCollection = getFromRepo(ids)
//ensure we don't include any null refs in the returned collection!
.WhereNotNull()
// cache failed, get from repo and cache
var repoEntities = performGetAll(ids)
.WhereNotNull() // exclude nulls!
.Where(x => x.HasIdentity) // be safe, though would be weird...
.ToArray();
//set the disposal action
SetCacheAction(ids, entityCollection);
// note: if empty & allow zero count, will cache a special (empty) entry
InsertEntities(ids, repoEntities);
return entityCollection;
return repoEntities;
}
/// <summary>
/// Looks up the zero count cache, must return null if it doesn't exist
/// </summary>
/// <returns></returns>
protected bool HasZeroCountCache()
/// <inheritdoc />
public override void ClearAll()
{
var zeroCount = Cache.GetCacheItem<TEntity[]>(GetCacheTypeKey());
return (zeroCount != null && zeroCount.Any() == false);
Cache.ClearAllCache();
}
/// <summary>
/// Performs the lookup for all entities of this type from the cache
/// </summary>
/// <returns></returns>
protected TEntity[] GetAllFromCache()
{
var allEntities = Cache.GetCacheItemsByKeySearch<TEntity>(GetCacheTypeKey())
.WhereNotNull()
.ToArray();
return allEntities.Any() ? allEntities : new TEntity[] {};
}
/// <summary>
/// Sets the action to execute on disposal for a single entity
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="entity"></param>
protected virtual void SetCacheAction(string cacheKey, TEntity entity)
{
if (entity == null) return;
SetCacheAction(() =>
{
//just to be safe, we cannot cache an item without an identity
if (entity.HasIdentity)
{
Cache.InsertCacheItem(cacheKey, () => entity,
timeout: TimeSpan.FromMinutes(5),
isSliding: true);
}
});
}
/// <summary>
/// Sets the action to execute on disposal for an entity collection
/// </summary>
/// <param name="ids"></param>
/// <param name="entityCollection"></param>
protected virtual void SetCacheAction(TId[] ids, TEntity[] entityCollection)
{
SetCacheAction(() =>
{
//This option cannot execute if we are looking up specific Ids
if (ids.Any() == false && entityCollection.Length == 0 && _options.GetAllCacheAllowZeroCount)
{
//there was nothing returned but we want to cache a zero count result so add an TEntity[] to the cache
// to signify that there is a zero count cache
//NOTE: Don't set expiry/sliding for a zero count
Cache.InsertCacheItem(GetCacheTypeKey(), () => new TEntity[] {});
}
else
{
//This is the default behavior, we'll individually cache each item so that if/when these items are resolved
// by id, they are returned from the already existing cache.
foreach (var entity in entityCollection.WhereNotNull())
{
var localCopy = entity;
//just to be safe, we cannot cache an item without an identity
if (localCopy.HasIdentity)
{
Cache.InsertCacheItem(GetCacheIdKey(entity.Id), () => localCopy,
timeout: TimeSpan.FromMinutes(5),
isSliding: true);
}
}
}
});
}
}
}
@@ -1,27 +0,0 @@
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Cache
{
/// <summary>
/// Creates cache policies
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TId"></typeparam>
internal class DefaultRepositoryCachePolicyFactory<TEntity, TId> : IRepositoryCachePolicyFactory<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private readonly IRuntimeCacheProvider _runtimeCache;
private readonly RepositoryCachePolicyOptions _options;
public DefaultRepositoryCachePolicyFactory(IRuntimeCacheProvider runtimeCache, RepositoryCachePolicyOptions options)
{
_runtimeCache = runtimeCache;
_options = options;
}
public virtual IRepositoryCachePolicy<TEntity, TId> CreatePolicy()
{
return new DefaultRepositoryCachePolicy<TEntity, TId>(_runtimeCache, _options);
}
}
}
@@ -3,227 +3,178 @@ using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Collections;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
/// <summary>
/// A caching policy that caches an entire dataset as a single collection
/// Represents a caching policy that caches the entire entities set as a single collection.
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TId"></typeparam>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <typeparam name="TId">The type of the identifier.</typeparam>
/// <remarks>
/// <para>Caches the entire set of entities as a single collection.</para>
/// <para>Used by Content-, Media- and MemberTypeRepository, DataTypeRepository, DomainRepository,
/// LanguageRepository, PublicAccessRepository, TemplateRepository... things that make sense to
/// keep as a whole in memory.</para>
/// </remarks>
internal class FullDataSetRepositoryCachePolicy<TEntity, TId> : RepositoryCachePolicyBase<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private readonly Func<TEntity, TId> _getEntityId;
private readonly Func<IEnumerable<TEntity>> _getAllFromRepo;
private readonly Func<TEntity, TId> _entityGetId;
private readonly bool _expires;
public FullDataSetRepositoryCachePolicy(IRuntimeCacheProvider cache, Func<TEntity, TId> getEntityId, Func<IEnumerable<TEntity>> getAllFromRepo, bool expires)
public FullDataSetRepositoryCachePolicy(IRuntimeCacheProvider cache, Func<TEntity, TId> entityGetId, bool expires)
: base(cache)
{
_getEntityId = getEntityId;
_getAllFromRepo = getAllFromRepo;
_entityGetId = entityGetId;
_expires = expires;
}
private bool? _hasZeroCountCache;
public override IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope)
{
return new ScopedRepositoryCachePolicy<TEntity, TId>(this, runtimeCache, scope);
}
protected static readonly TId[] EmptyIds = new TId[0]; // const
protected string GetCacheTypeKey()
protected string GetEntityTypeCacheKey()
{
return string.Format("uRepo_{0}_", typeof(TEntity).Name);
}
public override void CreateOrUpdate(TEntity entity, Action<TEntity> persistMethod)
protected void InsertEntities(TEntity[] entities)
{
if (entity == null) throw new ArgumentNullException("entity");
if (persistMethod == null) throw new ArgumentNullException("persistMethod");
// cache is expected to be a deep-cloning cache ie it deep-clones whatever is
// IDeepCloneable when it goes in, and out. it also resets dirty properties,
// making sure that no 'dirty' entity is cached.
//
// this policy is caching the entire list of entities. to ensure that entities
// are properly deep-clones when cached, it uses a DeepCloneableList. however,
// we don't want to deep-clone *each* entity in the list when fetching it from
// cache as that would not be efficient for Get(id). so the DeepCloneableList is
// set to ListCloneBehavior.CloneOnce ie it will clone *once* when inserting,
// and then will *not* clone when retrieving.
try
if (_expires)
{
persistMethod(entity);
//set the disposal action
SetCacheAction(() =>
{
//Clear all
Cache.ClearCacheItem(GetCacheTypeKey());
});
Cache.InsertCacheItem(GetEntityTypeCacheKey(), () => new DeepCloneableList<TEntity>(entities), TimeSpan.FromMinutes(5), true);
}
catch
else
{
//set the disposal action
SetCacheAction(() =>
{
//Clear all
Cache.ClearCacheItem(GetCacheTypeKey());
});
throw;
Cache.InsertCacheItem(GetEntityTypeCacheKey(), () => new DeepCloneableList<TEntity>(entities));
}
}
public override void Remove(TEntity entity, Action<TEntity> persistMethod)
/// <inheritdoc />
public override void Create(TEntity entity, Action<TEntity> persistNew)
{
if (entity == null) throw new ArgumentNullException("entity");
if (persistMethod == null) throw new ArgumentNullException("persistMethod");
try
{
persistMethod(entity);
persistNew(entity);
}
finally
{
//set the disposal action
SetCacheAction(() =>
{
//Clear all
Cache.ClearCacheItem(GetCacheTypeKey());
});
ClearAll();
}
}
public override TEntity Get(TId id, Func<TId, TEntity> getFromRepo)
/// <inheritdoc />
public override void Update(TEntity entity, Action<TEntity> persistUpdated)
{
//Force get all with cache
var found = GetAll(new TId[] { }, ids => _getAllFromRepo().WhereNotNull());
if (entity == null) throw new ArgumentNullException("entity");
//we don't have anything in cache (this should never happen), just return from the repo
if (found == null) return getFromRepo(id);
var entity = found.FirstOrDefault(x => _getEntityId(x).Equals(id));
if (entity == null) return null;
//We must ensure to deep clone each one out manually since the deep clone list only clones one way
return (TEntity)entity.DeepClone();
}
public override TEntity Get(TId id)
{
//Force get all with cache
var found = GetAll(new TId[] { }, ids => _getAllFromRepo().WhereNotNull());
//we don't have anything in cache (this should never happen), just return null
if (found == null) return null;
var entity = found.FirstOrDefault(x => _getEntityId(x).Equals(id));
if (entity == null) return null;
//We must ensure to deep clone each one out manually since the deep clone list only clones one way
return (TEntity)entity.DeepClone();
}
public override bool Exists(TId id, Func<TId, bool> getFromRepo)
{
//Force get all with cache
var found = GetAll(new TId[] { }, ids => _getAllFromRepo().WhereNotNull());
//we don't have anything in cache (this should never happen), just return from the repo
return found == null
? getFromRepo(id)
: found.Any(x => _getEntityId(x).Equals(id));
}
public override TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> getFromRepo)
{
//process getting all including setting the cache callback
var result = PerformGetAll(getFromRepo);
//now that the base result has been calculated, they will all be cached.
// Now we can just filter by ids if they have been supplied
return (ids.Any()
? result.Where(x => ids.Contains(_getEntityId(x))).ToArray()
: result)
//We must ensure to deep clone each one out manually since the deep clone list only clones one way
.Select(x => (TEntity)x.DeepClone())
.ToArray();
}
private TEntity[] PerformGetAll(Func<TId[], IEnumerable<TEntity>> getFromRepo)
{
var allEntities = GetAllFromCache();
if (allEntities.Any())
try
{
return allEntities;
persistUpdated(entity);
}
//check the zero count cache
if (HasZeroCountCache())
finally
{
//there is a zero count cache so return an empty list
return new TEntity[] { };
ClearAll();
}
//we need to do the lookup from the repo
var entityCollection = getFromRepo(new TId[] { })
//ensure we don't include any null refs in the returned collection!
.WhereNotNull()
.ToArray();
//set the disposal action
SetCacheAction(entityCollection);
return entityCollection;
}
/// <summary>
/// For this type of caching policy, we don't cache individual items
/// </summary>
/// <param name="cacheKey"></param>
/// <param name="entity"></param>
protected void SetCacheAction(string cacheKey, TEntity entity)
/// <inheritdoc />
public override void Delete(TEntity entity, Action<TEntity> persistDeleted)
{
//No-op
}
if (entity == null) throw new ArgumentNullException("entity");
/// <summary>
/// Sets the action to execute on disposal for an entity collection
/// </summary>
/// <param name="entityCollection"></param>
protected void SetCacheAction(TEntity[] entityCollection)
{
//set the disposal action
SetCacheAction(() =>
try
{
//We want to cache the result as a single collection
if (_expires)
{
Cache.InsertCacheItem(GetCacheTypeKey(), () => new DeepCloneableList<TEntity>(entityCollection),
timeout: TimeSpan.FromMinutes(5),
isSliding: true);
}
else
{
Cache.InsertCacheItem(GetCacheTypeKey(), () => new DeepCloneableList<TEntity>(entityCollection));
}
});
persistDeleted(entity);
}
finally
{
ClearAll();
}
}
/// <summary>
/// Looks up the zero count cache, must return null if it doesn't exist
/// </summary>
/// <returns></returns>
protected bool HasZeroCountCache()
/// <inheritdoc />
public override TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
if (_hasZeroCountCache.HasValue)
return _hasZeroCountCache.Value;
// get all from the cache, then look for the entity
var all = GetAllCached(performGetAll);
var entity = all.FirstOrDefault(x => _entityGetId(x).Equals(id));
_hasZeroCountCache = Cache.GetCacheItem<DeepCloneableList<TEntity>>(GetCacheTypeKey()) != null;
return _hasZeroCountCache.Value;
// see note in InsertEntities - what we get here is the original
// cached entity, not a clone, so we need to manually ensure it is deep-cloned.
return entity == null ? null : (TEntity) entity.DeepClone();
}
/// <summary>
/// This policy will cache the full data set as a single collection
/// </summary>
/// <returns></returns>
protected TEntity[] GetAllFromCache()
/// <inheritdoc />
public override TEntity GetCached(TId id)
{
var found = Cache.GetCacheItem<DeepCloneableList<TEntity>>(GetCacheTypeKey());
// get all from the cache -- and only the cache, then look for the entity
var all = Cache.GetCacheItem<DeepCloneableList<TEntity>>(GetEntityTypeCacheKey());
var entity = all == null ? null : all.FirstOrDefault(x => _entityGetId(x).Equals(id));
//This method will get called before checking for zero count cache, so we'll just set the flag here
_hasZeroCountCache = found != null;
return found == null ? new TEntity[] { } : found.WhereNotNull().ToArray();
// see note in InsertEntities - what we get here is the original
// cached entity, not a clone, so we need to manually ensure it is deep-cloned.
return entity == null ? null : (TEntity)entity.DeepClone();
}
/// <inheritdoc />
public override bool Exists(TId id, Func<TId, bool> performExits, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
// get all as one set, then look for the entity
var all = GetAllCached(performGetAll);
return all.Any(x => _entityGetId(x).Equals(id));
}
/// <inheritdoc />
public override TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
// get all as one set, from cache if possible, else repo
var all = GetAllCached(performGetAll);
// if ids have been specified, filter
if (ids.Length > 0) all = all.Where(x => ids.Contains(_entityGetId(x)));
// and return
// see note in SetCacheActionToInsertEntities - what we get here is the original
// cached entities, not clones, so we need to manually ensure they are deep-cloned.
return all.Select(x => (TEntity) x.DeepClone()).ToArray();
}
// does NOT clone anything, so be nice with the returned values
private IEnumerable<TEntity> GetAllCached(Func<TId[], IEnumerable<TEntity>> performGetAll)
{
// try the cache first
var all = Cache.GetCacheItem<DeepCloneableList<TEntity>>(GetEntityTypeCacheKey());
if (all != null) return all.ToArray();
// else get from repo and cache
var entities = performGetAll(EmptyIds).WhereNotNull().ToArray();
InsertEntities(entities); // may be an empty array...
return entities;
}
/// <inheritdoc />
public override void ClearAll()
{
Cache.ClearCacheItem(GetEntityTypeCacheKey());
}
}
}
@@ -1,33 +0,0 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Cache
{
/// <summary>
/// Creates cache policies
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TId"></typeparam>
internal class FullDataSetRepositoryCachePolicyFactory<TEntity, TId> : IRepositoryCachePolicyFactory<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private readonly IRuntimeCacheProvider _runtimeCache;
private readonly Func<TEntity, TId> _getEntityId;
private readonly Func<IEnumerable<TEntity>> _getAllFromRepo;
private readonly bool _expires;
public FullDataSetRepositoryCachePolicyFactory(IRuntimeCacheProvider runtimeCache, Func<TEntity, TId> getEntityId, Func<IEnumerable<TEntity>> getAllFromRepo, bool expires)
{
_runtimeCache = runtimeCache;
_getEntityId = getEntityId;
_getAllFromRepo = getAllFromRepo;
_expires = expires;
}
public virtual IRepositoryCachePolicy<TEntity, TId> CreatePolicy()
{
return new FullDataSetRepositoryCachePolicy<TEntity, TId>(_runtimeCache, _getEntityId, _getAllFromRepo, _expires);
}
}
}
@@ -154,7 +154,7 @@ namespace Umbraco.Core.Cache
value = result.Value; // will not throw (safe lazy)
var eh = value as ExceptionHolder;
if (eh != null) throw eh.Exception; // throw once!
if (eh != null) throw new Exception("Exception while creating a value.", eh.Exception); // throw once!
return value;
}
@@ -1,18 +1,97 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
internal interface IRepositoryCachePolicy<TEntity, TId> : IDisposable
internal interface IRepositoryCachePolicy<TEntity, TId>
where TEntity : class, IAggregateRoot
{
TEntity Get(TId id, Func<TId, TEntity> getFromRepo);
TEntity Get(TId id);
bool Exists(TId id, Func<TId, bool> getFromRepo);
void CreateOrUpdate(TEntity entity, Action<TEntity> persistMethod);
void Remove(TEntity entity, Action<TEntity> persistMethod);
TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> getFromRepo);
// note:
// at the moment each repository instance creates its corresponding cache policy instance
// we could reduce allocations by using static cache policy instances but then we would need
// to modify all methods here to pass the repository and cache eg:
//
// TEntity Get(TRepository repository, IRuntimeCacheProvider cache, TId id);
//
// it is not *that* complicated but then RepositoryBase needs to have a TRepository generic
// type parameter and it all becomes convoluted - keeping it simple for the time being.
/// <summary>
/// Creates a scoped version of this cache policy.
/// </summary>
/// <param name="runtimeCache">The global isolated runtime cache for this policy.</param>
/// <param name="scope">The scope.</param>
/// <remarks>When a policy is scoped, it means that it has been created with a scoped
/// isolated runtime cache, and now it needs to be wrapped into something that can apply
/// changes to the global isolated runtime cache.</remarks>
IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope);
/// <summary>
/// Gets an entity from the cache, else from the repository.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="performGet">The repository PerformGet method.</param>
/// <param name="performGetAll">The repository PerformGetAll method.</param>
/// <returns>The entity with the specified identifier, if it exits, else null.</returns>
/// <remarks>First considers the cache then the repository.</remarks>
TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll);
/// <summary>
/// Gets an entity from the cache.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>The entity with the specified identifier, if it is in the cache already, else null.</returns>
/// <remarks>Does not consider the repository at all.</remarks>
TEntity GetCached(TId id);
/// <summary>
/// Gets a value indicating whether an entity with a specified identifier exists.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="performExists">The repository PerformExists method.</param>
/// <param name="performGetAll">The repository PerformGetAll method.</param>
/// <returns>A value indicating whether an entity with the specified identifier exists.</returns>
/// <remarks>First considers the cache then the repository.</remarks>
bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>> performGetAll);
/// <summary>
/// Creates an entity.
/// </summary>
/// <param name="entity">The entity.</param>
/// <param name="persistNew">The repository PersistNewItem method.</param>
/// <remarks>Creates the entity in the repository, and updates the cache accordingly.</remarks>
void Create(TEntity entity, Action<TEntity> persistNew);
/// <summary>
/// Updates an entity.
/// </summary>
/// <param name="entity">The entity.</param>
/// <param name="persistUpdated">The reopsitory PersistUpdatedItem method.</param>
/// <remarks>Updates the entity in the repository, and updates the cache accordingly.</remarks>
void Update(TEntity entity, Action<TEntity> persistUpdated);
/// <summary>
/// Removes an entity.
/// </summary>
/// <param name="entity">The entity.</param>
/// <param name="persistDeleted">The repository PersistDeletedItem method.</param>
/// <remarks>Removes the entity from the repository and clears the cache.</remarks>
void Delete(TEntity entity, Action<TEntity> persistDeleted);
/// <summary>
/// Gets entities.
/// </summary>
/// <param name="ids">The identifiers.</param>
/// <param name="performGetAll">The repository PerformGetAll method.</param>
/// <returns>If <paramref name="ids"/> is empty, all entities, else the entities with the specified identifiers.</returns>
/// <remarks>Get all the entities. Either from the cache or the repository depending on the implementation.</remarks>
TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll);
/// <summary>
/// Clears the entire cache.
/// </summary>
void ClearAll();
}
}
@@ -1,9 +0,0 @@
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Cache
{
internal interface IRepositoryCachePolicyFactory<TEntity, TId> where TEntity : class, IAggregateRoot
{
IRepositoryCachePolicy<TEntity, TId> CreatePolicy();
}
}
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
internal class NoRepositoryCachePolicy<TEntity, TId> : IRepositoryCachePolicy<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private static readonly NoRepositoryCachePolicy<TEntity, TId> StaticInstance = new NoRepositoryCachePolicy<TEntity, TId>();
private NoRepositoryCachePolicy()
{ }
public static NoRepositoryCachePolicy<TEntity, TId> Instance { get { return StaticInstance; } }
public IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope)
{
throw new NotImplementedException();
}
public TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
return performGet(id);
}
public TEntity GetCached(TId id)
{
return null;
}
public bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
return performExists(id);
}
public void Create(TEntity entity, Action<TEntity> persistNew)
{
persistNew(entity);
}
public void Update(TEntity entity, Action<TEntity> persistUpdated)
{
persistUpdated(entity);
}
public void Delete(TEntity entity, Action<TEntity> persistDeleted)
{
persistDeleted(entity);
}
public TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
return performGetAll(ids).ToArray();
}
public void ClearAll()
{ }
}
}
@@ -1,27 +0,0 @@
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Cache
{
/// <summary>
/// Creates cache policies
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TId"></typeparam>
internal class OnlySingleItemsRepositoryCachePolicyFactory<TEntity, TId> : IRepositoryCachePolicyFactory<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private readonly IRuntimeCacheProvider _runtimeCache;
private readonly RepositoryCachePolicyOptions _options;
public OnlySingleItemsRepositoryCachePolicyFactory(IRuntimeCacheProvider runtimeCache, RepositoryCachePolicyOptions options)
{
_runtimeCache = runtimeCache;
_options = options;
}
public virtual IRepositoryCachePolicy<TEntity, TId> CreatePolicy()
{
return new SingleItemsOnlyRepositoryCachePolicy<TEntity, TId>(_runtimeCache, _options);
}
}
}
@@ -1,48 +1,51 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
internal abstract class RepositoryCachePolicyBase<TEntity, TId> : DisposableObject, IRepositoryCachePolicy<TEntity, TId>
/// <summary>
/// A base class for repository cache policies.
/// </summary>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <typeparam name="TId">The type of the identifier.</typeparam>
internal abstract class RepositoryCachePolicyBase<TEntity, TId> : IRepositoryCachePolicy<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private Action _action;
protected RepositoryCachePolicyBase(IRuntimeCacheProvider cache)
{
if (cache == null) throw new ArgumentNullException("cache");
if (cache == null) throw new ArgumentNullException("cache");
Cache = cache;
}
public abstract IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope);
protected IRuntimeCacheProvider Cache { get; private set; }
/// <summary>
/// The disposal performs the caching
/// </summary>
protected override void DisposeResources()
{
if (_action != null)
{
_action();
}
}
/// <inheritdoc />
public abstract TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll);
/// <summary>
/// Sets the action to execute on disposal
/// </summary>
/// <param name="action"></param>
protected void SetCacheAction(Action action)
{
_action = action;
}
/// <inheritdoc />
public abstract TEntity GetCached(TId id);
/// <inheritdoc />
public abstract bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>> performGetAll);
/// <inheritdoc />
public abstract void Create(TEntity entity, Action<TEntity> persistNew);
/// <inheritdoc />
public abstract void Update(TEntity entity, Action<TEntity> persistUpdated);
/// <inheritdoc />
public abstract void Delete(TEntity entity, Action<TEntity> persistDeleted);
/// <inheritdoc />
public abstract TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll);
/// <inheritdoc />
public abstract void ClearAll();
public abstract TEntity Get(TId id, Func<TId, TEntity> getFromRepo);
public abstract TEntity Get(TId id);
public abstract bool Exists(TId id, Func<TId, bool> getFromRepo);
public abstract void CreateOrUpdate(TEntity entity, Action<TEntity> persistMethod);
public abstract void Remove(TEntity entity, Action<TEntity> persistMethod);
public abstract TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> getFromRepo);
}
}
@@ -2,6 +2,9 @@ using System;
namespace Umbraco.Core.Cache
{
/// <summary>
/// Specifies how a repository cache policy should cache entities.
/// </summary>
internal class RepositoryCachePolicyOptions
{
/// <summary>
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Scoping;
namespace Umbraco.Core.Cache
{
internal class ScopedRepositoryCachePolicy<TEntity, TId> : IRepositoryCachePolicy<TEntity, TId>
where TEntity : class, IAggregateRoot
{
private readonly IRepositoryCachePolicy<TEntity, TId> _cachePolicy;
private readonly IRuntimeCacheProvider _globalIsolatedCache;
private readonly IScope _scope;
public ScopedRepositoryCachePolicy(IRepositoryCachePolicy<TEntity, TId> cachePolicy, IRuntimeCacheProvider globalIsolatedCache, IScope scope)
{
_cachePolicy = cachePolicy;
_globalIsolatedCache = globalIsolatedCache;
_scope = scope;
}
public IRepositoryCachePolicy<TEntity, TId> Scoped(IRuntimeCacheProvider runtimeCache, IScope scope)
{
throw new InvalidOperationException(); // obviously
}
public TEntity Get(TId id, Func<TId, TEntity> performGet, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
// loads into the local cache only, ok for now
return _cachePolicy.Get(id, performGet, performGetAll);
}
public TEntity GetCached(TId id)
{
// loads into the local cache only, ok for now
return _cachePolicy.GetCached(id);
}
public bool Exists(TId id, Func<TId, bool> performExists, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
// loads into the local cache only, ok for now
return _cachePolicy.Exists(id, performExists, performGetAll);
}
public void Create(TEntity entity, Action<TEntity> persistNew)
{
// writes into the local cache
_cachePolicy.Create(entity, persistNew);
}
public void Update(TEntity entity, Action<TEntity> persistUpdated)
{
// writes into the local cache
_cachePolicy.Update(entity, persistUpdated);
}
public void Delete(TEntity entity, Action<TEntity> persistDeleted)
{
// deletes the local cache
_cachePolicy.Delete(entity, persistDeleted);
}
public TEntity[] GetAll(TId[] ids, Func<TId[], IEnumerable<TEntity>> performGetAll)
{
// loads into the local cache only, ok for now
return _cachePolicy.GetAll(ids, performGetAll);
}
public void ClearAll()
{
// clears the local cache
_cachePolicy.ClearAll();
}
}
}
@@ -1,24 +1,27 @@
using System.Linq;
using Umbraco.Core.Collections;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Cache
{
/// <summary>
/// A caching policy that ignores all caches for GetAll - it will only cache calls for individual items
/// Represents a special policy that does not cache the result of GetAll.
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TId"></typeparam>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <typeparam name="TId">The type of the identifier.</typeparam>
/// <remarks>
/// <para>Overrides the default repository cache policy and does not writes the result of GetAll
/// to cache, but only the result of individual Gets. It does read the cache for GetAll, though.</para>
/// <para>Used by DictionaryRepository.</para>
/// </remarks>
internal class SingleItemsOnlyRepositoryCachePolicy<TEntity, TId> : DefaultRepositoryCachePolicy<TEntity, TId>
where TEntity : class, IAggregateRoot
{
public SingleItemsOnlyRepositoryCachePolicy(IRuntimeCacheProvider cache, RepositoryCachePolicyOptions options) : base(cache, options)
public SingleItemsOnlyRepositoryCachePolicy(IRuntimeCacheProvider cache, RepositoryCachePolicyOptions options)
: base(cache, options)
{ }
protected override void InsertEntities(TId[] ids, TEntity[] entities)
{
}
protected override void SetCacheAction(TId[] ids, TEntity[] entityCollection)
{
//no-op
// nop
}
}
}
+8 -1
View File
@@ -21,6 +21,10 @@ namespace Umbraco.Core
private static readonly ICacheProvider NullRequestCache = new NullCacheProvider();
private static readonly ICacheProvider NullStaticCache = new NullCacheProvider();
private static readonly IRuntimeCacheProvider NullRuntimeCache = new NullCacheProvider();
private static readonly IsolatedRuntimeCache NullIsolatedCache = new IsolatedRuntimeCache(_ => NullRuntimeCache);
private static readonly CacheHelper NullCache = new CacheHelper(NullRuntimeCache, NullStaticCache, NullRequestCache, NullIsolatedCache);
public static CacheHelper NoCache { get { return NullCache; } }
/// <summary>
/// Creates a cache helper with disabled caches
@@ -31,7 +35,10 @@ namespace Umbraco.Core
/// </remarks>
public static CacheHelper CreateDisabledCacheHelper()
{
return new CacheHelper(NullRuntimeCache, NullStaticCache, NullRequestCache, new IsolatedRuntimeCache(t => NullRuntimeCache));
// do *not* return NoCache
// NoCache is a special instance that is detected by RepositoryBase and disables all cache policies
// CreateDisabledCacheHelper is used in tests to use no cache, *but* keep all cache policies
return new CacheHelper(NullRuntimeCache, NullStaticCache, NullRequestCache, NullIsolatedCache);
}
/// <summary>
@@ -0,0 +1,15 @@
using System;
namespace Umbraco.Core.CodeAnnotations
{
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
internal class UmbracoUdiTypeAttribute : Attribute
{
public string UdiType { get; private set; }
public UmbracoUdiTypeAttribute(string udiType)
{
UdiType = udiType;
}
}
}
@@ -0,0 +1,9 @@
namespace Umbraco.Core.Configuration
{
internal enum ContentXmlStorage
{
Default,
AspNetTemp,
EnvironmentTemp
}
}
@@ -0,0 +1,27 @@
using System;
namespace Umbraco.Core.Configuration
{
internal static class CoreDebugExtensions
{
private static CoreDebug _coreDebug;
public static CoreDebug CoreDebug(this UmbracoConfig config)
{
return _coreDebug ?? (_coreDebug = new CoreDebug());
}
}
internal class CoreDebug
{
public CoreDebug()
{
var appSettings = System.Configuration.ConfigurationManager.AppSettings;
LogUncompletedScopes = string.Equals("true", appSettings["Umbraco.CoreDebug.LogUncompletedScopes"], StringComparison.OrdinalIgnoreCase);
}
// when true, Scope logs the stack trace for any scope that gets disposed without being completed.
// this helps troubleshooting rogue scopes that we forget to complete
public bool LogUncompletedScopes { get; private set; }
}
}
@@ -212,7 +212,7 @@ namespace Umbraco.Core.Configuration
{
get
{
var settings = ConfigurationManager.ConnectionStrings[UmbracoConnectionName];
var settings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName];
var connectionString = string.Empty;
if (settings != null)
@@ -241,10 +241,7 @@ namespace Umbraco.Core.Configuration
}
}
}
//TODO: Move these to constants!
public const string UmbracoConnectionName = "umbracoDbDSN";
public const string UmbracoMigrationName = "Umbraco";
/// <summary>
/// Gets or sets the configuration status. This will return the version number of the currently installed umbraco instance.
@@ -520,12 +517,25 @@ namespace Umbraco.Core.Configuration
}
internal static bool ContentCacheXmlStoredInCodeGen
{
get { return ContentCacheXmlStorageLocation == ContentXmlStorage.AspNetTemp; }
}
internal static ContentXmlStorage ContentCacheXmlStorageLocation
{
get
{
//defaults to false
return ConfigurationManager.AppSettings.ContainsKey("umbracoContentXMLUseLocalTemp")
&& bool.Parse(ConfigurationManager.AppSettings["umbracoContentXMLUseLocalTemp"]); //default to false
if (ConfigurationManager.AppSettings.ContainsKey("umbracoContentXMLStorage"))
{
return Enum<ContentXmlStorage>.Parse(ConfigurationManager.AppSettings["umbracoContentXMLStorage"]);
}
if (ConfigurationManager.AppSettings.ContainsKey("umbracoContentXMLUseLocalTemp"))
{
return bool.Parse(ConfigurationManager.AppSettings["umbracoContentXMLUseLocalTemp"])
? ContentXmlStorage.AspNetTemp
: ContentXmlStorage.Default;
}
return ContentXmlStorage.Default;
}
}
@@ -159,6 +159,12 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return GetOptionalTextElement("defaultDocumentTypeProperty", "Textstring"); }
}
[ConfigurationProperty("showDeprecatedPropertyEditors")]
internal InnerTextConfigurationElement<bool> ShowDeprecatedPropertyEditors
{
get { return GetOptionalTextElement("showDeprecatedPropertyEditors", false); }
}
[ConfigurationProperty("EnableInheritedDocumentTypes")]
internal InnerTextConfigurationElement<bool> EnableInheritedDocumentTypes
{
@@ -171,6 +177,12 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return GetOptionalTextElement("EnableInheritedMediaTypes", true); }
}
[ConfigurationProperty("EnablePropertyValueConverters")]
internal InnerTextConfigurationElement<bool> EnablePropertyValueConverters
{
get { return GetOptionalTextElement("EnablePropertyValueConverters", false); }
}
string IContentSection.NotificationEmailAddress
{
get { return Notifications.NotificationEmailAddress; }
@@ -306,6 +318,11 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return DefaultDocumentTypeProperty; }
}
bool IContentSection.ShowDeprecatedPropertyEditors
{
get { return ShowDeprecatedPropertyEditors; }
}
bool IContentSection.EnableInheritedDocumentTypes
{
get { return EnableInheritedDocumentTypes; }
@@ -315,5 +332,9 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
{
get { return EnableInheritedMediaTypes; }
}
bool IContentSection.EnablePropertyValueConverters
{
get { return EnablePropertyValueConverters; }
}
}
}
@@ -60,8 +60,17 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
string DefaultDocumentTypeProperty { get; }
/// <summary>
/// The default for this is false but if you would like deprecated property editors displayed
/// in the data type editor you can enable this
/// </summary>
bool ShowDeprecatedPropertyEditors { get; }
bool EnableInheritedDocumentTypes { get; }
bool EnableInheritedMediaTypes { get; }
bool EnablePropertyValueConverters { get; }
}
}
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.5.8");
private static readonly Version Version = new Version("7.6.0");
/// <summary>
/// Gets the current version of Umbraco.
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration
/// Gets the version comment (like beta or RC).
/// </summary>
/// <value>The version comment.</value>
public static string CurrentComment { get { return ""; } }
public static string CurrentComment { get { return "beta03"; } }
// Get the version of the umbraco.dll by looking at a class in that dll
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
+7 -1
View File
@@ -112,9 +112,15 @@
public const string Languages = "languages";
public const string PartialViews = "partialViews";
public const string PartialViewMacros = "partialViewMacros";
public const string Scripts = "scripts";
//TODO: Fill in the rest!
}
}
}
}
+2 -1
View File
@@ -4,7 +4,8 @@ using Umbraco.Core.Models;
namespace Umbraco.Core
{
public static partial class Constants
public static partial class Constants
{
/// <summary>
/// Defines the identifiers for property-type alias conventions that are used within the Umbraco core.
@@ -0,0 +1,12 @@
namespace Umbraco.Core
{
public static partial class Constants
{
public static class DatabaseProviders
{
public const string SqlCe = "System.Data.SqlServerCe.4.0";
public const string SqlServer = "System.Data.SqlClient";
public const string MySql = "MySql.Data.MySqlClient";
}
}
}
@@ -0,0 +1,17 @@
namespace Umbraco.Core
{
public static partial class Constants
{
/// <summary>
/// Contains the valid selector values.
/// </summary>
public static class DeploySelector
{
public const string This = "this";
public const string ThisAndChildren = "this-and-children";
public const string ThisAndDescendants = "this-and-descendants";
public const string ChildrenOfThis = "children";
public const string DescendantsOfThis = "descendants";
}
}
}
+55
View File
@@ -89,6 +89,11 @@ namespace Umbraco.Core
/// </summary>
public const string Media = "B796F64C-1F99-4FFB-B886-4BF4BC011A9C";
/// <summary>
/// Guid for a Document object.
/// </summary>
public static readonly Guid MediaGuid = new Guid(Media);
/// <summary>
/// Guid for the Media Recycle Bin.
/// </summary>
@@ -109,6 +114,11 @@ namespace Umbraco.Core
/// </summary>
public const string Member = "39EB0F98-B348-42A1-8662-E7EB18487560";
/// <summary>
/// Guid for a Media Type object.
/// </summary>
public static readonly Guid MemberGuid = new Guid(Member);
/// <summary>
/// Guid for a Member Group object.
/// </summary>
@@ -143,6 +153,11 @@ namespace Umbraco.Core
/// </summary>
public const string Template = "6FBDE604-4178-42CE-A10B-8A2600A2F07D";
/// <summary>
/// Guid for a Template object.
/// </summary>
public static readonly Guid TemplateTypeGuid = new Guid(Template);
/// <summary>
/// Guid for a Lock object.
/// </summary>
@@ -152,6 +167,46 @@ namespace Umbraco.Core
/// Guid for a Lock object.
/// </summary>
public static readonly Guid LockObjectGuid = new Guid(LockObject);
/// <summary>
/// Guid for a relation type.
/// </summary>
public const string RelationType = "B1988FAD-8675-4F47-915A-B3A602BC5D8D";
/// <summary>
/// Guid for a relation type.
/// </summary>
public static readonly Guid RelationTypeGuid = new Guid(RelationType);
/// <summary>
/// Guid for a Forms Form.
/// </summary>
public const string FormsForm = "F5A9F787-6593-46F0-B8FF-BFD9BCA9F6BB";
/// <summary>
/// Guid for a Forms Form.
/// </summary>
public static readonly Guid FormsFormGuid = new Guid(FormsForm);
/// <summary>
/// Guid for a Forms PreValue Source.
/// </summary>
public const string FormsPreValue = "42D7BF9B-A362-4FEE-B45A-674D5C064B70";
/// <summary>
/// Guid for a Forms PreValue Source.
/// </summary>
public static readonly Guid FormsPreValueGuid = new Guid(FormsPreValue);
/// <summary>
/// Guid for a Forms DataSource.
/// </summary>
public const string FormsDataSource = "CFED6CE4-9359-443E-9977-9956FEB1D867";
/// <summary>
/// Guid for a Forms DataSource.
/// </summary>
public static readonly Guid FormsDataSourceGuid = new Guid(FormsDataSource);
}
}
}
+24 -7
View File
@@ -42,10 +42,14 @@ namespace Umbraco.Core
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string ContentPicker = "158AA029-24ED-4948-939E-C3DA209E5FBA";
[Obsolete("This is an obsoleted content picker, use ContentPicker2Alias instead")]
public const string ContentPickerAlias = "Umbraco.ContentPickerAlias";
/// <summary>
/// Alias for the Content Picker datatype.
/// </summary>
public const string ContentPickerAlias = "Umbraco.ContentPickerAlias";
public const string ContentPicker2Alias = "Umbraco.ContentPicker2";
/// <summary>
/// Guid for the Date datatype.
@@ -192,11 +196,15 @@ namespace Umbraco.Core
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string MediaPicker = "EAD69342-F06D-4253-83AC-28000225583B";
[Obsolete("This is an obsoleted picker, use MediaPicker2Alias instead")]
public const string MediaPickerAlias = "Umbraco.MediaPicker";
/// <summary>
/// Alias for the Media Picker datatype.
/// </summary>
public const string MediaPickerAlias = "Umbraco.MediaPicker";
public const string MediaPicker2Alias = "Umbraco.MediaPicker2";
[Obsolete("This is an obsoleted picker, use MediaPicker2Alias instead")]
public const string MultipleMediaPickerAlias = "Umbraco.MultipleMediaPicker";
/// <summary>
@@ -205,26 +213,32 @@ namespace Umbraco.Core
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string MemberPicker = "39F533E4-0551-4505-A64B-E0425C5CE775";
[Obsolete("This is an obsoleted picker, use MemberPicker2Alias instead")]
public const string MemberPickerAlias = "Umbraco.MemberPicker";
/// <summary>
/// Alias for the Member Picker datatype.
/// </summary>
public const string MemberPickerAlias = "Umbraco.MemberPicker";
public const string MemberPicker2Alias = "Umbraco.MemberPicker2";
/// <summary>
/// Alias for the Member Group Picker datatype.
/// </summary>
public const string MemberGroupPickerAlias = "Umbraco.MemberGroupPicker";
/// <summary>
/// Guid for the Multi-Node Tree Picker datatype
/// </summary>
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string MultiNodeTreePicker = "7E062C13-7C41-4AD9-B389-41D88AEEF87C";
[Obsolete("This is an obsoleted picker, use MultiNodeTreePicker2Alias instead")]
public const string MultiNodeTreePickerAlias = "Umbraco.MultiNodeTreePicker";
/// <summary>
/// Alias for the Multi-Node Tree Picker datatype
/// </summary>
public const string MultiNodeTreePickerAlias = "Umbraco.MultiNodeTreePicker";
public const string MultiNodeTreePicker2Alias = "Umbraco.MultiNodeTreePicker2";
/// <summary>
/// Guid for the Multiple Textstring datatype.
@@ -275,11 +289,14 @@ namespace Umbraco.Core
/// </summary>
[Obsolete("GUIDs are no longer used to reference Property Editors, use the Alias constant instead. This will be removed in future versions")]
public const string RelatedLinks = "71B8AD1A-8DC2-425C-B6B8-FAA158075E63";
[Obsolete("This is an obsoleted picker, use RelatedLinks2Alias instead")]
public const string RelatedLinksAlias = "Umbraco.RelatedLinks";
/// <summary>
/// Alias for the Related Links datatype.
/// Alias for the Related Links property editor.
/// </summary>
public const string RelatedLinksAlias = "Umbraco.RelatedLinks";
public const string RelatedLinks2Alias = "Umbraco.RelatedLinks2";
/// <summary>
/// Guid for the Slider datatype.
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.ComponentModel;
namespace Umbraco.Core
{
public static partial class Constants
{
public static class Security
{
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
public const string BackOfficeExternalAuthenticationType = "UmbracoExternalCookie";
public const string BackOfficeExternalCookieName = "UMB_EXTLOGIN";
public const string BackOfficeTokenAuthenticationType = "UmbracoBackOfficeToken";
public const string BackOfficeTwoFactorAuthenticationType = "UmbracoTwoFactorCookie";
/// <summary>
/// The prefix used for external identity providers for their authentication type
/// </summary>
/// <remarks>
/// By default we don't want to interfere with front-end external providers and their default setup, for back office the
/// providers need to be setup differently and each auth type for the back office will be prefixed with this value
/// </remarks>
public const string BackOfficeExternalAuthenticationTypePrefix = "Umbraco.";
public const string StartContentNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startcontentnode";
public const string StartMediaNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startmedianode";
public const string AllowedApplicationsClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/allowedapp";
public const string SessionIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/sessionid";
}
}
}
+3 -9
View File
@@ -26,15 +26,9 @@
public const int DefaultMediaListViewDataTypeId = -96;
public const int DefaultMembersListViewDataTypeId = -97;
// identifiers for lock objects
public const int ServersLock = -331;
}
public static class DatabaseProviders
{
public const string SqlCe = "System.Data.SqlServerCe.4.0";
public const string SqlServer = "System.Data.SqlClient";
public const string MySql = "MySql.Data.MySqlClient";
public const string UmbracoConnectionName = "umbracoDbDSN";
public const string UmbracoMigrationName = "Umbraco";
}
}
}
+1 -25
View File
@@ -29,30 +29,6 @@ namespace Umbraco.Core
public const string AuthCookieName = "UMB_UCONTEXT";
}
public static class Security
{
public const string BackOfficeAuthenticationType = "UmbracoBackOffice";
public const string BackOfficeExternalAuthenticationType = "UmbracoExternalCookie";
public const string BackOfficeExternalCookieName = "UMB_EXTLOGIN";
public const string BackOfficeTokenAuthenticationType = "UmbracoBackOfficeToken";
public const string BackOfficeTwoFactorAuthenticationType = "UmbracoTwoFactorCookie";
/// <summary>
/// The prefix used for external identity providers for their authentication type
/// </summary>
/// <remarks>
/// By default we don't want to interfere with front-end external providers and their default setup, for back office the
/// providers need to be setup differently and each auth type for the back office will be prefixed with this value
/// </remarks>
public const string BackOfficeExternalAuthenticationTypePrefix = "Umbraco.";
public const string StartContentNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startcontentnode";
public const string StartMediaNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startmedianode";
public const string AllowedApplicationsClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/allowedapp";
public const string SessionIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/sessionid";
}
}
}
+10 -8
View File
@@ -28,6 +28,7 @@ using Umbraco.Core.PropertyEditors.ValueConverters;
using Umbraco.Core.Publishing;
using Umbraco.Core.Macros;
using Umbraco.Core.Manifest;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Sync;
using Umbraco.Core.Strings;
@@ -105,11 +106,14 @@ namespace Umbraco.Core
LegacyParameterEditorAliasConverter.CreateMappingsForCoreEditors();
//create database and service contexts for the app context
var dbFactory = new DefaultDatabaseFactory(GlobalSettings.UmbracoConnectionName, ProfilingLogger.Logger);
var dbFactory = new DefaultDatabaseFactory(Constants.System.UmbracoConnectionName, ProfilingLogger.Logger);
Database.Mapper = new PetaPocoMapper();
var scopeProvider = new ScopeProvider(dbFactory);
dbFactory.ScopeProvider = scopeProvider;
var dbContext = new DatabaseContext(
dbFactory,
scopeProvider,
ProfilingLogger.Logger,
SqlSyntaxProviders.CreateDefault(ProfilingLogger.Logger));
@@ -117,7 +121,7 @@ namespace Umbraco.Core
dbContext.Initialize();
//get the service context
var serviceContext = CreateServiceContext(dbContext, dbFactory);
var serviceContext = CreateServiceContext(dbContext, scopeProvider);
//set property and singleton from response
ApplicationContext.Current = ApplicationContext = CreateApplicationContext(dbContext, serviceContext);
@@ -160,17 +164,15 @@ namespace Umbraco.Core
/// Creates and returns the service context for the app
/// </summary>
/// <param name="dbContext"></param>
/// <param name="dbFactory"></param>
/// <param name="scopeProvider"></param>
/// <returns></returns>
protected virtual ServiceContext CreateServiceContext(DatabaseContext dbContext, IDatabaseFactory dbFactory)
protected virtual ServiceContext CreateServiceContext(DatabaseContext dbContext, IScopeProvider scopeProvider)
{
//default transient factory
var msgFactory = new TransientMessagesFactory();
return new ServiceContext(
new RepositoryFactory(ApplicationCache, ProfilingLogger.Logger, dbContext.SqlSyntax, UmbracoConfig.For.UmbracoSettings()),
new PetaPocoUnitOfWorkProvider(dbFactory),
new FileUnitOfWorkProvider(),
new PublishingStrategy(msgFactory, ProfilingLogger.Logger),
new PetaPocoUnitOfWorkProvider(scopeProvider),
ApplicationCache,
ProfilingLogger.Logger,
msgFactory);
+190 -63
View File
@@ -4,7 +4,6 @@ using System.Data.SqlServerCe;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Xml.Linq;
using Semver;
using Umbraco.Core.Configuration;
@@ -14,6 +13,7 @@ using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Migrations;
using Umbraco.Core.Persistence.Migrations.Initial;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
namespace Umbraco.Core
@@ -26,31 +26,42 @@ namespace Umbraco.Core
/// </remarks>
public class DatabaseContext
{
private readonly IDatabaseFactory _factory;
internal readonly IScopeProviderInternal ScopeProvider;
private readonly ILogger _logger;
private readonly SqlSyntaxProviders _syntaxProviders;
private bool _configured;
private readonly object _locker = new object();
private string _connectionString;
private string _providerName;
private DatabaseSchemaResult _result;
private DateTime? _connectionLastChecked = null;
private DateTime? _connectionLastChecked;
/// <summary>
/// The number of minutes to throttle the checks to CanConnect
/// </summary>
private const int ConnectionCheckMinutes = 1;
#region Compatibility with 7.5
// note: the ctors accepting IDatabaseFactory are here only for backward compatibility purpose
//
// problem: IDatabaseFactory2 adds the CreateNewDatabase() method which creates a new database
// 'cos IDatabaseFactory CreateDatabase() is supposed to also manage the ambient thing. We
// want to keep these ctors for backward compatibility reasons (in case ppl use them in tests)
// so we need to create a scope provider (else nothing would work) and so we need a IDatabaseFactory2,
// so...?
// solution: wrap IDatabaseFactory and pretend we have a IDatabaseFactory2, it *should* work in most
// cases but really, it depends on what ppl are doing in their tests... yet, cannot really see any
// other way to do it?
[Obsolete("Use the constructor specifying all dependencies instead")]
public DatabaseContext(IDatabaseFactory factory)
: this(factory, LoggerResolver.Current.Logger, new SqlSyntaxProviders(new ISqlSyntaxProvider[]
{
new MySqlSyntaxProvider(LoggerResolver.Current.Logger),
new SqlCeSyntaxProvider(),
new SqlCeSyntaxProvider(),
new SqlServerSyntaxProvider()
}))
{
}
{ }
/// <summary>
/// Default constructor
@@ -64,7 +75,11 @@ namespace Umbraco.Core
if (logger == null) throw new ArgumentNullException("logger");
if (syntaxProviders == null) throw new ArgumentNullException("syntaxProviders");
_factory = factory;
var asDbFactory2 = factory as IDatabaseFactory2;
ScopeProvider = asDbFactory2 == null
? new ScopeProvider(new DatabaseFactoryWrapper(factory))
: new ScopeProvider(asDbFactory2);
_logger = logger;
_syntaxProviders = syntaxProviders;
}
@@ -81,7 +96,83 @@ namespace Umbraco.Core
_providerName = providerName;
SqlSyntax = sqlSyntax;
SqlSyntaxContext.SqlSyntaxProvider = SqlSyntax;
_factory = factory;
var asDbFactory2 = factory as IDatabaseFactory2;
ScopeProvider = asDbFactory2 == null
? new ScopeProvider(new DatabaseFactoryWrapper(factory))
: new ScopeProvider(asDbFactory2);
_logger = logger;
_configured = true;
}
private class DatabaseFactoryWrapper : IDatabaseFactory2
{
private readonly IDatabaseFactory _factory;
public DatabaseFactoryWrapper(IDatabaseFactory factory)
{
_factory = factory;
}
public UmbracoDatabase CreateDatabase()
{
return _factory.CreateDatabase();
}
public UmbracoDatabase CreateNewDatabase()
{
return CreateDatabase();
}
public void Dispose()
{
_factory.Dispose();
}
}
#endregion
[Obsolete("Use the constructor specifying all dependencies instead")]
internal DatabaseContext(IScopeProviderInternal scopeProvider)
: this(scopeProvider, LoggerResolver.Current.Logger, new SqlSyntaxProviders(new ISqlSyntaxProvider[]
{
new MySqlSyntaxProvider(LoggerResolver.Current.Logger),
new SqlCeSyntaxProvider(),
new SqlServerSyntaxProvider()
}))
{ }
/// <summary>
/// Default constructor
/// </summary>
/// <param name="scopeProvider"></param>
/// <param name="logger"></param>
/// <param name="syntaxProviders"></param>
internal DatabaseContext(IScopeProviderInternal scopeProvider, ILogger logger, SqlSyntaxProviders syntaxProviders)
{
if (scopeProvider == null) throw new ArgumentNullException("scopeProvider");
if (logger == null) throw new ArgumentNullException("logger");
if (syntaxProviders == null) throw new ArgumentNullException("syntaxProviders");
ScopeProvider = scopeProvider;
_logger = logger;
_syntaxProviders = syntaxProviders;
}
/// <summary>
/// Create a configured DatabaseContext
/// </summary>
/// <param name="scopeProvider"></param>
/// <param name="logger"></param>
/// <param name="sqlSyntax"></param>
/// <param name="providerName"></param>
internal DatabaseContext(IScopeProviderInternal scopeProvider, ILogger logger, ISqlSyntaxProvider sqlSyntax, string providerName)
{
_providerName = providerName;
SqlSyntax = sqlSyntax;
SqlSyntaxContext.SqlSyntaxProvider = SqlSyntax;
ScopeProvider = scopeProvider;
_logger = logger;
_configured = true;
}
@@ -89,16 +180,27 @@ namespace Umbraco.Core
public ISqlSyntaxProvider SqlSyntax { get; private set; }
/// <summary>
/// Gets the <see cref="Database"/> object for doing CRUD operations
/// against custom tables that resides in the Umbraco database.
/// Gets an "ambient" database for doing CRUD operations against custom tables that resides in the Umbraco database.
/// </summary>
/// <remarks>
/// This should not be used for CRUD operations or queries against the
/// standard Umbraco tables! Use the Public services for that.
/// <para>Should not be used for operation against standard Umbraco tables; as services should be used instead.</para>
/// <para>Gets or creates an "ambient" database that is either stored in http context + available for the whole
/// request + auto-disposed at the end of the request, or stored in call context if there is no http context - in which
/// case it *must* be explicitely disposed (which will remove it from call context).</para>
/// </remarks>
public virtual UmbracoDatabase Database
{
get { return _factory.CreateDatabase(); }
get
{
if (IsDatabaseConfigured == false)
{
throw new InvalidOperationException("Cannot create a database instance, there is no available connection string");
}
return ScopeProvider.GetAmbientOrNoScope().Database;
//var scope = ScopeProvider.AmbientScope;
//return scope != null ? scope.Database : ScopeProvider.CreateNoScope().Database;
}
}
/// <summary>
@@ -121,7 +223,7 @@ namespace Umbraco.Core
//Don't check again if the timeout period hasn't elapsed
//this ensures we don't keep checking the connection too many times in a row like during startup.
//Do check if the _connectionLastChecked is null which means we're just initializing or it could
//Do check if the _connectionLastChecked is null which means we're just initializing or it could
//not connect last time it was checked.
if ((_connectionLastChecked.HasValue && (DateTime.Now - _connectionLastChecked.Value).TotalMinutes > ConnectionCheckMinutes)
|| _connectionLastChecked.HasValue == false)
@@ -157,14 +259,14 @@ namespace Umbraco.Core
return _providerName;
_providerName = Constants.DatabaseProviders.SqlServer;
if (ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName] != null)
if (ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName] != null)
{
if (string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName) == false)
_providerName = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName;
if (string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName) == false)
_providerName = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName;
}
else
{
throw new InvalidOperationException("Can't find a connection string with the name '" + GlobalSettings.UmbracoConnectionName + "'");
throw new NullReferenceException("Can't find a connection string with the name '" + Constants.System.UmbracoConnectionName + "'");
}
return _providerName;
}
@@ -246,14 +348,14 @@ namespace Umbraco.Core
/// <param name="password">Database Password</param>
/// <param name="databaseProvider">Type of the provider to be used (Sql, Sql Azure, Sql Ce, MySql)</param>
public void ConfigureDatabaseConnection(string server, string databaseName, string user, string password, string databaseProvider)
{
{
string providerName;
var connectionString = GetDatabaseConnectionString(server, databaseName, user, password, databaseProvider, out providerName);
SaveConnectionString(connectionString, providerName);
Initialize(providerName);
}
public string GetDatabaseConnectionString(string server, string databaseName, string user, string password, string databaseProvider, out string providerName)
{
providerName = Constants.DatabaseProviders.SqlServer;
@@ -284,18 +386,18 @@ namespace Umbraco.Core
public string GetIntegratedSecurityDatabaseConnectionString(string server, string databaseName)
{
return String.Format("Server={0};Database={1};Integrated Security=true", server, databaseName);
return String.Format("Server={0};Database={1};Integrated Security=true", server, databaseName);
}
internal string BuildAzureConnectionString(string server, string databaseName, string user, string password)
{
if (server.Contains(".") && ServerStartsWithTcp(server) == false)
server = string.Format("tcp:{0}", server);
if (server.Contains(".") == false && ServerStartsWithTcp(server))
{
string serverName = server.Contains(",")
? server.Substring(0, server.IndexOf(",", StringComparison.Ordinal))
string serverName = server.Contains(",")
? server.Substring(0, server.IndexOf(",", StringComparison.Ordinal))
: server;
var portAddition = string.Empty;
@@ -305,10 +407,10 @@ namespace Umbraco.Core
server = string.Format("{0}.database.windows.net{1}", serverName, portAddition);
}
if (ServerStartsWithTcp(server) == false)
server = string.Format("tcp:{0}.database.windows.net", server);
if (server.Contains(",") == false)
server = string.Format("{0},1433", server);
@@ -345,23 +447,23 @@ namespace Umbraco.Core
{
//Set the connection string for the new datalayer
var connectionStringSettings = string.IsNullOrEmpty(providerName)
? new ConnectionStringSettings(GlobalSettings.UmbracoConnectionName,
? new ConnectionStringSettings(Constants.System.UmbracoConnectionName,
connectionString)
: new ConnectionStringSettings(GlobalSettings.UmbracoConnectionName,
: new ConnectionStringSettings(Constants.System.UmbracoConnectionName,
connectionString, providerName);
_connectionString = connectionString;
_providerName = providerName;
var fileName = IOHelper.MapPath(string.Format("{0}/web.config", SystemDirectories.Root));
var xml = XDocument.Load(fileName, LoadOptions.PreserveWhitespace);
var connectionstrings = xml.Root.DescendantsAndSelf("connectionStrings").Single();
// Update connectionString if it exists, or else create a new appSetting for the given key and value
var setting = connectionstrings.Descendants("add").FirstOrDefault(s => s.Attribute("name").Value == GlobalSettings.UmbracoConnectionName);
var setting = connectionstrings.Descendants("add").FirstOrDefault(s => s.Attribute("name").Value == Constants.System.UmbracoConnectionName);
if (setting == null)
connectionstrings.Add(new XElement("add",
new XAttribute("name", GlobalSettings.UmbracoConnectionName),
new XAttribute("name", Constants.System.UmbracoConnectionName),
new XAttribute("connectionString", connectionStringSettings),
new XAttribute("providerName", providerName)));
else
@@ -386,23 +488,23 @@ namespace Umbraco.Core
/// </remarks>
internal void Initialize()
{
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
var databaseSettings = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName];
if (databaseSettings != null && string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) == false && string.IsNullOrWhiteSpace(databaseSettings.ProviderName) == false)
{
var providerName = Constants.DatabaseProviders.SqlServer;
string connString = null;
if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName))
if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName))
{
providerName = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName;
connString = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ConnectionString;
providerName = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ProviderName;
connString = ConfigurationManager.ConnectionStrings[Constants.System.UmbracoConnectionName].ConnectionString;
}
Initialize(providerName, connString);
}
else if (ConfigurationManager.AppSettings.ContainsKey(GlobalSettings.UmbracoConnectionName) && string.IsNullOrEmpty(ConfigurationManager.AppSettings[GlobalSettings.UmbracoConnectionName]) == false)
else if (ConfigurationManager.AppSettings.ContainsKey(Constants.System.UmbracoConnectionName) && string.IsNullOrEmpty(ConfigurationManager.AppSettings[Constants.System.UmbracoConnectionName]) == false)
{
//A valid connectionstring does not exist, but the legacy appSettings key was found, so we'll reconfigure the conn.string.
var legacyConnString = ConfigurationManager.AppSettings[GlobalSettings.UmbracoConnectionName];
var legacyConnString = ConfigurationManager.AppSettings[Constants.System.UmbracoConnectionName];
if (legacyConnString.ToLowerInvariant().Contains("sqlce4umbraco"))
{
ConfigureEmbeddedDatabaseConnection();
@@ -433,8 +535,8 @@ namespace Umbraco.Core
}
//Remove the legacy connection string, so we don't end up in a loop if something goes wrong.
GlobalSettings.RemoveSetting(GlobalSettings.UmbracoConnectionName);
GlobalSettings.RemoveSetting(Constants.System.UmbracoConnectionName);
}
else
{
@@ -453,15 +555,15 @@ namespace Umbraco.Core
{
if (_syntaxProviders != null)
{
SqlSyntax = _syntaxProviders.GetByProviderNameOrDefault(providerName);
SqlSyntax = _syntaxProviders.GetByProviderNameOrDefault(providerName);
}
else if (SqlSyntax == null)
{
throw new InvalidOperationException("No " + typeof(ISqlSyntaxProvider) + " specified or no " + typeof(SqlSyntaxProviders) + " instance specified");
}
SqlSyntaxContext.SqlSyntaxProvider = SqlSyntax;
_configured = true;
}
catch (Exception e)
@@ -501,7 +603,7 @@ namespace Umbraco.Core
}
internal Result CreateDatabaseSchemaAndData(ApplicationContext applicationContext)
{
{
try
{
var readyForInstall = CheckReadyForInstall();
@@ -519,7 +621,7 @@ namespace Umbraco.Core
// If MySQL, we're going to ensure that database calls are maintaining proper casing as to remove the necessity for checks
// for case insensitive queries. In an ideal situation (which is what we're striving for), all calls would be case sensitive.
/*
/*
var supportsCaseInsensitiveQueries = SqlSyntax.SupportsCaseInsensitiveQueries(database);
if (supportsCaseInsensitiveQueries == false)
{
@@ -537,9 +639,9 @@ namespace Umbraco.Core
message = GetResultMessageForMySql();
var schemaResult = ValidateDatabaseSchema();
var installedSchemaVersion = schemaResult.DetermineInstalledVersion();
//If Configuration Status is empty and the determined version is "empty" its a new install - otherwise upgrade the existing
if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus) && installedSchemaVersion.Equals(new Version(0, 0, 0)))
{
@@ -558,9 +660,9 @@ namespace Umbraco.Core
message = "<p>Upgrading database, this may take some time...</p>";
return new Result
{
RequiresUpgrade = true,
Message = message,
Success = true,
RequiresUpgrade = true,
Message = message,
Success = true,
Percentage = "30"
};
}
@@ -588,7 +690,7 @@ namespace Umbraco.Core
_logger.Info<DatabaseContext>("Database upgrade started");
var database = new UmbracoDatabase(_connectionString, ProviderName, _logger);
//var supportsCaseInsensitiveQueries = SqlSyntax.SupportsCaseInsensitiveQueries(database);
//var supportsCaseInsensitiveQueries = SqlSyntax.SupportsCaseInsensitiveQueries(database);
var message = GetResultMessageForMySql();
@@ -596,32 +698,32 @@ namespace Umbraco.Core
var installedSchemaVersion = new SemVersion(schemaResult.DetermineInstalledVersion());
var installedMigrationVersion = schemaResult.DetermineInstalledVersionByMigrations(migrationEntryService);
var installedMigrationVersion = schemaResult.DetermineInstalledVersionByMigrations(migrationEntryService);
var targetVersion = UmbracoVersion.Current;
//In some cases - like upgrading from 7.2.6 -> 7.3, there will be no migration information in the database and therefore it will
// return a version of 0.0.0 and we don't necessarily want to run all migrations from 0 -> 7.3, so we'll just ensure that the
// return a version of 0.0.0 and we don't necessarily want to run all migrations from 0 -> 7.3, so we'll just ensure that the
// migrations are run for the target version
if (installedMigrationVersion == new SemVersion(new Version(0, 0, 0)) && installedSchemaVersion > new SemVersion(new Version(0, 0, 0)))
{
//set the installedMigrationVersion to be one less than the target so the latest migrations are guaranteed to execute
installedMigrationVersion = new SemVersion(targetVersion.SubtractRevision());
}
//Figure out what our current installed version is. If the web.config doesn't have a version listed, then we'll use the minimum
// version detected between the schema installed and the migrations listed in the migration table.
// version detected between the schema installed and the migrations listed in the migration table.
// If there is a version in the web.config, we'll take the minimum between the listed migration in the db and what
// is declared in the web.config.
var currentInstalledVersion = string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)
//Take the minimum version between the detected schema version and the installed migration version
? new[] {installedSchemaVersion, installedMigrationVersion}.Min()
//Take the minimum version between the installed migration version and the version specified in the config
: new[] { SemVersion.Parse(GlobalSettings.ConfigurationStatus), installedMigrationVersion }.Min();
//Ok, another edge case here. If the current version is a pre-release,
// then we want to ensure all migrations for the current release are executed.
//Ok, another edge case here. If the current version is a pre-release,
// then we want to ensure all migrations for the current release are executed.
if (currentInstalledVersion.Prerelease.IsNullOrWhiteSpace() == false)
{
currentInstalledVersion = new SemVersion(currentInstalledVersion.GetVersion().SubtractRevision());
@@ -629,7 +731,7 @@ namespace Umbraco.Core
//DO the upgrade!
var runner = new MigrationRunner(migrationEntryService, _logger, currentInstalledVersion, UmbracoVersion.GetSemanticVersion(), GlobalSettings.UmbracoMigrationName);
var runner = new MigrationRunner(migrationEntryService, _logger, currentInstalledVersion, UmbracoVersion.GetSemanticVersion(), Constants.System.UmbracoMigrationName);
var upgraded = runner.Execute(database, true);
@@ -756,7 +858,7 @@ namespace Umbraco.Core
{
var datasource = dataSourcePart.Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory").ToString());
var filePath = datasource.Replace("Data Source=", string.Empty);
sqlCeDatabaseExists = File.Exists(filePath);
sqlCeDatabaseExists = File.Exists(filePath);
}
}
@@ -770,5 +872,30 @@ namespace Umbraco.Core
return true;
}
/*
private class UsingDatabase : IDisposable
{
private readonly UmbracoDatabase _orig;
private readonly UmbracoDatabase _temp;
public UsingDatabase(UmbracoDatabase orig, UmbracoDatabase temp)
{
_orig = orig;
_temp = temp;
}
public void Dispose()
{
if (_temp != null)
{
_temp.Dispose();
if (_orig != null)
DefaultDatabaseFactory.AttachAmbientDatabase(_orig);
}
GC.SuppressFinalize(this);
}
}
*/
}
}
+56
View File
@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Provides a base class to all artifacts.
/// </summary>
public abstract class ArtifactBase<TUdi> : IArtifact
where TUdi : Udi
{
protected ArtifactBase(TUdi udi, IEnumerable<ArtifactDependency> dependencies = null)
{
if (udi == null)
throw new ArgumentNullException("udi");
Udi = udi;
Name = Udi.ToString();
Dependencies = dependencies ?? Enumerable.Empty<ArtifactDependency>();
_checksum = new Lazy<string>(GetChecksum);
}
private readonly Lazy<string> _checksum;
private IEnumerable<ArtifactDependency> _dependencies;
protected abstract string GetChecksum();
#region Abstract implementation of IArtifactSignature
Udi IArtifactSignature.Udi
{
get { return Udi; }
}
public TUdi Udi { get; set; }
[JsonIgnore]
public string Checksum
{
get { return _checksum.Value; }
}
public IEnumerable<ArtifactDependency> Dependencies
{
get { return _dependencies; }
set { _dependencies = value.OrderBy(x => x.Udi); }
}
#endregion
public string Name { get; set; }
public string Alias { get; set; }
}
}
@@ -0,0 +1,40 @@
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represents an artifact dependency.
/// </summary>
/// <remarks>
/// <para>Dependencies have an order property which indicates whether it must be respected when ordering artifacts.</para>
/// <para>Dependencies have a mode which can be <c>Match</c> or <c>Exist</c> depending on whether the checksum should match.</para>
/// </remarks>
public class ArtifactDependency
{
/// <summary>
/// Initializes a new instance of the ArtifactDependency class with an entity identifier and a mode.
/// </summary>
/// <param name="udi">The entity identifier of the artifact that is a dependency.</param>
/// <param name="ordering">A value indicating whether the dependency is ordering.</param>
/// <param name="mode">The dependency mode.</param>
public ArtifactDependency(Udi udi, bool ordering, ArtifactDependencyMode mode)
{
Udi = udi;
Ordering = ordering;
Mode = mode;
}
/// <summary>
/// Gets the entity id of the artifact that is a dependency.
/// </summary>
public Udi Udi { get; private set; }
/// <summary>
/// Gets a value indicating whether the dependency is ordering.
/// </summary>
public bool Ordering { get; private set; }
/// <summary>
/// Gets the dependency mode.
/// </summary>
public ArtifactDependencyMode Mode { get; private set; }
}
}
@@ -0,0 +1,69 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represents a collection of distinct <see cref="ArtifactDependency"/>.
/// </summary>
/// <remarks>The collection cannot contain duplicates and modes are properly managed.</remarks>
public class ArtifactDependencyCollection : ICollection<ArtifactDependency>
{
private readonly Dictionary<Udi, ArtifactDependency> _dependencies
= new Dictionary<Udi, ArtifactDependency>();
public IEnumerator<ArtifactDependency> GetEnumerator()
{
return _dependencies.Values.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public void Add(ArtifactDependency item)
{
if (_dependencies.ContainsKey(item.Udi))
{
var exist = _dependencies[item.Udi];
if (item.Mode == ArtifactDependencyMode.Exist || item.Mode == exist.Mode)
return;
}
_dependencies[item.Udi] = item;
}
public void Clear()
{
_dependencies.Clear();
}
public bool Contains(ArtifactDependency item)
{
return _dependencies.ContainsKey(item.Udi) &&
(_dependencies[item.Udi].Mode == item.Mode || _dependencies[item.Udi].Mode == ArtifactDependencyMode.Match);
}
public void CopyTo(ArtifactDependency[] array, int arrayIndex)
{
_dependencies.Values.CopyTo(array, arrayIndex);
}
public bool Remove(ArtifactDependency item)
{
throw new NotSupportedException();
}
public int Count
{
get { return _dependencies.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
}
}
@@ -0,0 +1,18 @@
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Indicates the mode of the dependency.
/// </summary>
public enum ArtifactDependencyMode
{
/// <summary>
/// The dependency must match exactly.
/// </summary>
Match,
/// <summary>
/// The dependency must exist.
/// </summary>
Exist
}
}
@@ -0,0 +1,50 @@
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represent the state of an artifact being deployed.
/// </summary>
public abstract class ArtifactDeployState
{
/// <summary>
/// Creates a new instance of the <see cref="ArtifactDeployState"/> class from an artifact and an entity.
/// </summary>
/// <typeparam name="TArtifact">The type of the artifact.</typeparam>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <param name="art">The artifact.</param>
/// <param name="entity">The entity.</param>
/// <param name="connector">The service connector deploying the artifact.</param>
/// <param name="nextPass">The next pass number.</param>
/// <returns>A deploying artifact.</returns>
public static ArtifactDeployState<TArtifact, TEntity> Create<TArtifact, TEntity>(TArtifact art, TEntity entity, IServiceConnector connector, int nextPass)
where TArtifact : IArtifact
{
return new ArtifactDeployState<TArtifact, TEntity>(art, entity, connector, nextPass);
}
/// <summary>
/// Gets the artifact.
/// </summary>
public IArtifact Artifact
{
get { return GetArtifactAsIArtifact(); }
}
/// <summary>
/// Gets the artifact as an <see cref="IArtifact"/>.
/// </summary>
/// <returns>The artifact, as an <see cref="IArtifact"/>.</returns>
/// <remarks>This is because classes that inherit from this class cannot override the Artifact property
/// with a property that specializes the return type, and so they need to 'new' the property.</remarks>
protected abstract IArtifact GetArtifactAsIArtifact();
/// <summary>
/// Gets or sets the service connector in charge of deploying the artifact.
/// </summary>
public IServiceConnector Connector { get; set; }
/// <summary>
/// Gets or sets the next pass number.
/// </summary>
public int NextPass { get; set; }
}
}
@@ -0,0 +1,48 @@
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represent the state of an artifact being deployed.
/// </summary>
/// <typeparam name="TArtifact">The type of the artifact.</typeparam>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
public class ArtifactDeployState<TArtifact, TEntity> : ArtifactDeployState
where TArtifact : IArtifact
{
/// <summary>
/// Initializes a new instance of the <see cref="ArtifactDeployState{TArtifact,TEntity}"/> class.
/// </summary>
public ArtifactDeployState()
{ }
/// <summary>
/// Initializes a new instance of the <see cref="ArtifactDeployState{TArtifact,TEntity}"/> class.
/// </summary>
/// <param name="art">The artifact.</param>
/// <param name="entity">The entity.</param>
/// <param name="connector">The service connector deploying the artifact.</param>
/// <param name="nextPass">The next pass number.</param>
public ArtifactDeployState(TArtifact art, TEntity entity, IServiceConnector connector, int nextPass)
{
Artifact = art;
Entity = entity;
Connector = connector;
NextPass = nextPass;
}
/// <summary>
/// Gets or sets the artifact.
/// </summary>
public new TArtifact Artifact { get; set; }
/// <summary>
/// Gets or sets the entity.
/// </summary>
public TEntity Entity { get; set; }
/// <inheritdoc/>
protected sealed override IArtifact GetArtifactAsIArtifact()
{
return Artifact;
}
}
}
@@ -0,0 +1,21 @@
using System.Collections.Generic;
using System.Linq;
namespace Umbraco.Core.Deploy
{
public sealed class ArtifactSignature : IArtifactSignature
{
public ArtifactSignature(Udi udi, string checksum, IEnumerable<ArtifactDependency> dependencies = null)
{
Udi = udi;
Checksum = checksum;
Dependencies = dependencies ?? Enumerable.Empty<ArtifactDependency>();
}
public Udi Udi { get; private set; }
public string Checksum { get; private set; }
public IEnumerable<ArtifactDependency> Dependencies { get; private set; }
}
}
+28
View File
@@ -0,0 +1,28 @@
namespace Umbraco.Core.Deploy
{
public class Difference
{
public Difference(string title, string text = null, string category = null)
{
Title = title;
Text = text;
Category = category;
}
public string Title { get; set; }
public string Text { get; set; }
public string Category { get; set; }
public override string ToString()
{
var s = Title;
if (!string.IsNullOrWhiteSpace(Category)) s += string.Format("[{0}]", Category);
if (!string.IsNullOrWhiteSpace(Text))
{
if (s.Length > 0) s += ":";
s += Text;
}
return s;
}
}
}
+8
View File
@@ -0,0 +1,8 @@
namespace Umbraco.Core.Deploy
{
public enum Direction
{
ToArtifact,
FromArtifact
}
}
+11
View File
@@ -0,0 +1,11 @@
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represents an artifact ie an object that can be transfered between environments.
/// </summary>
public interface IArtifact : IArtifactSignature
{
string Name { get; }
string Alias { get; }
}
}
@@ -0,0 +1,41 @@
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represents the signature of an artifact.
/// </summary>
public interface IArtifactSignature
{
/// <summary>
/// Gets the entity unique identifier of this artifact.
/// </summary>
/// <remarks>
/// <para>The project identifier is independent from the state of the artifact, its data
/// values, dependencies, anything. It never changes and fully identifies the artifact.</para>
/// <para>What an entity uses as a unique identifier will influence what we can transfer
/// between environments. Eg content type "Foo" on one environment is not necessarily the
/// same as "Foo" on another environment, if guids are used as unique identifiers. What is
/// used should be documented for each entity, along with the consequences of the choice.</para>
/// </remarks>
Udi Udi { get; }
/// <summary>
/// Gets the checksum of this artifact.
/// </summary>
/// <remarks>
/// <para>The checksum depends on the artifact's properties, and on the identifiers of all its dependencies,
/// but not on their checksums. So the checksum changes when any of the artifact's properties changes,
/// or when the list of dependencies changes. But not if one of these dependencies change.</para>
/// <para>It is assumed that checksum collisions cannot happen ie that no two different artifact's
/// states will ever produce the same checksum, so that if two artifacts have the same checksum then
/// they are identical.</para>
/// </remarks>
string Checksum { get; }
/// <summary>
/// Gets the dependencies of this artifact.
/// </summary>
IEnumerable<ArtifactDependency> Dependencies { get; }
}
}
+42
View File
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represents a deployment context.
/// </summary>
public interface IDeployContext
{
/// <summary>
/// Gets the unique identifier of the deployment.
/// </summary>
Guid SessionId { get; }
/// <summary>
/// Gets the file source.
/// </summary>
/// <remarks>The file source is used to obtain files from the source environment.</remarks>
IFileSource FileSource { get; }
/// <summary>
/// Gets the next number in a numerical sequence.
/// </summary>
/// <returns>The next sequence number.</returns>
/// <remarks>Can be used to uniquely number things during a deployment.</remarks>
int NextSeq();
/// <summary>
/// Gets items.
/// </summary>
IDictionary<string, object> Items { get; }
/// <summary>
/// Gets item.
/// </summary>
/// <typeparam name="T">The type of the item.</typeparam>
/// <param name="key">The key of the item.</param>
/// <returns>The item with the specified key and type, if any, else null.</returns>
T Item<T>(string key) where T : class;
}
}
+91
View File
@@ -0,0 +1,91 @@
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Represents a file source, ie a mean for a target environment involved in a
/// deployment to obtain the content of files being deployed.
/// </summary>
public interface IFileSource
{
/// <summary>
/// Gets the content of a file as a stream.
/// </summary>
/// <param name="udi">A file entity identifier.</param>
/// <returns>A stream with read access to the file content.</returns>
/// <remarks>
/// <para>Returns null if no content could be read.</para>
/// <para>The caller should ensure that the stream is properly closed/disposed.</para>
/// </remarks>
Stream GetFileStream(StringUdi udi);
/// <summary>
/// Gets the content of a file as a stream.
/// </summary>
/// <param name="udi">A file entity identifier.</param>
/// <param name="token">A cancellation token.</param>
/// <returns>A stream with read access to the file content.</returns>
/// <remarks>
/// <para>Returns null if no content could be read.</para>
/// <para>The caller should ensure that the stream is properly closed/disposed.</para>
/// </remarks>
Task<Stream> GetFileStreamAsync(StringUdi udi, CancellationToken token);
/// <summary>
/// Gets the content of a file as a string.
/// </summary>
/// <param name="udi">A file entity identifier.</param>
/// <returns>A string containing the file content.</returns>
/// <remarks>Returns null if no content could be read.</remarks>
string GetFileContent(StringUdi udi);
/// <summary>
/// Gets the content of a file as a string.
/// </summary>
/// <param name="udi">A file entity identifier.</param>
/// <param name="token">A cancellation token.</param>
/// <returns>A string containing the file content.</returns>
/// <remarks>Returns null if no content could be read.</remarks>
Task<string> GetFileContentAsync(StringUdi udi, CancellationToken token);
/// <summary>
/// Gets the length of a file.
/// </summary>
/// <param name="udi">A file entity identifier.</param>
/// <returns>The length of the file, or -1 if the file does not exist.</returns>
long GetFileLength(StringUdi udi);
/// <summary>
/// Gets the length of a file.
/// </summary>
/// <param name="udi">A file entity identifier.</param>
/// <param name="token">A cancellation token.</param>
/// <returns>The length of the file, or -1 if the file does not exist.</returns>
Task<long> GetFileLengthAsync(StringUdi udi, CancellationToken token);
/// <summary>
/// Gets files and store them using a file store.
/// </summary>
/// <param name="udis">The udis of the files to get.</param>
/// <param name="fileTypes">A collection of file types which can store the files.</param>
void GetFiles(IEnumerable<StringUdi> udis, IFileTypeCollection fileTypes);
/// <summary>
/// Gets files and store them using a file store.
/// </summary>
/// <param name="udis">The udis of the files to get.</param>
/// <param name="fileTypes">A collection of file types which can store the files.</param>
/// <param name="token">A cancellation token.</param>
Task GetFilesAsync(IEnumerable<StringUdi> udis, IFileTypeCollection fileTypes, CancellationToken token);
///// <summary>
///// Gets the content of a file as a bytes array.
///// </summary>
///// <param name="Udi">A file entity identifier.</param>
///// <returns>A byte array containing the file content.</returns>
//byte[] GetFileBytes(StringUdi Udi);
}
}
+32
View File
@@ -0,0 +1,32 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Umbraco.Core.Deploy
{
public interface IFileType
{
Stream GetStream(StringUdi udi);
Task<Stream> GetStreamAsync(StringUdi udi, CancellationToken token);
Stream GetChecksumStream(StringUdi udi);
long GetLength(StringUdi udi);
void SetStream(StringUdi udi, Stream stream);
Task SetStreamAsync(StringUdi udi, Stream stream, CancellationToken token);
bool CanSetPhysical { get; }
void Set(StringUdi udi, string physicalPath, bool copy = false);
// this is not pretty as *everywhere* in Deploy we take care of ignoring
// the physical path and always rely on Core's virtual IFileSystem but
// Cloud wants to add some of these files to Git and needs the path...
string GetPhysicalPath(StringUdi udi);
string GetVirtualPath(StringUdi udi);
}
}
@@ -0,0 +1,9 @@
namespace Umbraco.Core.Deploy
{
public interface IFileTypeCollection
{
IFileType this[string entityType] { get; }
bool Contains(string entityType);
}
}
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using Umbraco.Core.Models;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Defines methods that can convert a grid cell value to / from an environment-agnostic string.
/// </summary>
/// <remarks>Grid cell values may contain values such as content identifiers, that would be local
/// to one environment, and need to be converted in order to be deployed.</remarks>
public interface IGridCellValueConnector
{
/// <summary>
/// Gets a value indicating whether the connector supports a specified grid editor view.
/// </summary>
/// <param name="view">The grid editor view. It needs to be the view instead of the alias as the view is really what identifies what kind of connector should be used. Alias can be anything and you can have multiple different aliases using the same kind of view.</param>
/// <remarks>A value indicating whether the connector supports the grid editor view.</remarks>
/// <remarks>Note that <paramref name="view" /> can be string.Empty to indicate the "default" connector.</remarks>
bool IsConnector(string view);
/// <summary>
/// Gets the value to be deployed from the control value as a string.
/// </summary>
/// <param name="gridControl">The control containing the value.</param>
/// <param name="property">The property where the control is located. Do not modify - only used for context</param>
/// <param name="dependencies">The dependencies of the property.</param>
/// <returns>The grid cell value to be deployed.</returns>
/// <remarks>Note that </remarks>
string GetValue(GridValue.GridControl gridControl, Property property, ICollection<ArtifactDependency> dependencies);
/// <summary>
/// Allows you to modify the value of a control being deployed.
/// </summary>
/// <param name="gridControl">The control being deployed.</param>
/// <param name="property">The property where the <paramref name="gridControl"/> is located. Do not modify - only used for context.</param>
/// <remarks>Follows the pattern of the property value connectors (<see cref="IValueConnector"/>). The SetValue method is used to modify the value of the <paramref name="gridControl"/>.</remarks>
/// <remarks>Note that only the <paramref name="gridControl"/> value should be modified - not the <paramref name="property"/>.</remarks>
/// <remarks>The <paramref name="property"/> should only be used to assist with context data relevant when setting the <paramref name="gridControl"/> value.</remarks>
void SetValue(GridValue.GridControl gridControl, Property property);
}
}
@@ -0,0 +1,27 @@
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Provides methods to parse image tag sources in property values.
/// </summary>
public interface IImageSourceParser
{
/// <summary>
/// Parses an Umbraco property value and produces an artifact property value.
/// </summary>
/// <param name="value">The property value.</param>
/// <param name="dependencies">A list of dependencies.</param>
/// <returns>The parsed value.</returns>
/// <remarks>Turns src="/media/..." into src="umb://media/..." and adds the corresponding udi to the dependencies.</remarks>
string ToArtifact(string value, ICollection<Udi> dependencies);
/// <summary>
/// Parses an artifact property value and produces an Umbraco property value.
/// </summary>
/// <param name="value">The artifact property value.</param>
/// <returns>The parsed value.</returns>
/// <remarks>Turns umb://media/... into /media/....</remarks>
string FromArtifact(string value);
}
}
@@ -0,0 +1,27 @@
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Provides methods to parse local link tags in property values.
/// </summary>
public interface ILocalLinkParser
{
/// <summary>
/// Parses an Umbraco property value and produces an artifact property value.
/// </summary>
/// <param name="value">The property value.</param>
/// <param name="dependencies">A list of dependencies.</param>
/// <returns>The parsed value.</returns>
/// <remarks>Turns {{localLink:1234}} into {{localLink:umb://{type}/{id}}} and adds the corresponding udi to the dependencies.</remarks>
string ToArtifact(string value, ICollection<Udi> dependencies);
/// <summary>
/// Parses an artifact property value and produces an Umbraco property value.
/// </summary>
/// <param name="value">The artifact property value.</param>
/// <returns>The parsed value.</returns>
/// <remarks>Turns {{localLink:umb://{type}/{id}}} into {{localLink:1234}}.</remarks>
string FromArtifact(string value);
}
}
+32
View File
@@ -0,0 +1,32 @@
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
public interface IMacroParser
{
/// <summary>
/// Parses an Umbraco property value and produces an artifact property value.
/// </summary>
/// <param name="value">Property value.</param>
/// <param name="dependencies">A list of dependencies.</param>
/// <returns>Parsed value.</returns>
string ToArtifact(string value, ICollection<Udi> dependencies);
/// <summary>
/// Parses an artifact property value and produces an Umbraco property value.
/// </summary>
/// <param name="value">Artifact property value.</param>
/// <returns>Parsed value.</returns>
string FromArtifact(string value);
/// <summary>
/// Tries to replace the value of the attribute/parameter with a value containing a converted identifier.
/// </summary>
/// <param name="value">Value to attempt to convert</param>
/// <param name="editorAlias">Alias of the editor used for the parameter</param>
/// <param name="dependencies">Collection to add dependencies to when performing ToArtifact</param>
/// <param name="direction">Indicates which action is being performed (to or from artifact)</param>
/// <returns>Value with converted identifiers</returns>
string ReplaceAttributeValue(string value, string editorAlias, ICollection<Udi> dependencies, Direction direction);
}
}
@@ -0,0 +1,32 @@
using System.Collections.Generic;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Defines methods that can convert a preValue to / from an environment-agnostic string.
/// </summary>
/// <remarks>PreValues may contain values such as content identifiers, that would be local
/// to one environment, and need to be converted in order to be deployed.</remarks>
public interface IPreValueConnector
{
/// <summary>
/// Gets the property editor aliases that the value converter supports by default.
/// </summary>
IEnumerable<string> PropertyEditorAliases { get; }
/// <summary>
/// Gets the environment-agnostic preValues corresponding to environment-specific preValues.
/// </summary>
/// <param name="preValues">The environment-specific preValues.</param>
/// <param name="dependencies">The dependencies.</param>
/// <returns></returns>
IDictionary<string, string> ConvertToDeploy(IDictionary<string, string> preValues, ICollection<ArtifactDependency> dependencies);
/// <summary>
/// Gets the environment-specific preValues corresponding to environment-agnostic preValues.
/// </summary>
/// <param name="preValues">The environment-agnostic preValues.</param>
/// <returns></returns>
IDictionary<string, string> ConvertToLocalEnvironment(IDictionary<string, string> preValues);
}
}
@@ -0,0 +1,86 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Umbraco.Core;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Connects to an Umbraco service.
/// </summary>
public interface IServiceConnector
{
/// <summary>
/// Gets an artifact.
/// </summary>
/// <param name="udi">The entity identifier of the artifact.</param>
/// <returns>The corresponding artifact, or null.</returns>
IArtifact GetArtifact(Udi udi);
/// <summary>
/// Gets an artifact.
/// </summary>
/// <param name="entity">The entity.</param>
/// <returns>The corresponding artifact.</returns>
IArtifact GetArtifact(object entity);
/// <summary>
/// Initializes processing for an artifact.
/// </summary>
/// <param name="art">The artifact.</param>
/// <param name="context">The deploy context.</param>
/// <returns>The mapped artifact.</returns>
ArtifactDeployState ProcessInit(IArtifact art, IDeployContext context);
/// <summary>
/// Processes an artifact.
/// </summary>
/// <param name="dart">The mapped artifact.</param>
/// <param name="context">The deploy context.</param>
/// <param name="pass">The processing pass number.</param>
void Process(ArtifactDeployState dart, IDeployContext context, int pass);
/// <summary>
/// Explodes a range into udis.
/// </summary>
/// <param name="range">The range.</param>
/// <param name="udis">The list of udis where to add the new udis.</param>
/// <remarks>Also, it's cool to have a method named Explode. Kaboom!</remarks>
void Explode(UdiRange range, List<Udi> udis);
/// <summary>
/// Gets a named range for a specified udi and selector.
/// </summary>
/// <param name="udi">The udi.</param>
/// <param name="selector">The selector.</param>
/// <returns>The named range for the specified udi and selector.</returns>
NamedUdiRange GetRange(Udi udi, string selector);
/// <summary>
/// Gets a named range for specified entity type, identifier and selector.
/// </summary>
/// <param name="entityType">The entity type.</param>
/// <param name="sid">The identifier.</param>
/// <param name="selector">The selector.</param>
/// <returns>The named range for the specified entity type, identifier and selector.</returns>
/// <remarks>
/// <para>This is temporary. At least we thought it would be, in sept. 2016. What day is it now?</para>
/// <para>At the moment our UI has a hard time returning proper udis, mainly because Core's tree do
/// not manage guids but only ints... so we have to provide a way to support it. The string id here
/// can be either a real string (for string udis) or an "integer as a string", using the value "-1" to
/// indicate the "root" i.e. an open udi.</para>
/// </remarks>
NamedUdiRange GetRange(string entityType, string sid, string selector);
/// <summary>
/// Compares two artifacts.
/// </summary>
/// <param name="art1">The first artifact.</param>
/// <param name="art2">The second artifact.</param>
/// <param name="differences">A collection of differences to append to, if not null.</param>
/// <returns>A boolean value indicating whether the artifacts are identical.</returns>
/// <remarks>ServiceConnectorBase{TArtifact} provides a very basic default implementation.</remarks>
bool Compare(IArtifact art1, IArtifact art2, ICollection<Difference> differences = null);
}
}
@@ -0,0 +1,35 @@
using System.Collections.Generic;
using Umbraco.Core.Models;
namespace Umbraco.Core.Deploy
{
/// <summary>
/// Defines methods that can convert a property value to / from an environment-agnostic string.
/// </summary>
/// <remarks>Property values may contain values such as content identifiers, that would be local
/// to one environment, and need to be converted in order to be deployed. Connectors also deal
/// with serializing to / from string.</remarks>
public interface IValueConnector
{
/// <summary>
/// Gets the property editor aliases that the value converter supports by default.
/// </summary>
IEnumerable<string> PropertyEditorAliases { get; }
/// <summary>
/// Gets the deploy property corresponding to a content property.
/// </summary>
/// <param name="property">The content property.</param>
/// <param name="dependencies">The content dependencies.</param>
/// <returns>The deploy property value.</returns>
string GetValue(Property property, ICollection<ArtifactDependency> dependencies);
/// <summary>
/// Sets a content property value using a deploy property.
/// </summary>
/// <param name="content">The content item.</param>
/// <param name="alias">The property alias.</param>
/// <param name="value">The deploy property value.</param>
void SetValue(IContentBase content, string alias, string value);
}
}
+22 -11
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
@@ -67,22 +68,15 @@ namespace Umbraco.Core
}
}
/// <summary>The for each.</summary>
/// <param name="items">The items.</param>
/// <param name="func">The func.</param>
/// <typeparam name="TItem">item type</typeparam>
/// <typeparam name="TResult">Result type</typeparam>
/// <returns>the Results</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Use a normal foreach loop instead, this adds more allocations than necessary")]
public static TResult[] ForEach<TItem, TResult>(this IEnumerable<TItem> items, Func<TItem, TResult> func)
{
return items.Select(func).ToArray();
}
/// <summary>The for each.</summary>
/// <param name="items">The items.</param>
/// <param name="action">The action.</param>
/// <typeparam name="TItem">Item type</typeparam>
/// <returns>list of TItem</returns>
[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)
@@ -101,6 +95,7 @@ namespace Umbraco.Core
/// <param name="f">The select child.</param>
/// <typeparam name="T">Item type</typeparam>
/// <returns>list of TItem</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("Do not use, use SelectRecursive instead which has far less potential of re-iterating an iterator which may cause significantly more SQL queries")]
public static IEnumerable<T> FlattenList<T>(this IEnumerable<T> e, Func<T, IEnumerable<T>> f)
{
@@ -301,5 +296,21 @@ namespace Umbraco.Core
&& list1Groups.All(g => g.Count() == list2Groups[g.Key].Count());
}
///<summary>
/// Returns the items of the given enumerable as a pure enumerable.
/// <remarks>
/// When quering lists using methods such as <see cref="M:List.Where"/>, the result, despite appearing to look like and quack like an
/// <see cref="T:Enumerable{T}"/> the type is actually an instance of <see cref="T:System.Linq.Enumerable.WhereEnumerableIterator"/>
/// </remarks>
/// </summary>
///<param name="source">The item to find.</param>
///<returns>The index of the first matching item, or -1 if the item was not found.</returns>
internal static IEnumerable<T> Yield<T>(this IEnumerable<T> source)
{
foreach (var element in source)
{
yield return element;
}
}
}
}
@@ -10,8 +10,8 @@ namespace Umbraco.Core.Events
/// Event args for that can support cancellation
/// </summary>
[HostProtection(SecurityAction.LinkDemand, SharedState = true)]
public class CancellableEventArgs : EventArgs
{
public class CancellableEventArgs : EventArgs, IEquatable<CancellableEventArgs>
{
private bool _cancel;
public CancellableEventArgs(bool canCancel, EventMessages messages, IDictionary<string, object> additionalData)
@@ -98,6 +98,36 @@ namespace Umbraco.Core.Events
/// This allows for a bit of flexibility in our event raising - it's not pretty but we need to maintain backwards compatibility
/// so we cannot change the strongly typed nature for some events.
/// </remarks>
public ReadOnlyDictionary<string, object> AdditionalData { get; private set; }
}
public ReadOnlyDictionary<string, object> AdditionalData { get; private set; }
public bool Equals(CancellableEventArgs other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Equals(AdditionalData, other.AdditionalData);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((CancellableEventArgs) obj);
}
public override int GetHashCode()
{
return (AdditionalData != null ? AdditionalData.GetHashCode() : 0);
}
public static bool operator ==(CancellableEventArgs left, CancellableEventArgs right)
{
return Equals(left, right);
}
public static bool operator !=(CancellableEventArgs left, CancellableEventArgs right)
{
return !Equals(left, right);
}
}
}
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Security.Permissions;
using Umbraco.Core.Models;
@@ -10,7 +11,7 @@ namespace Umbraco.Core.Events
/// </summary>
/// <typeparam name="T"></typeparam>
[HostProtection(SecurityAction.LinkDemand, SharedState = true)]
public class CancellableObjectEventArgs<T> : CancellableEventArgs
public class CancellableObjectEventArgs<T> : CancellableEventArgs, IEquatable<CancellableObjectEventArgs<T>>
{
public CancellableObjectEventArgs(T eventObject, bool canCancel, EventMessages messages, IDictionary<string, object> additionalData)
: base(canCancel, messages, additionalData)
@@ -48,5 +49,37 @@ namespace Umbraco.Core.Events
/// </remarks>
protected T EventObject { get; set; }
public bool Equals(CancellableObjectEventArgs<T> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && EqualityComparer<T>.Default.Equals(EventObject, other.EventObject);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((CancellableObjectEventArgs<T>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ EqualityComparer<T>.Default.GetHashCode(EventObject);
}
}
public static bool operator ==(CancellableObjectEventArgs<T> left, CancellableObjectEventArgs<T> right)
{
return Equals(left, right);
}
public static bool operator !=(CancellableObjectEventArgs<T> left, CancellableObjectEventArgs<T> right)
{
return !Equals(left, right);
}
}
}
+41 -1
View File
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Events
{
public class CopyEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>
public class CopyEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>, IEquatable<CopyEventArgs<TEntity>>
{
public CopyEventArgs(TEntity original, TEntity copy, bool canCancel, int parentId)
: base(original, canCancel)
@@ -43,5 +46,42 @@ namespace Umbraco.Core.Events
public int ParentId { get; private set; }
public bool RelateToOriginal { get; set; }
public bool Equals(CopyEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && EqualityComparer<TEntity>.Default.Equals(Copy, other.Copy) && ParentId == other.ParentId && RelateToOriginal == other.RelateToOriginal;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((CopyEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ EqualityComparer<TEntity>.Default.GetHashCode(Copy);
hashCode = (hashCode * 397) ^ ParentId;
hashCode = (hashCode * 397) ^ RelateToOriginal.GetHashCode();
return hashCode;
}
}
public static bool operator ==(CopyEventArgs<TEntity> left, CopyEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(CopyEventArgs<TEntity> left, CopyEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}
+70 -3
View File
@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Events
{
public class DeleteEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
public class DeleteEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>, IEquatable<DeleteEventArgs<TEntity>>, IDeletingMediaFilesEventArgs
{
/// <summary>
/// Constructor accepting multiple entities that are used in the delete operation
@@ -99,10 +100,43 @@ namespace Umbraco.Core.Events
/// <summary>
/// A list of media files that can be added to during a deleted operation for which Umbraco will ensure are removed
/// </summary>
public List<string> MediaFilesToDelete { get; private set; }
public List<string> MediaFilesToDelete { get; private set; }
public bool Equals(DeleteEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && MediaFilesToDelete.Equals(other.MediaFilesToDelete);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((DeleteEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ MediaFilesToDelete.GetHashCode();
}
}
public static bool operator ==(DeleteEventArgs<TEntity> left, DeleteEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(DeleteEventArgs<TEntity> left, DeleteEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
public class DeleteEventArgs : CancellableEventArgs
public class DeleteEventArgs : CancellableEventArgs, IEquatable<DeleteEventArgs>
{
public DeleteEventArgs(int id, bool canCancel, EventMessages eventMessages)
: base(canCancel, eventMessages)
@@ -125,5 +159,38 @@ namespace Umbraco.Core.Events
/// Gets the Id of the object being deleted.
/// </summary>
public int Id { get; private set; }
public bool Equals(DeleteEventArgs other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && Id == other.Id;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((DeleteEventArgs) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ Id;
}
}
public static bool operator ==(DeleteEventArgs left, DeleteEventArgs right)
{
return Equals(left, right);
}
public static bool operator !=(DeleteEventArgs left, DeleteEventArgs right)
{
return !Equals(left, right);
}
}
}
@@ -2,7 +2,7 @@ using System;
namespace Umbraco.Core.Events
{
public class DeleteRevisionsEventArgs : DeleteEventArgs
public class DeleteRevisionsEventArgs : DeleteEventArgs, IEquatable<DeleteRevisionsEventArgs>
{
public DeleteRevisionsEventArgs(int id, bool canCancel, Guid specificVersion = default(Guid), bool deletePriorVersions = false, DateTime dateToRetain = default(DateTime))
: base(id, canCancel)
@@ -31,5 +31,42 @@ namespace Umbraco.Core.Events
{
get { return SpecificVersion != default(Guid); }
}
public bool Equals(DeleteRevisionsEventArgs other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && DateToRetain.Equals(other.DateToRetain) && DeletePriorVersions == other.DeletePriorVersions && SpecificVersion.Equals(other.SpecificVersion);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((DeleteRevisionsEventArgs) obj);
}
public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ DateToRetain.GetHashCode();
hashCode = (hashCode * 397) ^ DeletePriorVersions.GetHashCode();
hashCode = (hashCode * 397) ^ SpecificVersion.GetHashCode();
return hashCode;
}
}
public static bool operator ==(DeleteRevisionsEventArgs left, DeleteRevisionsEventArgs right)
{
return Equals(left, right);
}
public static bool operator !=(DeleteRevisionsEventArgs left, DeleteRevisionsEventArgs right)
{
return !Equals(left, right);
}
}
}
@@ -0,0 +1,73 @@
using System;
namespace Umbraco.Core.Events
{
internal class EventDefinition : EventDefinitionBase
{
private readonly EventHandler _trackedEvent;
private readonly object _sender;
private readonly EventArgs _args;
public EventDefinition(EventHandler trackedEvent, object sender, EventArgs args, string eventName = null)
: base(sender, args, eventName)
{
_trackedEvent = trackedEvent;
_sender = sender;
_args = args;
}
public override void RaiseEvent()
{
if (_trackedEvent != null)
{
_trackedEvent(_sender, _args);
}
}
}
internal class EventDefinition<TEventArgs> : EventDefinitionBase
{
private readonly EventHandler<TEventArgs> _trackedEvent;
private readonly object _sender;
private readonly TEventArgs _args;
public EventDefinition(EventHandler<TEventArgs> trackedEvent, object sender, TEventArgs args, string eventName = null)
: base(sender, args, eventName)
{
_trackedEvent = trackedEvent;
_sender = sender;
_args = args;
}
public override void RaiseEvent()
{
if (_trackedEvent != null)
{
_trackedEvent(_sender, _args);
}
}
}
internal class EventDefinition<TSender, TEventArgs> : EventDefinitionBase
{
private readonly TypedEventHandler<TSender, TEventArgs> _trackedEvent;
private readonly TSender _sender;
private readonly TEventArgs _args;
public EventDefinition(TypedEventHandler<TSender, TEventArgs> trackedEvent, TSender sender, TEventArgs args, string eventName = null)
: base(sender, args, eventName)
{
_trackedEvent = trackedEvent;
_sender = sender;
_args = args;
}
public override void RaiseEvent()
{
if (_trackedEvent != null)
{
_trackedEvent(_sender, _args);
}
}
}
}
@@ -0,0 +1,70 @@
using System;
using System.Reflection;
namespace Umbraco.Core.Events
{
public abstract class EventDefinitionBase : IEventDefinition, IEquatable<EventDefinitionBase>
{
protected EventDefinitionBase(object sender, object args, string eventName = null)
{
if (sender == null) throw new ArgumentNullException("sender");
if (args == null) throw new ArgumentNullException("args");
Sender = sender;
Args = args;
EventName = eventName;
if (EventName.IsNullOrWhiteSpace())
{
var findResult = EventNameExtractor.FindEvent(sender, args,
//don't match "Ing" suffixed names
exclude:EventNameExtractor.MatchIngNames);
if (findResult.Success == false)
throw new AmbiguousMatchException("Could not automatically find the event name, the event name will need to be explicitly registered for this event definition. Error: " + findResult.Result.Error);
EventName = findResult.Result.Name;
}
}
public object Sender { get; private set; }
public object Args { get; private set; }
public string EventName { get; private set; }
public abstract void RaiseEvent();
public bool Equals(EventDefinitionBase other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return Args.Equals(other.Args) && string.Equals(EventName, other.EventName) && Sender.Equals(other.Sender);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((EventDefinitionBase) obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Args.GetHashCode();
hashCode = (hashCode * 397) ^ EventName.GetHashCode();
hashCode = (hashCode * 397) ^ Sender.GetHashCode();
return hashCode;
}
}
public static bool operator ==(EventDefinitionBase left, EventDefinitionBase right)
{
return Equals(left, right);
}
public static bool operator !=(EventDefinitionBase left, EventDefinitionBase right)
{
return Equals(left, right) == false;
}
}
}
@@ -0,0 +1,24 @@
namespace Umbraco.Core.Events
{
/// <summary>
/// The filter used in the <see cref="IEventDispatcher"/> GetEvents method which determines
/// how the result list is filtered
/// </summary>
public enum EventDefinitionFilter
{
/// <summary>
/// Returns all events tracked
/// </summary>
All,
/// <summary>
/// Deduplicates events and only returns the first duplicate instance tracked
/// </summary>
FirstIn,
/// <summary>
/// Deduplicates events and only returns the last duplicate instance tracked
/// </summary>
LastIn
}
}
+34 -34
View File
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Events
{
@@ -9,43 +12,40 @@ namespace Umbraco.Core.Events
/// </summary>
public static class EventExtensions
{
/// <summary>
/// Raises the event and returns a boolean value indicating if the event was cancelled
/// </summary>
/// <typeparam name="TSender"></typeparam>
/// <typeparam name="TArgs"></typeparam>
/// <param name="eventHandler"></param>
/// <param name="args"></param>
/// <param name="sender"></param>
/// <returns></returns>
public static bool IsRaisedEventCancelled<TSender, TArgs>(
this TypedEventHandler<TSender, TArgs> eventHandler,
TArgs args,
TSender sender)
where TArgs : CancellableEventArgs
{
if (eventHandler != null)
eventHandler(sender, args);
// keep these two for backward compatibility reasons but understand that
// they are *not* part of any scope / event dispatcher / anything...
/// <summary>
/// Raises a cancelable event and returns a value indicating whether the event should be cancelled.
/// </summary>
/// <typeparam name="TSender">The type of the event source.</typeparam>
/// <typeparam name="TArgs">The type of the event data.</typeparam>
/// <param name="eventHandler">The event handler.</param>
/// <param name="args">The event source.</param>
/// <param name="sender">The event data.</param>
/// <returns>A value indicating whether the cancelable event should be cancelled</returns>
/// <remarks>A cancelable event is raised by a component when it is about to perform an action that can be canceled.</remarks>
public static bool IsRaisedEventCancelled<TSender, TArgs>(this TypedEventHandler<TSender, TArgs> eventHandler, TArgs args, TSender sender)
where TArgs : CancellableEventArgs
{
if (eventHandler == null) return args.Cancel;
eventHandler(sender, args);
return args.Cancel;
}
/// <summary>
/// Raises the event
/// Raises an event.
/// </summary>
/// <typeparam name="TSender"></typeparam>
/// <typeparam name="TArgs"></typeparam>
/// <param name="eventHandler"></param>
/// <param name="args"></param>
/// <param name="sender"></param>
public static void RaiseEvent<TSender, TArgs>(
this TypedEventHandler<TSender, TArgs> eventHandler,
TArgs args,
TSender sender)
where TArgs : EventArgs
{
if (eventHandler != null)
eventHandler(sender, args);
}
}
/// <typeparam name="TSender">The type of the event source.</typeparam>
/// <typeparam name="TArgs">The type of the event data.</typeparam>
/// <param name="eventHandler">The event handler.</param>
/// <param name="args">The event source.</param>
/// <param name="sender">The event data.</param>
public static void RaiseEvent<TSender, TArgs>(this TypedEventHandler<TSender, TArgs> eventHandler, TArgs args, TSender sender)
where TArgs : EventArgs
{
if (eventHandler == null) return;
eventHandler(sender, args);
}
}
}
@@ -0,0 +1,159 @@
using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
namespace Umbraco.Core.Events
{
/// <summary>
/// There is actually no way to discover an event name in c# at the time of raising the event. It is possible
/// to get the event name from the handler that is being executed based on the event being raised, however that is not
/// what we want in this case. We need to find the event name before it is being raised - you would think that it's possible
/// with reflection or anything but that is not the case, the delegate that defines an event has no info attached to it, it
/// is literally just an event.
///
/// So what this does is take the sender and event args objects, looks up all public/static events on the sender that have
/// a generic event handler with generic arguments (but only) one, then we match the type of event arguments with the ones
/// being passed in. As it turns out, in our services this will work for the majority of our events! In some cases it may not
/// work and we'll have to supply a string but hopefully this saves a bit of magic strings.
///
/// We can also write tests to validate these are all working correctly for all services.
/// </summary>
internal class EventNameExtractor
{
/// <summary>
/// Finds the event name on the sender that matches the args type
/// </summary>
/// <param name="senderType"></param>
/// <param name="argsType"></param>
/// <param name="exclude">
/// A filter to exclude matched event names, this filter should return true to exclude the event name from being matched
/// </param>
/// <returns>
/// null if not found or an ambiguous match
/// </returns>
public static Attempt<EventNameExtractorResult> FindEvent(Type senderType, Type argsType, Func<string, bool> exclude)
{
var found = MatchedEventNames.GetOrAdd(new Tuple<Type, Type>(senderType, argsType), tuple =>
{
var events = CandidateEvents.GetOrAdd(senderType, t =>
{
return t.GetEvents(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
//we can only look for events handlers with generic types because that is the only
// way that we can try to find a matching event based on the arg type passed in
.Where(x => x.EventHandlerType.IsGenericType)
.Select(x => new EventInfoArgs(x, x.EventHandlerType.GetGenericArguments()))
//we are only looking for event handlers that have more than one generic argument
.Where(x =>
{
if (x.GenericArgs.Length == 1) return true;
//special case for our own TypedEventHandler
if (x.EventInfo.EventHandlerType.GetGenericTypeDefinition() == typeof(TypedEventHandler<,>) && x.GenericArgs.Length == 2)
{
return true;
}
return false;
})
.ToArray();
});
return events.Where(x =>
{
if (x.GenericArgs.Length == 1 && x.GenericArgs[0] == tuple.Item2)
return true;
//special case for our own TypedEventHandler
if (x.EventInfo.EventHandlerType.GetGenericTypeDefinition() == typeof(TypedEventHandler<,>)
&& x.GenericArgs.Length == 2
&& x.GenericArgs[1] == tuple.Item2)
{
return true;
}
return false;
}).Select(x => x.EventInfo.Name).ToArray();
});
var filtered = found.Where(x => exclude(x) == false).ToArray();
if (filtered.Length == 0)
return Attempt.Fail(new EventNameExtractorResult(EventNameExtractorError.NoneFound));
if (filtered.Length == 1)
return Attempt.Succeed(new EventNameExtractorResult(filtered[0]));
//there's more than one left so it's ambiguous!
return Attempt.Fail(new EventNameExtractorResult(EventNameExtractorError.Ambiguous));
}
/// <summary>
/// Finds the event name on the sender that matches the args type
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
/// <param name="exclude">
/// A filter to exclude matched event names, this filter should return true to exclude the event name from being matched
/// </param>
/// <returns>
/// null if not found or an ambiguous match
/// </returns>
public static Attempt<EventNameExtractorResult> FindEvent(object sender, object args, Func<string, bool> exclude)
{
return FindEvent(sender.GetType(), args.GetType(), exclude);
}
/// <summary>
/// Return true if the event is named with an ING name such as "Saving" or "RollingBack"
/// </summary>
/// <param name="eventName"></param>
/// <returns></returns>
internal static bool MatchIngNames(string eventName)
{
var splitter = new Regex(@"(?<!^)(?=[A-Z])");
var words = splitter.Split(eventName);
if (words.Length == 0)
return false;
return words[0].EndsWith("ing");
}
/// <summary>
/// Return true if the event is not named with an ING name such as "Saving" or "RollingBack"
/// </summary>
/// <param name="eventName"></param>
/// <returns></returns>
internal static bool MatchNonIngNames(string eventName)
{
var splitter = new Regex(@"(?<!^)(?=[A-Z])");
var words = splitter.Split(eventName);
if (words.Length == 0)
return false;
return words[0].EndsWith("ing") == false;
}
private class EventInfoArgs
{
public EventInfo EventInfo { get; private set; }
public Type[] GenericArgs { get; private set; }
public EventInfoArgs(EventInfo eventInfo, Type[] genericArgs)
{
EventInfo = eventInfo;
GenericArgs = genericArgs;
}
}
/// <summary>
/// Used to cache all candidate events for a given type so we don't re-look them up
/// </summary>
private static readonly ConcurrentDictionary<Type, EventInfoArgs[]> CandidateEvents = new ConcurrentDictionary<Type, EventInfoArgs[]>();
/// <summary>
/// Used to cache all matched event names by (sender type + arg type) so we don't re-look them up
/// </summary>
private static readonly ConcurrentDictionary<Tuple<Type, Type>, string[]> MatchedEventNames = new ConcurrentDictionary<Tuple<Type, Type>, string[]>();
}
}
@@ -0,0 +1,8 @@
namespace Umbraco.Core.Events
{
internal enum EventNameExtractorError
{
NoneFound,
Ambiguous
}
}
@@ -0,0 +1,18 @@
namespace Umbraco.Core.Events
{
internal class EventNameExtractorResult
{
public EventNameExtractorError? Error { get; private set; }
public string Name { get; private set; }
public EventNameExtractorResult(string name)
{
Name = name;
}
public EventNameExtractorResult(EventNameExtractorError error)
{
Error = error;
}
}
}
+36 -2
View File
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Umbraco.Core.Events
{
public class ExportEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
public class ExportEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>, IEquatable<ExportEventArgs<TEntity>>
{
/// <summary>
/// Constructor accepting a single entity instance
@@ -48,5 +49,38 @@ namespace Umbraco.Core.Events
/// Returns the xml relating to the export event
/// </summary>
public XElement Xml { get; private set; }
public bool Equals(ExportEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && Equals(Xml, other.Xml);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((ExportEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ (Xml != null ? Xml.GetHashCode() : 0);
}
}
public static bool operator ==(ExportEventArgs<TEntity> left, ExportEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(ExportEventArgs<TEntity> left, ExportEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}
@@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace Umbraco.Core.Events
{
internal interface IDeletingMediaFilesEventArgs
{
List<string> MediaFilesToDelete { get; }
}
}
@@ -0,0 +1,13 @@
using System;
namespace Umbraco.Core.Events
{
public interface IEventDefinition
{
object Sender { get; }
object Args { get; }
string EventName { get; }
void RaiseEvent();
}
}
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Events
{
/// <summary>
/// Dispatches events from within a scope.
/// </summary>
/// <remarks>
/// <para>The name of the event is auto-magically discovered by matching the sender type, args type, and
/// eventHandler type. If the match is not unique, then the name parameter must be used to specify the
/// name in an explicit way.</para>
/// <para>What happens when an event is dispatched depends on the scope settings. It can be anything from
/// "trigger immediately" to "just ignore". Refer to the scope documentation for more details.</para>
/// </remarks>
public interface IEventDispatcher
{
// not sure about the Dispatch & DispatchCancelable signatures at all for now
// nor about the event name thing, etc - but let's keep it like this
/// <summary>
/// Dispatches a cancelable event.
/// </summary>
/// <param name="eventHandler">The event handler.</param>
/// <param name="sender">The object that raised the event.</param>
/// <param name="args">The event data.</param>
/// <param name="name">The optional name of the event.</param>
/// <returns>A value indicating whether the cancelable event was cancelled.</returns>
/// <remarks>See general remarks on the interface.</remarks>
bool DispatchCancelable(EventHandler eventHandler, object sender, CancellableEventArgs args, string name = null);
/// <summary>
/// Dispatches a cancelable event.
/// </summary>
/// <param name="eventHandler">The event handler.</param>
/// <param name="sender">The object that raised the event.</param>
/// <param name="args">The event data.</param>
/// <param name="name">The optional name of the event.</param>
/// <returns>A value indicating whether the cancelable event was cancelled.</returns>
/// <remarks>See general remarks on the interface.</remarks>
bool DispatchCancelable<TArgs>(EventHandler<TArgs> eventHandler, object sender, TArgs args, string name = null)
where TArgs : CancellableEventArgs;
/// <summary>
/// Dispatches a cancelable event.
/// </summary>
/// <param name="eventHandler">The event handler.</param>
/// <param name="sender">The object that raised the event.</param>
/// <param name="args">The event data.</param>
/// <param name="name">The optional name of the event.</param>
/// <returns>A value indicating whether the cancelable event was cancelled.</returns>
/// <remarks>See general remarks on the interface.</remarks>
bool DispatchCancelable<TSender, TArgs>(TypedEventHandler<TSender, TArgs> eventHandler, TSender sender, TArgs args, string name = null)
where TArgs : CancellableEventArgs;
/// <summary>
/// Dispatches an event.
/// </summary>
/// <param name="eventHandler">The event handler.</param>
/// <param name="sender">The object that raised the event.</param>
/// <param name="args">The event data.</param>
/// <param name="name">The optional name of the event.</param>
/// <remarks>See general remarks on the interface.</remarks>
void Dispatch(EventHandler eventHandler, object sender, EventArgs args, string name = null);
/// <summary>
/// Dispatches an event.
/// </summary>
/// <param name="eventHandler">The event handler.</param>
/// <param name="sender">The object that raised the event.</param>
/// <param name="args">The event data.</param>
/// <param name="name">The optional name of the event.</param>
/// <remarks>See general remarks on the interface.</remarks>
void Dispatch<TArgs>(EventHandler<TArgs> eventHandler, object sender, TArgs args, string name = null);
/// <summary>
/// Dispatches an event.
/// </summary>
/// <param name="eventHandler">The event handler.</param>
/// <param name="sender">The object that raised the event.</param>
/// <param name="args">The event data.</param>
/// <param name="name">The optional name of the event.</param>
/// <remarks>See general remarks on the interface.</remarks>
void Dispatch<TSender, TArgs>(TypedEventHandler<TSender, TArgs> eventHandler, TSender sender, TArgs args, string name = null);
/// <summary>
/// Notifies the dispatcher that the scope is exiting.
/// </summary>
/// <param name="completed">A value indicating whether the scope completed.</param>
void ScopeExit(bool completed);
/// <summary>
/// Gets the collected events.
/// </summary>
/// <returns>The collected events.</returns>
IEnumerable<IEventDefinition> GetEvents(EventDefinitionFilter filter);
}
}
+36 -2
View File
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Xml.Linq;
namespace Umbraco.Core.Events
{
public class ImportEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
public class ImportEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>, IEquatable<ImportEventArgs<TEntity>>
{
/// <summary>
/// Constructor accepting an XElement with the xml being imported
@@ -46,5 +47,38 @@ namespace Umbraco.Core.Events
/// Returns the xml relating to the import event
/// </summary>
public XElement Xml { get; private set; }
public bool Equals(ImportEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && Equals(Xml, other.Xml);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((ImportEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ (Xml != null ? Xml.GetHashCode() : 0);
}
}
public static bool operator ==(ImportEventArgs<TEntity> left, ImportEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(ImportEventArgs<TEntity> left, ImportEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Umbraco.Core.Packaging.Models;
namespace Umbraco.Core.Events
{
internal class ImportPackageEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
internal class ImportPackageEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>, IEquatable<ImportPackageEventArgs<TEntity>>
{
private readonly MetaData _packageMetaData;
@@ -21,6 +22,44 @@ namespace Umbraco.Core.Events
public MetaData PackageMetaData
{
get { return _packageMetaData; }
}
public IEnumerable<TEntity> InstallationSummary
{
get { return EventObject; }
}
public bool Equals(ImportPackageEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && _packageMetaData.Equals(other._packageMetaData);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((ImportPackageEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ _packageMetaData.GetHashCode();
}
}
public static bool operator ==(ImportPackageEventArgs<TEntity> left, ImportPackageEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(ImportPackageEventArgs<TEntity> left, ImportPackageEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}
+44 -6
View File
@@ -7,7 +7,7 @@ using Umbraco.Core.Persistence.Migrations;
namespace Umbraco.Core.Events
{
public class MigrationEventArgs : CancellableObjectEventArgs<IList<IMigration>>
public class MigrationEventArgs : CancellableObjectEventArgs<IList<IMigration>>, IEquatable<MigrationEventArgs>
{
/// <summary>
/// Constructor accepting multiple migrations that are used in the migration runner
@@ -31,13 +31,13 @@ namespace Umbraco.Core.Events
[Obsolete("Use constructor accepting a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion, bool canCancel)
: this(eventObject, null, configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName, canCancel)
: this(eventObject, null, configuredVersion, targetVersion, Constants.System.UmbracoMigrationName, canCancel)
{ }
[Obsolete("Use constructor accepting SemVersion instances and a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, Version configuredVersion, Version targetVersion, bool canCancel)
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), GlobalSettings.UmbracoMigrationName, canCancel)
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, canCancel)
{ }
/// <summary>
@@ -74,7 +74,7 @@ namespace Umbraco.Core.Events
MigrationContext = migrationContext;
ConfiguredSemVersion = configuredVersion;
TargetSemVersion = targetVersion;
ProductName = GlobalSettings.UmbracoMigrationName;
ProductName = Constants.System.UmbracoMigrationName;
}
/// <summary>
@@ -97,13 +97,13 @@ namespace Umbraco.Core.Events
[Obsolete("Use constructor accepting a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, SemVersion configuredVersion, SemVersion targetVersion)
: this(eventObject, null, configuredVersion, targetVersion, GlobalSettings.UmbracoMigrationName, false)
: this(eventObject, null, configuredVersion, targetVersion, Constants.System.UmbracoMigrationName, false)
{ }
[Obsolete("Use constructor accepting SemVersion instances and a product name instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public MigrationEventArgs(IList<IMigration> eventObject, Version configuredVersion, Version targetVersion)
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), GlobalSettings.UmbracoMigrationName, false)
: this(eventObject, null, new SemVersion(configuredVersion), new SemVersion(targetVersion), Constants.System.UmbracoMigrationName, false)
{ }
/// <summary>
@@ -141,5 +141,43 @@ namespace Umbraco.Core.Events
public string ProductName { get; private set; }
internal MigrationContext MigrationContext { get; private set; }
public bool Equals(MigrationEventArgs other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && ConfiguredSemVersion.Equals(other.ConfiguredSemVersion) && MigrationContext.Equals(other.MigrationContext) && string.Equals(ProductName, other.ProductName) && TargetSemVersion.Equals(other.TargetSemVersion);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((MigrationEventArgs) obj);
}
public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ ConfiguredSemVersion.GetHashCode();
hashCode = (hashCode * 397) ^ MigrationContext.GetHashCode();
hashCode = (hashCode * 397) ^ ProductName.GetHashCode();
hashCode = (hashCode * 397) ^ TargetSemVersion.GetHashCode();
return hashCode;
}
}
public static bool operator ==(MigrationEventArgs left, MigrationEventArgs right)
{
return Equals(left, right);
}
public static bool operator !=(MigrationEventArgs left, MigrationEventArgs right)
{
return !Equals(left, right);
}
}
}
+34 -1
View File
@@ -4,7 +4,7 @@ using System.Linq;
namespace Umbraco.Core.Events
{
public class MoveEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>
public class MoveEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>, IEquatable<MoveEventArgs<TEntity>>
{
/// <summary>
/// Constructor accepting a collection of MoveEventInfo objects
@@ -123,5 +123,38 @@ namespace Umbraco.Core.Events
/// </summary>
[Obsolete("Retrieve the ParentId from the MoveInfoCollection property instead")]
public int ParentId { get; private set; }
public bool Equals(MoveEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && MoveInfoCollection.Equals(other.MoveInfoCollection);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((MoveEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ MoveInfoCollection.GetHashCode();
}
}
public static bool operator ==(MoveEventArgs<TEntity> left, MoveEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(MoveEventArgs<TEntity> left, MoveEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}
+40 -1
View File
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Events
{
public class MoveEventInfo<TEntity>
public class MoveEventInfo<TEntity> : IEquatable<MoveEventInfo<TEntity>>
{
public MoveEventInfo(TEntity entity, string originalPath, int newParentId)
{
@@ -12,5 +15,41 @@ namespace Umbraco.Core.Events
public TEntity Entity { get; set; }
public string OriginalPath { get; set; }
public int NewParentId { get; set; }
public bool Equals(MoveEventInfo<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return EqualityComparer<TEntity>.Default.Equals(Entity, other.Entity) && NewParentId == other.NewParentId && string.Equals(OriginalPath, other.OriginalPath);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((MoveEventInfo<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = EqualityComparer<TEntity>.Default.GetHashCode(Entity);
hashCode = (hashCode * 397) ^ NewParentId;
hashCode = (hashCode * 397) ^ OriginalPath.GetHashCode();
return hashCode;
}
}
public static bool operator ==(MoveEventInfo<TEntity> left, MoveEventInfo<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(MoveEventInfo<TEntity> left, MoveEventInfo<TEntity> right)
{
return !Equals(left, right);
}
}
}
+40 -1
View File
@@ -1,8 +1,10 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Models;
namespace Umbraco.Core.Events
{
public class NewEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>
public class NewEventArgs<TEntity> : CancellableObjectEventArgs<TEntity>, IEquatable<NewEventArgs<TEntity>>
{
@@ -84,5 +86,42 @@ namespace Umbraco.Core.Events
/// Gets or Sets the parent IContent object.
/// </summary>
public TEntity Parent { get; private set; }
public bool Equals(NewEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && string.Equals(Alias, other.Alias) && EqualityComparer<TEntity>.Default.Equals(Parent, other.Parent) && ParentId == other.ParentId;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((NewEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = (hashCode * 397) ^ Alias.GetHashCode();
hashCode = (hashCode * 397) ^ EqualityComparer<TEntity>.Default.GetHashCode(Parent);
hashCode = (hashCode * 397) ^ ParentId;
return hashCode;
}
}
public static bool operator ==(NewEventArgs<TEntity> left, NewEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(NewEventArgs<TEntity> left, NewEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}
@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace Umbraco.Core.Events
{
/// <summary>
/// This event manager supports event cancellation and will raise the events as soon as they are tracked, it does not store tracked events
/// </summary>
internal class PassThroughEventDispatcher : IEventDispatcher
{
public bool DispatchCancelable(EventHandler eventHandler, object sender, CancellableEventArgs args, string eventName = null)
{
if (eventHandler == null) return args.Cancel;
eventHandler(sender, args);
return args.Cancel;
}
public bool DispatchCancelable<TArgs>(EventHandler<TArgs> eventHandler, object sender, TArgs args, string eventName = null)
where TArgs : CancellableEventArgs
{
if (eventHandler == null) return args.Cancel;
eventHandler(sender, args);
return args.Cancel;
}
public bool DispatchCancelable<TSender, TArgs>(TypedEventHandler<TSender, TArgs> eventHandler, TSender sender, TArgs args, string eventName = null)
where TArgs : CancellableEventArgs
{
if (eventHandler == null) return args.Cancel;
eventHandler(sender, args);
return args.Cancel;
}
public void Dispatch(EventHandler eventHandler, object sender, EventArgs args, string eventName = null)
{
if (eventHandler == null) return;
eventHandler(sender, args);
}
public void Dispatch<TArgs>(EventHandler<TArgs> eventHandler, object sender, TArgs args, string eventName = null)
{
if (eventHandler == null) return;
eventHandler(sender, args);
}
public void Dispatch<TSender, TArgs>(TypedEventHandler<TSender, TArgs> eventHandler, TSender sender, TArgs args, string eventName = null)
{
if (eventHandler == null) return;
eventHandler(sender, args);
}
public IEnumerable<IEventDefinition> GetEvents(EventDefinitionFilter filter)
{
return Enumerable.Empty<IEventDefinition>();
}
public void ScopeExit(bool completed)
{ }
}
}
+36 -2
View File
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace Umbraco.Core.Events
{
public class PublishEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
public class PublishEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>, IEquatable<PublishEventArgs<TEntity>>
{
/// <summary>
/// Constructor accepting multiple entities that are used in the publish operation
@@ -101,5 +102,38 @@ namespace Umbraco.Core.Events
}
public bool IsAllRepublished { get; private set; }
public bool Equals(PublishEventArgs<TEntity> other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && IsAllRepublished == other.IsAllRepublished;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((PublishEventArgs<TEntity>) obj);
}
public override int GetHashCode()
{
unchecked
{
return (base.GetHashCode() * 397) ^ IsAllRepublished.GetHashCode();
}
}
public static bool operator ==(PublishEventArgs<TEntity> left, PublishEventArgs<TEntity> right)
{
return Equals(left, right);
}
public static bool operator !=(PublishEventArgs<TEntity> left, PublishEventArgs<TEntity> right)
{
return !Equals(left, right);
}
}
}

Some files were not shown because too many files have changed in this diff Show More