Compare commits

..

307 Commits

Author SHA1 Message Date
Sebastiaan Janssen fd2fe1939a Adds new installer image 2014-06-11 10:22:13 +02:00
Morten Christensen 81e56bed9e Implementing Document Type Compositions in the Document Type Editor.
Adds changes to the CMSNode and doc type related class which improves the internal usage of the new model based on IUmbracoEntity.
2014-06-11 07:08:38 +02:00
Sebastiaan Janssen 52457fea21 Bump version number 2014-06-10 18:47:02 +02:00
Sebastiaan Janssen 07ec9aa813 Undo formatting of query for now 2014-06-10 18:11:14 +02:00
Sebastiaan Janssen ba89aec34f Merge pull request #415 from rustyswayne/7.1.5-templatequery
Query Builder - Fix Date sort fields and format returned query
2014-06-10 17:48:59 +02:00
Jeavon Leopold 29533820ab Query Builder - Fix Date sort fields and format returned query to be on new lines and tabbed 2014-06-10 16:43:28 +01:00
Sebastiaan Janssen 4366500fad Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.2.0
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js
2014-06-10 17:15:07 +02:00
Sebastiaan Janssen ee6e1a9d8b Disable extra templates tree 2014-06-10 17:13:58 +02:00
antoine 3b95184f04 empty video or media issue 2014-06-10 17:06:13 +02:00
antoine 9da7e108da double )) in embed open windows 2014-06-10 16:52:29 +02:00
antoine cb491d45ab open preview issue fixed 2014-06-10 16:50:03 +02:00
Sebastiaan Janssen 344b880ba7 Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.2.0
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/common/dialogs/content/edit.controller.js
	src/Umbraco.Web.UI.Client/src/views/content/content.edit.controller.js
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/grid.controller.js
	src/Umbraco.Web/Umbraco.Web.csproj
2014-06-10 15:22:31 +02:00
Sebastiaan Janssen c958f12bc1 Merge pull request #413 from rustyswayne/7.1.5-templatequery
Template Query Editor Prototype
2014-06-10 15:11:57 +02:00
Shannon 9a973d0ccc fixes csproj 2014-06-10 15:06:41 +02:00
Jeavon Leopold b170053e87 Support for multiple "and" conditions in the query builder 2014-06-10 14:05:57 +01:00
antoine db4509de2b link picker removed 2014-06-10 14:35:57 +02:00
antoine 5c91b822e3 legacy grid's configs removed 2014-06-10 13:45:52 +02:00
Shannon e6ddf63e56 re-adds old providers 2014-06-10 13:19:52 +02:00
Shannon 84ac029372 re-add segment provider 2014-06-10 13:18:54 +02:00
antoine 5d59741612 iframe resize with the tuning panel 2014-06-10 12:52:33 +02:00
Jeavon Leopold 2ffd0413e8 Adding query builder button to View editor 2014-06-10 11:27:26 +01:00
Jeavon Leopold dc4e6ee01c Adding Visible to template query builder 2014-06-10 08:40:33 +01:00
Jeavon Leopold 1d8e217c6f Template Query builder prototype working! 2014-06-09 23:23:31 +01:00
Sebastiaan Janssen e59768dda0 Capitalize Caturday 2014-06-09 20:57:15 +02:00
Sebastiaan Janssen 0b114c88f0 Merge pull request #397 from lesleyauk/7.1.5
Correct English days of the week on login screen
2014-06-09 20:55:31 +02:00
Rusty Swayne 0b3136cf20 Patched Contains query & implemented SortExpression 2014-06-09 09:14:26 -07:00
Rusty Swayne b0e96b256a Merge branch '7.1.5' into 7.1.5-templatequery 2014-06-09 08:44:19 -07:00
Jeavon Leopold 72a966b0fa Template Query Editor - Angular and hooking up to the API controller 2014-06-09 16:42:57 +01:00
Rusty Swayne bf222f26cd Merge remote-tracking branch 'umbraco/7.1.5' into 7.1.5 2014-06-09 08:41:33 -07:00
Rusty Swayne be9f4b70e2 Added JasonCamelCaseFormatter to the .Web project 2014-06-09 08:40:47 -07:00
Stephan d9374c34d1 Add IPropertyValueConverterMeta interface
Conflicts:
	src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs
	src/Umbraco.Core/Umbraco.Core.csproj
2014-06-09 15:31:35 +02:00
Sebastiaan Janssen 2b7526ab2e Merge pull request #409 from JimBobSquarePants/7.1.5
Improving grammar in installer facts.
2014-06-09 15:30:46 +02:00
Shannon 2fde10494c Merge branch '7.1.5' of https://github.com/umbraco/Umbraco-CMS into 7.1.5 2014-06-09 15:32:52 +02:00
Shannon 0da4879400 downgrades mini profiler to what it used to be 2014-06-09 15:32:44 +02:00
Sebastiaan Janssen 07172067ab Merge pull request #408 from BatJan/7.1.5-wording-fix-4382
Fix of U4-4382
2014-06-09 15:28:36 +02:00
James South 681a3e3046 Improving grammar in installer facts. 2014-06-09 15:20:28 +02:00
Rusty Swayne 0060f0019e Merge branch '7.1.5' into 7.1.5-templatequery 2014-06-09 05:41:16 -07:00
Rusty Swayne 632cd221d9 Attribute for WebApi controllers that camel cases object property names when serialized to Json 2014-06-09 05:39:14 -07:00
Jeavon Leopold 46d5215d9e Merge remote-tracking branch 'upstream/7.1.5' into 7.1.5-templatequery 2014-06-09 13:21:07 +01:00
Jeavon Leopold aa43656cb9 Revisions to QueryModel. Added Sorting and Take functionality. 2014-06-09 13:18:35 +01:00
Sebastiaan Janssen e5dea8e4be Merge pull request #407 from BatJan/7.1.5-translation-fix-4538
Fix of U4-4538
2014-06-09 14:09:19 +02:00
Sebastiaan Janssen 087dd1fe9e Merge pull request #404 from BatJan/7.1.5-installer-fix-4416
Fix of U4-4416
2014-06-09 13:58:08 +02:00
Sebastiaan Janssen 37afe6dd29 Merge pull request #406 from BatJan/7.1.5-spelling-fix-5007
Fix of  issue U4-5007
2014-06-09 13:51:57 +02:00
Sebastiaan Janssen 338a125eaa Merge pull request #405 from JimBobSquarePants/7.1.5
Fixing broken preview dialog U4-4977
2014-06-09 13:49:45 +02:00
Jan Skovgaard 18fc6ccc99 Fix of U4-4382 2014-06-09 13:23:01 +02:00
Stephan 8a1db41fc4 Implement content.FirstChild 2014-06-09 13:04:40 +02:00
James South d2119c17c1 Fixing broken preview dialog U4-4977 2014-06-09 13:01:00 +02:00
Jan Skovgaard 9d4afbd007 Fix of U4-4538 2014-06-09 12:44:07 +02:00
Jan Skovgaard c4f764d5fc Fix of issue U4-5007 2014-06-09 12:28:29 +02:00
Sebastiaan Janssen db3d86aeca Merge pull request #402 from leekelleher/U4-3596
U4-3596 Recycle bin, use the listview on the recycle bin instead of showing the deleted items as children
2014-06-09 10:56:24 +02:00
Sebastiaan Janssen c17e60f709 Merge pull request #401 from leekelleher/U4-5066
U4-5066 Display message on empty list-view.
2014-06-09 10:45:13 +02:00
Sebastiaan Janssen 68860b6c54 Update Umbraco version everywhere 2014-06-09 10:32:09 +02:00
Sebastiaan Janssen 5834757476 Merge pull request #403 from BatJan/7.1.5-installer-fix-5040
Fix of U4-5040
2014-06-09 10:15:06 +02:00
Jeavon Leopold e4837d1962 Changing DescendantOrSelf to DescendantOrSelf.First as it doesn't work with dynamics 2014-06-09 08:41:29 +01:00
Jeavon Leopold 40868d7cd2 Fixing typo in Descendants for template query controller 2014-06-09 07:08:06 +01:00
Jeavon Leopold 0fde3f7b5d Fixing up the test method for the query builder 2014-06-08 23:26:46 +01:00
Jeavon Leopold 76f0eac5f8 Template Query WIP 2014-06-08 22:39:01 +01:00
Jeavon Leopold 2352d258b9 Fix mock API method and some Stylecop 2014-06-08 19:06:37 +01:00
Rusty Swayne 2dc38a29cf Added QueryModel 2014-06-08 10:20:34 -07:00
leekelleher 91ddbff990 U4-5066 Display message on empty list-view. 2014-06-08 18:18:50 +01:00
Niels Hartvig 5fd1d7c9e5 Merge branch '7.1.5' of https://github.com/umbraco/Umbraco-CMS into 7.1.5 2014-06-08 19:18:43 +02:00
Niels Hartvig 32cfdbe968 Fixes: U4-4892 Inconsistent (lack of) instructions regarding file extensions in the UI 2014-06-08 19:18:37 +02:00
Shannon a754cecaf7 Allows any Controller to use PreRenderViewActionFilterAttribute 2014-06-08 19:12:40 +02:00
Jeavon Leopold 1aa162e255 Add Site() method to DynamicPublishedContent for Template Query Builder 2014-06-08 18:09:29 +01:00
leekelleher 8ccb06c91d Tidied up the "Recycle Bin" headers for both content/media 2014-06-08 18:09:07 +01:00
Shannon d8e35ffc08 Merge branch '7.1.5' of https://github.com/umbraco/Umbraco-CMS into 7.1.5 2014-06-08 19:05:54 +02:00
Shannon 34dcde645c Half completes: U4-2462 Does the app_plugins manager monitor file changes? 2014-06-08 19:05:48 +02:00
Rusty Swayne 342999a678 TemplateQueryController 2014-06-08 09:51:06 -07:00
Jan Skovgaard 0474605d36 Fix of U4-4416
http://issues.umbraco.org/issue/U4-4416
2014-06-08 18:47:07 +02:00
Sebastiaan Janssen 4dd3f2f8ac Merge pull request #399 from leekelleher/U4-3575
U4-3575 Get Started Dashboard does not changes when changing sections using Left Menu icons
2014-06-08 18:38:43 +02:00
Jan Skovgaard d7a0447e2e Fix of U4-5040 2014-06-08 18:31:50 +02:00
Sebastiaan Janssen cbe23663e3 Merge pull request #400 from BatJan/7.1.5-installer-fix-4874
7.1.5 installer fix 4874
2014-06-08 18:23:21 +02:00
Niels Hartvig bff415a4c6 Fixes: U4-4893 Inconsistent display of file extensions in the UI 2014-06-08 17:55:05 +02:00
leekelleher caa59f2c80 Updated recycle-bin dashboard controller to handle both content and media items. 2014-06-08 16:46:04 +01:00
leekelleher 2ff1c973e0 Set the listview row item to 'inactive' if the item isTrashed.
(As media items do not have a published state.)
2014-06-08 16:45:22 +01:00
leekelleher f056d3fae7 Modified MediaTypeController.GetAllowedChildren to return an empty collection if the "node ID" is the content/media recycle-bin.
Removed the media recycle-bin node ID from the `ContentTypeController.GetAllowedChildren `.
2014-06-08 16:43:55 +01:00
leekelleher 41a455c9ac Added treeHeaders_mediaRecycleBin to the localization mocks 2014-06-08 16:28:13 +01:00
Shannon f834155763 updated version to 7.1.5 2014-06-08 17:26:23 +02:00
leekelleher 15cc3d19c1 Modified ContentTypeController.GetAllowedChildren to return an empty collection if the "node ID" is the content/media recycle-bin. 2014-06-08 16:18:33 +01:00
leekelleher 3bb563ec55 Modified the 'listview' view + controller - added isTrashed property/state 2014-06-08 16:17:16 +01:00
Shannon b5282244f0 Umbraco MVC style routes now implemented. 2014-06-08 17:16:28 +02:00
Shannon aa5b5708b2 Merge branch '7.1.5' of https://github.com/umbraco/Umbraco-CMS into 7.1.5 2014-06-08 17:15:58 +02:00
Shannon ec0d6959a9 mini profiler in back office now enabled with query string 2014-06-08 17:15:52 +02:00
leekelleher 320df6706e Modified content tree controller to point the recycle bin node to the dashboard. 2014-06-08 16:15:28 +01:00
leekelleher 519dd8b476 Modified the existing 'recyclebin' dashboard view.
Added view for media 'recyclebin'
2014-06-08 16:14:35 +01:00
leekelleher 0434b3e5bd #U4-3575 Get Started Dashboard does not changes when changing sections using Left Menu icons
Switching sections updates the route/location; thus displays the corresponding dashboard.
2014-06-08 16:02:18 +01:00
BatJan ff42a1b79c Fix of http://issues.umbraco.org/issue/U4-5025 2014-06-08 16:32:03 +02:00
BatJan 4e433becd6 Fix of http://issues.umbraco.org/issue/U4-5025 2014-06-08 16:29:10 +02:00
Niels Hartvig 8aafc583de New styling for content / media titles 2014-06-08 16:29:04 +02:00
Jan Skovgaard d6b0ed2d40 Fix for U4-4874
Added id's to the input fields, so labels are connected properly.
2014-06-08 16:09:06 +02:00
Shannon ebbbd80bb3 Fixes: U4-5065 Add event to modify the model on front-end for IRenderMvcControllers 2014-06-08 14:14:12 +02:00
Shannon 7b33eca014 disables dist call 2014-06-08 13:14:27 +02:00
Shannon f8e06e54de Merge branch '7.1.5' of https://github.com/umbraco/Umbraco-CMS into 7.1.5 2014-06-08 13:09:37 +02:00
Shannon 23d9ef624b Merge remote-tracking branch 'origin/6.2.1' into 7.1.5
Conflicts:
	build/Build.bat
	build/NuSpecs/build/UmbracoCms.targets
	src/Umbraco.Core/Configuration/UmbracoVersion.cs
	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
	src/Umbraco.Web/Umbraco.Web.csproj
2014-06-08 13:09:31 +02:00
Morten Christensen cdb5b0470d Implementing tests for all methods in the LocalizationService. 2014-06-08 12:59:30 +02:00
Shannon b43f39a0cb disables dist call 2014-06-08 12:50:45 +02:00
Shannon d0cb27d1c1 Completes: U4-2633 Bundle all cache refresher transmissions into a single call per request for much better performance 2014-06-08 12:49:20 +02:00
Shannon e8990eb6b2 Merge commit 'beb1979b4655a529b703ceec094a50f6a3dd8602' into 7.1.5
Conflicts:
	src/Umbraco.Web.UI/config/umbracoSettings.config
2014-06-08 12:24:29 +02:00
Shannon 05524c643e Merge branch '7.1.5-backoffice-miniprofiler' into 7.1.5 2014-06-08 12:08:34 +02:00
Shannon ed989079b4 positions mini profiler to the bottom right 2014-06-08 12:08:05 +02:00
antoine 5cb210c7b6 slider input updated real time 2014-06-08 11:08:56 +02:00
Morten Christensen feed5c5e51 Fixes #U4-4593 EntityService.GetObjectType with passed in integer id or guid unique id 2014-06-08 09:46:43 +02:00
antoine b80ab20cb4 device preview background color 2014-06-08 09:42:39 +02:00
Lesley 754a6e327e Correct capitals for English days of the week (part 2). 2014-06-07 15:56:17 +01:00
Lesley 650fb94057 Correct capitals for English days of the week. 2014-06-07 14:12:01 +01:00
Stephan 0af19fa442 U4-5057 - fix UmbracoHelper.TypedSearch 2014-06-05 17:30:58 +02:00
antoine bac6e71e7f color picker in real time, general clear code 2014-06-05 14:02:38 +02:00
antoine 9a36d74418 tuning issue 2014-06-04 16:24:02 +02:00
Shandem 5b17bc6d5f Merge pull request #393 from henrikrossen/7.1.5
Migrated obsolete method calls and cleaned ContentTypeServiceTests.cs
2014-06-04 10:46:36 +10:00
Henrik Rossen Jakobsen 06a1f790dd Migrated obsolete method calls and cleaned ContentTypeServiceTests.cs 2014-06-03 21:47:18 +02:00
antoine 39eaa4a15e Element select improved, default style more clean 2014-06-03 19:33:31 +02:00
antoine 2fdf040f73 Palette improvement 2014-06-02 10:55:53 +02:00
antoine aec956dd2e grunt js task issue 2014-06-02 10:55:17 +02:00
Shannon e7994d077e minor logic change for checking if sort exists 2014-06-02 15:40:24 +10:00
Shannon f55f9edb71 Ensures each property type has a real sort order when adding to the property type collection 2014-06-02 14:04:40 +10:00
antoine 65bb1e1e20 gridRow default less 2014-05-30 20:03:34 +02:00
antoine 3dabd73ec2 Merge branch '7.1.2-Usky' into 7.1.2-Usky-Grid
Conflicts:
	src/Umbraco.Web.UI.Client/src/tuning/tuning.controller.js
	src/Umbraco.Web.UI.Client/src/tuning/tuning.global.js
	src/Umbraco.Web.UI/Umbraco/js/tuning.panel.js
	src/Umbraco.Web.UI/Views/Partials/Grid/bootstrap3.cshtml
2014-05-30 19:56:51 +02:00
Shannon df3bc873df Upgrades mini profiler and enables it in the back offfice. 2014-05-30 15:26:22 +10:00
Sebastiaan Janssen d1c5ddc03d Merge branch 'AndrewSwerlick-7.1.1' into 7.1.5 2014-05-29 18:19:52 +02:00
Sebastiaan Janssen f11d209177 Merge branch '7.1.1' of https://github.com/AndrewSwerlick/Umbraco-CMS into AndrewSwerlick-7.1.1 2014-05-29 18:19:22 +02:00
Sebastiaan Janssen ea32776174 Bump version 2014-05-28 17:07:51 +02:00
Sebastiaan Janssen 92ef071883 Don't do a ToString() in a IsNullOrEmpty.. 2014-05-28 16:37:16 +02:00
Sebastiaan Janssen b42d0bc17e Bump version and fix dashboard 2014-05-28 16:04:11 +02:00
antoine 90e5440518 bootstrap3 ; issue + hx style issue 2014-05-28 15:33:36 +02:00
antoine 7cfd2d6593 schema's selector improved 2014-05-28 15:06:16 +02:00
Sebastiaan Janssen 020a416dc5 en_us lang also updated like en 2014-05-28 13:15:20 +02:00
Sebastiaan Janssen d491c133a7 Merge pull request #391 from danlister/patch-1
Updated en.xml to fix some minor spelling mistakes
2014-05-28 13:13:01 +02:00
Sebastiaan Janssen b68dd6b35c U4-5006 Typo: "struture" in the Copy and Move dialogs 2014-05-28 13:12:10 +02:00
Sebastiaan Janssen ba9d023cc0 Additional fix for U4-4950 U7.1.3 multiple media picker 2014-05-28 13:10:17 +02:00
Sebastiaan Janssen eb6fe1e4d3 Fix unit test that was failing after moving from yepnope to LazyLoad.js 2014-05-28 13:06:23 +02:00
Stephan c972ae566e Merge remote-tracking branch 'origin/6.2.1' into 7.1.4
Conflicts:
	src/Umbraco.Core/Dynamics/PropertyResult.cs
	src/Umbraco.Core/Models/IPublishedProperty.cs
	src/Umbraco.Core/Models/PublishedContent/PublishedPropertyBase.cs
	src/Umbraco.Tests/PublishedContent/PublishedContentTestElements.cs
2014-05-28 11:45:45 +02:00
Stephan 320b53ae3c U4-4773 - bring back IPublishedContentProperty Alias and Version (compat) 2014-05-28 11:36:31 +02:00
antoine 6382515258 Device preview always enable 2014-05-28 11:29:08 +02:00
Sebastiaan Janssen 84f94d6471 U4-4752 No "change password" dialog available in 7.x backoffice 2014-05-28 11:17:33 +02:00
Morten Christensen f758eb6a62 Extra open namespace for hackers 2014-05-28 10:54:52 +02:00
Shannon 7ec4d3f26d Fixes: U4-4950 U7.1.3 multiple media picker 2014-05-28 13:33:03 +10:00
Shannon 2a0d2bdb86 Fixes: U4-4945 Slider type stops working on ajax load in 7.1.3 2014-05-28 13:25:47 +10:00
Shannon 24d3e465ea Merge remote-tracking branch 'origin/6.2.1' into 7.1.4 2014-05-28 12:42:43 +10:00
Shannon d987dfb5a2 Fixes: U4-4141 7.0.2 "Save and send for approval" fails for a writer user on a newly created unsaved content page 2014-05-28 12:40:43 +10:00
Shannon 2ede32fe70 minor change, using non obsolete user id 2014-05-28 12:39:12 +10:00
Shannon fce8c9d3ec Fixes: U4-4141 7.0.2 "Save and send for approval" fails for a writer user on a newly created unsaved content page 2014-05-28 12:38:11 +10:00
Shannon f5194efb6e Fixes: U4-4999 Image cropper - Image file duplicated each time the page (content) is saved/published 2014-05-28 12:29:41 +10:00
Dan Lister 1b360226d6 Updated en.xml to fix some minor spelling mistakes 2014-05-27 12:01:41 +01:00
antoine fd2b9ce67d /umbraco/dialogs/tuning.aspx removed 2014-05-27 12:37:43 +02:00
antoine 1284417a58 /umbraco/dialogs/tuning.aspx removed 2014-05-27 12:36:49 +02:00
Sebastiaan Janssen 524d6fb76a U4-4914 Add icon for 'Import Document Type' action menu 2014-05-27 12:12:34 +02:00
Sebastiaan Janssen 7185a6dba5 Merge pull request #383 from imulus/colorpicker-toggle
Allow colors to be toggled on/off in Color Picker - U4-4935
2014-05-27 11:53:55 +02:00
Sebastiaan Janssen 2496a8e77e Merge branch '6.2.1' of https://github.com/umbraco/Umbraco-CMS into 7.1.4
Conflicts:
	src/Umbraco.Web/Models/PublishedContentBase.cs
	src/Umbraco.Web/PublishedCache/XmlPublishedCache/PublishedMediaCache.cs
2014-05-27 11:49:31 +02:00
Sebastiaan Janssen 13e8e972eb U4-4956 UserService.SavePassword method always throws a not supported exception 2014-05-27 11:43:50 +02:00
Stephan d631039c0d U4-4928 - issue with missing media content properties 2014-05-26 18:07:20 +02:00
Stephan b1e879bf68 U4-4928 - issue with missing media content properties 2014-05-26 15:59:28 +02:00
Stephan 95b9a46b88 U4-4928 - issue with missing media content properties 2014-05-26 15:02:05 +02:00
antoine b57642003c Grid row unique id 2014-05-25 20:52:23 +02:00
antoine 9ee59e8e38 Merge branch '7.1.2-Usky' into 7.1.2-Usky-Grid
Conflicts:
	src/Umbraco.Web.UI/Views/Partials/Grid/bootstrap3.cshtml
2014-05-25 18:35:18 +02:00
antoine a5f81ae6c2 Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky
Conflicts:
	src/Umbraco.Web.UI.Client/gruntFile.js
2014-05-23 16:39:39 +02:00
per ploug 08cc608dc8 One last change, enable setting max number of items in a cell 2014-05-23 14:57:16 +02:00
per ploug 71839d53a6 Last round of polish to the grid
adds image captions, textstring markup support in rendering, better
styling and icon previews
2014-05-23 14:37:00 +02:00
Shannon 766ca78725 Merge remote-tracking branch 'origin/6.2.1' into 7.1.4 2014-05-23 10:00:34 +10:00
Shannon 3ca4fb76b2 Merge branch 'darrenferguson-7.1.2' into 7.1.4 2014-05-23 09:52:11 +10:00
Shannon 0a76757cea Merge branch '7.1.2' of https://github.com/darrenferguson/Umbraco-CMS into darrenferguson-7.1.2 2014-05-23 09:51:48 +10:00
antoine 7508613d13 First approach 2014-05-22 22:20:13 +02:00
Sebastiaan Janssen 8fb446960c U4-4927 Image Cropper Crop URL is wrong in 6.2.0
Reverts part of 067268a96e which was refactored wrong
2014-05-22 19:39:25 +02:00
Stephan 1cf40aca07 U4-4922 - add details to error message 2014-05-22 18:32:20 +02:00
Shannon aadcdc9c15 ensures session id is set on user data on login. 2014-05-22 13:17:15 +10:00
Shannon e04eed41e7 Merge remote-tracking branch 'origin/6.2.1' into 7.1.4
Conflicts:
	src/Umbraco.Core/Models/DeepCloneHelper.cs
	src/Umbraco.Core/Models/PreValue.cs
	src/Umbraco.Core/Models/PreValueCollection.cs
	src/Umbraco.Tests/Persistence/Repositories/TemplateRepositoryTest.cs
	src/Umbraco.Web/umbraco.presentation/umbraco/editContent.aspx.cs
2014-05-22 13:01:23 +10:00
Shannon 62887607ff fixes csrf with mediauploader.ashx 2014-05-22 12:44:04 +10:00
Shandem 54a639ffcd Merge pull request #387 from lars-erik/Fix-U4-4264
Fixes U4-4264 (dictionary tree collapses) while we wait for angularification.
2014-05-22 10:47:47 +10:00
antoine 9626e91c83 dependency with bootstrap.3.0.1.min.js 2014-05-21 19:51:13 +02:00
per ploug 83b6375f04 Migrated the Editors out of the grid
Added configuration for individual editors, added allowed editors, new
styling refactored css
2014-05-21 15:40:17 +02:00
antoine 52cd44a700 Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky 2014-05-21 15:37:58 +02:00
antoine 0c8ff187aa grunt update to copy default files 2014-05-21 15:37:20 +02:00
John 3af74bd4fd Load google fonts independently in the content iframe.
Enables live preview on the page's content for google fonts.
2014-05-21 14:57:20 +02:00
John c9e2e1e116 Apply preview of font to page's content. 2014-05-21 14:57:18 +02:00
John c27f73e54a Fix glitch when selecting new font in dropdown.
In the font family picker, selecting a not-yet-loaded font caused the font sample to render as Arial until the font had been downloaded.
2014-05-21 14:57:17 +02:00
John cede13d180 Merge name and description changes from uSky. 2014-05-21 14:57:15 +02:00
antoine 3ffb2772b6 Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky 2014-05-21 13:54:25 +02:00
antoine e6f0d4e056 @Umbraco.EnableTuning() and Recursive less file 2014-05-21 13:53:00 +02:00
Shannon 9f16bee040 Fixes: U4-4952 RTE: macro editing - parameter dialog blank 2014-05-21 15:27:10 +10:00
Stephan 976d1b1ff6 Merge pull request #385 from zpqrtbnk/7.1.4
U4-4618 - public PublishedContentModel & Factory
2014-05-20 15:41:41 +02:00
Lars-Erik Aabech 8a4e39a999 Fixes U4-4264 while we wait for angularification. 2014-05-20 15:05:45 +02:00
per ploug 23c7eafaf5 merge from upstream 7.1.4 2014-05-20 12:32:47 +02:00
per ploug 90892ce818 adds rootscope access to umb.clientmgr 2014-05-20 12:14:10 +02:00
John e62d1559b1 Fix grunt not copying tuning's index.html to Umbraco/preview.
Also fixes same issue when using grunt --dev.
2014-05-20 10:36:48 +02:00
Stephan f325794523 U4-4949 - fix issue with domains 2014-05-20 09:32:26 +02:00
Stephan 0b3733f992 Merge remote-tracking branch 'origin/7.1.4' into 7.1.4 2014-05-20 09:28:03 +02:00
Stephan 2926a79c3f U4-4949 - fix issue with domains 2014-05-20 09:24:40 +02:00
Stephan ef7a6f19ba Fix the build 2014-05-20 08:57:27 +02:00
antoine 81934c47d2 laptop width 2014-05-19 16:06:45 +02:00
antoine 80379e116d umbraco media support 2014-05-19 14:34:09 +02:00
Stephan 95a4bb9ba6 refactor PublishedContentModelFactory 2014-05-19 13:15:47 +02:00
Stephan 32b7871eaf Rename PublishedContentModelFactoryImpl 2014-05-19 13:01:49 +02:00
Sebastiaan Janssen 3ec6d2b82f U4-4861 6.2.0 Nuget package copies wrong files 2014-05-19 10:08:26 +02:00
Stephan cd03e80410 Optimize PublishedContentModelFactoryImpl 2014-05-18 21:57:59 +02:00
Stephan 9ed3561b56 Fix the build 2014-05-18 21:41:34 +02:00
Stephan 28da44f0de Refactor PublishedContentModelFactory 2014-05-18 21:31:53 +02:00
Stephan f8d7aeec80 Merge branch '7.1.4' into HEAD 2014-05-18 21:29:37 +02:00
Stephan dacec47cd9 Fix the build 2014-05-18 21:27:41 +02:00
Stephan 57f06ba447 U4-4618 - public PublishedContentModel & Factory 2014-05-18 19:57:39 +02:00
Stephan 82c1c95e35 Detached PublishedProperty - refactor 2014-05-18 19:06:28 +02:00
Tom Fulton fa6c215849 Merge branch '7.1.4' into colorpicker-toggle 2014-05-17 15:06:15 -06:00
Shannon 420746397d fixes macro property saving issue in editor (to ensure the alias/key can be changed) 2014-05-17 15:35:56 +10:00
Shannon 142a9963af Fixes macro property saving issue in repo 2014-05-17 15:35:30 +10:00
Tom Fulton b656db3af3 Allow colors to be toggled on/off in Color Picker - U4-4935 2014-05-16 21:59:34 -06:00
Sebastiaan Janssen d697c590e7 U4-4930 NuGet update fails to copy new Umbraco binaries 2014-05-16 18:54:49 +02:00
Sebastiaan Janssen 1dd103caa3 U4-4930 NuGet update fails to copy new Umbraco binaries 2014-05-16 18:53:23 +02:00
antoine 89081b86af preview grunt issue 2014-05-16 14:42:47 +02:00
Sebastiaan Janssen a55cd67fd6 U4-4650 Pluralization of document type aliases doesn't always work 2014-05-16 14:33:25 +02:00
Sebastiaan Janssen 43bfd6e472 U4-4650 Pluralization of document type aliases doesn't always work 2014-05-16 14:33:03 +02:00
Sebastiaan Janssen afa81be102 Fixes U4-4650 Pluralization of document type aliases doesn't always work 2014-05-16 14:23:40 +02:00
Sebastiaan Janssen b07665f4d4 Fixes U4-4650 Pluralization of document type aliases doesn't always work 2014-05-16 14:22:13 +02:00
antoine 216e2255f2 Save message more friendly 2014-05-16 13:33:41 +02:00
Sebastiaan Janssen 0ebd66d926 Merge branch 'dampee-oembed_slideshare' into 7.1.3 2014-05-16 12:51:26 +02:00
Sebastiaan Janssen 8d45898274 UmbracoVersion property no longer needed. Added data folder to the targets. 2014-05-16 12:44:02 +02:00
Sebastiaan Janssen a99a33477a Centralized the current Umbraco version number in UmbracoVersion.txt that will be read by
buildbelle.bat, build.bat and the umbraco.web.ui.csproj so it works in VS, command line and
also in TeamCity.
2014-05-16 12:27:54 +02:00
antoine 9db3dbd730 Style improvement
focus schema in front when roll-over in panel
2014-05-16 11:40:39 +02:00
Sebastiaan Janssen b42d3b226d Bump version 2014-05-16 11:29:35 +02:00
Sebastiaan Janssen b6925f9f07 Merge branch 'gambrose-7.1.2' into 7.1.3 2014-05-16 11:28:02 +02:00
Stephan ddd0e8abb5 Bugfix media cache property alias case sensitivity 2014-05-16 10:10:55 +02:00
Stephan e07f573683 Fix the build 2014-05-16 09:57:21 +02:00
Shannon ffbb1a85ab Fixes: U4-4312 Spelling error on "Retreive" should be Retrieve -U7.0.0.4 2014-05-16 12:43:23 +10:00
Shannon ac9c938e92 Fixes: U4-4923 Failed to retrieve data for application tree media after upgrade to 7.1.2 2014-05-16 12:42:21 +10:00
Shannon 1f88960b3f Fixes: U4-4926 Pre-values need to be cloned in/out of the cache
Conflicts:
	src/Umbraco.Core/Models/PreValue.cs
	src/Umbraco.Core/Models/PreValueCollection.cs
2014-05-16 12:09:47 +10:00
Shannon d8edf67b82 Fixes: U4-4842 Unable to edit "name" and "alias" to MediaType property 2014-05-16 12:09:08 +10:00
Shannon 762656e964 Fixes: U4-4926 Pre-values need to be cloned in/out of the cache 2014-05-16 12:08:17 +10:00
Shannon 46a4f9242c fixes test 2014-05-16 11:43:20 +10:00
Shannon 8cae2526d5 Fixes: U4-4842 Unable to edit "name" and "alias" to MediaType property 2014-05-16 11:34:10 +10:00
Graham Ambrose 6b313aba48 CopyUmbracoFilesToWebRoot assumes packages loacation
CopyUmbracoFilesToWebRoot assumes packages folder is always one dir up from
project file which is not always the case.

I have changed to use MSBuildThisFileDirectory which makes the path
relative the the UmbracoCms.targets file.
MSBuildThisFileDirectory is supported from MSBuild 4 but as ToolsVersion is
already set to 4.0 that should not be a problem.

UmbracoVersion property is no longer required but removing it may break
external target files depending on it. Have moved it to props file as this
makes it more reliable for external targets files.
2014-05-15 22:43:24 +01:00
Shannon 365a8e85e9 Fixes: U4-2356 2014-05-15 16:13:54 +10:00
Shannon 7b4c58538d wrote test to confirm: U4-2356 2014-05-15 16:11:59 +10:00
Shannon e41c99d5bc Merge branch 'ma1f-7.1.2' into 7.1.3 2014-05-15 15:44:56 +10:00
Shannon a49dd36461 Merge branch '7.1.2' of https://github.com/ma1f/Umbraco-CMS into ma1f-7.1.2 2014-05-15 15:43:53 +10:00
Mark van Schaik 82a1e85431 solves issue U4-2356 when deleting templates 2014-05-15 16:37:32 +12:00
Shannon 5f9dddafd8 fixed an upgrade script when upgrading from old 4.x versions 2014-05-15 14:11:43 +10:00
Shannon 836297df58 Fixes error message on publishing when it fails due to any of these statuses: FailedHasExpired, FailedAwaitingRelease, FailedIsTrashed 2014-05-15 13:35:52 +10:00
Shannon 1c7d83f589 Undoes the comma encoding for tags and istead adds support to store the tags as json or csv (U4-4741) 2014-05-15 12:49:03 +10:00
antoine 8a1dd96294 some styles fixed 2014-05-14 19:15:43 +02:00
antoine 67bebd0d2d index.html missing 2014-05-14 18:39:25 +02:00
antoine 4f34fbd2c8 devices preview better look
tested in chrome/firefox/IE
2014-05-14 18:37:44 +02:00
antoine 8cda6e4062 Tuning panel include in preview mode 2014-05-14 14:51:58 +02:00
Shannon 157428dbc8 ensures multiple commas in tags still work. 2014-05-14 20:54:01 +10:00
Darren Ferguson a2a81222e6 Adding extension methods to PartialViewMacroModel to allow: Model.GetParameterValue<DateTime>("datey")
Model.GetParameterValue<int>("booly", 8) //optional default value if parsing can't happen
Model.GetParameterValue("booly",8) // can be used like this as type is implied by default value argument
2014-05-14 11:33:40 +01:00
Darren Ferguson 5abbca0f5d Adding extension methods to PartialViewMacroModel to allow: Model.GetParameterValue<DateTime>("datey")
Model.GetParameterValue<int>("booly", 8) //optional default value if parsing can't happen
Model.GetParameterValue("booly",8) // can be used like this as type is implied by default value argument
2014-05-14 11:32:39 +01:00
Shannon 0bcaa0da7f ensures that when querying for a tag with a comma that we encode it so that it finds it. 2014-05-14 20:31:32 +10:00
Shannon 922942197f Fixes: U4-4741 Tags Property Editor Mishandles Tags with Commas 2014-05-14 19:57:40 +10:00
Shannon b8975de04d Fixes: U4-4666 SQL Error when saving content with Tags property with @ value 2014-05-14 18:55:08 +10:00
Shannon f00950bfe4 adds unit test for image helper 2014-05-14 18:38:05 +10:00
Shannon 80d012f3ad Fixes: U4-4771 u7.1.1 Media section can't view images RangeError: Maximum call stack size exceeded 2014-05-14 18:25:50 +10:00
Shannon 654efd1128 Fixes: U4-3492 Recent history list persist between logged in users 2014-05-14 15:26:52 +10:00
Shannon aa2375b8ba Fixes client side mem leak for dialogs and not correctly removing their scopes. 2014-05-14 15:18:28 +10:00
Shannon f6532d2743 un-does the distinct check, in the past it was never like this, duplicate values were always allowed so by doing this it is a breaking change 2014-05-14 13:09:02 +10:00
Shannon 8c334a8c95 Fixes: U4-4880 SEO Checker fails after upgrading from 7.1.1 to 7.1.2 2014-05-14 12:29:38 +10:00
Shannon 42cd71ef6c Fixes: U4-4865 Umbraco 7.1.2 Date Picker not rendering icon or calendar control 2014-05-14 12:01:38 +10:00
Shannon 5956394bf1 Fixes: U4-4877 Editing macro parameters fails because of new item validation 2014-05-14 10:52:08 +10:00
Shannon d1e9fb6d9f re-fixes Core proj since it would not build 2014-05-14 09:42:34 +10:00
Damiaan 48dcc373dc Oembed for slideshare not working anymore 2014-05-13 22:29:59 +02:00
antoine d8209efefa Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky 2014-05-13 16:20:20 +02:00
antoine 00180d2120 Web.config with less mime 2014-05-13 16:19:45 +02:00
Stephan c9961b5192 Fix Umbraco.Core project (missing files, would not build) 2014-05-13 15:24:36 +02:00
per ploug 66e768afee Missing bootstrap3 grid view
Missing as gitignore wont allow it, had to manually add it
2014-05-13 13:31:51 +02:00
antoine bba109cb28 tuning.aspx deleted 2014-05-13 13:10:28 +02:00
antoine 39ede8c47a Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky
Conflicts:
	src/Umbraco.Web/Umbraco.Web.csproj
2014-05-13 13:07:38 +02:00
antoine fec84b8ce3 iframe 100% in firefox 2014-05-13 13:04:39 +02:00
antoine a00e5d54aa rename tuning project without usky 2014-05-13 12:50:48 +02:00
Stephan 03d3503531 Don't throw when validating doctype/property aliases with dangerous chars 2014-05-13 12:39:35 +02:00
per ploug 331813e370 Adds serverside grid api
Replaces the partial view macro, also enables the grid to be rendered
with different frameworks, should be fairly easy to support a couple
2014-05-13 12:36:38 +02:00
per ploug 6c36f43276 Adds support for loading custom RTE settings into the grid 2014-05-13 12:35:08 +02:00
Stephan 9acba1d6d7 U4-4857 - issue with document type new property alias 2014-05-13 09:53:22 +02:00
per ploug e8f4e7663f More visual tweaks to the grid to handle deletes
also rolls back a couple of bower "tweaks" that ended up being horrible
2014-05-13 09:45:09 +02:00
Shannon 659f47c038 Merge remote-tracking branch 'origin/6.2.1' into 7.1.3 2014-05-13 15:47:38 +10:00
Shannon 78613823ae Fixes: U4-4853 Richtext Editor doesn't render macros after upgrade to Umbraco 6.2.0 2014-05-13 15:22:16 +10:00
Shannon cb7f26c998 Fixes: U4-4197 Error 400 on admin area login 2014-05-13 13:39:18 +10:00
Shannon 16b5c86192 Fixes: U4-4869 Cannot save tags - was due to adding the loading... message and the ng-if creating a new scope and not targeting the $parent in the view, also fixes up clearing the value with typeahead is used 2014-05-13 12:55:31 +10:00
Shannon c83ab00827 Merge remote-tracking branch 'origin/6.2.1' into 7.1.3 2014-05-13 10:46:14 +10:00
Shannon 937e840104 Fixes: U4-4873 RuntimeCacheRefresher does not remove items when media or content requires cache refreshing & U4-4871 Synced media indexes between load balanced servers do not sync all properties 2014-05-13 10:40:56 +10:00
Shannon 8d49c730d5 Merge branch 'meixger-hotfix/imagecropper' into 7.1.3 2014-05-13 09:33:34 +10:00
Shannon fadb503b97 Merge branch 'hotfix/imagecropper' of https://github.com/meixger/Umbraco-CMS into meixger-hotfix/imagecropper 2014-05-13 09:33:22 +10:00
antoine 9f116c00d5 Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky 2014-05-12 20:00:57 +02:00
antoine 7e61b25746 uskytuning with style suggest and preview device 2014-05-12 19:57:06 +02:00
Martin Meixger 289bed8fd2 change negative coordinates to zero 2014-05-12 15:34:50 +02:00
per ploug 482750ab6a Missing file 2014-05-12 13:22:58 +02:00
per ploug 40d1099fbd grid modifications 2014-05-12 13:22:57 +02:00
Shannon eec1048631 Merge branch '6.2.1' into 7.1.3 2014-05-12 17:50:33 +10:00
Shannon 313d77eb91 Fixes: U4-4789 PluginCache doesn't update with code defined PropertyEditors in package and publicizes a couple things 2014-05-12 17:19:17 +10:00
Shannon b048341da0 Fixes: U4-4789 PluginCache doesn't update with code defined PropertyEditors in package and publicizes a couple things 2014-05-12 17:07:29 +10:00
Shannon 03cb54e931 fixed merge issue 2014-05-12 14:37:54 +10:00
Shannon 150b67d10f Merge remote-tracking branch 'origin/6.2.1' into 7.1.3
Conflicts:
	src/Umbraco.Tests/Models/ContentTests.cs
	src/Umbraco.Tests/Models/ContentTypeTests.cs
2014-05-12 14:37:19 +10:00
Shannon ac88da4188 Fixes: U4-4856 ApplicationContext.Current.Services.ContentService.Save throw exception 2014-05-12 14:32:34 +10:00
Shannon cca27e064a Fixes: U4-4855 Can't use macro parameters at all 2014-05-12 13:48:56 +10:00
Stephan 4e5019d5af U4-4851 - Umbraco.Field legacy names 2014-05-11 21:33:56 +02:00
Stephan f1a312b14a U4-4851 - Umbraco.Field legacy names 2014-05-11 21:06:33 +02:00
antoine 2d050a0c88 original sln 2014-05-10 15:57:59 +02:00
antoine 103f4f33bd Only one less style file 2014-05-10 15:56:36 +02:00
antoine 727f9355a0 dotless dependency 2014-05-10 14:53:59 +02:00
antoine e269a0b9bb Merge branch '7.1.2-Usky' of https://github.com/umbraco/UmbracoCms-Internal into 7.1.2-Usky 2014-05-09 18:22:37 +02:00
antoine 861b1cefe5 uSkyTuning.loader.js deleted 2014-05-09 18:22:02 +02:00
antoine 23301817bf uSkyTuning into Umbraco core, first approach 2014-05-09 18:18:08 +02:00
antoine f5842c82a6 dotless dependency 2014-05-09 18:15:31 +02:00
per ploug 4baf3ed99a Initial commit of the grid 2014-05-09 12:23:59 +02:00
Shannon da0b935604 Fixes merge 2014-05-09 16:08:05 +10:00
Shannon b91a06ab98 Fixes: U4-4849 Cannot change a users language/sections in the back office 2014-05-09 16:00:30 +10:00
Shannon d61fb5d94d Fixes user cloning issues with allowed sections 2014-05-09 15:59:30 +10:00
Shannon 3b424274ee ensure properties reset on deep clone of ContentType (this is just a fail safe check) 2014-05-09 15:57:17 +10:00
Shannon b763c2ab2f Fixes deep clone of User object 2014-05-09 15:56:45 +10:00
per ploug 3c09cd7674 Initial commit to set upstream
Includes a minor change to force it to commit...
2014-05-07 15:10:14 +02:00
Andrew Swerlick 6fae57c5e9 Fix for U4-4636. Changed to pass in the defined fileAddition names for preset sizes and pass in an empty string for additional file sizes 2014-04-08 01:10:06 -04:00
Shannon beb1979b46 Fixes small bug when distributed cache is called with invalid params. 2014-03-21 17:04:30 +11:00
Shannon 672672d0aa Completes: U4-2633 Bundle all cache refresher transmissions into a single call per request for much better performance 2014-03-21 14:50:24 +11:00
358 changed files with 20115 additions and 2196 deletions
+6
View File
@@ -78,6 +78,12 @@ src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.panel.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.palettes.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.loader.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.front.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/tuning.config.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.css
+11 -2
View File
@@ -1,6 +1,10 @@
@ECHO OFF
SET release=7.1.2
SET comment=
IF NOT EXIST UmbracoVersion.txt (
ECHO UmbracoVersion.txt missing!
GOTO :showerror
)
SET /p release=<UmbracoVersion.txt
SET comment=alpha
SET version=%release%
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
@@ -15,6 +19,11 @@ SET nuGetFolder=%CD%\..\src\packages\
ECHO Removing the belle build folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S
ECHO Removing existing built files to make sure everything is clean as a whistle
DEL /F /Q UmbracoCms.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt
ECHO Performing MSBuild and producing Umbraco binaries zip files
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
+1 -1
View File
@@ -325,7 +325,7 @@
Regex="CurrentComment { get { return &quot;([a-zA-Z]+)?&quot;"
ReplacementText="CurrentComment { get { return &quot;$(BUILD_COMMENT)&quot;"/>
<XmlPoke XmlInputPath=".\NuSpecs\build\UmbracoCms.targets"
<XmlPoke XmlInputPath=".\NuSpecs\build\UmbracoCms.props"
Namespaces="&lt;Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/msbuild/2003' /&gt;"
Query="//x:UmbracoVersion"
Value="$(NewVersion)" />
+2 -1
View File
@@ -1,4 +1,5 @@
@ECHO OFF
SET release=%1
ECHO Installing Npm NuGet Package
SET nuGetFolder=%CD%\..\src\packages\
@@ -26,7 +27,7 @@ ECHO Do npm install and the grunt build of Belle
call npm install
call npm install -g grunt-cli
call npm install -g bower
call grunt build --buildversion=7.1.2
call grunt build --buildversion=%release%
ECHO Reset path to what it was before
path=%oldPath%
+1
View File
@@ -67,5 +67,6 @@
<file src="..\_BuildOutput\WebApp\bin\umbraco.XmlSerializers.dll" target="lib\umbraco.XmlSerializers.dll" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
<file src="..\_BuildOutput\WebApp\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
<file src="tools\install.core.ps1" target="tools\install.ps1" />
</files>
</package>
+2 -3
View File
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
AddUmbracoFilesToOutput;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
+4 -4
View File
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UmbracoVersion>7.1.2</UmbracoVersion>
</PropertyGroup>
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
<PropertyGroup>
<UmbracoFilesFolder>..\packages\UmbracoCms.$(UmbracoVersion)\UmbracoFiles\</UmbracoFilesFolder>
<UmbracoFilesFolder>$(MSBuildThisFileDirectory)..\UmbracoFiles\</UmbracoFilesFolder>
</PropertyGroup>
<ItemGroup>
<UmbracoFiles Include="$(UmbracoFilesFolder)**\*" />
@@ -33,6 +30,9 @@
<CustomFilesToInclude Include=".\Config\Splashes\**\*">
<Dir>Config\Splashes</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\data\**\*">
<Dir>data</Dir>
</CustomFilesToInclude>
<CustomFilesToInclude Include=".\umbraco\**\*">
<Dir>umbraco</Dir>
</CustomFilesToInclude>
+24
View File
@@ -0,0 +1,24 @@
param($rootPath, $toolsPath, $package, $project)
if ($project) {
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
$backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\NuGetBackup\$dateTime"
$copyLogsPath = Join-Path $backupPath "CopyLogs"
$projectDestinationPath = Split-Path $project.FullName -Parent
# Create backup folder and logs folder if it doesn't exist yet
New-Item -ItemType Directory -Force -Path $backupPath
New-Item -ItemType Directory -Force -Path $copyLogsPath
# After backing up, remove all dlls from bin folder in case dll files are included in the VS project
# See: http://issues.umbraco.org/issue/U4-4930
$umbracoBinFolder = Join-Path $projectDestinationPath "bin"
if(Test-Path $umbracoBinFolder) {
$umbracoBinBackupPath = Join-Path $backupPath "bin"
New-Item -ItemType Directory -Force -Path $umbracoBinBackupPath
robocopy $umbracoBinFolder $umbracoBinBackupPath /e /LOG:$copyLogsPath\UmbracoBinBackup.log
Remove-Item $umbracoBinFolder\*.dll -Force -Confirm:$false
}
}
+1
View File
@@ -0,0 +1 @@
7.2.0
+1
View File
@@ -77,6 +77,7 @@
<Compile Include="SqlCEUtility.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.1.2");
private static readonly Version Version = new Version("7.2.0");
/// <summary>
/// Gets the current version of Umbraco.
@@ -23,7 +23,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 "alpha"; } }
// 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
@@ -70,6 +70,11 @@
//TODO: Fill in the rest!
/// <summary>
/// alias for the media tree.
/// </summary>
public const string Templates = "template";
}
}
@@ -130,6 +130,12 @@ namespace Umbraco.Core
/// </summary>
public const string FolderBrowserAlias = "Umbraco.FolderBrowser";
/// <summary>
/// Alias for the grid datatype.
/// </summary>
public const string GridAlias = "Umbraco.Grid";
/// <summary>
/// Guid for the Image Cropper datatype.
/// </summary>
+1 -2
View File
@@ -329,9 +329,8 @@ namespace Umbraco.Core
UrlSegmentProviderResolver.Current = new UrlSegmentProviderResolver(
typeof (DefaultUrlSegmentProvider));
// keep it internal for now
// by default, no factory is activated
PublishedContentModelFactoryResolver.Current = new PublishedContentModelFactoryResolver();
// new PublishedContentModelFactoryImpl());
}
}
}
@@ -117,13 +117,12 @@ namespace Umbraco.Core.Dynamics
}
catch (Exception ex)
{
var sb = new StringBuilder("An error occurred finding an executing an extension method for type ");
sb.Append(typeof (T));
sb.Append("Types searched for extension methods were ");
foreach(var t in findExtensionMethodsOnTypes)
{
sb.Append(t + ",");
}
var sb = new StringBuilder();
sb.AppendFormat("An error occurred finding and executing extension method \"{0}\" ", binder.Name);
sb.AppendFormat("for type \"{0}\". ", typeof (T));
sb.Append("Types searched for extension methods were ");
sb.Append(string.Join(", ", findExtensionMethodsOnTypes));
sb.Append(".");
LogHelper.Error<DynamicInstanceHelper>(sb.ToString(), ex);
var mresult = new TryInvokeMemberResult(null, TryInvokeMemberSuccessReason.FoundExtensionMethod);
return Attempt<TryInvokeMemberResult>.Fail(mresult, ex);
@@ -171,7 +170,7 @@ namespace Umbraco.Core.Dynamics
}
else
{
throw new MissingMethodException();
throw new MissingMethodException(typeof(T).FullName, name);
}
return result;
}
@@ -0,0 +1,49 @@
using System.Collections.Generic;
using System.IO;
using System.Web;
using Umbraco.Core.Logging;
namespace Umbraco.Core.Manifest
{
internal class ManifestWatcher : DisposableObject
{
private readonly List<FileSystemWatcher> _fws = new List<FileSystemWatcher>();
public void Start(params string[] packageFolders)
{
foreach (var packageFolder in packageFolders)
{
if (Directory.Exists(packageFolder) && File.Exists(Path.Combine(packageFolder, "package.manifest")))
{
//NOTE: for some reason *.manifest doesn't work!
var fsw = new FileSystemWatcher(packageFolder, "*package.*")
{
IncludeSubdirectories = false,
NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite
};
_fws.Add(fsw);
fsw.Changed += FswChanged;
fsw.EnableRaisingEvents = true;
}
}
}
void FswChanged(object sender, FileSystemEventArgs e)
{
if (e.Name.InvariantContains("package.manifest"))
{
LogHelper.Info<ManifestWatcher>("manifest has changed, app pool is restarting (" + e.FullPath + ")");
HttpRuntime.UnloadAppDomain();
Dispose();
}
}
protected override void DisposeResources()
{
foreach (var fw in _fws)
{
fw.Dispose();
}
}
}
}
+8 -4
View File
@@ -44,14 +44,18 @@ namespace Umbraco.Core.Media
var result = new List<ResizedImage>();
var allSizes = new List<int> {100, 500};
var allSizesDictionary = new Dictionary<int,string> {{100,"thumb"}, {500,"big-thumb"}};
var allSizes = allSizesDictionary.Select(kv => kv.Key).ToList();
allSizes.AddRange(additionalThumbSizes.Where(x => x > 0).Distinct());
var sizesDictionary = allSizes.ToDictionary(s => s, s => allSizesDictionary.ContainsKey(s) ? allSizesDictionary[s]: "");
foreach (var s in allSizes)
foreach (var s in sizesDictionary)
{
if (originalImage.Width >= s && originalImage.Height >= s)
var size = s.Key;
var name = s.Value;
if (originalImage.Width >= size && originalImage.Height >= size)
{
result.Add(Resize(fs, fileName, extension, s, "thumb", originalImage));
result.Add(Resize(fs, fileName, extension, size, name, originalImage));
}
}
+49 -8
View File
@@ -9,6 +9,8 @@ using System.Linq;
using System.Web;
using System.Xml;
using System.Xml.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
@@ -539,7 +541,7 @@ namespace Umbraco.Core.Models
return ApplicationContext.Current.Services.ContentService.HasPublishedVersion(content.Id);
}
#region Tag methods
///// <summary>
@@ -567,6 +569,21 @@ namespace Umbraco.Core.Models
/// <param name="tagGroup">The group/category to assign the tags, the default value is "default"</param>
/// <returns></returns>
public static void SetTags(this IContentBase content, string propertyTypeAlias, IEnumerable<string> tags, bool replaceTags, string tagGroup = "default")
{
content.SetTags(TagCacheStorageType.Csv, propertyTypeAlias, tags, replaceTags, tagGroup);
}
/// <summary>
/// Sets tags for the property - will add tags to the tags table and set the property value to be the comma delimited value of the tags.
/// </summary>
/// <param name="content">The content item to assign the tags to</param>
/// <param name="storageType">The tag storage type in cache (default is csv)</param>
/// <param name="propertyTypeAlias">The property alias to assign the tags to</param>
/// <param name="tags">The tags to assign</param>
/// <param name="replaceTags">True to replace the tags on the current property with the tags specified or false to merge them with the currently assigned ones</param>
/// <param name="tagGroup">The group/category to assign the tags, the default value is "default"</param>
/// <returns></returns>
public static void SetTags(this IContentBase content, TagCacheStorageType storageType, string propertyTypeAlias, IEnumerable<string> tags, bool replaceTags, string tagGroup = "default")
{
var property = content.Properties[propertyTypeAlias];
if (property == null)
@@ -583,15 +600,39 @@ namespace Umbraco.Core.Models
//ensure the property value is set to the same thing
if (replaceTags)
{
property.Value = string.Join(",", trimmedTags);
switch (storageType)
{
case TagCacheStorageType.Csv:
property.Value = string.Join(",", trimmedTags);
break;
case TagCacheStorageType.Json:
//json array
property.Value = JsonConvert.SerializeObject(trimmedTags);
break;
}
}
else
{
var currTags = property.Value.ToString().Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries)
switch (storageType)
{
case TagCacheStorageType.Csv:
var currTags = property.Value.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Trim());
property.Value = string.Join(",", trimmedTags.Union(currTags));
property.Value = string.Join(",", trimmedTags.Union(currTags));
break;
case TagCacheStorageType.Json:
var currJson = JsonConvert.DeserializeObject<JArray>(property.Value.ToString());
//need to append the new ones
foreach (var tag in trimmedTags)
{
currJson.Add(tag);
}
//json array
property.Value = JsonConvert.SerializeObject(currJson);
break;
}
}
}
/// <summary>
@@ -664,7 +705,7 @@ namespace Umbraco.Core.Models
{
return ApplicationContext.Current.Services.PackagingService.Export(media, true, raiseEvents: false);
}
/// <summary>
/// Creates the xml representation for the <see cref="IContent"/> object
/// </summary>
@@ -687,10 +728,10 @@ namespace Umbraco.Core.Models
{
return ((PackagingService)(ApplicationContext.Current.Services.PackagingService)).Export(member);
}
#endregion
}
}
-23
View File
@@ -133,29 +133,6 @@ namespace Umbraco.Core.Models
Key = Guid.NewGuid();
}
/// <summary>
/// Method to call when Entity is being updated
/// </summary>
/// <remarks>Modified Date is set and a new Version guid is set</remarks>
internal override void UpdatingEntity()
{
base.UpdatingEntity();
}
public override object DeepClone()
{
var clone = (ContentType)base.DeepClone();
var propertyGroups = PropertyGroups.Select(x => (PropertyGroup)x.DeepClone()).ToList();
clone.PropertyGroups = new PropertyGroupCollection(propertyGroups);
//set the property types that are not part of a group
clone.PropertyTypes = PropertyTypeCollection
.Where(x => x.PropertyGroupId == null)
.Select(x => (PropertyType)x.DeepClone()).ToList();
clone.ResetDirtyProperties(false);
return clone;
}
/// <summary>
/// Creates a deep clone of the current entity with its identity/alias and it's property identities reset
+31 -6
View File
@@ -331,11 +331,6 @@ namespace Umbraco.Core.Models
get { return _additionalData; }
}
/// <summary>
/// Some entities may expose additional data that other's might not, this custom data will be available in this collection
/// </summary>
public IDictionary<string, object> AdditionalData { get; private set; }
/// <summary>
/// Gets or sets a list of integer Ids for allowed ContentTypes
/// </summary>
@@ -356,7 +351,9 @@ namespace Umbraco.Core.Models
/// <summary>
/// List of PropertyGroups available on this ContentType
/// </summary>
/// <remarks>A PropertyGroup corresponds to a Tab in the UI</remarks>
/// <remarks>
/// A PropertyGroup corresponds to a Tab in the UI
/// </remarks>
[DataMember]
public virtual PropertyGroupCollection PropertyGroups
{
@@ -372,7 +369,13 @@ namespace Umbraco.Core.Models
/// List of PropertyTypes available on this ContentType.
/// This list aggregates PropertyTypes across the PropertyGroups.
/// </summary>
/// <remarks>
/// Marked as DoNotClone because the result of this property is not the natural result of the data, it is
/// a union of data so when auto-cloning if the setter is used it will be setting the unnatural result of the
/// data. We manually clone this instead.
/// </remarks>
[IgnoreDataMember]
[DoNotClone]
public virtual IEnumerable<PropertyType> PropertyTypes
{
get
@@ -388,6 +391,14 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Returns the property type collection containing types that are non-groups - used for tests
/// </summary>
internal IEnumerable<PropertyType> NonGroupedPropertyTypes
{
get { return _propertyTypes; }
}
/// <summary>
/// A boolean flag indicating if a property type has been removed from this instance.
/// </summary>
/// <remarks>
@@ -584,5 +595,19 @@ namespace Umbraco.Core.Models
propertyType.ResetDirtyProperties();
}
}
public override object DeepClone()
{
var clone = (ContentTypeBase)base.DeepClone();
//need to manually wire up the event handlers for the property type collections - we've ensured
// its ignored from the auto-clone process because its return values are unions, not raw and
// we end up with duplicates, see: http://issues.umbraco.org/issue/U4-4842
clone._propertyTypes = (PropertyTypeCollection)_propertyTypes.DeepClone();
clone._propertyTypes.CollectionChanged += clone.PropertyTypesChanged;
return clone;
}
}
}
@@ -93,8 +93,17 @@ namespace Umbraco.Core.Models
{
if (ContentTypeCompositionExists(alias))
{
var contentTypeComposition = ContentTypeComposition.First(x => x.Alias == alias);
var contentTypeComposition = ContentTypeComposition.FirstOrDefault(x => x.Alias == alias);
if (contentTypeComposition == null)//You can't remove a composition from another composition
return false;
RemovedContentTypeKeyTracker.Add(contentTypeComposition.Id);
//If the ContentType we are removing has Compositions of its own these needs to be removed as well
var compositionIdsToRemove = contentTypeComposition.CompositionIds().ToList();
if(compositionIdsToRemove.Any())
RemovedContentTypeKeyTracker.AddRange(compositionIdsToRemove);
OnPropertyChanged(ContentTypeCompositionSelector);
return _contentTypeComposition.Remove(contentTypeComposition);
}
+23 -1
View File
@@ -2,9 +2,29 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
namespace Umbraco.Core.Models
{
/// <summary>
/// Used to attribute properties that have a setter and are a reference type
/// that should be ignored for cloning when using the DeepCloneHelper
/// </summary>
/// <remarks>
///
/// This attribute must be used:
/// * when the property is backed by a field but the result of the property is the un-natural data stored in the field
///
/// This attribute should not be used:
/// * when the property is virtual
/// * when the setter performs additional required logic other than just setting the underlying field
///
/// </remarks>
internal class DoNotCloneAttribute : Attribute
{
}
public static class DeepCloneHelper
{
/// <summary>
@@ -25,8 +45,10 @@ namespace Umbraco.Core.Models
var refProperties = inputType.GetProperties()
.Where(x =>
//is not attributed with the ignore clone attribute
x.GetCustomAttribute<DoNotCloneAttribute>() == null
//reference type but not string
x.PropertyType.IsValueType == false && x.PropertyType != typeof (string)
&& x.PropertyType.IsValueType == false && x.PropertyType != typeof (string)
//settable
&& x.CanWrite
//non-indexed
@@ -240,52 +240,6 @@ namespace Umbraco.Core.Models.EntityBase
DeepCloneHelper.DeepCloneRefProperties(this, clone);
clone.ResetDirtyProperties(false);
return clone;
//Using data contract serializer - has issues
//var s = Serialize(this);
//var d = Deserialize(s, this.GetType());
//return d;
//Using binary serializer - has issues
//using (var memoryStream = new MemoryStream(10))
//{
//IFormatter formatter = new BinaryFormatter();
//formatter.Serialize(memoryStream, this);
//memoryStream.Seek(0, SeekOrigin.Begin);
//return formatter.Deserialize(memoryStream);
//}
}
// serialize/deserialize with data contracts:
//public static string Serialize(object obj)
//{
// using (var memoryStream = new MemoryStream())
// using (var reader = new StreamReader(memoryStream))
// {
// var serializer = new DataContractSerializer(obj.GetType());
// serializer.WriteObject(memoryStream, obj);
// memoryStream.Position = 0;
// return reader.ReadToEnd();
// }
//}
//public static object Deserialize(string xml, Type toType)
//{
// using (Stream stream = new MemoryStream())
// {
// using (var writer = new StreamWriter(stream, Encoding.UTF8))
// {
// writer.Write(xml);
// //byte[] data = Encoding.UTF8.GetBytes(xml);
// //stream.Write(data, 0, data.Length);
// stream.Position = 0;
// var deserializer = new DataContractSerializer(toType);
// return deserializer.ReadObject(stream);
// }
// }
//}
}
}
+1 -1
View File
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Models
/// <summary>
/// Defines a Property for a Macro
/// </summary>
public interface IMacroProperty : IValueObject
public interface IMacroProperty : IValueObject, IDeepCloneable, IRememberBeingDirty
{
[DataMember]
int Id { get; set; }
+11 -13
View File
@@ -138,12 +138,11 @@ namespace Umbraco.Core.Models
var alias = prop.Alias;
//remove from the removed/added props (since people could add/remove all they want in one request)
_removedProperties.RemoveAll(s => s == alias);
_addedProperties.RemoveAll(s => s == alias);
//add to the added props
_addedProperties.Add(alias);
if (_addedProperties.Contains(alias) == false)
{
//add to the added props
_addedProperties.Add(alias);
}
}
else if (e.Action == NotifyCollectionChangedAction.Remove)
{
@@ -153,12 +152,10 @@ namespace Umbraco.Core.Models
var alias = prop.Alias;
//remove from the removed/added props (since people could add/remove all they want in one request)
_removedProperties.RemoveAll(s => s == alias);
_addedProperties.RemoveAll(s => s == alias);
//add to the added props
_removedProperties.Add(alias);
if (_removedProperties.Contains(alias) == false)
{
_removedProperties.Add(alias);
}
}
}
@@ -404,7 +401,8 @@ namespace Umbraco.Core.Models
clone._addedProperties = new List<string>();
clone._removedProperties = new List<string>();
clone._properties = new MacroPropertyCollection();
clone._properties = (MacroPropertyCollection)Properties.DeepClone();
//re-assign the event handler
clone._properties.CollectionChanged += clone.PropertiesChanged;
clone.ResetDirtyProperties(false);
+33 -1
View File
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Models
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class MacroProperty : TracksChangesEntityBase, IMacroProperty, IRememberBeingDirty
public class MacroProperty : TracksChangesEntityBase, IMacroProperty, IRememberBeingDirty, IDeepCloneable
{
public MacroProperty()
{
@@ -176,5 +176,37 @@ namespace Umbraco.Core.Models
}, _editorAlias, PropertyTypeSelector);
}
}
public object DeepClone()
{
//Memberwise clone on MacroProperty will work since it doesn't have any deep elements
// for any sub class this will work for standard properties as well that aren't complex object's themselves.
var clone = (MacroProperty)MemberwiseClone();
//Automatically deep clone ref properties that are IDeepCloneable
DeepCloneHelper.DeepCloneRefProperties(this, clone);
clone.ResetDirtyProperties(false);
return clone;
}
protected bool Equals(MacroProperty other)
{
return string.Equals(_alias, other._alias) && _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((MacroProperty) obj);
}
public override int GetHashCode()
{
unchecked
{
return ((_alias != null ? _alias.GetHashCode() : 0)*397) ^ _id;
}
}
}
}
@@ -8,13 +8,60 @@ namespace Umbraco.Core.Models
/// <summary>
/// A macro's property collection
/// </summary>
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>, IDeepCloneable
{
public MacroPropertyCollection()
: base(property => property.Alias)
{
}
public object DeepClone()
{
var clone = new MacroPropertyCollection();
foreach (var item in this)
{
clone.Add((IMacroProperty)item.DeepClone());
}
return clone;
}
/// <summary>
/// Used to update an existing macro property
/// </summary>
/// <param name="name"></param>
/// <param name="sortOrder"></param>
/// <param name="editorAlias"></param>
/// <param name="currentAlias">
/// The existing property alias
/// </param>
/// <param name="newAlias"></param>
public void UpdateProperty(string currentAlias, string name = null, int? sortOrder = null, string editorAlias = null, string newAlias = null)
{
var prop = this[currentAlias];
if (prop == null)
{
throw new InvalidOperationException("No property exists with alias " + currentAlias);
}
if (name.IsNullOrWhiteSpace() == false)
{
prop.Name = name;
}
if (sortOrder.HasValue)
{
prop.SortOrder = sortOrder.Value;
}
if (name.IsNullOrWhiteSpace() == false)
{
prop.EditorAlias = editorAlias;
}
if (newAlias.IsNullOrWhiteSpace() == false && currentAlias != newAlias)
{
prop.Alias = newAlias;
ChangeKey(currentAlias, newAlias);
}
}
}
}
+8 -1
View File
@@ -3,7 +3,7 @@
/// <summary>
/// Represents a stored pre-value field value
/// </summary>
public class PreValue
public class PreValue : IDeepCloneable
{
public PreValue(int id, string value, int sortOrder)
{
@@ -37,5 +37,12 @@
/// The sort order stored for the pre-value field value
/// </summary>
public int SortOrder { get; private set; }
public virtual object DeepClone()
{
//Memberwise clone on PreValue will work since it doesn't have any deep elements
var clone = (PreValue)MemberwiseClone();
return clone;
}
}
}
+17 -1
View File
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Models
/// Most legacy property editors won't support the dictionary format but new property editors should always use the dictionary format.
/// In order to get overrideable pre-values working we need a dictionary since we'll have to reference a pre-value by a key.
/// </remarks>
public class PreValueCollection
public class PreValueCollection : IDeepCloneable
{
private IDictionary<string, PreValue> _preValuesAsDictionary;
private IEnumerable<PreValue> _preValuesAsArray;
@@ -82,5 +82,21 @@ namespace Umbraco.Core.Models
}
return result;
}
public object DeepClone()
{
var clone = (PreValueCollection) MemberwiseClone();
if (_preValuesAsArray != null)
{
clone._preValuesAsArray = _preValuesAsArray.Select(x => (PreValue)x.DeepClone()).ToArray();
}
if (_preValuesAsDictionary != null)
{
clone._preValuesAsDictionary = _preValuesAsDictionary.ToDictionary(x => x.Key, x => (PreValue)x.Value.DeepClone());
}
return clone;
}
}
}
@@ -0,0 +1,9 @@
namespace Umbraco.Core.Models
{
internal enum PropertyTagBehavior
{
Replace,
Remove,
Merge
}
}
-7
View File
@@ -33,11 +33,4 @@ namespace Umbraco.Core.Models
public IEnumerable<Tuple<string, string>> Tags { get; set; }
}
internal enum PropertyTagBehavior
{
Replace,
Remove,
Merge
}
}
@@ -83,6 +83,14 @@ namespace Umbraco.Core.Models
return;
}
}
//check if the item's sort order is already in use
if (this.Any(x => x.SortOrder == item.SortOrder))
{
//make it the next iteration
item.SortOrder = this.Max(x => x.SortOrder) + 1;
}
base.Add(item);
OnAdd.IfNotNull(x => x.Invoke());//Could this not be replaced by a Mandate/Contract for ensuring item is not null
@@ -3,7 +3,7 @@
/// <summary>
/// Provides the model creation service.
/// </summary>
internal interface IPublishedContentModelFactory
public interface IPublishedContentModelFactory
{
/// <summary>
/// Creates a strongly-typed model representing a published content.
@@ -51,7 +51,7 @@ namespace Umbraco.Core.Models.PublishedContent
// a model, and then that model has to inherit from PublishedContentExtended,
// => implements the internal IPublishedContentExtended.
var model = PublishedContentModelFactory.CreateModel(content);
var model = content.CreateModel();
var extended = model == content // == means the factory did not create a model
? new PublishedContentExtended(content) // so we have to extend
: model; // else we can use what the factory returned
@@ -0,0 +1,20 @@
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Provides strongly typed published content models services.
/// </summary>
internal static class PublishedContentExtensionsForModels
{
/// <summary>
/// Creates a strongly typed published content model for an internal published content.
/// </summary>
/// <param name="content">The internal published content.</param>
/// <returns>The strongly typed published content model.</returns>
public static IPublishedContent CreateModel(this IPublishedContent content)
{
return PublishedContentModelFactoryResolver.Current.HasValue
? PublishedContentModelFactoryResolver.Current.Factory.CreateModel(content)
: content;
}
}
}
@@ -10,7 +10,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// </summary>
/// <remarks>Every strongly-typed published content class should inherit from <c>PublishedContentModel</c>
/// (or inherit from a class that inherits from... etc.) so they are picked by the factory.</remarks>
internal abstract class PublishedContentModel : PublishedContentExtended
public abstract class PublishedContentModel : PublishedContentExtended
{
/// <summary>
/// Initializes a new instance of the <see cref="PublishedContentModel"/> class with
@@ -8,7 +8,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <remarks>By default, the name of the class is assumed to be the content type alias. The
/// <c>PublishedContentModelAttribute</c> can be used to indicate a different alias.</remarks>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
internal sealed class PublishedContentModelAttribute : Attribute
public sealed class PublishedContentModelAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="PublishedContentModelAttribute"/> class with a content type alias.
@@ -1,20 +1,86 @@
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Provides strongly typed published content models services.
/// </summary>
internal static class PublishedContentModelFactory
{
/// <summary>
/// Creates a strongly typed published content model for an internal published content.
/// </summary>
/// <param name="content">The internal published content.</param>
/// <returns>The strongly typed published content model.</returns>
public static IPublishedContent CreateModel(IPublishedContent content)
{
return PublishedContentModelFactoryResolver.Current.HasValue
? PublishedContentModelFactoryResolver.Current.Factory.CreateModel(content)
: content;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Implements a strongly typed content model factory
/// </summary>
public class PublishedContentModelFactory : IPublishedContentModelFactory
{
//private readonly Dictionary<string, ConstructorInfo> _constructors
// = new Dictionary<string, ConstructorInfo>();
private readonly Dictionary<string, Func<IPublishedContent, IPublishedContent>> _constructors;
/// <summary>
/// Initializes a new instance of the <see cref="PublishedContentModelFactory"/> class with types.
/// </summary>
/// <param name="types">The model types.</param>
/// <remarks>
/// <para>Types must implement <c>IPublishedContent</c> and have a unique constructor that
/// accepts one IPublishedContent as a parameter.</para>
/// <para>To activate,</para>
/// <code>
/// var types = PluginManager.Current.ResolveTypes{PublishedContentModel}();
/// var factory = new PublishedContentModelFactoryImpl(types);
/// PublishedContentModelFactoryResolver.Current.SetFactory(factory);
/// </code>
/// </remarks>
public PublishedContentModelFactory(IEnumerable<Type> types)
{
var ctorArgTypes = new[] { typeof(IPublishedContent) };
var constructors = new Dictionary<string, Func<IPublishedContent, IPublishedContent>>();
foreach (var type in types)
{
var constructor = type.GetConstructor(ctorArgTypes);
if (constructor == null)
throw new InvalidOperationException(string.Format("Type {0} is missing a public constructor with one argument of type IPublishedContent.", type.FullName));
var attribute = type.GetCustomAttribute<PublishedContentModelAttribute>(false);
var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias;
typeName = typeName.ToLowerInvariant();
if (constructors.ContainsKey(typeName))
throw new InvalidOperationException(string.Format("More that one type want to be a model for content type {0}.", typeName));
// should work everywhere, but slow
//_constructors[typeName] = constructor;
// much faster with a dynamic method but potential MediumTrust issues
// here http://stackoverflow.com/questions/16363838/how-do-you-call-a-constructor-via-an-expression-tree-on-an-existing-object
// fast enough and works in MediumTrust
// read http://boxbinary.com/2011/10/how-to-run-a-unit-test-in-medium-trust-with-nunitpart-three-umbraco-framework-testing/
var exprArg = Expression.Parameter(typeof(IPublishedContent), "content");
var exprNew = Expression.New(constructor, exprArg);
var expr = Expression.Lambda<Func<IPublishedContent, IPublishedContent>>(exprNew, exprArg);
var func = expr.Compile();
constructors[typeName] = func;
}
_constructors = constructors.Count > 0 ? constructors : null;
}
public IPublishedContent CreateModel(IPublishedContent content)
{
// fail fast
if (_constructors == null)
return content;
// be case-insensitive
var contentTypeAlias = content.DocumentTypeAlias.ToLowerInvariant();
//ConstructorInfo constructor;
//return _constructors.TryGetValue(contentTypeAlias, out constructor)
// ? (IPublishedContent) constructor.Invoke(new object[] { content })
// : content;
Func<IPublishedContent, IPublishedContent> constructor;
return _constructors.TryGetValue(contentTypeAlias, out constructor)
? constructor(content)
: content;
}
}
}
@@ -1,67 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Umbraco.Core.Models.PublishedContent
{
/// <summary>
/// Implements a strongly typed content model factory
/// </summary>
internal class PublishedContentModelFactoryImpl : IPublishedContentModelFactory
{
//private readonly Dictionary<string, ConstructorInfo> _constructors
// = new Dictionary<string, ConstructorInfo>();
private readonly Dictionary<string, Func<IPublishedContent, IPublishedContent>> _constructors
= new Dictionary<string, Func<IPublishedContent, IPublishedContent>>();
public PublishedContentModelFactoryImpl()
{
var types = PluginManager.Current.ResolveTypes<PublishedContentModel>();
var ctorArgTypes = new[] { typeof(IPublishedContent) };
foreach (var type in types)
{
var constructor = type.GetConstructor(ctorArgTypes);
if (constructor == null)
throw new InvalidOperationException(string.Format("Type {0} is missing a public constructor with one argument of type IPublishedContent.", type.FullName));
var attribute = type.GetCustomAttribute<PublishedContentModelAttribute>(false);
var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias;
typeName = typeName.ToLowerInvariant();
if (_constructors.ContainsKey(typeName))
throw new InvalidOperationException(string.Format("More that one type want to be a model for content type {0}.", typeName));
// should work everywhere, but slow
//_constructors[typeName] = constructor;
// much faster with a dynamic method but potential MediumTrust issues
// here http://stackoverflow.com/questions/16363838/how-do-you-call-a-constructor-via-an-expression-tree-on-an-existing-object
// fast enough and works in MediumTrust
// read http://boxbinary.com/2011/10/how-to-run-a-unit-test-in-medium-trust-with-nunitpart-three-umbraco-framework-testing/
var exprArg = Expression.Parameter(typeof(IPublishedContent), "content");
var exprNew = Expression.New(constructor, exprArg);
var expr = Expression.Lambda<Func<IPublishedContent, IPublishedContent>>(exprNew, exprArg);
var func = expr.Compile();
_constructors[typeName] = func;
}
}
public IPublishedContent CreateModel(IPublishedContent content)
{
// be case-insensitive
var contentTypeAlias = content.DocumentTypeAlias.ToLowerInvariant();
//ConstructorInfo constructor;
//return _constructors.TryGetValue(contentTypeAlias, out constructor)
// ? (IPublishedContent) constructor.Invoke(new object[] { content })
// : content;
Func<IPublishedContent, IPublishedContent> constructor;
return _constructors.TryGetValue(contentTypeAlias, out constructor)
? constructor(content)
: content;
}
}
}
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Models.PublishedContent
/// <summary>
/// Resolves the IPublishedContentModelFactory object.
/// </summary>
internal class PublishedContentModelFactoryResolver : SingleObjectResolverBase<PublishedContentModelFactoryResolver, IPublishedContentModelFactory>
public class PublishedContentModelFactoryResolver : SingleObjectResolverBase<PublishedContentModelFactoryResolver, IPublishedContentModelFactory>
{
/// <summary>
/// Initializes a new instance of the <see cref="PublishedContentModelFactoryResolver"/>.
@@ -44,6 +44,11 @@ namespace Umbraco.Core.Models.PublishedContent
InitializeIndexes();
}
// create detached content type - ie does not match anything in the DB
internal PublishedContentType(string alias, IEnumerable<PublishedPropertyType> propertyTypes)
: this (0, alias, propertyTypes)
{ }
private void InitializeIndexes()
{
for (var i = 0; i < _propertyTypes.Length; i++)
@@ -222,19 +222,38 @@ namespace Umbraco.Core.Models.PublishedContent
}
}
var converterMeta = _converter as IPropertyValueConverterMeta;
// get the cache levels, quietely fixing the inconsistencies (no need to throw, really)
_sourceCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.Source);
_objectCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.Object);
_objectCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.XPath);
if (converterMeta != null)
{
_sourceCacheLevel = converterMeta.GetPropertyCacheLevel(this, PropertyCacheValue.Source);
_objectCacheLevel = converterMeta.GetPropertyCacheLevel(this, PropertyCacheValue.Object);
_objectCacheLevel = converterMeta.GetPropertyCacheLevel(this, PropertyCacheValue.XPath);
}
else
{
_sourceCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.Source);
_objectCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.Object);
_objectCacheLevel = GetCacheLevel(_converter, PropertyCacheValue.XPath);
}
if (_objectCacheLevel < _sourceCacheLevel) _objectCacheLevel = _sourceCacheLevel;
if (_xpathCacheLevel < _sourceCacheLevel) _xpathCacheLevel = _sourceCacheLevel;
// get the CLR type of the converted value
if (_converter != null)
{
var attr = _converter.GetType().GetCustomAttribute<PropertyValueTypeAttribute>(false);
if (attr != null)
_clrType = attr.Type;
if (converterMeta != null)
{
_clrType = converterMeta.GetPropertyValueType(this);
}
else
{
var attr = _converter.GetType().GetCustomAttribute<PropertyValueTypeAttribute>(false);
if (attr != null)
_clrType = attr.Type;
}
}
}
@@ -9,7 +9,7 @@ namespace Umbraco.Core.Models.Rdbms
internal class DataTypePreValueDto
{
[Column("id")]
[PrimaryKeyColumn(IdentitySeed = 5)]
[PrimaryKeyColumn(IdentitySeed = 6)]
public int Id { get; set; }
[Column("datatypeNodeId")]
@@ -0,0 +1,8 @@
namespace Umbraco.Core.Models
{
public enum TagCacheStorageType
{
Csv,
Json
}
}
@@ -49,6 +49,7 @@ namespace Umbraco.Core.ObjectResolution
/// Initializes a new instance of the <see cref="LazyManyObjectsResolverBase{TResolver, TResolved}"/> class with an initial list
/// <remarks>If <paramref name="scope"/> is per HttpRequest then there must be a current HttpContext.</remarks>
/// <exception cref="InvalidOperationException"><paramref name="scope"/> is per HttpRequest but the current HttpContext is null.</exception>
/// </summary>
protected LazyManyObjectsResolverBase(IEnumerable<Lazy<Type>> lazyTypeList, ObjectLifetimeScope scope = ObjectLifetimeScope.Application)
: this(scope)
{
@@ -108,7 +109,7 @@ namespace Umbraco.Core.ObjectResolution
/// Gets a value indicating whether the resolver has resolved types to create instances from.
/// </summary>
/// <remarks>To be used in unit tests.</remarks>
internal bool HasResolvedTypes
public bool HasResolvedTypes
{
get
{
+22
View File
@@ -135,6 +135,28 @@ namespace Umbraco.Core
}
/// <summary>
/// Allows us to change the key of an item
/// </summary>
/// <param name="currentKey"></param>
/// <param name="newKey"></param>
public virtual void ChangeKey(TKey currentKey, TKey newKey)
{
if (!Indecies.ContainsKey(currentKey))
{
throw new InvalidOperationException("No item with the key " + currentKey + "was found in the collection");
}
if (ContainsKey(newKey))
{
throw new DuplicateKeyException(newKey.ToString());
}
var currentIndex = Indecies[currentKey];
Indecies.Remove(currentKey);
Indecies.Add(newKey, currentIndex);
}
internal class DuplicateKeyException : Exception
{
@@ -128,9 +128,9 @@ namespace Umbraco.Core.Persistence.Caching
public void Save(Type type, IEntity entity)
{
//IMPORTANT: we must clone to store, see: http://issues.umbraco.org/issue/U4-4259
entity = (IEntity)entity.DeepClone();
var clone = (IEntity)entity.DeepClone();
var key = GetCompositeId(type, entity.Id);
var key = GetCompositeId(type, clone.Id);
_keyTracker.TryAdd(key);
@@ -139,11 +139,11 @@ namespace Umbraco.Core.Persistence.Caching
if (_memoryCache != null)
{
_memoryCache.Set(key, entity, new CacheItemPolicy { SlidingExpiration = TimeSpan.FromMinutes(5) });
_memoryCache.Set(key, clone, new CacheItemPolicy { SlidingExpiration = TimeSpan.FromMinutes(5) });
}
else
{
HttpRuntime.Cache.Insert(key, entity, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5));
HttpRuntime.Cache.Insert(key, clone, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(5));
}
}
@@ -248,6 +248,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
{
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 3, Alias = "", SortOrder = 0, DataTypeNodeId = -87, Value = ",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|" });
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 4, Alias = "group", SortOrder = 0, DataTypeNodeId = 1041, Value = "default" });
//default's for MultipleMediaPickerAlias picker
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 5, Alias = "multiPicker", SortOrder = 0, DataTypeNodeId = 1045, Value = "1" });
}
private void CreateUmbracoRelationTypeData()
@@ -1,5 +1,7 @@
using System.Data;
using System.Linq;
using Umbraco.Core.Configuration;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourNineZero
{
@@ -18,9 +20,18 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionFourNineZero
}
else
{
//These are the old aliases
Delete.ForeignKey("FK_umbracoUser2app_umbracoApp").OnTable("umbracoUser2app");
Delete.ForeignKey("FK_umbracoUser2app_umbracoUser").OnTable("umbracoUser2app");
//These are the old aliases, before removing them, check they exist
var constraints = SqlSyntaxContext.SqlSyntaxProvider.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
if (constraints.Any(x => x.Item1.InvariantEquals("umbracoUser2app") && x.Item3.InvariantEquals("FK_umbracoUser2app_umbracoApp")))
{
Delete.ForeignKey("FK_umbracoUser2app_umbracoApp").OnTable("umbracoUser2app");
}
if (constraints.Any(x => x.Item1.InvariantEquals("umbracoUser2app") && x.Item3.InvariantEquals("FK_umbracoUser2app_umbracoUser")))
{
Delete.ForeignKey("FK_umbracoUser2app_umbracoUser").OnTable("umbracoUser2app");
}
}
}
@@ -240,7 +240,7 @@ AND umbracoNode.id <> @id",
{
var nodeId = contentDto.NodeId;
var propertyTypeId = propertyType.Id;
var propertySql = new Sql().Select("*")
var propertySql = new Sql().Select("cmsPropertyData.id")
.From<PropertyDataDto>()
.InnerJoin<PropertyTypeDto>()
.On<PropertyDataDto, PropertyTypeDto>(
@@ -249,7 +249,7 @@ AND umbracoNode.id <> @id",
.Where<PropertyTypeDto>(x => x.Id == propertyTypeId);
//Finally delete the properties that match our criteria for removing a ContentType from the composition
Database.Delete<PropertyDataDto>(propertySql);
Database.Delete<PropertyDataDto>(new Sql("WHERE id IN (" + propertySql.SQL + ")", propertySql.Arguments));
}
}
}
@@ -285,7 +285,8 @@ AND umbracoNode.id <> @id",
}
}
if (((ICanBeDirty) entity).IsPropertyDirty("PropertyGroups") || entity.PropertyGroups.Any(x => x.IsDirty()))
if (((ICanBeDirty)entity).IsPropertyDirty("PropertyGroups") ||
entity.PropertyGroups.Any(x => x.IsDirty()))
{
//Delete Tabs/Groups by excepting entries from db with entries from collections
var dbPropertyGroups =
@@ -346,6 +347,25 @@ AND umbracoNode.id <> @id",
if (propertyType.HasIdentity == false)
propertyType.Id = typePrimaryKey; //Set Id on new PropertyType
}
//If a Composition is removed we need to update/reset references to the PropertyGroups on that ContentType
if (((ICanBeDirty)entity).IsPropertyDirty("ContentTypeComposition") &&
compositionBase != null &&
compositionBase.RemovedContentTypeKeyTracker != null &&
compositionBase.RemovedContentTypeKeyTracker.Any())
{
foreach (var compositionId in compositionBase.RemovedContentTypeKeyTracker)
{
var dbPropertyGroups =
Database.Fetch<PropertyTypeGroupDto>("WHERE contenttypeNodeId = @Id", new { Id = compositionId })
.Select(x => x.Id);
foreach (var propertyGroup in dbPropertyGroups)
{
Database.Update<PropertyTypeGroupDto>("SET parentGroupId = NULL WHERE parentGroupId = @TabId AND contenttypeNodeId = @ContentTypeNodeId",
new { TabId = propertyGroup, ContentTypeNodeId = entity.Id });
}
}
}
}
protected IEnumerable<ContentTypeSort> GetAllowedContentTypeIds(int id)
@@ -295,8 +295,8 @@ AND umbracoNode.id <> @id",
var cached = _cacheHelper.RuntimeCache.GetCacheItemsByKeySearch<PreValueCollection>(GetPrefixedCacheKey(dataTypeId));
if (cached != null && cached.Any())
{
//return from the cache
return cached.First();
//return from the cache, ensure it's a cloned result
return (PreValueCollection)cached.First().DeepClone();
}
l.UpgradeToWriteLock();
@@ -493,14 +493,17 @@ namespace Umbraco.Core.Persistence.Repositories
// Is this the same UmbracoEntity as the current one we're processing
if (Current != null && Current.Key == a.uniqueID)
{
// Add this UmbracoProperty to the current additional data
Current.AdditionalData[p.PropertyAlias] = new UmbracoEntity.EntityProperty
if (p != null && p.PropertyAlias.IsNullOrWhiteSpace() == false)
{
PropertyEditorAlias = p.PropertyEditorAlias,
Value = p.NTextValue.IsNullOrWhiteSpace()
? p.NVarcharValue
: p.NTextValue.ConvertToJsonIfPossible()
};
// Add this UmbracoProperty to the current additional data
Current.AdditionalData[p.PropertyAlias] = new UmbracoEntity.EntityProperty
{
PropertyEditorAlias = p.PropertyEditorAlias,
Value = p.NTextValue.IsNullOrWhiteSpace()
? p.NVarcharValue
: p.NTextValue.ConvertToJsonIfPossible()
};
}
// Return null to indicate we're not done with this UmbracoEntity yet
return null;
@@ -516,14 +519,17 @@ namespace Umbraco.Core.Persistence.Repositories
Current = _factory.BuildEntityFromDynamic(a);
//add the property/create the prop list if null
Current.AdditionalData[p.PropertyAlias] = new UmbracoEntity.EntityProperty
if (p != null && p.PropertyAlias.IsNullOrWhiteSpace() == false)
{
PropertyEditorAlias = p.PropertyEditorAlias,
Value = p.NTextValue.IsNullOrWhiteSpace()
? p.NVarcharValue
: p.NTextValue.ConvertToJsonIfPossible()
};
//add the property/create the prop list if null
Current.AdditionalData[p.PropertyAlias] = new UmbracoEntity.EntityProperty
{
PropertyEditorAlias = p.PropertyEditorAlias,
Value = p.NTextValue.IsNullOrWhiteSpace()
? p.NVarcharValue
: p.NTextValue.ConvertToJsonIfPossible()
};
}
// Return the now populated previous UmbracoEntity (or null if first time through)
return prev;
@@ -165,10 +165,18 @@ namespace Umbraco.Core.Persistence.Repositories
Database.Update(dto);
//update the sections if they've changed
//update the properties if they've changed
var macro = (Macro)entity;
if (macro.IsPropertyDirty("Properties"))
if (macro.IsPropertyDirty("Properties") || macro.Properties.Any(x => x.IsDirty()))
{
//now we need to delete any props that have been removed
foreach (var propAlias in macro.RemovedProperties)
{
//delete the property
Database.Delete<MacroPropertyDto>("WHERE macro=@macroId AND macroPropertyAlias=@propAlias",
new { macroId = macro.Id, propAlias = propAlias });
}
//for any that exist on the object, we need to determine if we need to update or insert
foreach (var propDto in dto.MacroPropertyDtos)
{
@@ -180,17 +188,15 @@ namespace Umbraco.Core.Persistence.Repositories
}
else
{
Database.Update(propDto);
//only update if it's dirty
if (macro.Properties[propDto.Alias].IsDirty())
{
Database.Update(propDto);
}
}
}
//now we need to delete any props that have been removed
foreach (var propAlias in macro.RemovedProperties)
{
//delete the property
Database.Delete<MacroPropertyDto>("WHERE macro=@macroId AND macroPropertyAlias=@propAlias",
new { macroId = macro.Id, propAlias = propAlias });
}
}
((ICanBeDirty)entity).ResetDirtyProperties();
@@ -285,7 +285,7 @@ namespace Umbraco.Core.Persistence.Repositories
if (group.IsNullOrWhiteSpace() == false)
{
sql = sql.Where<TagDto>(dto => dto.Group == group);
}
}
var factory = new TagFactory();
@@ -329,7 +329,7 @@ namespace Umbraco.Core.Persistence.Repositories
//NOTE: There's some very clever logic in the umbraco.cms.businesslogic.Tags.Tag to insert tags where they don't exist,
// and assign where they don't exist which we've borrowed here. The queries are pretty zany but work, otherwise we'll end up
// with quite a few additional queries.
//do all this in one transaction
using (var trans = Database.GetTransaction())
{
@@ -397,7 +397,7 @@ namespace Umbraco.Core.Persistence.Repositories
public void RemoveTagsFromProperty(int contentId, int propertyTypeId, IEnumerable<ITag> tags)
{
var tagSetSql = GetTagSet(tags);
var deleteSql = string.Concat("DELETE FROM cmsTagRelationship WHERE nodeId = ",
contentId,
" AND propertyTypeId = ",
@@ -439,7 +439,11 @@ namespace Umbraco.Core.Persistence.Repositories
/// <returns></returns>
private static string GetTagSet(IEnumerable<ITag> tagsToInsert)
{
var array = tagsToInsert.Select(tag => string.Format("select '{0}' as Tag, '{1}' as [Group]", tag.Text.Replace("'", "''"), tag.Group)).ToArray();
var array = tagsToInsert
.Select(tag =>
string.Format("select '{0}' as Tag, '{1}' as [Group]",
PetaPocoExtensions.EscapeAtSymbols(tag.Text.Replace("'", "''")), tag.Group))
.ToArray();
return "(" + string.Join(" union ", array).Replace(" ", " ") + ") as TagSet";
}
@@ -158,7 +158,7 @@ namespace Umbraco.Core.Persistence.Repositories
{
"DELETE FROM umbracoUser2NodeNotify WHERE nodeId = @Id",
"DELETE FROM umbracoUser2NodePermission WHERE nodeId = @Id",
"UPDATE cmsDocument SET templateId = NULL WHERE nodeId = @Id",
"UPDATE cmsDocument SET templateId = NULL WHERE templateId = @Id",
"DELETE FROM cmsDocumentType WHERE templateNodeId = @Id",
"DELETE FROM cmsTemplate WHERE nodeId = @Id",
"DELETE FROM umbracoNode WHERE id = @Id"
@@ -371,7 +371,6 @@ namespace Umbraco.Core.Persistence.Repositories
//template.CreateDate = _viewsFileSystem.GetCreated(path).UtcDateTime;
//template.Key = new FileInfo(path).Name.EncodeAsGuid();
template.Path = path;
template.Content = content;
}
+28 -16
View File
@@ -44,9 +44,9 @@ namespace Umbraco.Core
/// file is cached temporarily until app startup completes.
/// </summary>
/// <param name="appContext"></param>
/// <param name="detectBinChanges"></param>
internal PluginManager(ApplicationContext appContext, bool detectBinChanges = true)
: this(detectBinChanges)
/// <param name="detectChanges"></param>
internal PluginManager(ApplicationContext appContext, bool detectChanges = true)
: this(detectChanges)
{
if (appContext == null) throw new ArgumentNullException("appContext");
_appContext = appContext;
@@ -55,11 +55,11 @@ namespace Umbraco.Core
/// <summary>
/// Creates a new PluginManager
/// </summary>
/// <param name="detectCodeChanges">
/// If true will detect changes in the /bin folder and therefor load plugins from the
/// <param name="detectChanges">
/// If true will detect changes in the /bin folder, app_code, etc... and therefor load plugins from the
/// cached plugins file if one is found. If false will never use the cache file for plugins
/// </param>
internal PluginManager(bool detectCodeChanges = true)
internal PluginManager(bool detectChanges = true)
{
_tempFolder = IOHelper.MapPath("~/App_Data/TEMP/PluginCache");
//create the folder if it doesn't exist
@@ -68,29 +68,41 @@ namespace Umbraco.Core
Directory.CreateDirectory(_tempFolder);
}
var pluginListFile = GetPluginListFilePath();
//this is a check for legacy changes, before we didn't store the TypeResolutionKind in the file which was a mistake,
//so we need to detect if the old file is there without this attribute, if it is then we delete it
if (DetectLegacyPluginListFile())
{
var filePath = GetPluginListFilePath();
File.Delete(filePath);
File.Delete(pluginListFile);
}
if (detectCodeChanges)
if (detectChanges)
{
//first check if the cached hash is 0, if it is then we ne
//do the check if they've changed
HaveAssembliesChanged = (CachedAssembliesHash != CurrentAssembliesHash) || CachedAssembliesHash == 0;
RequiresRescanning = (CachedAssembliesHash != CurrentAssembliesHash) || CachedAssembliesHash == 0;
//if they have changed, we need to write the new file
if (HaveAssembliesChanged)
if (RequiresRescanning)
{
//if the hash has changed, clear out the persisted list no matter what, this will force
// rescanning of all plugin types including lazy ones.
// http://issues.umbraco.org/issue/U4-4789
File.Delete(pluginListFile);
WriteCachePluginsHash();
}
}
else
{
//if the hash has changed, clear out the persisted list no matter what, this will force
// rescanning of all plugin types including lazy ones.
// http://issues.umbraco.org/issue/U4-4789
File.Delete(pluginListFile);
//always set to true if we're not detecting (generally only for testing)
HaveAssembliesChanged = true;
RequiresRescanning = true;
}
}
@@ -130,9 +142,9 @@ namespace Umbraco.Core
/// <summary>
/// Returns a bool if the assemblies in the /bin have changed since they were last hashed.
/// Returns a bool if the assemblies in the /bin, app_code, global.asax, etc... have changed since they were last hashed.
/// </summary>
internal bool HaveAssembliesChanged { get; private set; }
internal bool RequiresRescanning { get; private set; }
/// <summary>
/// Returns the currently cached hash value of the scanned assemblies in the /bin folder. Returns 0
@@ -328,7 +340,7 @@ namespace Umbraco.Core
/// <remarks>
/// Generally only used for resetting cache, for example during the install process
/// </remarks>
internal void ClearPluginCache()
public void ClearPluginCache()
{
var path = GetPluginListFilePath();
if (File.Exists(path))
@@ -670,7 +682,7 @@ namespace Umbraco.Core
//we first need to look into our cache file (this has nothing to do with the 'cacheResult' parameter which caches in memory).
//if assemblies have not changed and the cache file actually exists, then proceed to try to lookup by the cache file.
if (HaveAssembliesChanged == false && File.Exists(GetPluginListFilePath()))
if (RequiresRescanning == false && File.Exists(GetPluginListFilePath()))
{
var fileCacheResult = TryGetCachedPluginsFromFile<T>(resolutionType);
+10 -3
View File
@@ -82,9 +82,16 @@ namespace Umbraco.Core.Profiling
return false;
var request = TryGetRequest(sender);
if (request.Success == false || request.Result.Url.IsClientSideRequest() || string.IsNullOrEmpty(request.Result["umbDebug"]))
if (request.Success == false || request.Result.Url.IsClientSideRequest())
return false;
if (string.IsNullOrEmpty(request.Result["umbDebug"]))
return true;
if (request.Result.Url.IsBackOfficeRequest(HttpRuntime.AppDomainAppVirtualPath))
return true;
return true;
}
@@ -97,7 +104,7 @@ namespace Umbraco.Core.Profiling
/// </remarks>
public string Render()
{
return MiniProfiler.RenderIncludes().ToString();
return MiniProfiler.RenderIncludes(RenderPosition.Right).ToString();
}
/// <summary>
@@ -22,6 +22,7 @@ using System.Security.Permissions;
[assembly: InternalsVisibleTo("umbraco")]
[assembly: InternalsVisibleTo("Umbraco.Tests")]
[assembly: InternalsVisibleTo("Umbraco.Extensions")]
[assembly: InternalsVisibleTo("businesslogic")]
[assembly: InternalsVisibleTo("cms")]
[assembly: InternalsVisibleTo("umbraco.editorControls")]
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Core.PropertyEditors
{
/// <summary>
/// Provides published content properties converter meta data.
/// </summary>
public interface IPropertyValueConverterMeta : IPropertyValueConverter
{
/// <summary>
/// Gets the type of values returned by the converter.
/// </summary>
/// <param name="propertyType">The property type.</param>
/// <returns>The CLR type of values returned by the converter.</returns>
Type GetPropertyValueType(PublishedPropertyType propertyType);
/// <summary>
/// Gets the property cache level of a specified value.
/// </summary>
/// <param name="propertyType">The property type.</param>
/// <param name="cacheValue">The property value.</param>
/// <returns>The property cache level of the specified value.</returns>
PropertyCacheLevel GetPropertyCacheLevel(PublishedPropertyType propertyType, PropertyCacheValue cacheValue);
}
}
@@ -1,4 +1,5 @@
using System;
using Umbraco.Core.Models;
namespace Umbraco.Core.PropertyEditors
{
@@ -30,6 +31,7 @@ namespace Umbraco.Core.PropertyEditors
Delimiter = ",";
ReplaceTags = true;
TagGroup = "default";
StorageType = TagCacheStorageType.Csv;
}
/// <summary>
@@ -37,6 +39,11 @@ namespace Umbraco.Core.PropertyEditors
/// </summary>
public TagValueType ValueType { get; set; }
/// <summary>
/// Defines how to store the tags in cache (CSV or Json)
/// </summary>
public TagCacheStorageType StorageType { get; set; }
/// <summary>
/// Defines a custom delimiter, the default is a comma
/// </summary>
@@ -1,4 +1,5 @@
using Umbraco.Core.Models.Editors;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
namespace Umbraco.Core.PropertyEditors
{
@@ -30,8 +31,14 @@ namespace Umbraco.Core.PropertyEditors
Delimiter = tagsAttribute.Delimiter;
ReplaceTags = tagsAttribute.ReplaceTags;
TagGroup = tagsAttribute.TagGroup;
StorageType = TagCacheStorageType.Csv;
}
/// <summary>
/// Defines how to store the tags in cache (CSV or Json)
/// </summary>
public virtual TagCacheStorageType StorageType { get; private set; }
/// <summary>
/// Defines a custom delimiter, the default is a comma
/// </summary>
@@ -86,6 +86,7 @@ namespace Umbraco.Core.Security
public static UmbracoBackOfficeIdentity GetCurrentIdentity(this HttpContextBase http, bool authenticateRequestIfNotFound)
{
if (http == null) throw new ArgumentNullException("http");
if (http.User == null) return null; //there's no user at all so no identity
var identity = http.User.Identity as UmbracoBackOfficeIdentity;
if (identity != null) return identity;
if (authenticateRequestIfNotFound == false) return null;
+2 -2
View File
@@ -1224,8 +1224,8 @@ namespace Umbraco.Core.Services
if (SendingToPublish.IsRaisedEventCancelled(new SendToPublishEventArgs<IContent>(content), this))
return false;
//TODO: Do some stuff here.. ... what is it supposed to do ?
// pretty sure all that legacy stuff did was raise an event? and we no longer have IActionHandlers so no worries there.
//Save before raising event
Save(content, userId);
SentToPublish.RaiseEvent(new SendToPublishEventArgs<IContent>(content, false), this);
+3 -1
View File
@@ -124,7 +124,9 @@ namespace Umbraco.Core.Services
{
var collection = repository.GetPreValuesCollectionByDataTypeId(id);
//now convert the collection to a string list
var list = collection.FormatAsDictionary().Select(x => x.Value.Value).ToList();
var list = collection.FormatAsDictionary()
.Select(x => x.Value.Value)
.ToList();
return list;
}
}
+4 -4
View File
@@ -367,8 +367,8 @@ namespace Umbraco.Core.Services
using (var uow = _uowProvider.GetUnitOfWork())
{
var sql = new Sql().Select("nodeObjectType").From<NodeDto>().Where<NodeDto>(x => x.NodeId == id);
var nodeObjectTypeId = uow.Database.ExecuteScalar<string>(sql);
var objectTypeId = new Guid(nodeObjectTypeId);
var nodeObjectTypeId = uow.Database.ExecuteScalar<Guid>(sql);
var objectTypeId = nodeObjectTypeId;
return UmbracoObjectTypesExtensions.GetUmbracoObjectType(objectTypeId);
}
}
@@ -383,8 +383,8 @@ namespace Umbraco.Core.Services
using (var uow = _uowProvider.GetUnitOfWork())
{
var sql = new Sql().Select("nodeObjectType").From<NodeDto>().Where<NodeDto>(x => x.UniqueId == key);
var nodeObjectTypeId = uow.Database.ExecuteScalar<string>(sql);
var objectTypeId = new Guid(nodeObjectTypeId);
var nodeObjectTypeId = uow.Database.ExecuteScalar<Guid>(sql);
var objectTypeId = nodeObjectTypeId;
return UmbracoObjectTypesExtensions.GetUmbracoObjectType(objectTypeId);
}
}
+5 -6
View File
@@ -207,10 +207,11 @@ namespace Umbraco.Core.Services
if (user == null) throw new ArgumentNullException("user");
var provider = MembershipProviderExtensions.GetUsersMembershipProvider();
if (provider.IsUmbracoMembershipProvider())
{
provider.ChangePassword(user.Username, "", password);
}
if (provider.IsUmbracoMembershipProvider() == false)
throw new NotSupportedException("When using a non-Umbraco membership provider you must change the user password by using the MembershipProvider.ChangePassword method");
provider.ChangePassword(user.Username, "", password);
//go re-fetch the member and update the properties that may have changed
var result = GetByUsername(user.Username);
@@ -221,8 +222,6 @@ namespace Umbraco.Core.Services
user.LastPasswordChangeDate = result.LastPasswordChangeDate;
user.UpdateDate = user.UpdateDate;
}
throw new NotSupportedException("When using a non-Umbraco membership provider you must change the user password by using the MembershipProvider.ChangePassword method");
}
/// <summary>
+1 -1
View File
@@ -213,7 +213,7 @@ namespace Umbraco.Core
//this is from SqlMetal and just makes it a bit of fun to allow pluralisation
public static string MakePluralName(this string name)
{
if ((name.EndsWith("x", StringComparison.OrdinalIgnoreCase) || name.EndsWith("ch", StringComparison.OrdinalIgnoreCase)) || (name.EndsWith("ss", StringComparison.OrdinalIgnoreCase) || name.EndsWith("sh", StringComparison.OrdinalIgnoreCase)))
if ((name.EndsWith("x", StringComparison.OrdinalIgnoreCase) || name.EndsWith("ch", StringComparison.OrdinalIgnoreCase)) || (name.EndsWith("s", StringComparison.OrdinalIgnoreCase) || name.EndsWith("sh", StringComparison.OrdinalIgnoreCase)))
{
name = name + "es";
return name;
@@ -4,6 +4,7 @@ using System.Globalization;
using System.Linq;
using System.Net;
using System.Threading;
using System.Web;
using System.Web.Script.Serialization;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
@@ -520,7 +521,7 @@ namespace Umbraco.Core.Sync
}
}
private IEnumerable<IAsyncResult> GetAsyncResults(List<IAsyncResult> asyncResultsList, out List<WaitHandle> waitHandlesList)
internal IEnumerable<IAsyncResult> GetAsyncResults(List<IAsyncResult> asyncResultsList, out List<WaitHandle> waitHandlesList)
{
var asyncResults = asyncResultsList.ToArray();
waitHandlesList = new List<WaitHandle>();
@@ -0,0 +1,63 @@
using System;
namespace Umbraco.Core.Sync
{
[Serializable]
public class RefreshInstruction
{
public RefreshMethodType RefreshType { get; set; }
public Guid RefresherId { get; set; }
public Guid GuidId { get; set; }
public int IntId { get; set; }
public string JsonIds { get; set; }
public string JsonPayload { get; set; }
[Serializable]
public enum RefreshMethodType
{
RefreshAll,
RefreshByGuid,
RefreshById,
RefreshByIds,
RefreshByJson,
RemoveById
}
protected bool Equals(RefreshInstruction other)
{
return RefreshType == other.RefreshType && RefresherId.Equals(other.RefresherId) && GuidId.Equals(other.GuidId) && IntId == other.IntId && string.Equals(JsonIds, other.JsonIds) && string.Equals(JsonPayload, other.JsonPayload);
}
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((RefreshInstruction) obj);
}
public override int GetHashCode()
{
unchecked
{
int hashCode = (int) RefreshType;
hashCode = (hashCode*397) ^ RefresherId.GetHashCode();
hashCode = (hashCode*397) ^ GuidId.GetHashCode();
hashCode = (hashCode*397) ^ IntId;
hashCode = (hashCode*397) ^ (JsonIds != null ? JsonIds.GetHashCode() : 0);
hashCode = (hashCode*397) ^ (JsonPayload != null ? JsonPayload.GetHashCode() : 0);
return hashCode;
}
}
public static bool operator ==(RefreshInstruction left, RefreshInstruction right)
{
return Equals(left, right);
}
public static bool operator !=(RefreshInstruction left, RefreshInstruction right)
{
return !Equals(left, right);
}
}
}
@@ -4,7 +4,6 @@ using Umbraco.Core.IO;
namespace Umbraco.Core.Sync
{
/// <summary>
/// The client Soap service for making distrubuted cache calls between servers
/// </summary>
@@ -21,6 +20,31 @@ namespace Umbraco.Core.Sync
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/BulkRefresh", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void BulkRefresh(RefreshInstruction[] instructions, string login, string password)
{
this.Invoke("BulkRefresh", new object[] {
instructions,
login,
password});
}
/// <remarks/>
public System.IAsyncResult BeginBulkRefresh(RefreshInstruction[] instructions, string login, string password, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("BulkRefresh", new object[] {
instructions,
login,
password}, callback, asyncState);
}
/// <remarks/>
public void EndBulkRefresh(System.IAsyncResult asyncResult)
{
this.EndInvoke(asyncResult);
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://umbraco.org/webservices/RefreshAll", RequestNamespace = "http://umbraco.org/webservices/", ResponseNamespace = "http://umbraco.org/webservices/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void RefreshAll(System.Guid uniqueIdentifier, string Login, string Password)
+10 -3
View File
@@ -55,7 +55,8 @@
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="MiniProfiler">
<Reference Include="MiniProfiler, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b44f9351044011a3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MiniProfiler.2.1.0\lib\net40\MiniProfiler.dll</HintPath>
</Reference>
<Reference Include="MySql.Data">
@@ -315,6 +316,7 @@
<Compile Include="Manifest\ManifestBuilder.cs" />
<Compile Include="Manifest\ManifestParser.cs" />
<Compile Include="Manifest\ManifestValidatorConverter.cs" />
<Compile Include="Manifest\ManifestWatcher.cs" />
<Compile Include="Manifest\PackageManifest.cs" />
<Compile Include="Manifest\ParameterEditorConverter.cs" />
<Compile Include="Manifest\PreValueFieldConverter.cs" />
@@ -349,12 +351,14 @@
<Compile Include="Models\MemberGroup.cs" />
<Compile Include="Models\MemberTypePropertyProfileAccess.cs" />
<Compile Include="Models\Notification.cs" />
<Compile Include="Models\PropertyTagBehavior.cs" />
<Compile Include="Models\PublishedContent\IPublishedContentExtended.cs" />
<Compile Include="Models\PublishedContent\PublishedPropertyBase.cs" />
<Compile Include="Models\PublishedContent\PublishedContentModelFactoryImpl.cs" />
<Compile Include="Models\PublishedContent\PublishedContentModelFactory.cs" />
<Compile Include="Models\PublishedContent\IPublishedContentModelFactory.cs" />
<Compile Include="Models\PublishedContent\PublishedContentModel.cs" />
<Compile Include="Models\PublishedContent\PublishedContentModelFactoryResolver.cs" />
<Compile Include="Models\TagCacheStorageType.cs" />
<Compile Include="Models\TaggableObjectTypes.cs" />
<Compile Include="Models\TemplateNode.cs" />
<Compile Include="Models\UmbracoEntityExtensions.cs" />
@@ -403,6 +407,7 @@
<Compile Include="PropertyEditors\TagPropertyDefinition.cs" />
<Compile Include="PropertyEditors\TagValueType.cs" />
<Compile Include="PropertyEditors\ValueConverters\IntegerValueConverter.cs" />
<Compile Include="PropertyEditors\IPropertyValueConverterMeta.cs" />
<Compile Include="PropertyEditors\ValueConverters\JsonValueConverter.cs" />
<Compile Include="PropertyEditors\ValueConverters\MultipleTextStringValueConverter.cs" />
<Compile Include="PropertyEditors\ValueConverters\MarkdownEditorValueConverter.cs" />
@@ -439,7 +444,7 @@
<Compile Include="Models\Macro.cs" />
<Compile Include="Models\PublishedContent\PublishedContentExtended.cs" />
<Compile Include="Models\PublishedContent\PublishedContentModelAttribute.cs" />
<Compile Include="Models\PublishedContent\PublishedContentModelFactory.cs" />
<Compile Include="Models\PublishedContent\PublishedContentExtensionsForModels.cs" />
<Compile Include="Models\MacroProperty.cs" />
<Compile Include="Models\MacroPropertyCollection.cs" />
<Compile Include="Models\MacroPropertyTypeBaseTypes.cs" />
@@ -1061,6 +1066,7 @@
<Compile Include="Standalone\StandaloneCoreBootManager.cs" />
<Compile Include="Strings\ContentBaseExtensions.cs" />
<Compile Include="Strings\Diff.cs" />
<Compile Include="Sync\RefreshInstruction.cs" />
<Compile Include="TopologicalSorter.cs" />
<Compile Include="Strings\DefaultUrlSegmentProvider.cs" />
<Compile Include="Strings\IUrlSegmentProvider.cs" />
@@ -1157,6 +1163,7 @@
<Compile Include="Xml\XPathVariable.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<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" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+2 -2
View File
@@ -9,8 +9,8 @@
<package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net40" />
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
<package id="MySql.Data" version="6.6.5" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
</packages>
@@ -26,27 +26,13 @@ namespace Umbraco.Tests.AngularIntegration
{
var result = JsInitialization.ParseMain(new[] {"[World]", "Hello" });
Assert.AreEqual(@"
yepnope({
load: [
'lib/jquery/jquery-2.0.3.min.js',
'lib/angular/1.1.5/angular.min.js',
'lib/underscore/underscore.js',
],
complete: function () {
yepnope({
load: [World],
complete: function () {
Assert.AreEqual(@"LazyLoad.js([World], function () {
//we need to set the legacy UmbClientMgr path
UmbClientMgr.setUmbracoPath('Hello');
//we need to set the legacy UmbClientMgr path
UmbClientMgr.setUmbracoPath('Hello');
jQuery(document).ready(function () {
angular.bootstrap(document, ['umbraco']);
});
}
});
}
jQuery(document).ready(function () {
angular.bootstrap(document, ['umbraco']);
});
});", result);
}
}
+37 -29
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="umbracoConfiguration">
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false"/>
<section name="FileSystemProviders" type="Umbraco.Core.Configuration.FileSystemProvidersSection, Umbraco.Core" requirePermission="false" />
</sectionGroup>
</configSections>
@@ -12,69 +12,69 @@
<FileSystemProviders>
<Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="\Media\"/>
<add key="rootUrl" value="/Media/"/>
<add key="rootPath" value="\Media\" />
<add key="rootUrl" value="/Media/" />
</Parameters>
</Provider>
<!-- Macros -->
<Provider alias="macros" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="\App_Data\Macros"/>
<add key="rootUrl" value="/Macros/"/>
<add key="rootPath" value="\App_Data\Macros" />
<add key="rootUrl" value="/Macros/" />
</Parameters>
</Provider>
<!-- Scripts -->
<Provider alias="scripts" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="\scripts\"/>
<add key="rootUrl" value="/scripts/"/>
<add key="rootPath" value="\scripts\" />
<add key="rootUrl" value="/scripts/" />
</Parameters>
</Provider>
<!-- Stylesheets -->
<Provider alias="stylesheets" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="\css\"/>
<add key="rootUrl" value="/css/"/>
<add key="rootPath" value="\css\" />
<add key="rootUrl" value="/css/" />
</Parameters>
</Provider>
<!-- Templates -->
<Provider alias="masterpages" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="\masterpages\"/>
<add key="rootUrl" value="/masterpages/"/>
<add key="rootPath" value="\masterpages\" />
<add key="rootUrl" value="/masterpages/" />
</Parameters>
</Provider>
<Provider alias="views" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="rootPath" value="\views\"/>
<add key="rootUrl" value="/views/"/>
<add key="rootPath" value="\views\" />
<add key="rootUrl" value="/views/" />
</Parameters>
</Provider>
</FileSystemProviders>
</umbracoConfiguration>
<appSettings>
<add key="umbracoConfigurationStatus" value="6.0.0"/>
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd"/>
<add key="umbracoReservedPaths" value="~/umbraco,~/install/"/>
<add key="umbracoPath" value="~/umbraco"/>
<add key="umbracoHideTopLevelNodeFromPath" value="true"/>
<add key="umbracoUseDirectoryUrls" value="false"/>
<add key="umbracoTimeOutInMinutes" value="20"/>
<add key="umbracoDefaultUILanguage" value="en"/>
<add key="umbracoUseSSL" value="false"/>
<add key="umbracoConfigurationStatus" value="6.0.0" />
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
<add key="umbracoPath" value="~/umbraco" />
<add key="umbracoHideTopLevelNodeFromPath" value="true" />
<add key="umbracoUseDirectoryUrls" value="false" />
<add key="umbracoTimeOutInMinutes" value="20" />
<add key="umbracoDefaultUILanguage" value="en" />
<add key="umbracoUseSSL" value="false" />
</appSettings>
<connectionStrings>
<add name="umbracoDbDSN" connectionString="Datasource=|DataDirectory|UmbracoPetaPocoTests.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0"/>
<add name="umbracoDbDSN" connectionString="Datasource=|DataDirectory|UmbracoPetaPocoTests.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
@@ -85,13 +85,13 @@
<!-- Sitemap provider-->
<siteMap defaultProvider="UmbracoSiteMapProvider" enabled="true">
<providers>
<clear/>
<add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true"/>
<clear />
<add name="UmbracoSiteMapProvider" type="umbraco.presentation.nodeFactory.UmbracoSiteMapProvider" defaultDescriptionAlias="description" securityTrimmingEnabled="true" />
</providers>
</siteMap>
</system.web>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
@@ -128,6 +128,14 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MiniProfiler" publicKeyToken="b44f9351044011a3" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
@@ -12,6 +12,8 @@ namespace Umbraco.Tests.Models
[TestFixture]
public class ContentTypeTests : BaseUmbracoConfigurationTest
{
[Test]
public void Can_Deep_Clone_Content_Type_Sort()
{
@@ -150,6 +152,7 @@ namespace Umbraco.Tests.Models
}
Assert.AreNotSame(clone.PropertyTypes, contentType.PropertyTypes);
Assert.AreEqual(clone.PropertyTypes.Count(), contentType.PropertyTypes.Count());
Assert.AreEqual(0, ((ContentTypeBase)clone).NonGroupedPropertyTypes.Count());
for (var index = 0; index < contentType.PropertyTypes.Count(); index++)
{
Assert.AreNotSame(clone.PropertyTypes.ElementAt(index), contentType.PropertyTypes.ElementAt(index));
+13
View File
@@ -1,3 +1,4 @@
using System.Linq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Models.EntityBase;
@@ -19,6 +20,7 @@ namespace Umbraco.Tests.Models
public void Can_Deep_Clone()
{
var macro = new Macro(1, true, 3, "test", "Test", "blah", "blah", "xslt", false, true, true, "script");
macro.Properties.Add(new MacroProperty(6, "rewq", "REWQ", 1, "asdfasdf"));
var clone = (Macro)macro.DeepClone();
@@ -26,6 +28,14 @@ namespace Umbraco.Tests.Models
Assert.AreEqual(clone, macro);
Assert.AreEqual(clone.Id, macro.Id);
Assert.AreEqual(clone.Properties.Count, macro.Properties.Count);
for (int i = 0; i < clone.Properties.Count; i++)
{
Assert.AreEqual(clone.Properties[i], macro.Properties[i]);
Assert.AreNotSame(clone.Properties[i], macro.Properties[i]);
}
Assert.AreNotSame(clone.Properties, macro.Properties);
Assert.AreNotSame(clone.AddedProperties, macro.AddedProperties);
Assert.AreNotSame(clone.RemovedProperties, macro.RemovedProperties);
@@ -44,6 +54,9 @@ namespace Umbraco.Tests.Models
Assert.IsFalse(asDirty.IsPropertyDirty("Properties"));
clone.Properties.Add(new MacroProperty(3, "asdf", "SDF", 3, "asdfasdf"));
Assert.IsTrue(asDirty.IsPropertyDirty("Properties"));
Assert.AreEqual(1, clone.AddedProperties.Count());
clone.Properties.Remove("rewq");
Assert.AreEqual(1, clone.RemovedProperties.Count());
}
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core.Models;
namespace Umbraco.Tests.Models
{
[TestFixture]
public class PreValueCollectionTests
{
[Test]
public void Can_Deep_Clone()
{
var d = new PreValueCollection(new Dictionary<string, PreValue>
{
{"blah1", new PreValue(1, "test1", 1)},
{"blah2", new PreValue(2, "test1", 3)},
{"blah3", new PreValue(3, "test1", 2)}
});
var a = new PreValueCollection(new[]
{
new PreValue(1, "test1", 1),
new PreValue(2, "test1", 3),
new PreValue(3, "test1", 2)
});
var clone1 = (PreValueCollection)d.DeepClone();
var clone2 = (PreValueCollection)a.DeepClone();
Action<PreValueCollection, PreValueCollection> assert = (orig, clone) =>
{
Assert.AreNotSame(orig, clone);
var oDic = orig.FormatAsDictionary();
var cDic = clone.FormatAsDictionary();
Assert.AreEqual(oDic.Keys.Count(), cDic.Keys.Count());
foreach (var k in oDic.Keys)
{
Assert.AreNotSame(oDic[k], cDic[k]);
Assert.AreEqual(oDic[k].Id, cDic[k].Id);
Assert.AreEqual(oDic[k].SortOrder, cDic[k].SortOrder);
Assert.AreEqual(oDic[k].Value, cDic[k].Value);
}
};
assert(d, clone1);
assert(a, clone2);
}
}
}
@@ -2,11 +2,12 @@ using System;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Serialization;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Models
{
[TestFixture]
public class PropertyGroupTests
public class PropertyGroupTests : BaseUmbracoConfigurationTest
{
[Test]
public void Can_Deep_Clone()
@@ -37,7 +38,7 @@ namespace Umbraco.Tests.Models
Alias = "test2",
CreateDate = DateTime.Now,
DataTypeDefinitionId = 6,
DataTypeId = Guid.NewGuid(),
PropertyEditorAlias = "propTest",
Description = "testing2",
Key = Guid.NewGuid(),
Mandatory = true,
@@ -118,7 +119,7 @@ namespace Umbraco.Tests.Models
Alias = "test2",
CreateDate = DateTime.Now,
DataTypeDefinitionId = 6,
DataTypeId = Guid.NewGuid(),
PropertyEditorAlias = "propTest",
Description = "testing2",
Key = Guid.NewGuid(),
Mandatory = true,
@@ -364,7 +364,58 @@ namespace Umbraco.Tests.Persistence.Repositories
}
}
[Test]
public void Can_Update_Property_For_Macro()
{
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
using (var repository = new MacroRepository(unitOfWork, NullCacheProvider.Current))
{
var macro = repository.Get(1);
macro.Properties.Add(new MacroProperty("new1", "New1", 3, "test"));
repository.AddOrUpdate(macro);
unitOfWork.Commit();
//Act
macro = repository.Get(1);
macro.Properties["new1"].Name = "this is a new name";
repository.AddOrUpdate(macro);
unitOfWork.Commit();
// Assert
var result = repository.Get(1);
Assert.AreEqual("new1", result.Properties.First().Alias);
Assert.AreEqual("this is a new name", result.Properties.First().Name);
}
}
[Test]
public void Can_Update_Macro_Property_Alias()
{
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
using (var repository = new MacroRepository(unitOfWork, NullCacheProvider.Current))
{
var macro = repository.Get(1);
macro.Properties.Add(new MacroProperty("new1", "New1", 3, "test"));
repository.AddOrUpdate(macro);
unitOfWork.Commit();
//Act
macro = repository.Get(1);
macro.Properties.UpdateProperty("new1", newAlias: "newAlias");
repository.AddOrUpdate(macro);
unitOfWork.Commit();
// Assert
var result = repository.Get(1);
Assert.AreEqual("newAlias", result.Properties.First().Alias);
}
}
[TearDown]
public override void TearDown()
@@ -3,6 +3,7 @@ using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence;
@@ -10,6 +11,7 @@ using Umbraco.Core.Persistence.Caching;
using Umbraco.Core.Persistence.Repositories;
using Umbraco.Core.Persistence.UnitOfWork;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Entities;
namespace Umbraco.Tests.Persistence.Repositories
{
@@ -37,10 +39,13 @@ namespace Umbraco.Tests.Persistence.Repositories
var unitOfWork = provider.GetUnitOfWork();
// Act
var repository = RepositoryResolver.Current.ResolveByType<ITemplateRepository>(unitOfWork);
using (var repository = RepositoryResolver.Current.ResolveByType<ITemplateRepository>(unitOfWork))
{
// Assert
Assert.That(repository, Is.Not.Null);
}
// Assert
Assert.That(repository, Is.Not.Null);
}
[Test]
@@ -51,10 +56,13 @@ namespace Umbraco.Tests.Persistence.Repositories
var unitOfWork = provider.GetUnitOfWork();
// Act
var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem);
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
// Assert
Assert.That(repository, Is.Not.Null);
}
// Assert
Assert.That(repository, Is.Not.Null);
}
[Test]
@@ -63,16 +71,18 @@ namespace Umbraco.Tests.Persistence.Repositories
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem);
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
// Act
var template = new Template("test-add-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
// Act
var template = new Template("test-add-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
//Assert
Assert.That(repository.Get("test"), Is.Not.Null);
Assert.That(_masterPageFileSystem.FileExists("test.master"), Is.True);
//Assert
Assert.That(repository.Get("test"), Is.Not.Null);
Assert.That(_masterPageFileSystem.FileExists("test.master"), Is.True);
}
}
[Test]
@@ -81,22 +91,25 @@ namespace Umbraco.Tests.Persistence.Repositories
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem);
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
// Act
var template = new Template("test-updated-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
// Act
var template = new Template("test-updated-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
template.Content = @"<%@ Master Language=""VB"" %>";
repository.AddOrUpdate(template);
unitOfWork.Commit();
template.Content = @"<%@ Master Language=""VB"" %>";
repository.AddOrUpdate(template);
unitOfWork.Commit();
var updated = repository.Get("test");
var updated = repository.Get("test");
// Assert
Assert.That(_masterPageFileSystem.FileExists("test.master"), Is.True);
Assert.That(updated.Content, Is.EqualTo(@"<%@ Master Language=""VB"" %>"));
}
// Assert
Assert.That(_masterPageFileSystem.FileExists("test.master"), Is.True);
Assert.That(updated.Content, Is.EqualTo(@"<%@ Master Language=""VB"" %>"));
}
[Test]
@@ -105,19 +118,64 @@ namespace Umbraco.Tests.Persistence.Repositories
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem);
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
var template = new Template("test-add-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
var template = new Template("test-add-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
// Act
var templates = repository.Get("test");
repository.Delete(templates);
unitOfWork.Commit();
// Act
var templates = repository.Get("test");
repository.Delete(templates);
unitOfWork.Commit();
// Assert
Assert.IsNull(repository.Get("test"));
}
// Assert
Assert.IsNull(repository.Get("test"));
}
[Test]
public void Can_Perform_Delete_When_Assigned_To_Doc()
{
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
var templateRepository = new TemplateRepository(unitOfWork, NullCacheProvider.Current);
var tagRepository = new TagsRepository(unitOfWork, NullCacheProvider.Current);
var contentTypeRepository = new ContentTypeRepository(unitOfWork, NullCacheProvider.Current, templateRepository);
var contentRepo = new ContentRepository(unitOfWork, NullCacheProvider.Current, contentTypeRepository, templateRepository, tagRepository, CacheHelper.CreateDisabledCacheHelper());
using (contentRepo)
{
var contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage2", "Textpage");
var textpage = MockedContent.CreateSimpleContent(contentType);
contentTypeRepository.AddOrUpdate(contentType);
contentRepo.AddOrUpdate(textpage);
unitOfWork.Commit();
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
var template = new Template("test-add-masterpage.master", "test", "test") { Content = @"<%@ Master Language=""C#"" %>" };
repository.AddOrUpdate(template);
unitOfWork.Commit();
textpage.Template = template;
contentRepo.AddOrUpdate(textpage);
unitOfWork.Commit();
// Act
var templates = repository.Get("test");
repository.Delete(templates);
unitOfWork.Commit();
// Assert
Assert.IsNull(repository.Get("test"));
}
}
}
[Test]
@@ -126,27 +184,30 @@ namespace Umbraco.Tests.Persistence.Repositories
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem);
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
var parent = new Template("test-parent-masterpage.master", "parent", "parent") { Content = @"<%@ Master Language=""C#"" %>" };
var child = new Template("test-child-masterpage.master", "child", "child") { Content = @"<%@ Master Language=""C#"" %>" };
var baby = new Template("test-baby-masterpage.master", "baby", "baby") { Content = @"<%@ Master Language=""C#"" %>" };
child.MasterTemplateAlias = parent.Alias;
child.MasterTemplateId = new Lazy<int>(() => parent.Id);
baby.MasterTemplateAlias = child.Alias;
baby.MasterTemplateId = new Lazy<int>(() => child.Id);
repository.AddOrUpdate(parent);
repository.AddOrUpdate(child);
repository.AddOrUpdate(baby);
unitOfWork.Commit();
var parent = new Template("test-parent-masterpage.master", "parent", "parent") { Content = @"<%@ Master Language=""C#"" %>" };
var child = new Template("test-child-masterpage.master", "child", "child") { Content = @"<%@ Master Language=""C#"" %>" };
var baby = new Template("test-baby-masterpage.master", "baby", "baby") { Content = @"<%@ Master Language=""C#"" %>" };
child.MasterTemplateAlias = parent.Alias;
child.MasterTemplateId = new Lazy<int>(() => parent.Id);
baby.MasterTemplateAlias = child.Alias;
baby.MasterTemplateId = new Lazy<int>(() => child.Id);
repository.AddOrUpdate(parent);
repository.AddOrUpdate(child);
repository.AddOrUpdate(baby);
unitOfWork.Commit();
// Act
var templates = repository.Get("parent");
repository.Delete(templates);
unitOfWork.Commit();
// Act
var templates = repository.Get("parent");
repository.Delete(templates);
unitOfWork.Commit();
// Assert
Assert.IsNull(repository.Get("test"));
}
// Assert
Assert.IsNull(repository.Get("test"));
}
[Test]
@@ -155,66 +216,69 @@ namespace Umbraco.Tests.Persistence.Repositories
// Arrange
var provider = new PetaPocoUnitOfWorkProvider();
var unitOfWork = provider.GetUnitOfWork();
var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem);
using (var repository = new TemplateRepository(unitOfWork, NullCacheProvider.Current, _masterPageFileSystem, _viewsFileSystem))
{
var parent = new Template("test-parent-masterpage.master", "parent", "parent") { Content = @"<%@ Master Language=""C#"" %>" };
var child1 = new Template("test-child1-masterpage.master", "child1", "child1") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler1 = new Template("test-toddler1-masterpage.master", "toddler1", "toddler1") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler2 = new Template("test-toddler2-masterpage.master", "toddler2", "toddler2") { Content = @"<%@ Master Language=""C#"" %>" };
var baby1 = new Template("test-baby1-masterpage.master", "baby1", "baby1") { Content = @"<%@ Master Language=""C#"" %>" };
var child2 = new Template("test-child2-masterpage.master", "child2", "child2") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler3 = new Template("test-toddler3-masterpage.master", "toddler3", "toddler3") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler4 = new Template("test-toddler4-masterpage.master", "toddler4", "toddler4") { Content = @"<%@ Master Language=""C#"" %>" };
var baby2 = new Template("test-baby2-masterpage.master", "baby2", "baby2") { Content = @"<%@ Master Language=""C#"" %>" };
child1.MasterTemplateAlias = parent.Alias;
child1.MasterTemplateId = new Lazy<int>(() => parent.Id);
child2.MasterTemplateAlias = parent.Alias;
child2.MasterTemplateId = new Lazy<int>(() => parent.Id);
toddler1.MasterTemplateAlias = child1.Alias;
toddler1.MasterTemplateId = new Lazy<int>(() => child1.Id);
toddler2.MasterTemplateAlias = child1.Alias;
toddler2.MasterTemplateId = new Lazy<int>(() => child1.Id);
toddler3.MasterTemplateAlias = child2.Alias;
toddler3.MasterTemplateId = new Lazy<int>(() => child2.Id);
toddler4.MasterTemplateAlias = child2.Alias;
toddler4.MasterTemplateId = new Lazy<int>(() => child2.Id);
baby1.MasterTemplateAlias = toddler2.Alias;
baby1.MasterTemplateId = new Lazy<int>(() => toddler2.Id);
baby2.MasterTemplateAlias = toddler4.Alias;
baby2.MasterTemplateId = new Lazy<int>(() => toddler4.Id);
repository.AddOrUpdate(parent);
repository.AddOrUpdate(child1);
repository.AddOrUpdate(child2);
repository.AddOrUpdate(toddler1);
repository.AddOrUpdate(toddler2);
repository.AddOrUpdate(toddler3);
repository.AddOrUpdate(toddler4);
repository.AddOrUpdate(baby1);
repository.AddOrUpdate(baby2);
unitOfWork.Commit();
// Act
var rootNode = repository.GetTemplateNode("parent");
// Assert
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "parent"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "child1"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "child2"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler1"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler2"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler3"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler4"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "baby1"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "baby2"));
}
var parent = new Template("test-parent-masterpage.master", "parent", "parent") { Content = @"<%@ Master Language=""C#"" %>" };
var child1 = new Template("test-child1-masterpage.master", "child1", "child1") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler1 = new Template("test-toddler1-masterpage.master", "toddler1", "toddler1") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler2 = new Template("test-toddler2-masterpage.master", "toddler2", "toddler2") { Content = @"<%@ Master Language=""C#"" %>" };
var baby1 = new Template("test-baby1-masterpage.master", "baby1", "baby1") { Content = @"<%@ Master Language=""C#"" %>" };
var child2 = new Template("test-child2-masterpage.master", "child2", "child2") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler3 = new Template("test-toddler3-masterpage.master", "toddler3", "toddler3") { Content = @"<%@ Master Language=""C#"" %>" };
var toddler4 = new Template("test-toddler4-masterpage.master", "toddler4", "toddler4") { Content = @"<%@ Master Language=""C#"" %>" };
var baby2 = new Template("test-baby2-masterpage.master", "baby2", "baby2") { Content = @"<%@ Master Language=""C#"" %>" };
child1.MasterTemplateAlias = parent.Alias;
child1.MasterTemplateId = new Lazy<int>(() => parent.Id);
child2.MasterTemplateAlias = parent.Alias;
child2.MasterTemplateId = new Lazy<int>(() => parent.Id);
toddler1.MasterTemplateAlias = child1.Alias;
toddler1.MasterTemplateId = new Lazy<int>(() => child1.Id);
toddler2.MasterTemplateAlias = child1.Alias;
toddler2.MasterTemplateId = new Lazy<int>(() => child1.Id);
toddler3.MasterTemplateAlias = child2.Alias;
toddler3.MasterTemplateId = new Lazy<int>(() => child2.Id);
toddler4.MasterTemplateAlias = child2.Alias;
toddler4.MasterTemplateId = new Lazy<int>(() => child2.Id);
baby1.MasterTemplateAlias = toddler2.Alias;
baby1.MasterTemplateId = new Lazy<int>(() => toddler2.Id);
baby2.MasterTemplateAlias = toddler4.Alias;
baby2.MasterTemplateId = new Lazy<int>(() => toddler4.Id);
repository.AddOrUpdate(parent);
repository.AddOrUpdate(child1);
repository.AddOrUpdate(child2);
repository.AddOrUpdate(toddler1);
repository.AddOrUpdate(toddler2);
repository.AddOrUpdate(toddler3);
repository.AddOrUpdate(toddler4);
repository.AddOrUpdate(baby1);
repository.AddOrUpdate(baby2);
unitOfWork.Commit();
// Act
var rootNode = repository.GetTemplateNode("parent");
// Assert
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "parent"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "child1"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "child2"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler1"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler2"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler3"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "toddler4"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "baby1"));
Assert.IsNotNull(repository.FindTemplateInTree(rootNode, "baby2"));
}
//[Test]
@@ -1,3 +1,4 @@
using System;
using System.IO;
using System.Linq;
using NUnit.Framework;
@@ -31,7 +32,50 @@ namespace Umbraco.Tests.PublishedContent
return GetNode(id).AsDynamic();
}
[Test]
[Test]
public void FirstChild()
{
var content = GetDynamicNode(1173);
var x = content.FirstChild();
Assert.IsNotNull(x);
Assert.IsInstanceOf<DynamicPublishedContent>(x);
Assert.AreEqual(1174, x.Id);
x = content.FirstChild("CustomDocument");
Assert.IsNotNull(x);
Assert.IsInstanceOf<DynamicPublishedContent>(x);
Assert.AreEqual(1177, x.Id);
}
[Test]
public void Children()
{
var content = GetDynamicNode(1173);
var l = content.Children;
Assert.AreEqual(4, l.Count());
// works - but not by calling the extension method
// because the binder will in fact re-route to the property first
l = content.Children();
Assert.AreEqual(4, l.Count());
}
[Test]
public void ChildrenOfType()
{
var content = GetDynamicNode(1173);
var l = content.Children;
Assert.AreEqual(4, l.Count());
// fails - because it fails to find extension methods?
l = content.Children("CustomDocument");
Assert.AreEqual(2, l.Count());
}
[Test]
public void Custom_Extension_Methods()
{
var asDynamic = GetDynamicNode(1173);
@@ -44,8 +44,9 @@ namespace Umbraco.Tests.PublishedContent
{
PropertyValueConvertersResolver.Current =
new PropertyValueConvertersResolver();
var types = PluginManager.Current.ResolveTypes<PublishedContentModel>();
PublishedContentModelFactoryResolver.Current =
new PublishedContentModelFactoryResolver(new PublishedContentModelFactoryImpl());
new PublishedContentModelFactoryResolver(new PublishedContentModelFactory(types));
base.FreezeResolution();
}
@@ -32,7 +32,7 @@ namespace Umbraco.Tests.PublishedContent
public void Add(SolidPublishedContent content)
{
_content[content.Id] = PublishedContentModelFactory.CreateModel(content);
_content[content.Id] = content.CreateModel();
}
public void Clear()
@@ -63,8 +63,9 @@ namespace Umbraco.Tests.PublishedContent
protected override void FreezeResolution()
{
var types = PluginManager.Current.ResolveTypes<PublishedContentModel>();
PublishedContentModelFactoryResolver.Current = new PublishedContentModelFactoryResolver(
new PublishedContentModelFactoryImpl());
new PublishedContentModelFactory(types));
base.FreezeResolution();
}
@@ -221,7 +222,7 @@ namespace Umbraco.Tests.PublishedContent
var doc = GetNode(1173);
var items = doc.Children
.Select(PublishedContentModelFactory.CreateModel) // linq, returns IEnumerable<IPublishedContent>
.Select(x => x.CreateModel()) // linq, returns IEnumerable<IPublishedContent>
// only way around this is to make sure every IEnumerable<T> extension
// explicitely returns a PublishedContentSet, not an IEnumerable<T>
@@ -1,7 +1,7 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;
@@ -11,30 +11,30 @@ using Umbraco.Tests.TestHelpers.Entities;
namespace Umbraco.Tests.Services
{
[DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerTest)]
[TestFixture, RequiresSTA]
public class ContentTypeServiceTests : BaseServiceTest
{
[SetUp]
public override void Initialize()
{
base.Initialize();
}
[TestFixture, RequiresSTA]
public class ContentTypeServiceTests : BaseServiceTest
{
[SetUp]
public override void Initialize()
{
base.Initialize();
}
[TearDown]
public override void TearDown()
{
base.TearDown();
}
[TearDown]
public override void TearDown()
{
base.TearDown();
}
[Test]
public void Deleting_PropertyType_Removes_The_Property_From_Content()
{
[Test]
public void Deleting_PropertyType_Removes_The_Property_From_Content()
{
IContentType contentType1 = MockedContentTypes.CreateTextpageContentType("test1", "Test1");
ServiceContext.ContentTypeService.Save(contentType1);
IContent contentItem = MockedContent.CreateTextpageContent(contentType1, "Testing", -1);
ServiceContext.ContentService.SaveAndPublish(contentItem);
var initProps = contentItem.Properties.Count;
var initPropTypes = contentItem.PropertyTypes.Count();
IContent contentItem = MockedContent.CreateTextpageContent(contentType1, "Testing", -1);
ServiceContext.ContentService.SaveAndPublishWithStatus(contentItem);
var initProps = contentItem.Properties.Count;
var initPropTypes = contentItem.PropertyTypes.Count();
//remove a property
contentType1.RemovePropertyType(contentType1.PropertyTypes.First().Alias);
@@ -44,30 +44,31 @@ namespace Umbraco.Tests.Services
contentItem = ServiceContext.ContentService.GetById(contentItem.Id);
Assert.AreEqual(initPropTypes - 1, contentItem.PropertyTypes.Count());
Assert.AreEqual(initProps -1, contentItem.Properties.Count);
}
Assert.AreEqual(initProps - 1, contentItem.Properties.Count);
}
[Test]
public void Rebuild_Content_Xml_On_Alias_Change()
[Test]
public void Rebuild_Content_Xml_On_Alias_Change()
{
var contentType1 = MockedContentTypes.CreateTextpageContentType("test1", "Test1");
var contentType2 = MockedContentTypes.CreateTextpageContentType("test2", "Test2");
ServiceContext.ContentTypeService.Save(contentType1);
ServiceContext.ContentTypeService.Save(contentType2);
var contentItems1 = MockedContent.CreateTextpageContent(contentType1, -1, 10).ToArray();
contentItems1.ForEach(x => ServiceContext.ContentService.SaveAndPublish(x));
var contentItems1 = MockedContent.CreateTextpageContent(contentType1, -1, 10).ToArray();
contentItems1.ForEach(x => ServiceContext.ContentService.SaveAndPublishWithStatus(x));
var contentItems2 = MockedContent.CreateTextpageContent(contentType2, -1, 5).ToArray();
contentItems2.ForEach(x => ServiceContext.ContentService.SaveAndPublish(x));
contentItems2.ForEach(x => ServiceContext.ContentService.SaveAndPublishWithStatus(x));
//only update the contentType1 alias which will force an xml rebuild for all content of that type
contentType1.Alias = "newAlias";
contentType1.Alias = "newAlias";
ServiceContext.ContentTypeService.Save(contentType1);
foreach (var c in contentItems1)
{
var xml = DatabaseContext.Database.FirstOrDefault<ContentXmlDto>("WHERE nodeId = @Id", new { Id = c.Id });
Assert.IsNotNull(xml);
Assert.IsTrue(xml.Xml.StartsWith("<newAlias"));
}
foreach (var c in contentItems2)
{
var xml = DatabaseContext.Database.FirstOrDefault<ContentXmlDto>("WHERE nodeId = @Id", new { Id = c.Id });
@@ -79,19 +80,20 @@ namespace Umbraco.Tests.Services
[Test]
public void Rebuild_Content_Xml_On_Property_Removal()
{
var contentType1 = MockedContentTypes.CreateTextpageContentType("test1", "Test1");
ServiceContext.ContentTypeService.Save(contentType1);
var contentType1 = MockedContentTypes.CreateTextpageContentType("test1", "Test1");
ServiceContext.ContentTypeService.Save(contentType1);
var contentItems1 = MockedContent.CreateTextpageContent(contentType1, -1, 10).ToArray();
contentItems1.ForEach(x => ServiceContext.ContentService.SaveAndPublish(x));
contentItems1.ForEach(x => ServiceContext.ContentService.SaveAndPublishWithStatus(x));
var alias = contentType1.PropertyTypes.First().Alias;
var elementToMatch = "<" + alias + ">";
foreach (var c in contentItems1)
{
var xml = DatabaseContext.Database.FirstOrDefault<ContentXmlDto>("WHERE nodeId = @Id", new { Id = c.Id });
Assert.IsNotNull(xml);
Assert.IsTrue(xml.Xml.Contains(elementToMatch)); //verify that it is there before we remove the property
}
//remove a property
contentType1.RemovePropertyType(contentType1.PropertyTypes.First().Alias);
ServiceContext.ContentTypeService.Save(contentType1);
@@ -107,21 +109,21 @@ namespace Umbraco.Tests.Services
}
}
[Test]
public void Get_Descendants()
{
// Arrange
var contentTypeService = ServiceContext.ContentTypeService;
var hierarchy = CreateContentTypeHierarchy();
[Test]
public void Get_Descendants()
{
// Arrange
var contentTypeService = ServiceContext.ContentTypeService;
var hierarchy = CreateContentTypeHierarchy();
contentTypeService.Save(hierarchy, 0); //ensure they are saved!
var master = hierarchy.First();
//Act
var descendants = master.Descendants();
var descendants = master.Descendants();
//Assert
Assert.AreEqual(10, descendants.Count());
}
}
[Test]
public void Get_Descendants_And_Self()
@@ -139,67 +141,97 @@ namespace Umbraco.Tests.Services
Assert.AreEqual(11, descendants.Count());
}
[Test]
public void Can_Bulk_Save_New_Hierarchy_Content_Types()
{
// Arrange
var contentTypeService = ServiceContext.ContentTypeService;
var hierarchy = CreateContentTypeHierarchy();
[Test]
public void Can_Bulk_Save_New_Hierarchy_Content_Types()
{
// Arrange
var contentTypeService = ServiceContext.ContentTypeService;
var hierarchy = CreateContentTypeHierarchy();
// Act
contentTypeService.Save(hierarchy, 0);
// Act
contentTypeService.Save(hierarchy, 0);
Assert.That(hierarchy.Any(), Is.True);
Assert.That(hierarchy.Any(x => x.HasIdentity == false), Is.False);
//all parent id's should be ok, they are lazy and if they equal zero an exception will be thrown
Assert.DoesNotThrow(() => hierarchy.Any(x => x.ParentId != 0));
for (var i = 0; i < hierarchy.Count(); i++)
{
if (i == 0) continue;
Assert.AreEqual(hierarchy.ElementAt(i).ParentId, hierarchy.ElementAt(i - 1).Id);
}
}
Assert.That(hierarchy.Any(), Is.True);
Assert.That(hierarchy.Any(x => x.HasIdentity == false), Is.False);
//all parent id's should be ok, they are lazy and if they equal zero an exception will be thrown
Assert.DoesNotThrow(() => hierarchy.Any(x => x.ParentId != 0));
for (var i = 0; i < hierarchy.Count(); i++)
{
if (i == 0) continue;
Assert.AreEqual(hierarchy.ElementAt(i).ParentId, hierarchy.ElementAt(i - 1).Id);
}
}
[Test]
public void Can_Save_ContentType_Structure_And_Create_Content_Based_On_It()
{
// Arrange
var cs = ServiceContext.ContentService;
var cts = ServiceContext.ContentTypeService;
var dtdYesNo = ServiceContext.DataTypeService.GetDataTypeDefinitionById(-49);
var ctBase = new ContentType(-1) {Name = "Base", Alias = "Base", Icon = "folder.gif", Thumbnail = "folder.png"};
ctBase.AddPropertyType(new PropertyType(dtdYesNo)
{
Name = "Hide From Navigation",
Alias = Constants.Conventions.Content.NaviHide
}
/*,"Navigation"*/);
cts.Save(ctBase);
[Test]
public void Can_Save_ContentType_Structure_And_Create_Content_Based_On_It()
{
// Arrange
var cs = ServiceContext.ContentService;
var cts = ServiceContext.ContentTypeService;
var dtdYesNo = ServiceContext.DataTypeService.GetDataTypeDefinitionById(-49);
var ctBase = new ContentType(-1) { Name = "Base", Alias = "Base", Icon = "folder.gif", Thumbnail = "folder.png" };
ctBase.AddPropertyType(new PropertyType(dtdYesNo)
{
Name = "Hide From Navigation",
Alias = Constants.Conventions.Content.NaviHide
}
/*,"Navigation"*/);
cts.Save(ctBase);
var ctHomePage = new ContentType(ctBase)
{
Name = "Home Page",
Alias = "HomePage",
Icon = "settingDomain.gif",
Thumbnail = "folder.png",
AllowedAsRoot = true
};
ctHomePage.AddPropertyType(new PropertyType(dtdYesNo) {Name = "Some property", Alias = "someProperty"}
/*,"Navigation"*/);
cts.Save(ctHomePage);
var ctHomePage = new ContentType(ctBase)
{
Name = "Home Page",
Alias = "HomePage",
Icon = "settingDomain.gif",
Thumbnail = "folder.png",
AllowedAsRoot = true
};
ctHomePage.AddPropertyType(new PropertyType(dtdYesNo) { Name = "Some property", Alias = "someProperty" }
/*,"Navigation"*/);
cts.Save(ctHomePage);
// Act
var homeDoc = cs.CreateContent("Home Page", -1, "HomePage");
cs.SaveAndPublish(homeDoc);
// Act
var homeDoc = cs.CreateContent("Home Page", -1, "HomePage");
cs.SaveAndPublishWithStatus(homeDoc);
// Assert
Assert.That(ctBase.HasIdentity, Is.True);
Assert.That(ctHomePage.HasIdentity, Is.True);
Assert.That(homeDoc.HasIdentity, Is.True);
Assert.That(homeDoc.ContentTypeId, Is.EqualTo(ctHomePage.Id));
}
// Assert
Assert.That(ctBase.HasIdentity, Is.True);
Assert.That(ctHomePage.HasIdentity, Is.True);
Assert.That(homeDoc.HasIdentity, Is.True);
Assert.That(homeDoc.ContentTypeId, Is.EqualTo(ctHomePage.Id));
}
[Test]
[Test]
public void Create_Content_Type_Ensures_Sort_Orders()
{
var service = ServiceContext.ContentTypeService;
var contentType = new ContentType(-1)
{
Alias = "test",
Name = "Test",
Description = "ContentType used for simple text pages",
Icon = ".sprTreeDoc3",
Thumbnail = "doc2.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext) { Alias = "title", Name = "Title", Description = "", Mandatory = false, DataTypeDefinitionId = -88 });
contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.TinyMCEAlias, DataTypeDatabaseType.Ntext) { Alias = "bodyText", Name = "Body Text", Description = "", Mandatory = false, DataTypeDefinitionId = -87 });
contentType.AddPropertyType(new PropertyType(Constants.PropertyEditors.TextboxAlias, DataTypeDatabaseType.Ntext) { Alias = "author", Name = "Author", Description = "Name of the author", Mandatory = false, DataTypeDefinitionId = -88 });
service.Save(contentType);
var sortOrders = contentType.PropertyTypes.Select(x => x.SortOrder).ToArray();
Assert.AreEqual(1, sortOrders.Count(x => x == 0));
Assert.AreEqual(1, sortOrders.Count(x => x == 1));
Assert.AreEqual(1, sortOrders.Count(x => x == 2));
}
[Test]
public void Can_Create_And_Save_ContentType_Composition()
{
/*
@@ -266,9 +298,9 @@ namespace Umbraco.Tests.Services
}
[Test]
public void Can_Copy_ContentType_By_Performing_Clone()
{
// Arrange
public void Can_Copy_ContentType_By_Performing_Clone()
{
// Arrange
var service = ServiceContext.ContentTypeService;
var metaContentType = MockedContentTypes.CreateMetaContentType();
service.Save(metaContentType);
@@ -278,7 +310,7 @@ namespace Umbraco.Tests.Services
var categoryId = simpleContentType.Id;
// Act
var sut = simpleContentType.Clone("newcategory");
var sut = simpleContentType.DeepCloneWithResetIdentities("newcategory");
service.Save(sut);
// Assert
@@ -297,25 +329,24 @@ namespace Umbraco.Tests.Services
Assert.AreNotEqual(contentType.SortOrder, category.SortOrder);
Assert.AreNotEqual(contentType.PropertyTypes.First(x => x.Alias.Equals("title")).Id, category.PropertyTypes.First(x => x.Alias.Equals("title")).Id);
Assert.AreNotEqual(contentType.PropertyGroups.First(x => x.Name.Equals("Content")).Id, category.PropertyGroups.First(x => x.Name.Equals("Content")).Id);
}
}
[Test]
public void Can_Copy_ContentType_To_New_Parent_By_Performing_Clone()
{
// Arrange
var service = ServiceContext.ContentTypeService;
var parentContentType1 = MockedContentTypes.CreateSimpleContentType("parent1", "Parent1");
service.Save(parentContentType1);
var parentContentType2 = MockedContentTypes.CreateSimpleContentType("parent2", "Parent2");
service.Save(parentContentType2);
var simpleContentType = MockedContentTypes.CreateSimpleContentType("category", "Category", parentContentType1);
service.Save(simpleContentType);
// Act
var clone = simpleContentType.Clone("newcategory");
var clone = simpleContentType.DeepCloneWithResetIdentities("newcategory");
clone.RemoveContentType("parent1");
clone.AddContentType(parentContentType2);
clone.ParentId = parentContentType2.Id;
@@ -332,7 +363,7 @@ namespace Umbraco.Tests.Services
Assert.AreEqual(clonedContentType.Path, "-1," + parentContentType2.Id + "," + clonedContentType.Id);
Assert.AreEqual(clonedContentType.PropertyTypes.Count(), originalContentType.PropertyTypes.Count());
Assert.AreNotEqual(clonedContentType.ParentId, originalContentType.ParentId);
Assert.AreEqual(clonedContentType.ParentId, parentContentType2.Id);
@@ -342,7 +373,6 @@ namespace Umbraco.Tests.Services
Assert.AreNotEqual(clonedContentType.PropertyTypes.First(x => x.Alias.Equals("title")).Id, originalContentType.PropertyTypes.First(x => x.Alias.Equals("title")).Id);
Assert.AreNotEqual(clonedContentType.PropertyGroups.First(x => x.Name.Equals("Content")).Id, originalContentType.PropertyGroups.First(x => x.Name.Equals("Content")).Id);
}
[Test]
@@ -366,12 +396,12 @@ namespace Umbraco.Tests.Services
var cloned = service.GetContentType(clone.Id);
var original = service.GetContentType(categoryId);
Assert.That(cloned.CompositionAliases().Any(x => x.Equals("meta")), Is.False); //it's been copied to root
Assert.AreEqual(cloned.ParentId, -1);
Assert.AreEqual(cloned.Level, 1);
Assert.AreEqual(cloned.PropertyTypes.Count(), original.PropertyTypes.Count());
Assert.AreEqual(cloned.PropertyGroups.Count(), original.PropertyGroups.Count());
for (int i = 0; i < cloned.PropertyGroups.Count; i++)
{
Assert.AreEqual(cloned.PropertyGroups[i].PropertyTypes.Count, original.PropertyGroups[i].PropertyTypes.Count);
@@ -380,17 +410,18 @@ namespace Umbraco.Tests.Services
Assert.IsTrue(propertyType.HasIdentity);
}
}
foreach (var propertyType in cloned.PropertyTypes)
{
Assert.IsTrue(propertyType.HasIdentity);
}
Assert.AreNotEqual(cloned.Id, original.Id);
Assert.AreNotEqual(cloned.Key, original.Key);
Assert.AreNotEqual(cloned.Path, original.Path);
Assert.AreNotEqual(cloned.SortOrder, original.SortOrder);
Assert.AreNotEqual(cloned.PropertyTypes.First(x => x.Alias.Equals("title")).Id, original.PropertyTypes.First(x => x.Alias.Equals("title")).Id);
Assert.AreNotEqual(cloned.PropertyGroups.First(x => x.Name.Equals("Content")).Id, original.PropertyGroups.First(x => x.Name.Equals("Content")).Id);
}
[Test]
@@ -431,22 +462,21 @@ namespace Umbraco.Tests.Services
Assert.AreNotEqual(clonedContentType.PropertyTypes.First(x => x.Alias.Equals("title")).Id, originalContentType.PropertyTypes.First(x => x.Alias.Equals("title")).Id);
Assert.AreNotEqual(clonedContentType.PropertyGroups.First(x => x.Name.Equals("Content")).Id, originalContentType.PropertyGroups.First(x => x.Name.Equals("Content")).Id);
}
private ContentType CreateComponent()
{
var component = new ContentType(-1)
{
Alias = "component",
Name = "Component",
Description = "ContentType used for Component grouping",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
{
Alias = "component",
Name = "Component",
Description = "ContentType used for Component grouping",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
var contentCollection = new PropertyTypeCollection();
contentCollection.Add(new PropertyType("test", DataTypeDatabaseType.Ntext) { Alias = "componentGroup", Name = "Component Group", Description = "", HelpText = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 });
@@ -458,27 +488,26 @@ namespace Umbraco.Tests.Services
private ContentType CreateBannerComponent(ContentType parent)
{
var banner = new ContentType(parent)
{
Alias = "banner",
Name = "Banner Component",
Description = "ContentType used for Banner Component",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
{
Alias = "banner",
Name = "Banner Component",
Description = "ContentType used for Banner Component",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
var propertyType = new PropertyType("test", DataTypeDatabaseType.Ntext)
{
Alias = "bannerName",
Name = "Banner Name",
Description = "",
HelpText = "",
Mandatory = false,
SortOrder = 2,
DataTypeDefinitionId = -88
};
{
Alias = "bannerName",
Name = "Banner Name",
Description = "",
Mandatory = false,
SortOrder = 2,
DataTypeDefinitionId = -88
};
banner.AddPropertyType(propertyType, "Component");
return banner;
}
@@ -486,16 +515,16 @@ namespace Umbraco.Tests.Services
private ContentType CreateSite()
{
var site = new ContentType(-1)
{
Alias = "site",
Name = "Site",
Description = "ContentType used for Site inheritence",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 2,
CreatorId = 0,
Trashed = false
};
{
Alias = "site",
Name = "Site",
Description = "ContentType used for Site inheritence",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 2,
CreatorId = 0,
Trashed = false
};
var contentCollection = new PropertyTypeCollection();
contentCollection.Add(new PropertyType("test", DataTypeDatabaseType.Ntext) { Alias = "hostname", Name = "Hostname", Description = "", HelpText = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 });
@@ -507,16 +536,16 @@ namespace Umbraco.Tests.Services
private ContentType CreateHomepage(ContentType parent)
{
var contentType = new ContentType(parent)
{
Alias = "homepage",
Name = "Homepage",
Description = "ContentType used for the Homepage",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
{
Alias = "homepage",
Name = "Homepage",
Description = "ContentType used for the Homepage",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
var contentCollection = new PropertyTypeCollection();
contentCollection.Add(new PropertyType("test", DataTypeDatabaseType.Ntext) { Alias = "title", Name = "Title", Description = "", HelpText = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 });
@@ -528,26 +557,26 @@ namespace Umbraco.Tests.Services
return contentType;
}
private IContentType[] CreateContentTypeHierarchy()
{
//create the master type
var masterContentType = MockedContentTypes.CreateSimpleContentType("masterContentType", "MasterContentType");
masterContentType.Key = new Guid("C00CA18E-5A9D-483B-A371-EECE0D89B4AE");
ServiceContext.ContentTypeService.Save(masterContentType);
private IContentType[] CreateContentTypeHierarchy()
{
//create the master type
var masterContentType = MockedContentTypes.CreateSimpleContentType("masterContentType", "MasterContentType");
masterContentType.Key = new Guid("C00CA18E-5A9D-483B-A371-EECE0D89B4AE");
ServiceContext.ContentTypeService.Save(masterContentType);
//add the one we just created
var list = new List<IContentType> {masterContentType};
for (var i = 0; i < 10; i++)
{
var contentType = MockedContentTypes.CreateSimpleContentType("childType" + i, "ChildType" + i,
//make the last entry in the list, this one's parent
list.Last());
//add the one we just created
var list = new List<IContentType> { masterContentType };
list.Add(contentType);
}
for (var i = 0; i < 10; i++)
{
var contentType = MockedContentTypes.CreateSimpleContentType("childType" + i, "ChildType" + i,
//make the last entry in the list, this one's parent
list.Last());
return list.ToArray();
}
}
list.Add(contentType);
}
return list.ToArray();
}
}
}
@@ -138,6 +138,16 @@ namespace Umbraco.Tests.Services
&& ((UmbracoEntity.EntityProperty)y.Value).PropertyEditorAlias == Constants.PropertyEditors.UploadFieldAlias)), Is.True);
}
[Test]
public void EntityService_Can_Get_ObjectType()
{
var service = ServiceContext.EntityService;
var mediaObjectType = service.GetObjectType(1031);
Assert.NotNull(mediaObjectType);
Assert.AreEqual(mediaObjectType, UmbracoObjectTypes.MediaType);
}
private static bool _isSetup = false;
public override void CreateTestData()
@@ -1,4 +1,8 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Services
@@ -8,10 +12,17 @@ namespace Umbraco.Tests.Services
/// This is more of an integration test as it involves multiple layers
/// as well as configuration.
/// </summary>
[DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerFixture)]
[DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerTest)]
[TestFixture, RequiresSTA]
public class LocalizationServiceTests : BaseServiceTest
{
private Guid _parentItemGuidId;
private int _parentItemIntId;
private Guid _childItemGuidId;
private int _childItemIntId;
private int _danishLangId;
private int _englishLangId;
[SetUp]
public override void Initialize()
{
@@ -23,5 +34,194 @@ namespace Umbraco.Tests.Services
{
base.TearDown();
}
[Test]
public void LocalizationService_Can_Get_Root_Dictionary_Items()
{
var rootItems = ServiceContext.LocalizationService.GetRootDictionaryItems();
Assert.NotNull(rootItems);
Assert.IsTrue(rootItems.Any());
}
[Test]
public void LocalizationService_Can_Determint_If_DictionaryItem_Exists()
{
var exists = ServiceContext.LocalizationService.DictionaryItemExists("Parent");
Assert.IsTrue(exists);
}
[Test]
public void LocalizationService_Can_Get_All_Languages()
{
var languages = ServiceContext.LocalizationService.GetAllLanguages();
Assert.NotNull(languages);
Assert.IsTrue(languages.Any());
Assert.That(languages.Count(), Is.EqualTo(3));
}
[Test]
public void LocalizationService_Can_Get_Dictionary_Item_By_Int_Id()
{
var parentItem = ServiceContext.LocalizationService.GetDictionaryItemById(_parentItemIntId);
Assert.NotNull(parentItem);
var childItem = ServiceContext.LocalizationService.GetDictionaryItemById(_childItemIntId);
Assert.NotNull(childItem);
}
[Test]
public void LocalizationService_Can_Get_Dictionary_Item_By_Guid_Id()
{
var parentItem = ServiceContext.LocalizationService.GetDictionaryItemById(_parentItemGuidId);
Assert.NotNull(parentItem);
var childItem = ServiceContext.LocalizationService.GetDictionaryItemById(_childItemGuidId);
Assert.NotNull(childItem);
}
[Test]
public void LocalizationService_Can_Get_Dictionary_Item_By_Key()
{
var parentItem = ServiceContext.LocalizationService.GetDictionaryItemByKey("Parent");
Assert.NotNull(parentItem);
var childItem = ServiceContext.LocalizationService.GetDictionaryItemByKey("Child");
Assert.NotNull(childItem);
}
[Test]
public void LocalizationService_Can_Get_Dictionary_Item_Children()
{
var item = ServiceContext.LocalizationService.GetDictionaryItemChildren(_parentItemGuidId);
Assert.NotNull(item);
Assert.That(item.Count(), Is.EqualTo(1));
foreach (var dictionaryItem in item)
{
Assert.IsFalse(string.IsNullOrEmpty(dictionaryItem.ItemKey));
}
}
[Test]
public void LocalizationService_Can_Get_Language_By_Culture_Code()
{
var danish = ServiceContext.LocalizationService.GetLanguageByCultureCode("Danish");
var english = ServiceContext.LocalizationService.GetLanguageByCultureCode("English");
Assert.NotNull(danish);
Assert.NotNull(english);
}
[Test]
public void LocalizationService_Can_GetLanguageById()
{
var danish = ServiceContext.LocalizationService.GetLanguageById(_danishLangId);
var english = ServiceContext.LocalizationService.GetLanguageById(_englishLangId);
Assert.NotNull(danish);
Assert.NotNull(english);
}
[Test]
public void LocalizationService_Can_GetLanguageByIsoCode()
{
var danish = ServiceContext.LocalizationService.GetLanguageByIsoCode("da-DK");
var english = ServiceContext.LocalizationService.GetLanguageByIsoCode("en-GB");
Assert.NotNull(danish);
Assert.NotNull(english);
}
[Test]
public void LocalizationService_Does_Not_Fail_When_Language_Doesnt_Exist()
{
var language = ServiceContext.LocalizationService.GetLanguageByIsoCode("sv-SE");
Assert.Null(language);
}
[Test]
public void LocalizationService_Does_Not_Fail_When_DictionaryItem_Doesnt_Exist()
{
var item = ServiceContext.LocalizationService.GetDictionaryItemByKey("RandomKey");
Assert.Null(item);
}
[Test]
public void LocalizationService_Can_Delete_Language()
{
var norwegian = new Language("nb-NO") { CultureName = "Norwegian" };
ServiceContext.LocalizationService.Save(norwegian, 0);
Assert.That(norwegian.HasIdentity, Is.True);
var languageId = norwegian.Id;
ServiceContext.LocalizationService.Delete(norwegian);
var language = ServiceContext.LocalizationService.GetLanguageById(languageId);
Assert.Null(language);
}
[Test]
public void LocalizationService_Can_Delete_DictionaryItem()
{
var item = ServiceContext.LocalizationService.GetDictionaryItemByKey("Child");
Assert.NotNull(item);
ServiceContext.LocalizationService.Delete(item);
var deletedItem = ServiceContext.LocalizationService.GetDictionaryItemByKey("Child");
Assert.Null(deletedItem);
}
[Test]
public void LocalizationService_Can_Update_Existing_DictionaryItem()
{
var item = ServiceContext.LocalizationService.GetDictionaryItemByKey("Child");
foreach (var translation in item.Translations)
{
translation.Value = translation.Value + "UPDATED";
}
ServiceContext.LocalizationService.Save(item);
var updatedItem = ServiceContext.LocalizationService.GetDictionaryItemByKey("Child");
Assert.NotNull(updatedItem);
foreach (var translation in updatedItem.Translations)
{
Assert.That(translation.Value.EndsWith("UPDATED"), Is.True);
}
}
public override void CreateTestData()
{
var danish = new Language("da-DK") { CultureName = "Danish" };
var english = new Language("en-GB") { CultureName = "English"};
ServiceContext.LocalizationService.Save(danish, 0);
ServiceContext.LocalizationService.Save(english, 0);
_danishLangId = danish.Id;
_englishLangId = english.Id;
var parentItem = new DictionaryItem("Parent")
{
Translations = new List<IDictionaryTranslation>
{
new DictionaryTranslation(english, "ParentValue"),
new DictionaryTranslation(danish, "ForældreVærdi")
}
};
ServiceContext.LocalizationService.Save(parentItem);
_parentItemGuidId = parentItem.Key;
_parentItemIntId = parentItem.Id;
var childItem = new DictionaryItem(parentItem.Key, "Child")
{
Translations = new List<IDictionaryTranslation>
{
new DictionaryTranslation(english, "ChildValue"),
new DictionaryTranslation(danish, "BørnVærdi")
}
};
ServiceContext.LocalizationService.Save(childItem);
_childItemGuidId = childItem.Key;
_childItemIntId = childItem.Id;
}
}
}
@@ -150,6 +150,40 @@ namespace Umbraco.Tests.Services
}
[Test]
public void Can_Add_And_Remove_Properties()
{
var macroService = ServiceContext.MacroService;
var macro = new Macro("test", "Test", scriptPath: "~/Views/MacroPartials/Test.cshtml", cacheDuration: 1234);
//adds some properties
macro.Properties.Add(new MacroProperty("blah1", "Blah1", 0, "blah1"));
macro.Properties.Add(new MacroProperty("blah2", "Blah2", 0, "blah2"));
macro.Properties.Add(new MacroProperty("blah3", "Blah3", 0, "blah3"));
macro.Properties.Add(new MacroProperty("blah4", "Blah4", 0, "blah4"));
macroService.Save(macro);
var result1 = macroService.GetById(macro.Id);
Assert.AreEqual(4, result1.Properties.Count());
//simulate clearing the sections
foreach (var s in result1.Properties.ToArray())
{
result1.Properties.Remove(s.Alias);
}
//now just re-add a couple
result1.Properties.Add(new MacroProperty("blah3", "Blah3", 0, "blah3"));
result1.Properties.Add(new MacroProperty("blah4", "Blah4", 0, "blah4"));
macroService.Save(result1);
//assert
//re-get
result1 = macroService.GetById(result1.Id);
Assert.AreEqual(2, result1.Properties.Count());
}
//[Test]
//public void Can_Get_Many_By_Alias()
//{
+1
View File
@@ -191,6 +191,7 @@
<Compile Include="Models\LanguageTests.cs" />
<Compile Include="Models\MemberGroupTests.cs" />
<Compile Include="Models\MemberTests.cs" />
<Compile Include="Models\PreValueCollectionTests.cs" />
<Compile Include="Models\PropertyGroupTests.cs" />
<Compile Include="Models\PropertyTypeTests.cs" />
<Compile Include="Models\RelationTests.cs" />
+3 -1
View File
@@ -16,6 +16,8 @@
"tests"
],
"dependencies": {
"typeahead.js": "~0.10.2"
"typeahead.js": "~0.10.2",
"ace-builds": "~1.1.3",
"rgrove-lazyload": "*"
}
}
+58 -14
View File
@@ -6,15 +6,16 @@ module.exports = function (grunt) {
grunt.registerTask('dev', ['jshint:dev', 'build', 'webserver', 'open:dev', 'watch']);
//run by the watch task
grunt.registerTask('watch-js', ['jshint:dev','concat','copy:app','copy:mocks','copy:packages','copy:vs','karma:unit']);
grunt.registerTask('watch-less', ['recess:build','recess:installer','copy:assets','copy:vs']);
grunt.registerTask('watch-js', ['jshint:dev','concat','copy:app','copy:mocks','copy:packages','copy:tuning','copy:vs','karma:unit']);
grunt.registerTask('watch-less', ['recess:build', 'recess:installer', 'recess:tuning','copy:tuning', 'copy:assets', 'copy:vs']);
grunt.registerTask('watch-html', ['copy:views', 'copy:vs']);
grunt.registerTask('watch-packages', ['copy:packages']);
grunt.registerTask('watch-installer', ['concat:install','concat:installJs','copy:installer', 'copy:vs']);
grunt.registerTask('watch-installer', ['concat:install', 'concat:installJs', 'copy:installer', 'copy:vs']);
grunt.registerTask('watch-tuning', ['copy:tuning', 'concat:tuningJs', 'copy:vs']);
grunt.registerTask('watch-test', ['jshint:dev', 'karma:unit']);
//triggered from grunt dev or grunt
grunt.registerTask('build', ['clean','concat','recess:min','recess:installer','copy']);
grunt.registerTask('build', ['clean', 'concat', 'recess:min', 'recess:installer', 'recess:tuning', 'bower', 'copy']);
//utillity tasks
grunt.registerTask('docs', ['ngdocs']);
@@ -109,23 +110,48 @@ module.exports = function (grunt) {
clean: ['<%= distdir %>/*'],
copy: {
/* Copies over the files downloaded by bower
bower: {
files: [
{ dest: '<%= distdir %>/lib/typeahead/typeahead.bundle.min.js', src: '<%= bowerfiles %>/typeahead.js/dist/typeahead.bundle.min.js' }
]
},
*/
assets: {
files: [{ dest: '<%= distdir %>/assets', src : '**', expand: true, cwd: 'src/assets/' }]
},
// Copies over the files downloaded by bower
bower: {
files: [
{
dest: '<%= distdir %>/lib/typeahead/typeahead.bundle.min.js',
src: 'bower_components/typeahead.js/dist/typeahead.bundle.min.js'
},
{
dest: '<%= distdir %>/lib/lazyload/lazyload.min.js',
src: 'bower_components/rgrove-lazyload/lazyload.js'
},
{
dest: '<%= distdir %>/lib/ace/',
src: '**',
expand: true,
cwd: 'bower_components/ace-builds/src-min-noconflict/'
}
]
},
installer: {
files: [{ dest: '<%= distdir %>/views/install', src : '**/*.html', expand: true, cwd: 'src/installer/steps' }]
},
tuning: {
files: [
{ dest: '<%= distdir %>/preview', src: '**/*.html', expand: true, cwd: 'src/tuning' },
{ dest: '<%= distdir %>/assets/css', src: 'tuning.defaultStyle.css', expand: true, cwd: 'src/tuning' },
{ dest: '<%= distdir %>/assets/less', src: 'tuning.defaultStyle.less', expand: true, cwd: 'src/tuning' },
{ dest: '<%= distdir %>/assets/less', src: 'tuning.gridRowStyle.less', expand: true, cwd: 'src/tuning' },
{ dest: '<%= distdir %>/js', src: 'tuning.config.js', expand: true, cwd: 'src/tuning/config' },
{ dest: '<%= distdir %>/js', src: 'tuning.palettes.js', expand: true, cwd: 'src/tuning/config' },
{ dest: '<%= distdir %>/js', src: 'tuning.front.js', expand: true, cwd: 'src/tuning' }
]
},
vendor: {
files: [{ dest: '<%= distdir %>/lib', src : '**', expand: true, cwd: 'lib/' }]
},
@@ -147,7 +173,8 @@ module.exports = function (grunt) {
{ dest: '<%= vsdir %>/assets', src: '**', expand: true, cwd: '<%= distdir %>/assets' },
{ dest: '<%= vsdir %>/js', src: '**', expand: true, cwd: '<%= distdir %>/js' },
{ dest: '<%= vsdir %>/lib', src: '**', expand: true, cwd: '<%= distdir %>/lib' },
{ dest: '<%= vsdir %>/views', src: '**', expand: true, cwd: '<%= distdir %>/views' }
{ dest: '<%= vsdir %>/views', src: '**', expand: true, cwd: '<%= distdir %>/views' },
{ dest: '<%= vsdir %>/preview', src: '**', expand: true, cwd: '<%= distdir %>/preview' }
]
},
@@ -186,6 +213,10 @@ module.exports = function (grunt) {
footer: "\n\n})();"
}
},
tuningJs: {
src: ['src/tuning/tuning.global.js', 'src/tuning/tuning.controller.js', 'src/tuning/lib/slider.directive.js', 'src/tuning/lib/spectrum.directive.js'],
dest: '<%= distdir %>/js/tuning.panel.js'
},
controllers: {
src:['src/controllers/**/*.controller.js','src/views/**/*.controller.js'],
dest: '<%= distdir %>/js/umbraco.controllers.js',
@@ -272,6 +303,15 @@ module.exports = function (grunt) {
compile: true
}
},
tuning: {
files: {
'<%= distdir %>/assets/css/tuning.panelStyles.css':
['src/less/tuning.panelStyles.less', 'src/less/helveticons.less']
},
options: {
compile: true
}
},
min: {
files: {
'<%= distdir %>/assets/css/<%= pkg.name %>.css': ['<%= src.less %>']
@@ -304,6 +344,10 @@ module.exports = function (grunt) {
files: ['src/installer/**/*.*'],
tasks: ['watch-installer', 'timestamp'],
},
tuning: {
files: ['src/tuning/**/*.*'],
tasks: ['watch-tuning', 'timestamp'],
},
html: {
files: ['src/views/**/*.html', 'src/*.html'],
tasks:['watch-html','timestamp']
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
// Inline and block code styles
code,
pre {
pre.code {
padding: 0 3px 2px;
#font > #family > .monospace;
font-size: @baseFontSize - 2;
@@ -23,7 +23,7 @@ code {
}
// Blocks of code
pre {
pre.code {
display: block;
padding: (@baseLineHeight - 1) / 2;
margin: 0 0 @baseLineHeight / 2;
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

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