Compare commits

...

795 Commits

Author SHA1 Message Date
Sebastiaan Janssen 21426610ad Need to take the current schema into account for the ExcessiveHeadersCheck 2016-10-19 17:01:15 +02:00
Sebastiaan Janssen 40b0a62cc3 Use int.MaxValue instead of 0 2016-10-19 14:58:56 +02:00
Shannon Deminick 3949b78c61 Merge pull request #1533 from callumbwhyte/U4-9042
U4-9042: Fixes backoffice members list view for custom membership providers
2016-10-19 14:48:44 +02:00
Claus 55179d7400 adding missing multiple content picker macro parameter. 2016-10-19 13:56:26 +02:00
Mads Rasmussen 517147346e Merge pull request #1534 from umbraco/temp-u4-9048
temp-U4-9048 - security when uploading files
2016-10-19 11:01:19 +02:00
Mads Rasmussen e1e63d079f add curly brackets to fix "grunt vs" task 2016-10-19 10:48:14 +02:00
Sebastiaan Janssen 86744046e3 Merge pull request #1531 from umbraco/temp-u4-8981
U4-8981 - fix package actions
2016-10-19 09:15:01 +02:00
Stephan a5f1c3e564 Merge pull request #1530 from umbraco/temp-U4-8769
fixes: U4-8769 ImageCropper focal points randomly sets to 'null'
2016-10-19 09:01:55 +02:00
Stephan 2b2734cd66 U4-8981 - fix package actions 2016-10-19 08:48:35 +02:00
Sebastiaan Janssen c2d33f3301 Merge pull request #1532 from richarth/patch-1
Update noNodes.aspx
2016-10-18 22:12:52 +02:00
Sebastiaan Janssen 8fc999f771 Merge pull request #1510 from lukawefocus/dev-v7
U4-7238 issue sorting listview after 7.3.0 upgrade
2016-10-18 20:25:17 +02:00
Sebastiaan Janssen be0fb51193 Merge pull request #1529 from mzajkowski/U4-6710
Cast tag value to unicoded text before inserting it into database
2016-10-18 18:37:11 +02:00
Sebastiaan Janssen 097f5355e2 U4-9050 Update to latest Examine 0.1.70.0 2016-10-18 18:03:43 +02:00
Sebastiaan Janssen 843fad9963 Merge pull request #1477 from arknu/U4-8968
Fix U4-8968: Add missing check for backoffice session in ClaimsIdentity
2016-10-18 17:53:14 +02:00
Sebastiaan Janssen 7b5670f275 U4-9076 Update to latest ImageProcessor 2016-10-18 16:45:16 +02:00
Sebastiaan Janssen f4410891e4 Merge pull request #1459 from umbraco/temp-U4-8829-dashboards-from-remote-feed
Temp u4 8829 dashboards from remote feed
2016-10-18 15:50:15 +02:00
Sebastiaan Janssen 9da95ce28f Moved UmbracoAuthorize to the class level
Unfortunately can't consolidate GetCacheItem and InsertCacheItem because of different timespan
Can't directly cache the `content` variable due to problems with modified closures
2016-10-18 14:16:37 +02:00
Sebastiaan Janssen 33e05625ed Fixes based on review 2016-10-18 10:10:50 +02:00
Sebastiaan Janssen b8575d04ad Adds default/fallback dashboard missing content 2016-10-18 09:56:25 +02:00
Stephan b64b67ce81 U4-9048 - return proper Forbidden status code when uploading to invalid folder 2016-10-18 08:47:03 +02:00
Stephan 1b6a2c7d5c U4-9048 - validate user before retrying queued promises 2016-10-18 08:46:41 +02:00
Callum Whyte a1a90d5bff Fixes backoffice members list view for custom membership providers by using key instead of id in edit URL 2016-10-17 16:26:20 +01:00
richarth 08733d7351 Update noNodes.aspx
Grammar correction
2016-10-17 14:28:16 +01:00
Sebastiaan Janssen 5d0d65c624 Merge branch 'dev-v7' into temp-U4-8829-dashboards-from-remote-feed 2016-10-17 15:00:40 +02:00
Stephan 6c7c333d8f Merge pull request #1523 from umbraco/temp-U4-8896
fixes: U4-8896 U7 (7.4.2) - Uploading images in media library fails
2016-10-17 14:45:24 +02:00
Mads Rasmussen b039fbfb13 Merge pull request #1498 from bjarnef/dev-v7-U4-9007
Format package created date
2016-10-17 14:41:36 +02:00
Mads Rasmussen 428bc7fbad Merge pull request #1525 from JeffreyPerplex/patch-2
Update imagecropper.html
2016-10-17 14:21:55 +02:00
Stephan fe9686f215 U4-8981 - fix package actions 2016-10-17 14:21:51 +02:00
Mads Rasmussen e4a472f902 fixes: U4-8769 ImageCropper focal points randomly sets to 'null' 2016-10-17 13:32:09 +02:00
Sebastiaan Janssen 900f8970f0 Check for null orderBy argument earlier to avoid doing unnecessary work 2016-10-17 09:56:50 +02:00
Claus dd6c24d3b8 Merge pull request #1527 from leekelleher/issue/U4-9073
Grid: Quote editor - wrong CSS style rule for italic
2016-10-17 09:08:52 +02:00
Marcin Zajkowski 8175e68ecd Cast tag value to unicoded text before inserting it into database
Quick fix for: http://issues.umbraco.org/issue/U4-6710
2016-10-16 03:15:02 +02:00
leekelleher c839285f90 Grid: Quote editor - wrong CSS style rule for italic
[Issue #U4-9073](http://issues.umbraco.org/issue/U4-9073)

In `grid.editors.config.js`, the style config for the Quote editor has an incorrect CSS style rule for italic, it has...

```css
font-variant: italic;
```

It should be...

```css
font-style: italic;
```

I wasn't sure which `grid.editors.config.js` to change, so I did them all.
2016-10-14 16:37:06 +01:00
Claus 21378a07c8 Merge pull request #1466 from AndyButland/u4-8941
u4-8941 - Used configurable application URL when constructing password reset link
2016-10-14 11:05:37 +02:00
Jeffrey Schoemaker 74e6633f2a Update imagecropper.html
Remove ng-show="imageIsLoaded" so "Remove file" is always visible when there's an image or file uploaded, even if it can't be rendered because whether is .tif-file (correct image, but not rendered in modern browsers), .pdf-file (foolish action) or the image is removed from the server (staging with a production-environment-database).

Related to http://issues.umbraco.org/issue/U4-8490
2016-10-14 10:31:12 +02:00
Claus 8693b13e68 Merge pull request #1511 from umbraco/temp-U4-8992
U4-8992 - update content and media xml caches when upgrading from bef…
2016-10-13 15:31:09 +02:00
Mads Rasmussen a0a861370b Merge pull request #1499 from darrenferguson/dev-v7
U4-9012 The word "Oops" should probably be removed, because we can ca…
2016-10-13 15:20:59 +02:00
Mads Rasmussen 7282626c0f Merge pull request #1514 from abryukhov/patch-6
Update UI language ru.xml
2016-10-13 14:50:12 +02:00
Mads Rasmussen cf604255fc fixes: U4-8896 U7 (7.4.2) - Uploading images in media library fails 2016-10-13 13:12:24 +02:00
Shannon Deminick b275850aca Merge pull request #1515 from seth-reeser/patch-1
Update README.md
2016-10-13 11:46:43 +02:00
Seth Reeser 8aa36a82c4 Update README.md 2016-10-12 22:48:10 -04:00
Alexander Bryukhov 06132fcdaf Update UI language ru.xml
New key in healthCheck area added
2016-10-12 11:17:04 +07:00
Stephan f1e5b3fcfa Prevent tests from failing due to dates rounding 2016-10-11 15:06:33 +02:00
Mads Rasmussen fba4b91bec Merge pull request #1465 from abryukhov/patch-6
Localizing URL tracker dashboard
2016-10-11 14:42:37 +02:00
Mads Rasmussen 0ef987207b Merge pull request #1489 from abryukhov/patch-7
U4-8985 Label for row configurations in the grid editor
2016-10-11 14:21:06 +02:00
Mads Rasmussen 2d7b5b959e Merge pull request #1497 from bjarnef/dev-v7-U4-8897
Change color of remove button to red
2016-10-11 14:01:27 +02:00
Mads Rasmussen 2837861d9a Merge pull request #1501 from jt3432/dev-v7
Added title attribute to image tags
2016-10-11 13:27:32 +02:00
Mads Rasmussen 212222c98e Merge pull request #1505 from bjarnef/dev-v7-U4-9031
Make increase/decrease buttons in grid layout and row configurations …
2016-10-11 13:14:09 +02:00
Mads Rasmussen 15237a6d91 Merge pull request #1512 from Joddsson/changeDocTypeToolbar
Styled toolbar buttons in ChangeDocType dialog
2016-10-11 13:02:03 +02:00
Ivar 95b2ef0f3c Styled toolbar buttons in ChangeDocType dialog 2016-10-10 23:27:42 +00:00
Stephan c452d31f25 Prevent tests from failing due to dates rounding 2016-10-10 19:18:49 +02:00
Stephan 7361d1f16f U4-8992 - update content and media xml caches when upgrading from before 7.3 2016-10-10 18:25:54 +02:00
Luka Kuljic 7ffb22a40f U4-7238 issue sorting listview after 7.3.0 upgrade
http://issues.umbraco.org/issue/U4-7238

System field publish only available for Content, didn't work on content
sorting by this field. Fixed by prefixing the field with table:
cmsDocumen.published.
2016-10-06 15:59:59 +02:00
Claus f78e496e69 Merge pull request #1509 from umbraco/temp-u4-8983
U4-8983 - clear EntityService cache on content events
2016-10-06 10:56:30 +02:00
Stephan 48ed511ba5 U4-8983 - clear EntityService cache on content events 2016-10-06 09:06:25 +02:00
Stephan 3cff6fdd6c Merge pull request #1451 from umbraco/temp-u4-8698
U4-8698 - fix notification service perfs issues
2016-10-06 08:31:39 +02:00
Shannon Deminick 81da2e49f7 Merge pull request #1508 from umbraco/temp-U4-9005
U4-9005 Update comments in urlrewriting.config to note it's obsolete
2016-10-05 18:32:51 +02:00
Shannon 2cd6427958 Fixes more issues with notifications which weren't sending properly do to a i++ instead of a ++1, have refactored that to read better. Also fixes up performance issues since we were returning every single fully resolved IContent for all versions when all we need is the top 2 version ids, have added methods to do that plus a unit test. Have tested the emails and the diffs and they all work. 2016-10-05 18:30:03 +02:00
Sebastiaan Janssen 061f1ae0b1 U4-9005 Update comments in urlrewriting.config to note it's obsolete 2016-10-05 17:49:09 +02:00
Shannon f503cd41de Merge branch 'refs/heads/dev-v7' into temp-u4-8698 2016-10-05 11:52:05 +02:00
Shannon Deminick 4428877158 Merge pull request #1507 from umbraco/temp-U4-6809
U4-6809 u7.2.6 Updating media items with large file cause out of memo…
2016-10-05 11:23:50 +02:00
Shannon 876f61ac27 U4-8788 ContentService.GetByIds() returns items in different order
U4-8937 ContentController.PostSort is not honouring the passed sorted ids.
2016-10-05 11:20:48 +02:00
Claus 2cc541e084 U4-6809 u7.2.6 Updating media items with large file cause out of memory exception 2016-10-05 11:06:51 +02:00
Shannon ddd3c78fa6 Merge branch 'refs/heads/temp-u4-8937' into dev-v7 2016-10-05 11:05:44 +02:00
Shannon Deminick 62dffedc02 Merge pull request #1491 from umbraco/temp-U4-9001
U4-9001 Health Check, HTTPS Configuration is missing a message when c…
2016-10-05 10:53:49 +02:00
Claus 13e5409ab2 Merge pull request #1492 from jswietek/U4-8975
U4 8975
2016-10-05 10:51:14 +02:00
bjarnef 927e9cf14a Make increase/decrease buttons in grid layout and row configurations use same icons 2016-10-02 21:09:52 +02:00
Per Ploug 7611829f2e Changes http to https 2016-09-29 13:28:57 +02:00
Jason Thomas 1ff5d171e3 Added title attribute to image tags for mediapicker.html and umb-media-grid.html. 2016-09-28 17:22:08 -06:00
Sebastiaan Janssen b8aaebf51a Fix automapper remove/insert transform 2016-09-28 16:05:35 +02:00
Shannon Deminick 2c9bc5135c Merge pull request #1483 from umbraco/temp-U4-8984
U4-8984 Upgrade AutoMapper to latest 3.x
2016-09-28 15:41:38 +02:00
Shannon 248177f518 Ensures Nuspec has correct AutoMapper, ensures config transform is correct (we cannot remove something that isn't there since it never existed before) 2016-09-28 15:33:32 +02:00
Shannon Deminick d34901fd13 Merge pull request #1500 from markwemekamp/dev-v7
Bugfix in Initialize method of UmbracoMediaFile
2016-09-27 09:44:29 +02:00
Mark 94b12dfb02 Updated code according to coding rules 2016-09-27 09:36:35 +02:00
Mark 0cc88a1706 Bugfix in Initialize method of UmbracoMediaFile
GetExtension returns an empty string instead of null which causes the
substring to return an argumentoutofrange exception. Discovered this
when trying to use Save(HttpPostedFile file) and Save(HttpPostedFileBase
file), but since the temporary generated path didn't include an
extension, these methods always threw an exception
2016-09-27 09:08:56 +02:00
Darren Ferguson 78524398b7 U4-9012 The word "Oops" should probably be removed, because we can cancel publish by API, it may be deliberate. http://issues.umbraco.org/issue/U4-9012 2016-09-23 18:43:55 +01:00
bjarnef f97123015a Format package created date 2016-09-22 19:55:32 +02:00
bjarnef b1e6559f4d Change color of remove button to red 2016-09-22 19:29:32 +02:00
Sebastiaan Janssen 9d9c36b253 U4-9001 Health Check, HTTPS Configuration is missing a message when certificate is valid 2016-09-21 13:04:06 +02:00
Jakub Swietek 6d9a747b34 Added option to delete cell from a row 2016-09-21 13:00:02 +02:00
Jakub Swietek a28cd8a54f Changed row cell's minimum width to 1 2016-09-21 12:57:57 +02:00
Jakub Swietek 44ad842542 Added option to delete selected section from layout 2016-09-21 12:56:31 +02:00
Jakub Swietek 917e05a16c Changed section's minimum width to 1 2016-09-21 12:55:05 +02:00
Alexander Bryukhov e60d5c8f2c U4-8985 Label for row configurations in the grid editor 2016-09-20 20:39:31 +07:00
Warren Buckley 03f16dfb78 Merge pull request #1485 from umbraco/temp-U4-8986
U4-8986 Allowing for more complex settings of the applyTo configurati…
2016-09-20 10:40:48 +01:00
Claus c9106065fd config transform for nuget upgrade. 2016-09-20 09:12:44 +02:00
Warren Buckley 2c9e96406b Merge pull request #1486 from umbraco/temp-U4-8987
U4-8987 Grid editor radiobuttonlist in settings should allow prevalue…
2016-09-19 12:01:54 +01:00
Warren Buckley 21c7d6a667 Merge pull request #1484 from umbraco/temp-U4-8985
U4-8985 Label for row configurations in the grid editor
2016-09-19 10:45:22 +01:00
Warren Buckley e0f95f18d3 Small mod to ensure the copy for the updated warning is easier to read that modifying the label is OK to do so 2016-09-19 10:07:23 +01:00
Warren Buckley b9ffbe9a57 Merge pull request #1481 from umbraco/temp-U4-8924
U4-8924 Heath Check: Pingback to HTTPS uses wrong protocol
2016-09-19 09:11:38 +01:00
Sebastiaan Janssen dc9b2b3ca8 Fix the ClickJackingCheck to make sure it adds an "s" to "http" when SSL is enforced or site is running on port 443 2016-09-19 09:44:03 +02:00
Claus baafa604fe Merge pull request #1448 from abjerner/patch-11
The p in picker should be uppercase
2016-09-17 14:34:04 +02:00
Claus e79bfebb76 U4-8987 Grid editor radiobuttonlist in settings should allow prevalues to have a label 2016-09-17 14:01:58 +02:00
Claus 131fdab675 U4-8986 Allowing for more complex settings of the applyTo configuration for grid editor. 2016-09-17 12:35:49 +02:00
Claus efc2a8e2ea U4-8985 Label for row configurations in the grid editor 2016-09-16 23:20:47 +02:00
Claus d725f1362f U4-8984 Upgrade AutoMapper to latest 3.x 2016-09-16 21:23:31 +02:00
Claus e79427619b Revert "U4-8984 Upgrade AutoMapper to latest 3.x"
This reverts commit 4887302b51.
2016-09-16 21:22:35 +02:00
Claus 4887302b51 U4-8984 Upgrade AutoMapper to latest 3.x 2016-09-16 21:21:14 +02:00
Warren Buckley aea735f20e Merge pull request #1441 from umbraco/temp-U4-8866
U4-8866 Deleting a parent document type fails if any documents using …
2016-09-16 15:46:50 +01:00
Warren Buckley 7a34b490c7 Merge pull request #1468 from umbraco/temp-u4-8954
U4-8954 - fix WhereIn issue with non-value-types
2016-09-16 11:37:12 +01:00
Warren Buckley 8091d9a098 Resetting UmbracoSettings file in this PR back to what it was previously - seems to have been committed by mistake 2016-09-16 11:04:50 +01:00
Sebastiaan Janssen e2e6440109 Merge pull request #1482 from romanlytvyn/temp-u4-8956
U4-8956 PublicAccessEntry.ClearRules() triggers an unhandled exception
2016-09-16 09:49:54 +02:00
Roman Lytvyn caffb36ec2 U4-8956 PublicAccessEntry.ClearRules() triggers an unhandled exception
fixed System.InvalidOperationException (Collection was modified;
enumeration operation may not execute.) by reverse iterating the
collection.
2016-09-16 10:35:14 +03:00
Sebastiaan Janssen 0d054de6ac U4-8924 Heath Check: Pingback to HTTPS uses wrong protocol 2016-09-15 17:37:42 +02:00
Warren Buckley 5397f2c53a Merge pull request #1447 from umbraco/temp-u4-8906
U4-8906 - optimize member perfs
2016-09-15 15:14:34 +01:00
Warren Buckley 61b11025bd Merge pull request #1476 from umbraco/temp-U4-8966
U4-8966 Unable to uninstall Umbraco Forms - The relative virtual path…
2016-09-15 13:40:48 +01:00
Claus 8c8a0160a1 U4-7705 Media Picker does not render when image has been deleted
refixing - seems to have been left out in a merge somewhere.
2016-09-14 08:43:32 +02:00
Asbjørn Riis-Knudsen cbd980357b Fix U4-8968: Add missing check for backoffice session in ClaimsIdentity (like the comment says) 2016-09-13 22:36:14 +02:00
Sebastiaan Janssen 8b37f1dc6c Really cleaned up all of the other unneeded usings now... 2016-09-12 23:29:34 +02:00
Sebastiaan Janssen 6ec7028fe8 No need to add umbraco.Utils.. also cleaned up all of the other unneeded usings 2016-09-12 23:26:39 +02:00
Sebastiaan Janssen 14c0055899 U4-8966 Unable to uninstall Umbraco Forms - The relative virtual path 'bin/Umbraco.Forms.Core.dll' is not allowed here. 2016-09-12 23:24:01 +02:00
Claus e0981f1c44 Merge pull request #1475 from umbraco/temp-U4-8965
U4-8965 Updates for ImageProcessor parameters to support new crop mod…
2016-09-12 13:36:24 +02:00
Claus 2ca7304215 Merge pull request #1444 from Jeavon/u4-8876
Update ImageCropMode & ImageCropAnchor enums with options available i…
2016-09-12 13:33:03 +02:00
Claus 88f8052573 U4-8965 Updates for ImageProcessor parameters to support new crop modes in v. 4.4.0 2016-09-12 12:51:48 +02:00
Stephan 5afeb315ba U4-8954 - rename file 2016-09-08 10:39:56 +02:00
Stephan c2eeff6e47 U4-8954 - fix WhereIn issue with non-value-types 2016-09-08 10:37:03 +02:00
Shannon 893c2a99be adds some comments 2016-09-08 09:30:13 +02:00
AndyButland 9da18d0697 Used configurable application URL when constructing password reset link 2016-09-06 08:42:53 +02:00
Alexander Bryukhov 3bb991edd3 Missing key 'signInWith' added 2016-09-06 11:52:19 +07:00
Alexander Bryukhov dd0373b855 Localizing URL tracker dashboard 2016-09-06 11:36:00 +07:00
Shannon Deminick 48786fcae1 Merge pull request #1464 from umbraco/temp-U4-8939
Temp u4 8939
2016-09-05 15:11:23 +02:00
Sebastiaan Janssen 28b4945d36 No longer need this now that it's part of JsJQueryCore 2016-09-05 14:59:22 +02:00
Sebastiaan Janssen 4a5314d8b9 No longer need this now that it's part of JsJQueryCore 2016-09-05 14:56:06 +02:00
Shannon Deminick c67adcc43f Merge pull request #1463 from umbraco/temp-U4-8939
U4-8939 Old openContentPicker() method is failing
2016-09-05 14:51:29 +02:00
Sebastiaan Janssen 0a43fea1c0 U4-8939 Old openContentPicker() method is failing
Adding jquery-migrate to make sure legacy applications keep working
2016-09-05 14:42:45 +02:00
Sebastiaan Janssen a20b7f9303 Merge pull request #1457 from umbraco/temp-u4-8917
U4-8719 - bugfix the redirect dashboard
2016-09-05 12:48:30 +02:00
Stephan 5b9b6be383 Merge pull request #1455 from abjerner/patch-12
Added support for progress bar/list for when uploading a single file
2016-09-05 12:22:54 +02:00
Stephan fce0a4b0eb U4-8937 - cleanup 2016-09-05 12:20:05 +02:00
Stephan 381de750e7 Merge branch 'U4-8937' of https://github.com/SayTen/Umbraco-CMS into temp-u4-8937 2016-09-05 11:44:06 +02:00
Stephan 40f6de950c Merge pull request #1460 from umbraco/temp-U4-8938
U4-8938 [OutputCache] headers changed from Cache-Control: public to p…
2016-09-05 11:35:58 +02:00
Stephan 916c350352 Merge pull request #1461 from umbraco/temp-U4-8898
U4-8898 Blank login screen after upgrade to 7.5.x
2016-09-05 11:30:48 +02:00
Sebastiaan Janssen 4186791d9a Removing this reference for now, doesn't seem like the best way to reference a dll and the sln build fine without this 2016-09-04 13:13:45 +02:00
Sebastiaan Janssen 02cef43815 Localizing the URL tracker dashboard 2016-09-04 13:09:37 +02:00
Sebastiaan Janssen 8d291efedd In the spirit of DRY: centralized IsAdmin() check in an extension method
Made sure that non-admins can't trigger the enable/disable URL tracker endpoint
Renamed "admin" in GetEnableState to "isUserAdmin" for clarity
2016-09-04 11:44:16 +02:00
Sebastiaan Janssen a5c8052439 Better error message when package install fails 2016-09-03 13:55:54 +02:00
Sebastiaan Janssen 704169abab Merge branch 'refs/heads/dev-v7' into temp-U4-8889 2016-09-03 13:27:31 +02:00
Sebastiaan Janssen 8ee8b52832 Bumps version 2016-09-03 13:26:40 +02:00
Sebastiaan Janssen 81819aa3b7 Merge branch 'refs/heads/master-v7' into dev-v7 2016-09-03 13:25:02 +02:00
Sebastiaan Janssen 90ffae5526 Adds back some try-catches that were previously removed so we can actually log the errors 2016-09-03 13:23:32 +02:00
Sebastiaan Janssen a3c99531bf U4-8898 Blank login screen after upgrade to 7.5.x
Moves the updating of the CDF version to the very beginning before we even redirect to the login screen so it is nicely cachebusted
2016-09-03 10:23:17 +02:00
Sebastiaan Janssen 1b6bf2f331 U4-8938 [OutputCache] headers changed from Cache-Control: public to private 2016-09-03 10:16:34 +02:00
Per Ploug f5d18157bf resource to load dashboard data 2016-09-02 16:27:40 +02:00
Per Ploug 7c7dd0736e DashboardBoard to render remote grid data
- Includes offline mode
- loading state
- replaces content with data loaded from dashboard.umbraco.org
2016-09-02 16:27:30 +02:00
Per Ploug 0a5cd9f113 Change dashboardcontroller to UmbracoApiController
- Enables us to proxy css through the local server without a token on
the css request
- Adds method to load remote grid json
- Adds method to load remote grid css
2016-09-02 16:26:47 +02:00
Matt Cheale 9b498b8471 U4-8937 ContentController.PostSort is not honouring the passed sorted ids.
* Updates media to content for comments and logging.
* Adds sorting of the retrieved content items to match the passed sort order before persisting.
2016-09-02 14:50:54 +01:00
Stephan fee217e8d7 U4-8719 - minor fix 2016-09-02 15:01:58 +02:00
Stephan c05a28a901 U4-8719 - bugfix the redirect dashboard, move to content section 2016-09-02 14:54:18 +02:00
Stephan fa45cd1a88 tmp 2016-09-02 14:44:16 +02:00
Simon Busborg 6cb5331918 Fixed mistake where :not was applied to every umb-table-cell 2016-09-02 14:37:31 +02:00
Simon Busborg fca865a743 Fixed Redirects UI.. Added flex-box basis utility, removed date and edit button 2016-09-02 14:33:07 +02:00
Anders Bjerner 1f313b9487 Added support for progress bar/list for when uploading a single file 2016-09-02 11:39:16 +02:00
Stephan 85d243508c Merge pull request #1453 from umbraco/temp-U4-8923
U4-8923 Adding new property to media breaks ability to save
2016-09-01 15:55:48 +02:00
Stephan 365da75d1b U4-8698 - fix notification service perfs issues 2016-09-01 15:25:40 +02:00
Sebastiaan Janssen a74feab9eb U4-8923 Adding new property to media breaks ability to save
If you add a new property to a member or media type and then try to update an
existing media item/member ContentRepository didn't have this problem because
it was already using the additional if statement that has now also been added to
MemberRepository and MediaRepository
2016-09-01 15:15:47 +02:00
Sebastiaan Janssen ae591d4883 U4-8889 Package install fails
Fixes one of the problems with installing packages (when 1 file needs to be copied to multiple places) and adds better logging for other potential problems
2016-09-01 14:19:12 +02:00
Stephan 3489bf22bb U4-8698 - fix notification service perfs issues 2016-09-01 12:15:03 +02:00
Stephan 9e82b8d693 U4-8906 - optimize member perfs 2016-09-01 12:11:12 +02:00
Claus 71482f0fc9 U4-8584 Starterkit thumbnails are not really thumbnails
updating url for thumbnails in the "new" starterkit code - seems we forgot those and only updated the legacy installer.
2016-08-29 08:54:01 +02:00
Anders Bjerner 8216fa1d88 The p in picker should be uppercase 2016-08-26 21:49:10 +02:00
Stephan 4133574db0 U4-8906 - optimize member perfs 2016-08-26 15:30:24 +02:00
Sebastiaan Janssen af5455a500 Bumps version 2016-08-23 10:52:29 +02:00
Sebastiaan Janssen be57692a62 Change some event handlers back to .live instead of .on
#U4-8884 Fixed
2016-08-23 10:48:15 +02:00
Sebastiaan Janssen 460d884109 Update the companion PermissionEditor.aspx file too 2016-08-23 10:48:15 +02:00
Sebastiaan Janssen 1a1a3c43ca Merge pull request #1446 from or321/or321-patch-1
Update UmbracoCms.nuspec
2016-08-23 10:40:10 +02:00
or321 6df6b87c4c Update UmbracoCms.nuspec
Update Newtonsoft.Json dependency to allow version 9.0.1 . This will match the same change in UmbracoCms.Core.nuspec file
2016-08-23 11:01:21 +03:00
Sebastiaan Janssen 172895f17f U4-8884 Users editor doesn't work any more in 7.5.0
#U4-8884 Fixed
2016-08-22 15:18:04 +02:00
Simon Busborg 8d3add8834 Fixes: U4-8878 Text in grid items in reorder-mode is now right aligned 2016-08-22 09:10:05 +02:00
Sebastiaan Janssen ae257550da Update README.md 2016-08-21 15:33:08 +02:00
Sebastiaan Janssen 4653746117 Correct notation of path/name combo 2016-08-21 11:06:25 +02:00
Sebastiaan Janssen 84bd22190b Use names artifacts 2016-08-21 10:58:57 +02:00
Sebastiaan Janssen 5e58e0d0a5 Wrong artifact filter 2016-08-20 16:05:46 +02:00
Sebastiaan Janssen 8b2fa22b90 Attempt to have dev-v7 builds deploy to nightlies 2016-08-20 15:49:21 +02:00
Sebastiaan Janssen f76fd360f1 Bumps version 2016-08-20 10:29:49 +02:00
Jeavon bc9a6abccf Update ImageCropMode & ImageCropAnchor enums with options available in ImageProcessor v4.4+ 2016-08-19 16:14:56 +01:00
Sebastiaan Janssen 39ebb9545d Merge pull request #1442 from umbraco/temp-U4-8868
U4-8868 Ensuring all usages of .live() is updated
2016-08-18 15:32:03 +02:00
Sebastiaan Janssen 6572eea915 Merge pull request #1443 from jannikanker/jannikanker-U4-8867
U4-8867 (IFRAME casing typos)
2016-08-18 13:05:14 +02:00
Jannik Anker 99ad5d6826 Update en_us.xml 2016-08-18 12:57:17 +02:00
Jannik Anker 2a1697b0a3 Update en.xml 2016-08-18 12:55:37 +02:00
Jannik Anker 583a09260e Update ClickJackingCheck.cs 2016-08-18 12:52:34 +02:00
Claus 344dab65d4 U4-8868 Ensuring all usages of .live() is updated
changed .on bind handlers to use .live instead.
removed an old jquery.1.4.4 which seems unreferenced and unused in the whole project.
2016-08-18 12:45:15 +02:00
Claus 9f5a9f179f U4-8866 Deleting a parent document type fails if any documents using a child document type exist
ensures that we also manually delete content of any child content type being deleted, instead of only deleting content of the actual content type sent for delete.
2016-08-18 11:17:05 +02:00
Sebastiaan Janssen f658613fad Update README.md 2016-08-18 10:14:12 +02:00
Claus 1216f4a49e Merge pull request #1436 from umbraco/temp-u4-8856
U4-8856 - don't flood log with media errors
2016-08-17 10:52:02 +02:00
Sebastiaan Janssen 460e72fc1f Dealing with quirky trees.configs 2016-08-16 16:03:50 +02:00
Stephan 908c8837e9 U4-8856 - don't flood log with media errors 2016-08-16 15:41:52 +02:00
Sebastiaan Janssen 11c720cc2a Fixes trees config transform to work with versions older than 7.4 too 2016-08-16 14:39:52 +02:00
Sebastiaan Janssen c93b4fa1fe Reverts: Makes sure the build uses a predictable version of npm 2016-08-16 14:39:52 +02:00
Stephan d409d17189 U4-8813 - bugfix 2016-08-16 14:36:18 +02:00
Stephan 38c876bb53 Revert "U4-8813 - bugfix"
This reverts commit 95fb7f97d0.
2016-08-16 14:35:31 +02:00
Stephan 95fb7f97d0 U4-8813 - bugfix 2016-08-16 14:30:19 +02:00
Sebastiaan Janssen 9dfa9e2fb6 Bump the version 2016-08-16 13:37:05 +02:00
Sebastiaan Janssen 6ee8382ff3 Makes sure the build uses a predictable version of npm 2016-08-16 13:35:40 +02:00
Claus 69fb5e9932 Merge branch 'abjerner-patch-10' into dev-v7 2016-08-16 13:28:27 +02:00
Claus ca9f3bbd5a updating various references to use examine constants. 2016-08-16 13:27:46 +02:00
Claus fe7efa4fba Merge branch 'patch-10' of git://github.com/abjerner/Umbraco-CMS into abjerner-patch-10 2016-08-16 13:11:34 +02:00
Sebastiaan Janssen 1ec2cc430b Merge pull request #1429 from bjarnef/dev-v7-U4-8844
Set border radius for modal to zero.
2016-08-16 13:10:51 +02:00
Sebastiaan Janssen c1a8ea9df3 Merge pull request #1433 from umbraco/temp-U4-8850
U4-8850 Configuring a custom BackOfficeUserManager type will not work if the type is not specifically BackOfficeUserManager
2016-08-16 13:09:50 +02:00
Stephan cd2c79e7d5 U4-8813 - cleanup 2016-08-16 12:45:10 +02:00
Claus d5d0a958d3 removed console.logs 2016-08-16 11:45:42 +02:00
Mads Rasmussen 9e9e51cf29 Merge pull request #1432 from theotron/U4-8845
U4-8845 - Prevents double-click on confirm delete from deleting from bin
2016-08-16 09:50:47 +02:00
Sebastiaan Janssen 808793edd8 Updating to latest ImageProcessor 2016-08-16 09:35:05 +02:00
Sebastiaan Janssen 3895a93b61 Replaces the old packages tree item with the new one and puts it at the top 2016-08-16 09:35:05 +02:00
Shannon eadb9ba276 Merge branch 'refs/heads/dev-v7' into temp-U4-8850 2016-08-12 17:08:05 +02:00
Shannon fc582b0516 adds db schema check to validate if 7.4 has been installed, changes the versions detected to only be minor versions (they shouldn't have indicated build versions), updates code to not use deprecated methods 2016-08-12 16:54:24 +02:00
Shannon Deminick 432fac7dc9 Merge pull request #1430 from umbraco/temp-U4-8849
Fixes: U4-8849 301 Url tracker - When deleting last item on a page th…
2016-08-12 16:40:49 +02:00
Sebastiaan Janssen fad69046df Don't ship with the test-baseUrl 2016-08-12 16:38:48 +02:00
Shannon 6bcadfea44 Removes the explicit castings to (BackOfficeUserManager) since that isn't actually the base class! The base class is BackOfficeUserManager<BackOfficeIdentityUser>, all of this identity stuff is a bit of a generics nightmare but that also do to the generic nightmare that is OWIN. Moves more logic to the base class so it can be used by sub classes, fixes the base class to use a generic user type 2016-08-12 16:17:14 +02:00
theotron a3c457e50b Fixes U4-8845 - Double-click on confirm delete, deletes from bin as well
http://issues.umbraco.org/issue/U4-8845
2016-08-12 14:39:12 +01:00
Sebastiaan Janssen b2a56fa58f Merge branch 'ugurcelenk-dev-v7' into dev-v7 2016-08-12 14:19:09 +02:00
Sebastiaan Janssen f97c20253a Turkish Language file updated #1431 2016-08-12 14:18:50 +02:00
Ugur Celenk 51f57eb5ce Turkish Language file updated 2016-08-12 14:58:10 +03:00
Sebastiaan Janssen 54e82f9ed1 Fix nasty typo 2016-08-12 12:25:58 +02:00
Shannon 2ff3ce933b U4-8850 Configuring a custom BackOfficeUserManager type will not work if the type is not specifically BackOfficeUserManager 2016-08-12 12:20:00 +02:00
Mads Rasmussen 1c15daca52 Fixes: U4-8849 301 Url tracker - When deleting last item on a page the url tracker should check for new results. 2016-08-12 10:49:20 +02:00
Shannon de2d4bef13 Ensure the current umbraco version is passed up to Our for the new packaging section 2016-08-12 10:19:08 +02:00
bjarnef 8c6f56d3f5 Set border radius for modal to zero. 2016-08-11 18:46:01 +02:00
Sebastiaan Janssen 2f0b26db47 Merge pull request #1428 from umbraco/temp-U4-8841
U4-8841 Scheduled publishing in 7.5.0-latest has some problems
2016-08-11 17:37:16 +02:00
Shannon 1fd020a0f2 adds better debug logging to scheduled publishing 2016-08-11 14:33:10 +02:00
Shannon e12c294150 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-11 14:06:49 +02:00
Shannon 8d1d394ded Adds latest stable Examine version 2016-08-11 14:06:38 +02:00
Claus 3274965c34 typo 2016-08-11 12:43:12 +02:00
Claus 54fb1c6231 fixes the offsetting not being applied when loading the datepicker. 2016-08-11 11:22:50 +02:00
Morten Christensen d3ff1cbba9 Merge pull request #1426 from umbraco/temp-U4-8671
U4-8671 Media Types Missing in 7.4
2016-08-11 11:03:08 +02:00
Claus f4072bc975 Merge branch 'update-site-count-installer' into dev-v7 2016-08-11 08:13:46 +02:00
paulsterling 31e0913488 Updating number for current sites to 360 000 2016-08-10 14:49:30 -07:00
Claus f55e673632 adding a few tests for U4-8567. 2016-08-10 14:58:55 +02:00
Shannon f1087fce3c Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-10 14:41:09 +02:00
Shannon 5620074790 U4-8718 Latest ClientDependency release 2016-08-10 14:40:54 +02:00
Claus 600d7be2ac U4-8567 UmbracoHelper.CreateEncryptedRouteString fails to parse additionalRouteVals when it is of type Dictionary<string, object> 2016-08-10 13:45:06 +02:00
Claus 596888a8f6 Revert "Revert "U4-8833 The default sorting field for the member list view should be LoginName not Name""
This reverts commit d355d2609a.
2016-08-10 12:58:41 +02:00
Claus 0f0a0a186c U4-8838 Media type list has issues 2016-08-10 12:13:03 +02:00
Sebastiaan Janssen 200f0bb67e Don't add the Get Started panel back on upgrades 2016-08-10 11:59:35 +02:00
Sebastiaan Janssen af1be7f32f Insert <areas> if they're missing 2016-08-10 11:59:35 +02:00
Shannon d355d2609a Revert "U4-8833 The default sorting field for the member list view should be LoginName not Name" 2016-08-10 11:42:58 +02:00
Shannon 06da9f4f7d Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-10 11:42:12 +02:00
Shannon 5bd5bf87ad Fixes the search sorting for the packages section against our 2016-08-10 11:41:58 +02:00
Claus db78e26647 U4-8833 The default sorting field for the member list view should be LoginName not Name
correcting LoginName to username.
2016-08-10 11:23:46 +02:00
Claus a2adfe4798 Merge pull request #1425 from umbraco/temp-U4-8830
Fixes: U4-8830 Redirect url dashboard - add confirm dialog when remov…
2016-08-10 10:58:25 +02:00
Claus a7b19e1acf Merge pull request #1424 from umbraco/temp-U4-8825
Fixes: U4-8825 Show SVG preview in media picker
2016-08-10 10:47:35 +02:00
Claus a92aa6ad9a fixed up a comment and some cleanup. 2016-08-10 10:04:47 +02:00
Claus 154e4a19a5 cleaning and formatting. 2016-08-10 10:01:04 +02:00
Claus 0142bc61bc U4-8671 Media Types Missing in 7.4
renders child nodes in media type tree.
fixed up the context menus returned on nodes so you can create children if not disabled in config.
2016-08-10 09:56:28 +02:00
Shannon d99a691bdc Changes magic strings to constants for database provider types. 2016-08-09 15:36:02 +02:00
Shannon 10422079b6 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-09 15:33:49 +02:00
Shannon c1da28dd47 U4-8837 Change paging query for SQL server 2012+ to be more efficient 2016-08-09 15:33:35 +02:00
Sebastiaan Janssen 2018dab869 Fixed deprecation warning with moment.js 2016-08-09 15:32:17 +02:00
Shannon 5b88f35471 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-09 15:30:54 +02:00
Shannon 2ee71ecb96 U4-8833 The default sorting field for the member list view should be LoginName not Name 2016-08-09 15:30:43 +02:00
Mads Rasmussen 213a25e3fe fixes: U4-8836 Add empty state to content and member list view 2016-08-09 14:27:48 +02:00
Sebastiaan Janssen 14b527a9fa Makes sure the redirect dashboard is added in zip and for NuGet upgrades
Also adds healthcheck for NuGet upgrades
2016-08-09 14:12:28 +02:00
Shannon 2d25c4dad5 deletes tests to attempt to test the sorting issue: U4-8831 which didn't work because it's on sql ce 2016-08-09 14:01:18 +02:00
Shannon 8bdf0924de Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into dev-v7 2016-08-09 13:59:00 +02:00
Shannon 1b85163a7f U4-8831 Paging logic is flawed when ordering by a potentially non-unique value 2016-08-09 13:58:53 +02:00
Shannon 634dfaaf75 U4-8833 The default sorting field for the member list view should be LoginName not Name 2016-08-09 13:55:41 +02:00
Claus 2279e6cc53 U4-8834 Removing code assigning PropertyData IDs for new properties even though it isn't used 2016-08-09 13:39:40 +02:00
Mads Rasmussen 82c5b91deb Fixes: U4-8832 Remove custom styling of pagination on list views 2016-08-09 13:30:19 +02:00
Shannon 9d2efdfb37 Adds test to confirm bug U4-8831 2016-08-09 12:47:14 +02:00
Mads Rasmussen 952cfc6d5f Fixes: U4-8830 Redirect url dashboard - add confirm dialog when removing redirect 2016-08-09 12:13:56 +02:00
Mads Rasmussen ff2311d19c bring back the checkered background for white images 2016-08-09 12:02:30 +02:00
Mads Rasmussen ef64098f4e remove checkered background from picked media 2016-08-09 10:34:47 +02:00
Mads Rasmussen 611acf8cea Show SVG preview in picked media 2016-08-09 10:34:27 +02:00
Shannon 910e6b7a64 U4-8766 v7.5.0-beta2 exception from Examine Grid Indexer 2016-08-09 09:40:29 +02:00
Sebastiaan Janssen bffd9c340d Wrong parameter name being sent to the RedirectUrlManagementController 2016-08-09 09:21:22 +02:00
Simon Busborg df116555ad fix search 2016-08-09 09:11:19 +02:00
Mads Rasmussen ca7e9c90b9 fixes: U4-8827 Add empty state for no search result and no added redirects to url redirects dashboard 2016-08-09 08:47:01 +02:00
Mads Rasmussen 65fc23dadc Fixes: U4-8828 Redirect urls dashboard - when search field has focus and enter is pressed the first redirect gets deleted 2016-08-09 08:44:45 +02:00
Sebastiaan Janssen 3ac7512a98 Merge pull request #1116 from rpjengaard/patch-1
Update da.xml
2016-08-08 17:23:20 +02:00
Sebastiaan Janssen a553fabce4 Merge pull request #1262 from umbraco/UmbracoCMS-Settings-Dashboard
Fixed issue: U4-8435 so the link is correct in settingsdashboardintro…
2016-08-08 17:07:55 +02:00
Sebastiaan Janssen 2a2453a969 Merge pull request #1283 from jbreuer/patch-1
Fix for U4-8510
2016-08-08 17:06:21 +02:00
Sebastiaan Janssen f4711a4473 Merge pull request #1340 from bjarnef/dev-v7-U4-8608
Document getByQuery
2016-08-08 17:02:53 +02:00
Sebastiaan Janssen 2069c585fb Merge branch 'temp-U4-8802' into dev-v7
# Conflicts:
#	src/Umbraco.Web/Routing/RedirectTrackingEventHandler.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
2016-08-08 16:49:10 +02:00
Mads Rasmussen 045374993f Fixes: U4-8821 Prevent random form submits from healthcheck dashboard 2016-08-08 15:12:42 +02:00
Sebastiaan Janssen 57923866ed Merge pull request #1419 from umbraco/temp-U4-8813
U4-8813 RedirectTrackingEventhandler always iterates over all descend…
2016-08-08 14:59:58 +02:00
Shannon bf61956b7f oops fixes build 2016-08-08 14:48:05 +02:00
Shannon 9ad84a7eab fixes repository mapping the GUID id for redirect urls and removes unused properties 2016-08-08 14:47:48 +02:00
Shannon 4301af108f Merge branch 'temp-U4-8802' of https://github.com/umbraco/Umbraco-CMS into temp-U4-8802
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html
#	src/Umbraco.Web/Editors/RedirectUrlManagementController.cs
2016-08-08 14:42:07 +02:00
Shannon c331ba134a Fixes 301 redirect js naming conventions, fixes URL handling, moves c# classes to the correct/constistent namespaces, fixes up models and N+1 requests, adds model mapping to not return the business logic model, adds controller method to check if it's enabled instead of returning the result as part of the search. 2016-08-08 14:40:53 +02:00
Mads Rasmussen 7d4e547b8d Fixes: U4-8820 Healthcheck dashboard should validate input for notification email 2016-08-08 14:30:59 +02:00
Mads Rasmussen cbd20cb9b3 Merge pull request #1406 from arknu/U4-8749
U4-8749: Allow default sort order to be custom properties
2016-08-08 14:01:53 +02:00
Claus 3170d6829a browser object null check in jquery.ba-bbq.min. 2016-08-08 13:26:21 +02:00
Claus 55752abdcf fixing InsertMacroSplitButton typo in jquery selector causing javascript errors.
fixing modal $.browser checks to not cause console errors due to deprecated browser object in jquery 1.9+.
2016-08-08 13:23:46 +02:00
Sebastiaan Janssen 69c952ddda Don't use HttpContext 2016-08-08 13:10:32 +02:00
Simon Busborg 4ff728b62a added target blank so it opens in another tab 2016-08-08 12:55:52 +02:00
Shannon Deminick 1b9a3e8ebc Merge pull request #1423 from abryukhov/patch-3
Update UI language ru.xml * dev-v7-U4-8597 - Social login form key added
2016-08-08 12:22:11 +02:00
Shannon fee4a84c66 Revert temp commit, adds logic to check if the segment value has changed + lots of notes 2016-08-08 12:19:03 +02:00
Shannon ad2a644bdf temp save to track history since i need to roll this back 2016-08-08 12:07:43 +02:00
Sebastiaan Janssen f4b0700528 Merge branch 'temp-U4-8802' of https://github.com/umbraco/Umbraco-CMS into temp-U4-8802 2016-08-08 12:00:14 +02:00
Sebastiaan Janssen 126c358546 Fixes build and use Guid where necessary 2016-08-08 11:57:48 +02:00
Alexander Bryukhov f316393955 Update UI language ru.xml 2016-08-08 16:41:19 +07:00
Simon Busborg 80d579891b Removes search when disabled 2016-08-08 11:33:56 +02:00
Claus bfc2e6f666 Merge branch 'bjarnef-dev-v7-U4-8597' into dev-v7 2016-08-08 11:32:02 +02:00
Claus c3035f26a7 Merge branch 'dev-v7-U4-8597' of git://github.com/bjarnef/Umbraco-CMS into bjarnef-dev-v7-U4-8597
Conflicts:
	src/Umbraco.Web.UI/umbraco/config/lang/da.xml
2016-08-08 11:31:29 +02:00
Sebastiaan Janssen b2e03dcc1b Merge branch 'refs/heads/dev-v7' into temp-U4-8802 2016-08-08 11:31:16 +02:00
Mads Rasmussen 97a765d6af Merge branch 'bjarnef-dev-v7-U4-8580' into dev-v7 2016-08-08 11:28:07 +02:00
Mads Rasmussen 67430392e3 Change object to img to make it render in Edge 2016-08-08 11:22:16 +02:00
Sebastiaan Janssen 6560f752d6 Merge branch 'refs/heads/dev-v7' into temp-U4-8802 2016-08-08 11:21:19 +02:00
Claus e02575830f Merge pull request #1420 from umbraco/temp-U4-8816
U4-8816 Update to jQuery  2.2.4
2016-08-08 11:00:47 +02:00
Shannon Deminick a838d20c3e Merge pull request #1422 from abryukhov/patch-9
Update UI language ru.xml
2016-08-08 10:57:22 +02:00
Alexander Bryukhov 081284bc62 Update UI language ru.xml
1. Duplicated 'prompt' area removed
2. Several typos corrected
2016-08-08 15:48:14 +07:00
Claus 9e9c1ad030 Merge pull request #1418 from drpeck/dev-v7
U4-8814 - HTml.Wrap adds children twice
2016-08-08 10:45:35 +02:00
Simon Busborg 32d48b12d1 Changed button when inactive, added class to toggle when table in inactive 2016-08-08 10:36:10 +02:00
Claus b4b91f0fef Merge branch 'pynej-sql-repalce' into dev-v7 2016-08-08 10:19:35 +02:00
Claus cbf67a4399 changing to Debug.Print. 2016-08-08 10:18:44 +02:00
Claus f58e0dc08e Merge branch 'sql-repalce' of git://github.com/pynej/Umbraco-CMS into pynej-sql-repalce 2016-08-08 09:58:39 +02:00
Shannon Deminick e449c237be Merge pull request #1421 from abryukhov/patch-8
Update UI language ru-RU.xml
2016-08-08 09:40:51 +02:00
Shannon Deminick 1dae6724cc Merge pull request #1227 from abryukhov/patch-6
Update UI language ru.xml
2016-08-08 09:40:20 +02:00
Simon Busborg a28c52aa16 Added styling to url list 2016-08-08 09:36:10 +02:00
Mads Rasmussen 26708ae82b Merge branch 'dev-v7-U4-8580' of git://github.com/bjarnef/Umbraco-CMS into bjarnef-dev-v7-U4-8580 2016-08-08 09:20:32 +02:00
Alexander Bryukhov 809970bc2e Update UI language ru-RU.xml
New 'bulk' area and few more corrections
2016-08-07 14:06:16 +07:00
Mads Rasmussen 27d041c055 Merge pull request #1416 from bjarnef/dev-v7-U4-8765-fix
Open documentation link in new browser window/tab
2016-08-05 21:36:27 +02:00
Shannon 7bf3d04a25 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-05 19:29:10 +02:00
Shannon 87934e52dc obsoletes strange IsGuid and changes logic to use what .Net does instead of regex in case others are using this. 2016-08-05 19:28:46 +02:00
Shannon 4022c3cec9 U4-8816 Update to jQuery 2.2.4 2016-08-05 19:15:11 +02:00
Shannon 816107a348 U4-8813 RedirectTrackingEventhandler always iterates over all descendants
fixes SHA1 hashing (moves to a ext method), fixes col length for new db for the redirect table, updates migration len to 40 to store the correct hash format, don't iterate descendents if there's nothing changed, fixes issue with RedirectTrackingEventHandler with regards to operating outside of a web request (i.e. console app)
2016-08-05 18:55:48 +02:00
Sebastiaan Janssen aedba40b54 Updates language file to specify which integrity check we're looking at. Quotes all table names correctly. Updates description for the check. 2016-08-05 18:03:05 +02:00
Shannon 31b17e3048 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-05 17:41:13 +02:00
Shannon 42666403a6 Fixes regression issue with building the xml cache file, moves the logic to query and build the xml document for the cache to the repository level. 2016-08-05 17:41:00 +02:00
Mads Rasmussen aa66fd6e33 rewrite controller as vm + refactor controller to follow angular style guide 2016-08-05 16:59:03 +02:00
Sebastiaan Janssen 19325ac522 Fixes the build 2016-08-05 14:44:37 +02:00
Mads Rasmussen b8b30bdc6e make resource for all redirect url end points 2016-08-05 14:35:58 +02:00
Claus 69b6044bc6 fixing null check on UmbracoContext.Current in RedirectTrackingEventHandler's PageCacheRefresher_CacheUpdated. 2016-08-05 14:01:25 +02:00
Sebastiaan Janssen 18a1aa2f6f Merge pull request #1413 from umbraco/temp-U4-8530
U4-8530 Make it possbile to hide preview button by DocumentType or ContentItem
2016-08-05 13:18:29 +02:00
Shannon 92f7782ab9 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-05 13:06:49 +02:00
Shannon 3e932ecf3f fixes icon and author urls for local package install 2016-08-05 13:06:35 +02:00
Sebastiaan Janssen dd62a917fd Merge pull request #1411 from umbraco/temp-U4-8808
U4-8808 Fixing up 301 redirects
2016-08-05 13:06:18 +02:00
Sebastiaan Janssen 958e20356c Merge pull request #1412 from umbraco/temp-U4-8786
U4-8786 Member search in listview returns error (7.5-beta2)
2016-08-05 13:04:42 +02:00
Mads Rasmussen 1f8dc9a424 move dashboard from App_Plugins to dashboards folder 2016-08-05 12:36:10 +02:00
Shannon 539637720f Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-05 12:31:00 +02:00
Shannon 6a3f146da1 Fixes health check index & throbber while fixing, fixes xml data integrity check to check for invalid XML that doesn't contain a GUID 2016-08-05 12:29:05 +02:00
David Peck 7fe7f88c98 Merge pull request #1 from drpeck/U4-8814
Children added to HtmlTagWrapper twice
2016-08-05 11:14:53 +01:00
David Peck 774f00d4f5 Children added to HtmlTagWrapper twice
By calling the overload on line 884 the children are added. To do it again results in the children being added twice.
2016-08-05 11:14:01 +01:00
Sebastiaan Janssen aab2c65aaa Merge pull request #1417 from umbraco/temp-U4-8156
U4-8156 Support minimum versions for Umbraco packages
2016-08-05 11:58:38 +02:00
Sebastiaan Janssen 3dcba7a6b0 urlHash column has to be 20 chars because SHA1 uses more bytes than MD5 2016-08-05 11:51:08 +02:00
Sebastiaan Janssen 3ece30bd8b Don't let the event handlers kick in if Redirect Tracking is turned off in the config 2016-08-05 11:41:08 +02:00
Shannon 36a191464d ensures table name is quoted properly 2016-08-05 11:26:20 +02:00
Simon Busborg 9131b73cbb Merge pull request #1415 from bjarnef/dev-v7-U4-8809
Show only empty recycle bin text, when filter doesn't has a value
2016-08-05 11:14:44 +02:00
Simon Busborg 68b3ea349e Merge pull request #1414 from bjarnef/dev-v7-U4-8805
Ensure editing area use full height when it only has a little...
2016-08-05 10:53:13 +02:00
Mads Rasmussen 2f0ba3ac07 First part of html + js cleanup - use angular components in dashboard view + make js fit. 2016-08-05 10:51:32 +02:00
Claus 6c271d92f9 migration should only delete table if it is using a integer id, otherwise leave it alone. 2016-08-05 08:25:58 +02:00
bjarnef e1daa79bab Open documentation link in new browser window/tab 2016-08-04 22:35:55 +02:00
bjarnef a136235c72 Show only empty recycle bin text, when filter doesn't has a value 2016-08-04 21:10:31 +02:00
bjarnef e8e440516f Ensure editing area use full height when it only has a little or no content 2016-08-04 20:30:54 +02:00
Sebastiaan Janssen b2e7c7a8d4 More specific exception when a conversion fails 2016-08-04 19:18:52 +02:00
Shannon 2c15db5950 U4-8530 Make it possbile to hide preview button by DocumentType or ContentItem 2016-08-04 18:34:20 +02:00
Shannon 7ed240d510 Merge branch 'Phosworks-U4-8530' into temp-U4-8530 2016-08-04 18:09:00 +02:00
Shannon a91b8e0acf Merge branch 'U4-8530' of https://github.com/Phosworks/Umbraco-CMS into Phosworks-U4-8530 2016-08-04 18:08:27 +02:00
Shannon 0be81aa4e5 U4-8786 Member search in listview returns error (7.5-beta2) 2016-08-04 18:01:57 +02:00
Sebastiaan Janssen 221edc76cf Merge remote-tracking branch 'refs/remotes/origin/dev-v7' into temp-U4-8802 2016-08-04 17:49:42 +02:00
Sebastiaan Janssen 0280d832b5 Some fixing based on code review 2016-08-04 17:48:50 +02:00
Sebastiaan Janssen 875070fed8 File should not have been committed 2016-08-04 17:02:46 +02:00
Shannon 9d62b2f5f9 nuspec and nuget refs updated to latest Models Builder 2016-08-04 16:59:26 +02:00
Shannon Deminick 548c7845cb Merge pull request #1409 from umbraco/temp-U4-8779
U4-8779 Sorting not working in Members List View in 7.5 Beta2
2016-08-04 16:46:54 +02:00
Shannon 9c7052f0fd Fixed the property join for sorting on custom columns, this would have only worked if there were actual values in those columns, we fix this now with an outer join instead of an inner join 2016-08-04 16:46:46 +02:00
Sebastiaan Janssen 177b61bbf5 Merge pull request #1292 from darrenferguson/dev-v7
Fix U4-8532 - No built in Active Directory authentication in Umbraco
2016-08-04 16:25:22 +02:00
Sebastiaan Janssen 8038016b55 U4-8778 The "Link your xx account" button doesn't work because it's a form wrapped in a form 2016-08-04 15:58:19 +02:00
Claus ae0ad2becf switching to sha1 instead of md5. 2016-08-04 15:46:02 +02:00
Claus ba11de51e3 deleting through the recycle bin also deletes redirect urls. 2016-08-04 15:46:01 +02:00
Claus ccaa198e25 changing integer IDs to guid for RedirectUrls. 2016-08-04 15:46:01 +02:00
Claus 66c0d9dc12 removing migrations from solution 2016-08-04 15:45:58 +02:00
Claus 59c3d6a206 cleaning up migrations. we're deleting the table so no need to do a bunch of migration stuff instead of just compiling it into one migration deleting and creating the table again. 2016-08-04 15:45:58 +02:00
Shannon 0ab145e4ac Ensures that type="strict" is added to the package creation, does some null checking on the stylesheets packaging so ysod doesn't occur, some code formatting. 2016-08-04 15:33:26 +02:00
Shannon 423588d018 code formatting 2016-08-04 15:20:57 +02:00
Shannon Deminick 16afab86f3 Merge pull request #1407 from umbraco/temp-U4-8754
U4-8754 Single content queries like Get(int id) for content, media an…
2016-08-04 15:05:58 +02:00
Sebastiaan Janssen 43737e78fb Sorry about that! 2016-08-04 15:05:49 +02:00
Shannon Deminick f6943ceab4 Merge pull request #1408 from umbraco/temp-U4-8361-2
U4-8361 301 Url Tracking
2016-08-04 14:51:50 +02:00
Sebastiaan Janssen 6495077568 Whoops 2016-08-04 14:50:55 +02:00
Sebastiaan Janssen c61a9ee433 AppendCacheExtension needs to be AppendHeader 2016-08-04 14:46:07 +02:00
Sebastiaan Janssen b7264b58f9 Fixed the mapping for HasPublishedVersion 2016-08-04 12:19:24 +02:00
Sebastiaan Janssen ba5be0e22a Adds search function 2016-08-04 11:21:42 +02:00
Mads Rasmussen d8f68f5f9b Merge branch 'spacebetween-U4-7475-grid-tinymce-styles' into dev-v7 2016-08-04 10:32:30 +02:00
Mads Rasmussen b365a9944f Fix js errors for grunt to build 2016-08-04 10:29:36 +02:00
Simon Busborg 5b2bcdbfac Merge pull request #1399 from marcemarc/temp-u4-8772
Fixes  U4-8772, adds icon to published but changed listview items
2016-08-04 10:08:04 +02:00
Mads Rasmussen abb994cf30 Merge branch 'U4-7475-grid-tinymce-styles' of git://github.com/spacebetween/Umbraco-CMS into spacebetween-U4-7475-grid-tinymce-styles 2016-08-04 10:02:11 +02:00
Sebastiaan Janssen 6e480058b9 Adds R# rule to give a little hint when newing up a disposable 2016-08-04 09:46:48 +02:00
Simon Busborg 912a460bd8 Merge pull request #1353 from abjerner/patch-7
Added a tooltip with icon alias on mouseover
2016-08-04 09:35:38 +02:00
Sebastiaan Janssen 52d366bb6f MD5CryptoServiceProvider is disposable 2016-08-04 08:58:30 +02:00
Asbjørn Riis-Knudsen 2ddbca8861 U4-8749: Add a service to allow acces to prevalues from inline listview editor 2016-08-03 22:07:06 +02:00
Sebastiaan Janssen e66eefbbd7 Fixes unit test 2016-08-03 21:42:40 +02:00
Sebastiaan Janssen f1d9775a0f Fix the build 2016-08-03 21:15:27 +02:00
Sebastiaan Janssen 1aa2845b4a Merge pull request #1360 from marcemarc/dev-u4-8657
Closes Issue U4-8657 - Add an overload to GetDictionaryValue to provide fallback text
2016-08-03 21:08:16 +02:00
Sebastiaan Janssen 1c88117498 U4-8803 Add "Create package" back as a right-click item on the "Created Packages" node
#U4-8803 Fixed
2016-08-03 20:17:43 +02:00
Sebastiaan Janssen 6237d4a3e5 Adds a toggle to disable/enable the URL tracker
Adds paging, adapted from https://github.com/robertjf/umbMemberListView/blob/master/MemberListView/App_Plugins/MemberManager/backoffice/dashboard/memberListView.controller.js
2016-08-03 20:01:43 +02:00
Sebastiaan Janssen 77cbdcf38f js files are ignored by default, need to force add them if we really want them 2016-08-03 19:05:04 +02:00
Sebastiaan Janssen 85a3abf643 Adds a setting to be able to disable redirect URL tracking 2016-08-03 17:57:41 +02:00
Sebastiaan Janssen c53a04d658 Needed to be fixed, just like for the ascending OrderBy - see U4-4474 2016-08-03 17:57:41 +02:00
Sebastiaan Janssen b4d5140d07 WIP Starting with taking Marc's code to get a rudimentary dashboard for the 301 URL tracker 2016-08-03 17:57:01 +02:00
Sebastiaan Janssen 11cafa2c4c Adds a setting to be able to disable redirect URL tracking 2016-08-03 17:54:21 +02:00
Sebastiaan Janssen a5f3b50699 Needed to be fixed, just like for the ascending OrderBy - see U4-4474 2016-08-03 17:52:27 +02:00
Shannon 00bc454080 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-08-03 14:04:33 +02:00
Shannon 67cd4aeb59 fixes user mgr logic 2016-08-03 14:04:25 +02:00
Claus b4ea03cdf3 U4-8779 Sorting not working in Members List View in 7.5 Beta2 2016-08-03 12:43:46 +02:00
Mads Rasmussen c8d7a62a47 Fixes: U4-8747 Actions menu button not aligned with heading input 2016-08-03 09:53:55 +02:00
Sebastiaan Janssen b9fcda8f39 U4-8361 301 Url Tracking
Adds the ability to add certain headers to a PublishedContentRequest - these are internal for now until we're sure we want to expose them
Adds response headers to tell browsers not to cache the 301 redirects so people can easily change their mind later
2016-08-02 17:01:32 +02:00
Sebastiaan Janssen e020779a14 U4-8751 GetCropUrl method should have a parameter for specifying the image format
Additional fix asking for InvariantContains instead of just Contains
2016-08-02 15:07:25 +02:00
Sebastiaan Janssen d611ae85e1 Merge pull request #1398 from arknu/U4-8751_2
U4-8751: Put format parameter at the end when format is specified in furtherOptions
2016-08-02 14:57:38 +02:00
Sebastiaan Janssen 2df8f55032 U4-8794 Allow Newtosoft JSON 9.0.1 to be installed
#U4-8794 Fixed
2016-08-02 14:45:57 +02:00
Sebastiaan Janssen 6788e8954e U4-8509 woff2 mime type 2016-08-02 14:37:08 +02:00
Sebastiaan Janssen 080da771ff U4-8457 Ensure <MacroErrors> default is updated from legacy inline setting to newer throw setting
#U4-8457 Fixed
2016-08-02 14:37:08 +02:00
Sebastiaan Janssen 08b3b635b4 Merge pull request #1305 from electricsheep/U4-8336
U4-8509 - Added woff2 mime type
2016-08-02 14:36:58 +02:00
Mads Rasmussen 8e411069f4 Merge pull request #1318 from umbraco/temp-U4-8584
Temp u4 8584
2016-08-02 13:26:34 +02:00
Claus 7d0c92937a U4-8754 Single content queries like Get(int id) for content, media and members needs to execute a TOP 1 (or LIMIT 1)
updated a bunch of the remaining repositories to also use this pattern where applicable (repos using mappers aren't compatible without more work).
2016-08-02 12:11:35 +02:00
Simon Busborg 1ca6674095 Fixes http://issues.umbraco.org/issue/U4-8770 2016-08-02 09:41:01 +02:00
Shannon 3ebb3dc544 U4-7813 Enable MiniProfiler to profiler during startup 2016-08-01 12:04:02 +02:00
Asbjørn Riis-Knudsen 1f6caa0164 U4-8749: add back some acceidentally deleted code to deal with existing values 2016-07-30 00:35:06 +02:00
Asbjørn Riis-Knudsen 6adccb66dd U4-8749: Use watch do dynamically refresh sort column list 2016-07-30 00:30:50 +02:00
Asbjørn Riis-Knudsen 6837dd2ce8 U4-8749: One more fix by @AndyButland 2016-07-29 23:55:20 +02:00
Asbjørn Riis-Knudsen b686fa74c9 U4-8749: Fixes by @AndyButland 2016-07-29 23:42:59 +02:00
Claus 22d12f3abc Merge branch 'bjarnef-dev-v7-U4-8488' into dev-v7 2016-07-29 11:23:36 +02:00
Claus bb4671faf1 Merge branch 'dev-v7-U4-8488' of git://github.com/bjarnef/Umbraco-CMS into bjarnef-dev-v7-U4-8488
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js
2016-07-29 11:22:13 +02:00
Claus 57d2901c2e Merge pull request #1405 from umbraco/temp-U4-8367
U4-8367 Breadcrumb and save button breaks layout.
2016-07-29 10:48:31 +02:00
Claus 9914ab6c59 Merge branch 'bjarnef-dev-v7-U4-8748' into dev-v7 2016-07-29 10:38:33 +02:00
Claus ccd03cb1f2 fixes overlay width on small screens (mads). 2016-07-29 10:38:00 +02:00
Claus 89fd31085c Merge branch 'dev-v7-U4-8748' of git://github.com/bjarnef/Umbraco-CMS into bjarnef-dev-v7-U4-8748 2016-07-29 10:30:18 +02:00
Asbjørn Riis-Knudsen e53b81b627 U4-8749: Remove commented out code 2016-07-28 22:21:21 +02:00
Asbjørn Riis-Knudsen 385c53936e U4-8749: Initial implementation of the default sort order using the columns added instead of a fixed list 2016-07-28 22:18:17 +02:00
Mads Rasmussen be8a52e7b6 fix positioning of sub header when scrolling 2016-07-28 12:34:04 +02:00
Mads Rasmussen 3cdf80a82b change main editor from absolute positioning to flex box. Sets auto height on editor footer so it can expand 2016-07-28 12:33:32 +02:00
Mads Rasmussen b631db14c3 show full breadcrumb item on hover 2016-07-28 12:26:52 +02:00
Mads Rasmussen 5f7859a8c1 truncate breadcrumb items 2016-07-28 12:25:58 +02:00
Claus 1a2f7b8788 Merge branch 'dev-v7' of github.com:umbraco/Umbraco-CMS into dev-v7 2016-07-27 14:18:39 +02:00
Claus 39aca137a4 Merge branch 'temp-U4-8601' into dev-v7
Conflicts:
	src/Umbraco.Web.UI.Client/src/views/dashboard/developer/healthcheck.controller.js
	src/Umbraco.Web.UI.Client/src/views/dashboard/developer/healthcheck.html
2016-07-27 14:18:21 +02:00
Warren Buckley 88c6b0450e Merge pull request #1401 from umbraco/temp-U4-8733
U4-8733 Trying to include a stylesheet in a package results in a YSOD
2016-07-27 13:18:07 +01:00
Claus 9ae339f17b removing a console.log.
whitespace and some formatting.
2016-07-27 13:59:10 +02:00
Mads Rasmussen b1f13cdbb2 health check overview - hide status when group is loading 2016-07-27 13:15:22 +02:00
Mads Rasmussen 1636c16954 move loading indicator one level up in detail view, so it's visible first time the checks are run. 2016-07-27 12:40:45 +02:00
Claus f7f736fe63 Merge pull request #1403 from umbraco/temp-U4-8780
U4-8780 Error migrating from 7.2.2 -> 7.5 beta 2 - cmsStylesheetProperty invalid object name
2016-07-27 11:04:10 +02:00
bjarnef ba6736dbb3 Fix correct syntax of calc function in less 2016-07-27 10:31:18 +02:00
Mads Rasmussen 29be571afd Add button to check all groups + a bit of style polish 2016-07-27 09:31:01 +02:00
bjarnef c5b9e6a194 Load svg in <object> to have access to events and be able to manipulate svg 2016-07-27 01:36:17 +02:00
Jeremy Pyne 2cad3838f4 Update ExpressionTests.cs
Fixes for SQL replace test.
2016-07-26 10:27:19 -04:00
Sebastiaan Janssen c955cce28d Because the cmsStylesheetProperty table was already deleted by an earlier migration, it can't be deleted again
However because all of this runs in one transaction, it will try anyway, we need to do this in a "local" context instead
2016-07-26 16:20:22 +02:00
Sebastiaan Janssen bb376367d6 If the umbracoMigration table does not yet exist, then get the configured version from the web.config and parse it 2016-07-26 16:19:17 +02:00
Sebastiaan Janssen a83b524130 DetermineInstalledVersionByMigrations needs to check if the table exists, not the code asking for a version 2016-07-26 16:18:00 +02:00
Claus dcdd47dff4 adding a few unit tests to MemberService. 2016-07-26 16:05:30 +02:00
Jeremy Pyne c6a2d41888 Added test. 2016-07-26 09:45:45 -04:00
bjarnef d37b65adcf Extend model with extension property, display svg in <img> and font icon for other files 2016-07-26 14:45:03 +02:00
Claus 379a0d68f7 U4-8733 Trying to include a stylesheet in a package results in a YSOD 2016-07-26 13:38:06 +02:00
Sebastiaan Janssen c206965f88 U4-8777 ImageProcessor fails to generate thumbnail for animated gif
#U4-8777 Fixed

Updates to the latest ImageProcessor to ship in the zip release
2016-07-26 12:09:05 +02:00
Mads Rasmussen 8fd1743bce only render actions div if there are any actions 2016-07-26 12:01:24 +02:00
Claus 4acfd1dcca better error message for errors when embedding media. 2016-07-26 11:31:39 +02:00
Mads Rasmussen 67234ef115 Fixes: U4-8713 New packager - avoid horizontal scrollbar for narrow screens 2016-07-26 10:34:29 +02:00
Jeremy Pyne de89f555d4 Added missing Sql mapping for standard Replace function:
.Where<MyModel>(s => s.Name.Replace(" ", "-") == userName)

Should generate valid SQL:
REPLACE([dbo].[MyModel].[Name], ' ', '-')
2016-07-25 16:46:49 -04:00
Shannon Deminick 9f36d2b7c6 Update README.md 2016-07-25 11:13:06 +02:00
Simon Busborg 2aa27dcf8c Merge pull request #1395 from bjarnef/dev-v7-U4-8746
Open link in new browser window/tab
2016-07-25 10:45:56 +02:00
Simon Busborg 43da97332c Merge pull request #1396 from bjarnef/dev-v7-U4-8765
Open documentation link in new browser window/tab
2016-07-25 10:44:48 +02:00
Marc Goodson 379661e302 Fixes U4-8772, adds HasPublishedVersion property to mapping of IContent to ContentItemBasic, then adds existing 'has-unpublished-version' css class to list view row if item is published but has unpublished changes 2016-07-25 09:17:27 +01:00
Asbjørn Riis-Knudsen 5f3f698ffd U4-8751: Put format parameter at the end when format is specified in furtherOptions 2016-07-24 18:09:06 +02:00
Sebastiaan Janssen 4ab200d538 Request elevated command promt to install git (necessary for the install to succeed) 2016-07-23 11:52:47 +02:00
bjarnef 55fad36bad Open documentation link in new browser window/tab 2016-07-22 15:13:00 +02:00
Warren Buckley 99a7aa53a1 Merge pull request #1393 from umbraco/temp-U4-8755
U4-8755 - more explicit errors when xml cache is corrupt
2016-07-22 11:47:17 +01:00
Warren Buckley d783554476 Merge pull request #1392 from umbraco/temp-u4-8756
U4-8756 - fix 7.5 beta2 upgrade
2016-07-22 10:50:28 +01:00
bjarnef 5444b65eaf Open link in new browser window/tab 2016-07-21 19:56:57 +02:00
Warren Buckley c4400a20d6 Merge pull request #1388 from umbraco/temp-u4-8720
temp-u4-8720
2016-07-21 15:48:47 +01:00
Stephan 32d59bb2bc U4-8755 - more explicit errors when xml cache is corrupt 2016-07-21 16:46:46 +02:00
Stephan 6c6c56645d U4-8720 - add documentation 2016-07-21 15:20:45 +02:00
Warren Buckley be16e84dbb Merge pull request #1386 from umbraco/temp-u4-8663
U4-8663 - fix deleting properties in doctype editor
2016-07-21 11:39:29 +01:00
Stephan a4fec9dd0f U4-8756 - fix 7.5 beta2 upgrade 2016-07-21 11:49:25 +02:00
Sebastiaan Janssen 3f2ebbda59 U4-8757 DB error installing 7.5.0 beta2 with SQL server - first escape characters, THEN wrap the password in single quotes
#U4-8757 Fixed
2016-07-21 11:24:08 +02:00
bjarnef ed392cd252 Fix issue where subsequent submit of reset password form cleared error message 2016-07-21 02:31:40 +02:00
bjarnef 0fe24a45ff Fix position of user and help dialog position and optimization in mobile layout. 2016-07-21 00:47:28 +02:00
Sebastiaan Janssen b290e6af8a Merge pull request #1385 from umbraco/temp-u4-6247
U4-6247 - fix PublicAccess repo
2016-07-20 14:02:46 +02:00
Warren Buckley 6e440f0f69 Merge pull request #1375 from bjarnef/dev-v7-U4-8696
Only add class "-light" to grid items in content.
2016-07-20 11:12:24 +01:00
Lukas Vorlicek 2eaa2b3166 U4-7475 Feature UA-1736 (element+class styles) for TinyMCE in grid
credits to @SorenA https://github.com/umbraco/Umbraco-CMS/pull/630
2016-07-19 20:38:46 +02:00
Stephan a0caab410e U4-8720 - add dynamic support, UmbracoHelper methods 2016-07-19 16:13:46 +02:00
Warren Buckley 05ebc9dfa7 Merge branch 'abjerner-patch-9' into dev-v7 2016-07-19 14:41:08 +01:00
Warren Buckley f4a2990819 Replace inline style with CSS class that achieves same result 2016-07-19 14:38:44 +01:00
Stephan dc476dcb02 U4-8720 - get typed content by guid 2016-07-19 15:38:42 +02:00
Stephan 0603cb3ab1 U4-8720 - add IPublishedContent Site, Children ext. methods 2016-07-19 15:38:42 +02:00
Stephan 6ba761df20 Fix null checks in HttpRequestCacheProvider 2016-07-19 15:37:55 +02:00
Shannon d687fadac3 Performs some null checks in the HttpRequestCacheProvider since if there is no place to cache, it just doesn't do any caching. 2016-07-19 15:07:38 +02:00
Warren Buckley d81a95dbdc Merge branch 'patch-9' of https://github.com/abjerner/Umbraco-CMS into abjerner-patch-9 2016-07-19 14:06:51 +01:00
Warren Buckley 90b39070a7 Merge pull request #1367 from skttl/patch-1
U4-8579: Replace linebreaks
2016-07-19 12:20:56 +01:00
Sebastiaan Janssen 3c653fbd5f Don't use C#6 syntax in tests 2016-07-19 12:40:08 +02:00
Sebastiaan Janssen 05b0c16d18 Use the newest version of CDF 2016-07-19 12:15:36 +02:00
Stephan 57c561fae1 Merge pull request #1387 from umbraco/temp-u4-8729
u4 8729
2016-07-19 12:07:41 +02:00
Sebastiaan Janssen d7e6b0732e Add upgrade hints for some of our dependencies 2016-07-19 11:58:02 +02:00
Stephan 2481b77f03 U4-8729 - reviewing PR 2016-07-19 11:28:54 +02:00
Sebastiaan Janssen e2c2cdd632 Use the newest version of ModelsBuilder 2016-07-19 11:22:23 +02:00
Stephan 764f10327e Merge branch 'peta-poco-issues' of https://github.com/pynej/Umbraco-CMS into temp-u4-8729 2016-07-19 10:57:03 +02:00
Stephan 576539c774 U4-8663 - fix deleting properties in doctype editor 2016-07-19 10:46:18 +02:00
Stephan 4786a8037c U4-6247 - fix PublicAccess repo 2016-07-18 19:26:49 +02:00
Jeremy Pyne 2e24923cc4 Update PetaPoco.cs
Sql() class should reset build cache when new Append operations are called.  If not then stepping through with the debugger or doing internal logging can cause invalid SQL and unexpected results.
2016-07-18 09:00:23 -04:00
Sebastiaan Janssen c617599fef Use the newest version of ImageProcessor 2016-07-18 11:25:56 +02:00
Stephan 6836e48217 Fix assertion in tests 2016-07-18 10:17:34 +02:00
Shannon e3b9a45435 Updates public APIs to enable umbraco cookie auth so devs can specify their own cookie options if required. 2016-07-18 10:09:46 +02:00
Sebastiaan Janssen a758688c52 U4-8730 MigrationRunner should check for migrations params to already be null
#U4-8730 Fixed
2016-07-15 12:03:15 +02:00
Sebastiaan Janssen 6f2aac14fc Revert "Adds a pause after build succeeds and when not running on the build server"
This reverts commit de9c0d5cf1.
2016-07-15 12:00:11 +02:00
Sebastiaan Janssen 13ed60b77b In upgrades, the new install views weren't being copied over 2016-07-15 11:49:14 +02:00
Shannon 4469e6bf11 fixes migration to actually execute for mysql 2016-07-15 09:45:03 +02:00
Sebastiaan Janssen 3435a2d872 Updates version 2016-07-15 09:24:21 +02:00
Sebastiaan Janssen de9c0d5cf1 Adds a pause after build succeeds and when not running on the build server 2016-07-15 09:23:42 +02:00
Sebastiaan Janssen 91b8f4dcce Merge pull request #1380 from umbraco/temp-U4-8522
U4-8522 cmsPropertyData needs unique constraint indexes and index refactoring
2016-07-15 09:22:31 +02:00
Jeremy Pyne a40f87eb36 Fixed an issues with user generated PetaPoco's would not work if they included schema's.
Fixed an issue where strong typed helper methods would not generate valid SQL for column names if the poco didn't explicitly set a [Column(Name="")] attribute. The PetaPoco format allows for this though and will default to the property name.  Again this would cause issues for developers trying to use the DatabaseContext.Database class with their own Poco's.

Both the above causes would happen for example if using the PetaPoco T4 templates to automatically generate Poco's.
2016-07-14 17:01:51 -04:00
Shannon 52e2cbab90 updates delete query to work with MySql 2016-07-14 18:00:43 +02:00
Shannon e7b26ad949 updates migratoin to run a single delete statement during execution 2016-07-14 17:51:18 +02:00
Sebastiaan Janssen 1dc5515e80 Merge branch 'temp-appveyor-output' into dev-v7
Conflicts:
	appveyor.yml
2016-07-14 14:57:42 +02:00
Sebastiaan Janssen 4ee4066dc6 Whoops, too many newlines 2016-07-14 14:46:34 +02:00
Sebastiaan Janssen de0bb494a5 Improving Build.bat and appveyor build output
Moving all Console.Write* to Debug.Print
2016-07-14 14:11:05 +02:00
Sebastiaan Janssen db9f4325f5 Merge pull request #1378 from umbraco/temp-U4-8629
U4-8629 Displays link to version report on our.umb during Upgrade step
2016-07-14 13:27:02 +02:00
Sebastiaan Janssen 8a17494d1e Merge pull request #1377 from umbraco/temp-U4-8618
U4-8618 - Adds button to manually trigger health checks
2016-07-14 13:00:35 +02:00
Sebastiaan Janssen dfe1c52f6e Merge pull request #1379 from umbraco/temp-U4-8542
U4-8542 Require https attribute for back office web api controllers
2016-07-14 12:13:44 +02:00
Sebastiaan Janssen 89f759c088 U4-8670 Ensure the create package system in the back office allows for specifying correct metadata
Just a few more updates based on PR feedback
2016-07-14 12:09:55 +02:00
Shannon bd306295c2 Ensures the correct index is installed by default, fixes a test that didn't take this index into account 2016-07-12 19:39:22 +02:00
Shannon bd219cb8f2 U4-8542 Require https attribute for back office web api controllers
This adds the webapi filter and also creates a new MVC one with a better name and the correct namespace since it was previously in the wrong namespace . I've obsoleted the old one and proxied the logic to the new renamed one so there are no breaking changes.
2016-07-12 18:13:11 +02:00
Shannon 1eef30710d U4-8522 cmsPropertyData needs unique constraint indexes and index refactoring 2016-07-12 17:34:11 +02:00
Warren Buckley 9a5527864f Update the HTML Angular view for UpgradeStep to match the anonymous object we send down the wire as JSON from the InstallStep. Lists out the two versions & a simple button for a link to the our.umbraco version compare tool 2016-07-12 15:58:59 +01:00
Warren Buckley 13add0c355 Update the ViewModel we return as JSON to the Upgrade Installer Step - Has logic for checking latest logic (Needs bullet proof testing & discussion most likely) 2016-07-12 15:57:48 +01:00
Warren Buckley d90426eb64 Adds a button to manually trigger Health Checks. Adds disabled state & inactive CSS class to ensure it cannot be triggered again whilst checks taking place. 2016-07-12 13:32:16 +01:00
Shannon 0450cdd550 removes some old notes 2016-07-12 13:36:08 +02:00
Shannon 856de5b9f3 Ensures Stylesheet tables are not re-added on install, and re-removes them for upgrades. 2016-07-11 15:32:22 +02:00
Shannon Deminick f051ff2ec2 Merge pull request #1362 from umbraco/temp-U4-8602
U4-8602 Packages - Repository UI/UX Polish
2016-07-11 14:38:18 +02:00
Shannon a86a5d3db2 U4-8636 New Packager - Do not allow a package to be installed multiple times
adds better localization support for installing/uninstalling and validates the installation target
2016-07-11 14:34:02 +02:00
Shannon da92eef733 U4-8714 New packager - wrong number for package votes 2016-07-11 12:50:22 +02:00
Shannon d377ebfc47 Ensures you cannot install an already installed package in the local install area, localizes errors, ensures the installed packages list only shows the latest installed versions, ensures when uninstalling a package it removes all versions it installed. 2016-07-11 12:42:26 +02:00
Shannon d7c98c2686 Fixes the redirect when uninstalling, fixes the icon header width of installing a local package 2016-07-11 11:31:21 +02:00
Shannon 676bf3a6b2 Fixes where the packager redirects when there is not a custom control to display - it was going to the old old packager thing which we don't want 2016-07-11 11:02:18 +02:00
Shannon a83dec1351 Merge branch 'dev-v7' into temp-U4-8602
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js
#	src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html
#	src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html
2016-07-11 10:38:33 +02:00
Shannon 50d6f876a4 updates some code notes 2016-07-11 10:25:42 +02:00
Shannon ff0711f786 bumps version txt file 2016-07-11 10:09:17 +02:00
Shannon Deminick 44eb491cd9 Merge pull request #1364 from umbraco/temp-U4-8624
U4-8624 umbracoCacheInstructions is slowing server response
2016-07-11 09:48:38 +02:00
Shannon 7858ad5634 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-07-11 09:40:04 +02:00
Shannon ca0ffe23ba U4-8718 Latest ClientDependency release 2016-07-11 09:39:54 +02:00
Sebastiaan Janssen 2a67e2eb46 YAML files need white lines to denote a new command, else they just get concatenated 2016-07-08 15:09:16 +02:00
Sebastiaan Janssen 444c431527 Improving Build.bat and appveyor build output 2016-07-08 14:51:02 +02:00
Anders Bjerner e7f0eda504 Might as well have constants for the external searcher (and indexers) 2016-07-08 12:45:17 +02:00
bjarnef b9b3de0b01 Only add class "-light" to grid items in content. 2016-07-07 23:08:58 +02:00
Sebastiaan Janssen 5ebcdce557 Merge pull request #1374 from umbraco/temp-u4-8682
U4-8682 - manage cache in tests
2016-07-07 17:54:39 +02:00
Sebastiaan Janssen f2d50866d9 Merge pull request #1370 from umbraco/temp-u4-8361
u4-8361 From ids to guids
2016-07-07 17:52:41 +02:00
Stephan 6f6c7ede0a U4-8361 - fixing migrations 2016-07-07 16:56:52 +02:00
Sebastiaan Janssen 85c7b102b9 Revert C#6 notation 2016-07-07 16:22:55 +02:00
Sebastiaan Janssen 05cb2050e7 Revert C#6 notation 2016-07-07 16:17:01 +02:00
Warren Buckley a494ea8dc8 Merge pull request #1350 from umbraco/temp-U4-8640
U4-8640 Deleting a content type with children only emits a deleted ev…
2016-07-07 14:40:56 +01:00
Sebastiaan Janssen d0e47fe1ff Merge pull request #1339 from dannydrogt/temp-u4-8613
U4-8613 Link to DocType from "Properties" tab is not localized
2016-07-07 15:38:00 +02:00
Sebastiaan Janssen 7c485dcd50 Forgot password email sent as raw text, but contains html
#U4-8703 Fixed
2016-07-07 15:24:53 +02:00
Warren Buckley a319aa9503 Merge pull request #1365 from umbraco/temp-packaging
U4-8670 Ensure the create package system in the back office allows for specifying correct metadata
2016-07-07 13:08:19 +01:00
Warren Buckley e02fbd0bbe Merge pull request #1355 from umbraco/temp-U4-8561
Properly URL Encodes stylesheet properties
2016-07-07 10:47:48 +01:00
Stephan 560c0fbb33 U4-8361 - fixing and perfs 2016-07-06 21:53:08 +02:00
Stephan c5a346d70f Merge branch 'dev-v7' into temp-u4-8361 2016-07-06 20:00:17 +02:00
Stephan c1f6708b21 Fix 2016-07-06 18:08:19 +02:00
Stephan 4531bf6c30 U4-8682 - manage cache in tests 2016-07-06 18:01:59 +02:00
Sebastiaan Janssen c7967dc4f2 Merge pull request #1363 from umbraco/temp-U4-8472
U4-8472 Add web.config file to media folder path to prevent all execu…
2016-07-06 16:49:00 +02:00
Sebastiaan Janssen 0f19937aec Making sure the media/web.config is correctly installed from nuget 2016-07-06 16:48:30 +02:00
Warren Buckley b3259e5d3c Merge pull request #1371 from umbraco/temp-u4-8675
u4-8675
2016-07-06 11:42:16 +01:00
Sebastiaan Janssen 620800b448 Merge branch 'dev-v7' into temp-U4-8561 2016-07-06 12:32:06 +02:00
Sebastiaan Janssen f057eca45a Scratch that.. the Alias is actually the Name. Consistency FTW! 2016-07-06 11:14:59 +02:00
Sebastiaan Janssen b395d1a049 Alias is already running through ToSafeAlias, doesn't need UrlEncoding 2016-07-06 11:04:27 +02:00
Sebastiaan Janssen 46cd7cae38 Make sure to encode/decode the property name everywhere 2016-07-06 11:02:51 +02:00
Sebastiaan Janssen b2e9fb1534 Need to UrlDecode the parts[1] part so that we can find and properly delete properties with ampersands 2016-07-06 11:00:34 +02:00
Shannon 1f041f17c1 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-07-06 09:38:00 +02:00
Shannon ee27264a72 Ensures all instances of SqlCeEngine are in a using claus so native objects are disposed properly 2016-07-06 09:37:52 +02:00
Stephan 1f40043740 Hopefull fixing tests 2016-07-05 15:11:10 +02:00
Stephan a7ae9e66cd U4-8624 - throttle pruning instr. and optimize query 2016-07-05 12:29:16 +02:00
Stephan a0f00efcef Merge branch 'dev-v7' into temp-U4-8624 2016-07-05 12:00:29 +02:00
Stephan ac44079044 Merge branch 'dev-v7' into temp-U4-8627 2016-07-05 11:45:42 +02:00
Stephan f799938989 Revert "Merge branch 'U4-8588' ..."
This reverts commit 1bfb32dcdc.
2016-07-05 11:44:41 +02:00
Stephan cec456d672 U4-8675 - minor fixes 2016-07-05 11:31:53 +02:00
Stephan b9e886c0bc Merge branch 'U4-8675' of https://github.com/benjaminketron/Umbraco-CMS into temp-u4-8675 2016-07-05 10:30:53 +02:00
Stephan 3d2a0b4a29 U4-8361 - from ids to guids 2016-07-04 18:22:06 +02:00
Stephan 6897ee1d14 U4-8469 - bugfix content cache 2016-07-04 18:21:36 +02:00
Shannon b1b5352e26 updates to latest Markdown version 2016-07-04 14:38:45 +02:00
Anders Bjerner 826b9e9cc3 Added editor alias to the list of available editors 2016-07-04 13:09:07 +02:00
Shannon Deminick 04ebb6ab4e Merge pull request #1368 from skttl/patch-2
U4-7386: Adds summaries to string functions
2016-07-04 12:42:05 +02:00
Søren Kottal 44565226fe U4-7386: Adds summaries to string functions 2016-07-01 22:14:44 +02:00
Søren Kottal b84f17ce5e U4-8579: Replace linebreaks
Uses Umbraco Helper to replace linebreaks for html in model.value
2016-07-01 21:32:09 +02:00
bjarnef 4b08442652 Fix localization 2016-07-01 00:04:09 +02:00
Simon Busborg 2bb89fa63b Cleanup 2016-06-29 16:12:22 +02:00
Shannon 76a962c2e0 published package now includes icon url 2016-06-29 15:44:34 +02:00
Shannon c05c14988e package saving now working with extra metadata 2016-06-29 15:36:45 +02:00
Shannon 092abfb56d Gets created packages deletion working, gets the min umb version field working on the created packages UI 2016-06-29 15:31:10 +02:00
Simon Busborg edd80ae55f Added better utilities 2016-06-29 14:34:59 +02:00
Mads Rasmussen 8d9da719b4 add progress bar to install and uninstall 2016-06-29 14:20:21 +02:00
Simon Busborg ca40fd3976 Changed name of utilities and their width value 2016-06-29 14:15:41 +02:00
Mads Rasmussen 9956dee829 move wrapper class so "Take me back" is in the top right corner 2016-06-29 13:34:50 +02:00
Mads Rasmussen 93945e30cc bring back the redirect to webforms view - use localStorageService to handle local storage 2016-06-29 13:18:26 +02:00
Mads Rasmussen a0ccbc3fac package details information: label as block element, wrap words, don't show empty information item 2016-06-29 11:55:19 +02:00
Simon Busborg 9aa25d5265 changed lorem ipsum with actual copy 2016-06-29 11:13:19 +02:00
Mads Rasmussen 61ef71d9fb Merge branch 'temp-U4-8602' of https://github.com/umbraco/Umbraco-CMS into temp-U4-8602 2016-06-29 11:04:16 +02:00
Mads Rasmussen 4be68eede7 only show external sources if there are any 2016-06-29 10:58:26 +02:00
Simon Busborg fbd5e58cca Fixed width issue for package details coursed by inline styling 2016-06-29 10:57:59 +02:00
Mads Rasmussen 5b4381cc2b change src to ng-src 2016-06-29 10:49:11 +02:00
Mads Rasmussen 0ede94e0f9 rename src and srcset attr on umb-avatar 2016-06-29 10:47:24 +02:00
Shannon a67020ec31 Ensures that the package Icon is displayed for installed packages. Cleans up lots of try/catch/swallows in the packaging logic, adds better xml error handling (we really need a lot more though), ensures that if any part of the package installation fails, that angular bails and doesn't keep trying to install - same logic for installing forms. 2016-06-28 20:14:12 +02:00
Benjamin Ketron 42ef6d3d76 An attempt to speed up sorting a large set of nodes when a large set of users exist. Our sorts were failing in azure because the user notifications were taking long enough that azure would kill the thread. 2016-06-28 12:03:36 -06:00
Shannon Deminick 7c8f0457f1 Merge pull request #1338 from Jeavon/U4-8612
Fix for U4-8612 so that Icon shows when installing a local package
2016-06-28 16:36:31 +02:00
Shannon 81a4130f46 U4-8624 umbracoCacheInstructions is slowing server response 2016-06-28 16:31:24 +02:00
Shannon 1a02841649 U4-8472 Add web.config file to media folder path to prevent all execution based files from being run by IIS 2016-06-28 16:01:23 +02:00
Simon Busborg fdd1a89fb3 Added utilities font weight 2016-06-28 13:11:19 +02:00
Simon Busborg e2826e36ef Fixed width on form and changed copy 2016-06-28 11:43:34 +02:00
Simon Busborg 2a7c50f114 Changed latest to “New Releases” 2016-06-28 11:43:34 +02:00
Mads Rasmussen f7cdee9ba9 delete unused views 2016-06-28 11:43:34 +02:00
Mads Rasmussen 39541cd335 swap title when searching 2016-06-28 11:43:34 +02:00
Mads Rasmussen a2973519e2 Add empty state for installed packages 2016-06-28 11:43:34 +02:00
Mads Rasmussen fd9db1fee7 use empty state component when there are no search result 2016-06-28 11:43:34 +02:00
Simon Busborg 6c95e9efd6 Added target blanks to all links 2016-06-28 11:43:34 +02:00
Mads Rasmussen 1bd391a392 increase page size to 24 2016-06-28 11:43:34 +02:00
Mads Rasmussen f41453b972 change search to use ng-change instead of $watch. Reset search results when search field is cleared. 2016-06-28 11:43:34 +02:00
Simon Busborg 340d0eb84e Added “Take me back link” to missing views 2016-06-28 11:43:34 +02:00
Simon Busborg 9602a52801 added better utility for flexbox and changed classes in views 2016-06-28 11:42:34 +02:00
Simon Busborg c280a0a5ab Added new utility in text-align and added empty message for search 2016-06-28 11:42:34 +02:00
Simon Busborg dbec2c207f Package category navigation fixed for all screen resolutions 2016-06-28 11:42:34 +02:00
Simon Busborg e12b9665ab Added better ui for multiple screen resolutions, added success screens for installer, added better ui for uninstall and accept term screens 2016-06-28 11:42:34 +02:00
Simon Busborg 831c7a951f Merge pull request #1358 from umbraco/temp-U4-8661
U4-8661 Add progress bar angular component
2016-06-28 11:29:01 +02:00
Mads Rasmussen 63b90ad0c9 use umb-progress-bar in package details 2016-06-28 11:27:26 +02:00
Mads Rasmussen 72a319572a add umb-progress-bar component 2016-06-28 11:27:04 +02:00
Claus 4423f965d1 Merge pull request #1359 from umbraco/temp-U4-8592b
U4-8592 - fix property conversions
2016-06-28 11:13:22 +02:00
Simon Busborg 3370c57ae6 Merge pull request #1357 from umbraco/temp-U4-8660
U4-8660 Add avatar angular component
2016-06-28 10:39:56 +02:00
Stephan db79690501 U4-8592 - fix decimal scaling factor issue 2016-06-28 10:09:11 +02:00
Mads Rasmussen 178dbcc7fc Merge pull request #1361 from umbraco/temp-U4-8416
U4-8416 Empty recycle bin does not refresh or gives feedback to user
2016-06-28 09:50:48 +02:00
Shannon 0e61eb79a8 U4-8416 Empty recycle bin does not refresh or gives feedback to user 2016-06-27 18:27:49 +02:00
Marc Goodson 29e45534c5 Add an overload to GetDictionaryValue to provide a fallback - U4-8657 2016-06-27 16:46:52 +01:00
Shannon Deminick 374fa5b574 Merge pull request #1351 from umbraco/temp-u4-8649
U4-8469 - xml cache TLC
2016-06-27 17:16:06 +02:00
Stephan 09526e6db4 U4-8592 - fix property conversions 2016-06-27 15:33:08 +02:00
Shannon eec0e4f946 Merge branch 'U4-8588' of https://github.com/JimBobSquarePants/Umbraco-CMS into dev-v7
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	src/Umbraco.Core/Umbraco.Core.csproj
#	src/Umbraco.Web.UI/packages.config
2016-06-27 14:20:13 +02:00
Shannon Deminick 46690ed405 Merge pull request #1284 from umbraco/temp-U4-265
U4-265 Time zone adjustment in Umbraco backend for Date/Time picker
2016-06-27 14:15:13 +02:00
Shannon 37f67b505c Changes the greymed color to be a bit darker (after discussing with mads), makes the forms styles use greymed instead of a custom one, removes the first line from the help (too long) 2016-06-27 14:14:49 +02:00
Mads Rasmussen 3773c55633 use avatar component in sections 2016-06-27 09:53:40 +02:00
Mads Rasmussen f6c74eedf6 use avatar component in package details 2016-06-27 09:52:29 +02:00
Mads Rasmussen f420960eea add umb-avatar component + documentation 2016-06-27 09:50:35 +02:00
Shannon Deminick 5fc2d93709 Merge pull request #1354 from abjerner/patch-8
Implemented better translations for the create data type dialog
2016-06-27 09:45:27 +02:00
Sebastiaan Janssen b840ab250a Merge pull request #1238 from Dynacy/patch-1
Create tr.xml
2016-06-24 13:08:17 +02:00
Sebastiaan Janssen 2e2d0e506f Properly URL Encodes stylesheet properties 2016-06-24 10:49:07 +02:00
bjarnef 889ef47fd2 Update localization of listview bulk actions 2016-06-24 00:44:45 +02:00
Anders Bjerner a70aa5cb25 Added translations for en-US 2016-06-23 18:14:58 +02:00
Anders Bjerner 6e1e7ff8ba Added translations for English 2016-06-23 18:13:37 +02:00
Anders Bjerner 74c22c8491 Added translations for Danish 2016-06-23 18:13:03 +02:00
Anders Bjerner 54b01caa38 Added localize elements for "New data type" and "New folder" 2016-06-23 18:11:19 +02:00
Stephan 1e12cb8ac5 U4-8649 - fix tests 2016-06-23 18:05:42 +02:00
Anders Bjerner 8d55a55a80 Added a tooltip with icon alias on mouseover 2016-06-23 17:45:01 +02:00
Shannon 1c40d9d0d8 U4-8627 Umbraco.Core.Sync.DatabaseServerMessenger - No last synced Id found when '0' is stored and there are no instructions 2016-06-23 16:55:04 +02:00
Shannon 1bfb32dcdc Merge branch 'U4-8588' of https://github.com/JimBobSquarePants/Umbraco-CMS into JimBobSquarePants-U4-8588
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	src/Umbraco.Web.UI/packages.config
2016-06-23 16:55:04 +02:00
Mads Rasmussen 8a3c5c226c fix angular docs build 2016-06-23 15:44:55 +02:00
Mads Rasmussen 7411be99a8 Merge pull request #1344 from bjarnef/dev-v7-U4-8607
Document localizationService and localize directive
2016-06-23 15:30:26 +02:00
Stephan 7d25723afd U4-8469 - media cache TLC 2016-06-23 13:52:43 +02:00
Sebastiaan Janssen 7dcd67f953 != to !== 2016-06-23 12:39:32 +02:00
Sebastiaan Janssen f995370792 Merge pull request #1328 from pynej/fix-markdwn-isDirty
Update markdowneditor.controller.js
2016-06-23 12:35:46 +02:00
Stephan f3f53896b7 U4-8469 - fixing 2016-06-23 11:31:32 +02:00
Stephan 5b28260f96 U4-8469 - xml cache TLC 2016-06-23 09:39:31 +02:00
Claus b75578c889 U4-8640 Deleting a content type with children only emits a deleted event on the parent content type
service now includes all deleted content types including children, in the DeletedContentType event arguments.
tests to ensure the correct number of deleted entities are sent in events.
2016-06-22 19:30:31 +02:00
Sebastiaan Janssen 402b2b082f Merge pull request #1347 from umbraco/temp-U4-8433
This ensures we are using the latest code from Log4Net.Async for thes…
2016-06-22 17:25:11 +02:00
Sebastiaan Janssen abd2e70b6a Make sure to hide the timezone offset message when no offsetting is needed (server and client are in the same timezone) 2016-06-22 17:19:24 +02:00
Warren Buckley 772754bde8 Merge pull request #1348 from umbraco/temp-U4-8630
fixes: U4-8630 Make lightbox component for package images
2016-06-22 15:35:46 +01:00
Stephan 980683d25a Merge pull request #1285 from umbraco/temp-U4-8410-2
Backports some changes from v8 so that we can perform a nice strongly… Reviewed, sounds good.
2016-06-22 14:55:06 +02:00
Stephan ab973fd4df U4-8410 - fix build 2016-06-22 13:33:52 +02:00
Stephan 3f285185d1 U4-8410 - minor fixes 2016-06-22 13:10:37 +02:00
Mads Rasmussen f1803b4f33 fixes: U4-8630 Make lightbox component for package images 2016-06-22 12:15:50 +02:00
Shannon 9463db7431 This ensures we are using the latest code from Log4Net.Async for these libs. there are very little changes and none breaking but it is now up-to-date and we will use the nuget package in v8 instead. 2016-06-22 11:48:52 +02:00
Mads Rasmussen 5021112934 fix the Angular Docs build: fixes small issues in healthCheck resource documentation 2016-06-22 11:40:11 +02:00
Stephan d4f2486b4f Merge remote-tracking branch 'origin/dev-v7' into temp-U4-8410-2 2016-06-22 10:58:46 +02:00
Shannon 740c3e770a remove test thing 2016-06-21 21:09:41 +02:00
Shannon b8c88139e1 fixing build 2016-06-21 21:08:38 +02:00
Shannon 33ca761441 Updated all to use the ref parameter, tests are passing - now to see if they run any faster :) 2016-06-21 20:43:02 +02:00
Shannon 866df9c0b8 Merge branch 'temp-U4-8410-2' of https://github.com/umbraco/Umbraco-CMS into temp-U4-8410-2
# Conflicts:
#	src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs
2016-06-21 18:22:26 +02:00
Shannon 06fd7c2780 starting ref refactor (need to merge first) 2016-06-21 18:20:55 +02:00
Shannon b5411a5402 Initial commit of refactor of better/more efficient in terms of mem and performance properpty selectors for our models, this also yields a much cleaner syntax. I have discovered one issue now which is that the PropertyChanged event now fires before the property value is actually set, this is why the lambda syntax existed before. Instead we can use a ref property for the SetPropertyValueAndDetectChanges methods which will work much nicer - and also potentially have less allocations. 2016-06-21 18:11:03 +02:00
Sebastiaan Janssen d2ad39f2d3 Merge pull request #1287 from bjarnef/dev-v7-U4-8526
Fix a few translations in da.xml
2016-06-21 17:47:06 +02:00
Sebastiaan Janssen 5842575d48 Correct path for the matchbrackets.js file 2016-06-21 16:55:02 +02:00
Sebastiaan Janssen 3a0ff337bd Merge pull request #1304 from pynej/fix-matchbrackets
Update CodeArea.cs
2016-06-21 16:54:09 +02:00
Wincent 944898d6e5 http://issues.umbraco.org/issue/U4-8530
Adds Preview property to ContentItemDisplay
2016-06-21 14:18:55 +02:00
Simon Busborg 4c57cc2f39 Fixed white space in package overview 2016-06-21 12:19:02 +02:00
Sebastiaan Janssen afd62caa73 Ignore ClientDependency.config, building the solution will automatically create it 2016-06-21 10:55:18 +02:00
Sebastiaan Janssen df95b2a402 Same trick as for web.config, copy the ClientDependency.config from a template once and then ignore it so we don't always get prompted to commit it 2016-06-21 10:53:52 +02:00
Sebastiaan Janssen fc0334493a Update installer background 2016-06-21 10:43:56 +02:00
Mads Rasmussen 7b1563e0ca Merge pull request #1315 from JimBobSquarePants/U4-8583
U4 8583
2016-06-21 10:43:15 +02:00
Simon Busborg b7eb4e4e19 Merge pull request #1337 from bjarnef/dev-v7-U4-8598
Focus on input and toggle checkbox when clicking label
2016-06-21 10:34:04 +02:00
Warren Buckley 24a9ce51d5 Merge pull request #1330 from umbraco/temp-U4-6551
U4-6551 GetMediaByPath returning null
2016-06-21 09:21:55 +01:00
Simon Busborg 6c8771fae7 Merge pull request #1289 from pynej/fix-grid-macro
Macro's inserted in the grid should block link clicks so that users d…
2016-06-21 10:18:31 +02:00
bjarnef 5a53984b43 Document localizationService and localize directive 2016-06-21 01:25:14 +02:00
bjarnef f247e1b66f Document getByQuery 2016-06-20 19:54:46 +02:00
Stephan afcf2e195e Upgrade to ModelsBuilder 3.0.3 2016-06-20 16:10:06 +02:00
Shannon bc2b9ab298 U4-8614 JsonCamelCaseFormatter breaks the global configuration for the default JsonMediaTypeFormatter 2016-06-20 15:35:30 +02:00
Shannon Deminick 465a02d697 Merge pull request #1157 from simonech/patch-1
[U4-8128] Always rejecting promise even with server error
2016-06-20 15:33:21 +02:00
Danny Drogt 5b417f6241 U4-8613 Link to DocType from "Properties" tab is not localized - Added call to TextService 2016-06-20 15:32:27 +02:00
Jeavon 53fbf04a6c Add target=_blank on license url in local package installer so user doesn't loose their installer if they click the link 2016-06-20 13:20:24 +01:00
Jeavon fed718efb5 Fix Author link in Local package installer 2016-06-20 13:17:09 +01:00
Jeavon 05ed8e9530 Fix for U4-8612 so that Icon shows when installing a local package 2016-06-20 13:07:16 +01:00
bjarnef bca6e16e1b Focus on input, toggle checkbox when clicking label and only submit button dimmed 2016-06-19 23:11:26 +02:00
Sebastiaan Janssen 2a5dcef5f9 Merge pull request #1335 from bkclerke/U4-7879
escape semicolons
2016-06-16 14:11:32 +02:00
Blake Clerke-Smith f00a5271c3 escape other stuff 2016-06-16 06:09:59 -06:00
Blake Clerke-Smith deff98612f escape semicolons 2016-06-16 06:07:21 -06:00
Claus c612505362 updated unittest to be more precise. 2016-06-14 17:47:33 +02:00
Claus 12a2de7cf3 U4-6551 GetMediaByPath returning null
now doing fallbacks to other querys trying to get media from the json value format stored.
2016-06-14 17:43:46 +02:00
Sebastiaan Janssen 85b00f60ab Update broken unit test 2016-06-14 14:38:19 +02:00
Sebastiaan Janssen 2ae2047b7c Temporarily ignore two failing tests 2016-06-14 14:18:24 +02:00
Shannon c5aa97e23a Merge branch 'temp-packages' into dev-v7
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less
2016-06-14 14:15:47 +02:00
Shannon 017b925fe7 Merge branch 'temp-packages' of https://github.com/umbraco/Umbraco-CMS into temp-packages 2016-06-14 14:12:41 +02:00
Shannon 3fcb2a7840 Installer is now 'fully' working 2016-06-14 14:12:10 +02:00
Mads Rasmussen 5f506a8bbc fix dropzone width 2016-06-13 23:50:36 +02:00
Sebastiaan Janssen 8539de08d0 IRedirectUrlRepository needs to be public 2016-06-13 23:41:19 +02:00
Shannon a8c71e52ec Ensures the min umbraco version is checked when installing packages that have the strict flag set. 2016-06-13 23:35:09 +02:00
Sebastiaan Janssen 7cddeca730 New installer background 2016-06-13 23:24:58 +02:00
Sebastiaan Janssen 7f154e28de Add the beta label 2016-06-13 23:24:57 +02:00
Sebastiaan Janssen b2cd4820be Updates Examine 2016-06-13 23:24:19 +02:00
Sebastiaan Janssen 82954b6b6f Merge pull request #1325 from umbraco/temp-u4-8361
U4-8361 Basic 301 Support In Core
2016-06-13 23:22:34 +02:00
Stephan ef181b7230 U4-8361 - internal some things 2016-06-13 23:20:27 +02:00
Mads Rasmussen 67d71908bf add back button when uninstalling package 2016-06-13 22:45:42 +02:00
Jeremy Pyne 4cf202188f Update markdowneditor.controller.js
This is a important fix for the Markdown property type.  I added code previously to get it to properly record changes made via the button controls.  This was causing every document loaded with a markdown property on it to immedetly be flagged as checked with IsDirty() instead of only when a change was actually made.
2016-06-13 15:20:07 -04:00
Mads Rasmussen e38d4b7e88 increase icon font size 2016-06-13 20:57:00 +02:00
James Jackson-South c9c1aea8ab Update ImageProcessor, clean up log message 2016-06-14 04:54:26 +10:00
Sebastiaan Janssen 2407517fd5 Merge pull request #1326 from AndyButland/u4-3805f
u4-3805 - Set fixed value for click-jacking protection to sameorigin...
2016-06-13 20:54:26 +02:00
AndyButland 0a00be7cfe Set fixed value for click-jacking protection to sameorigin instead of deny 2016-06-13 20:48:37 +02:00
Mads Rasmussen 1a7993b9d7 set bigger font icon on uninstall dashboard 2016-06-13 20:46:40 +02:00
James Jackson-South b7ef324287 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into U4-8588 2016-06-14 04:24:46 +10:00
Shannon c0625a7853 adds small icon to packages without them 2016-06-13 20:15:11 +02:00
Shannon 3d2fe3c9da Install/uninstall working - just need a few ui updates and then get the repo install working 2016-06-13 20:10:31 +02:00
Stephan 839603342b U4-8361 - bugfix, get events to work 2016-06-13 19:45:25 +02:00
Andy Butland 203e9e3394 Ensured click-jacking meta-tag health check searches case insensitively (#1324) 2016-06-13 19:44:01 +02:00
Shannon 2d9010caf4 I can haz package uninstallation 2016-06-13 19:43:04 +02:00
Shannon c2b016d7d0 Gets local package installation 'working', now needs a little UI work. 2016-06-13 18:28:56 +02:00
Sebastiaan Janssen d83d7956bb Dev v7 health check (#1220)
Adds health check feature including some initial checks
2016-06-13 17:42:05 +02:00
James Jackson-South 33cbcbb7d4 Save projects. 2016-06-13 22:47:49 +10:00
James Jackson-South b0a4cc3333 Updates ImageProcessor 💥
- Update versions
- Add ImageProcessorLogger
2016-06-13 22:43:05 +10:00
Shannon f5d3f9087f updates to package filtering to unselect a category 2016-06-13 13:29:51 +02:00
Shannon 441ea0cfaf Got the package search/filter/etc.. all working 2016-06-13 13:10:26 +02:00
Shannon 5a32e1a294 package tree is basically done, got the editor updated to work with the server data to display the initial screen and details 2016-06-12 21:39:29 +02:00
Claus 2e9e8f23e9 adjustments for paddings. 2016-06-12 20:40:39 +02:00
Claus a099c40d93 U4-8584 Starterkit thumbnails are not really thumbnails
adding a parameter to the image url to avoid loading a massive image when its only rendered in a thumbnail size.
2016-06-12 20:39:53 +02:00
Stephan 795e6945e3 Merge pull request #1313 from marcemarc/temp-u4-8361
Create 301 Redirects When Urls Change - merging for review
2016-06-12 19:54:00 +02:00
Stephan e231206555 U4-8361 - bugfix, get finder to work 2016-06-12 19:47:11 +02:00
James Jackson-South 7cfead45a6 Fix #U4-8583
Add styles to the hacks.less file that fixes all pre and code samples
within the back office.
2016-06-13 03:30:54 +10:00
Marc Goodson 7c49bb4aca Event Handler to wire up to publishing and moving events to track Url changes, and then create appropriate 301 redirects using the new RedirectUrlService to maintain google juice 2016-06-12 16:54:13 +01:00
Stephan 0ad25ff7b9 Merge pull request #1310 from JimBobSquarePants/temp-u4-8361
Add IContentFinder implementation.
2016-06-12 16:47:44 +02:00
Stephan 2570a9139c U4-8361 - service & repository 2016-06-12 16:22:06 +02:00
James Jackson-South c916c09dee Add IContentFinder implementation. 2016-06-12 23:51:22 +10:00
Stephan 79bbd6a70c U4-8361 - implement repository 2016-06-12 15:27:54 +02:00
Shannon ba9315079b Merge branch 'temp-packages' of https://github.com/umbraco/Umbraco-CMS into temp-packages 2016-06-12 15:20:50 +02:00
Shannon cba91145ee Updates new packages tree, obsoletes old one, have the package UI running for root node and sub nodes only for created packages. 2016-06-12 15:19:42 +02:00
Stephan a7759c6175 U4-8361 - renaming 2016-06-12 13:07:00 +02:00
Stephan 36fbb9df86 U4-8361 - initial work 2016-06-12 12:38:35 +02:00
Mads Rasmussen ae7c145fcd add scrollable header to details page 2016-06-12 11:45:57 +02:00
James Jackson-South ceddf6c883 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2016-06-10 20:31:59 +10:00
Oliver Philpott 952ff74899 Fixed formatting for woff2 mimetype 2016-06-09 10:26:03 +01:00
Oliver Philpott 3f5729767d U4-8509 - Added woff2 mime type 2016-06-09 10:08:05 +01:00
Jeremy Pyne fed8a170cd Update CodeArea.cs
Added a missing include so the matchbrackets tag works in CodeMirror.
2016-06-08 12:40:15 -04:00
Mads Rasmussen 08ae541bd8 center icons in header 2016-06-01 13:47:03 +02:00
Mads Rasmussen e3b8ad5e23 fake loading state 2016-06-01 13:27:33 +02:00
Mads Rasmussen 6dab9d2966 clean up overview controller and view 2016-06-01 13:19:02 +02:00
Mads Rasmussen d435c8c4c8 hide footer 2016-06-01 13:16:49 +02:00
Simon Busborg 2ce2a03072 Local installer 2016-06-01 13:03:19 +02:00
Mads Rasmussen a39150a98c added auto focus to search field 2016-06-01 12:57:53 +02:00
Mads Rasmussen 0d99e1d9a2 added pagination 2016-06-01 11:12:34 +02:00
Mads Rasmussen 43f7a18eb6 move details view into repo sub view 2016-06-01 10:06:09 +02:00
Mads Rasmussen 41bef87365 add description to package 2016-05-31 21:56:33 +02:00
Mads Rasmussen 05cdc066ab do not redirect when changing category 2016-05-31 21:29:23 +02:00
Mads Rasmussen 5858823252 add even spacing to sections + a bit more padding to category nav 2016-05-31 21:29:00 +02:00
Mads Rasmussen 86eaacc5d2 tighten repo overview a bit 2016-05-31 21:10:52 +02:00
Simon Busborg c66de2298b Added local installer 2016-05-31 16:18:41 +02:00
Mads Rasmussen 4545e83534 added list for installed packages 2016-05-31 16:00:23 +02:00
Mads Rasmussen c36db267ce add val-form-manager to fix js errors 2016-05-31 15:57:34 +02:00
Mads Rasmussen 8b3160cd79 remove unused model 2016-05-31 15:56:56 +02:00
Mads Rasmussen 5ba2967c15 added design for package details 2016-05-31 14:02:07 +02:00
Shannon 03d53737a0 Fixes issue with a zero offset time - which in JS also means false, so need to check for undefined explicitly 2016-05-31 13:39:14 +02:00
Simon Busborg c3e4b611a6 added subviews 2016-05-31 11:18:34 +02:00
Darren Ferguson def690b8c3 Fix U4-8532 - No built in Active Directory authentication in Umbraco 7.3+ 2016-05-30 11:15:03 +01:00
Mads Rasmussen 521329feac send id to category and details view 2016-05-30 09:15:28 +02:00
Darren Ferguson b168923d5f http://issues.umbraco.org/issue/U4-7032 : Include a password checker for Active Directory - as ability to authenticate via AD was removed in 7.3 2016-05-29 15:46:42 +01:00
Jeremy Pyne 24959f4495 Macro's inserted in the grid should block link clicks so that users done accidentally navigate away from backoffice when trying to edit macro settings. 2016-05-27 16:51:34 -04:00
Simon Busborg 5b9d063808 Changed categories 2016-05-27 14:52:35 +02:00
Mads Rasmussen a04cb1d970 added details view 2016-05-27 14:29:30 +02:00
Mads Rasmussen d77986fb18 open overview html instead of edit html.. add category html and link the two views 2016-05-27 13:11:03 +02:00
Simon Busborg db21aef150 added icons and versions 2016-05-27 11:59:19 +02:00
Mads Rasmussen 140218b0ed remove install button + make categories smaller 2016-05-27 10:32:55 +02:00
bjarnef 2f1b234d85 Fix template translation 2016-05-26 22:43:15 +02:00
bjarnef 00ae650ee2 Modify a few other keys 2016-05-26 22:37:49 +02:00
bjarnef e3dae6d77e Fix a few translations in da.xml 2016-05-26 22:24:33 +02:00
Stephan 6a0ca68d17 Fixing, stupid 2016-05-26 18:44:22 +02:00
Stephan 928e74f24c No C# 6 yet 2016-05-26 17:14:13 +02:00
Stephan d0c030a34c Reduce dictionary allocs in TracksChangesEntityBase 2016-05-26 16:49:55 +02:00
Shannon 41b68333d2 publicizes EnableChangeTracking and DisableChangeTracking methods for entities, ensures that change tracking is disabled whenever building an entity for a repository as this is totally unnecessary and probably large memory overhead. Updates examine content indexer to page by 10000 rows 2016-05-26 16:36:53 +02:00
Simon Busborg 3cc8a71a60 added button back 2016-05-26 16:31:56 +02:00
Shannon 628ce5ea1f Backports some changes from v8 so that we can perform a nice strongly typed query with paging - this is then used for the content indexer to index content via the db for published content instead of the xml cache system. This was already done in v8 but have no backported the logic and fixed up the unit tests. When merging with v8 we will most likely just keep all v8 stuff and discard these changes, but we'll need to compare just in case. All tests pass and re-indexing is working as expected. Also updated the paging count from 1000 to 5000 for reindexing. 2016-05-26 15:30:40 +02:00
Simon Busborg 8a744b52fe Removed install button, better spacing 2016-05-26 15:21:12 +02:00
Mads Rasmussen 098eb32ef6 added categories 2016-05-26 14:57:38 +02:00
Simon Busborg 7bb8430022 Packages 📦 2016-05-26 14:50:11 +02:00
Simon Busborg 259ccd653e Added dummy data to packages 2016-05-26 14:13:55 +02:00
Simon Busborg f876b6b728 added umb-packages.less, added repeater for packages + minimal styling 2016-05-26 13:39:01 +02:00
Mads Rasmussen 05746c7b7c added editor scaffold 2016-05-26 13:12:41 +02:00
Mads Rasmussen 30ac4e94be hacked new packages tree 2016-05-26 13:12:05 +02:00
Shannon bab693f2ba fix build 2016-05-25 10:56:41 +02:00
Shannon f243133b95 Merge remote-tracking branch 'origin/dev-v7' into temp-U4-265
# Conflicts:
#	src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs
2016-05-25 09:51:46 +02:00
Shannon 2504586c26 removes initial idea of performing conversion on the server since this would be a breaking change, instead we can easily do this on the client side - and this works much better. Have added pre-values to the date/time picker to be able to enable offset times. This is enabled for the publish-at pickers since those must be offset. When the datetime is offset, it shows the server time in small text underneath the picker. Have added js unit tests for the date conversions. Have updated the datepicker controller to set the model date in a single place/method so it's consistent. 2016-05-25 09:43:31 +02:00
Jeroen Breuer 1fc17e6f46 Fix for U4-8510 2016-05-24 17:04:39 +02:00
Shannon b69580967e Updates interceptor files with correct module usage - creates new request interceptor to append a custom Time-Offset header 2016-05-24 16:12:54 +02:00
bjarnef 695c69af7f Updated indent 2016-05-22 21:11:51 +02:00
bjarnef 0607782028 Added localization for the new password reset stuff. 2016-05-22 21:08:21 +02:00
bjarnef 45ff11b884 Change "siten" to "sitet" 2016-05-22 14:26:37 +02:00
bjarnef e39f818389 Fix indent 2016-05-22 13:53:43 +02:00
bjarnef e2aee08959 Change back to original timeout value. 2016-05-22 13:52:02 +02:00
bjarnef 5fab1ca207 Localize move and copy overlay titles opened from listview actions. Prepare localization of bulk messages. 2016-05-22 13:46:48 +02:00
Dennis Aaen 02ffaa9ee8 Fixed issue: U4-8435 so the link is correct in settingsdashboardintro dashboard 2016-05-10 20:33:03 +02:00
Alexander Bryukhov 89cd2f50d7 Update UI language ru.xml
New area and keys for unsaved changes dialog localization (PR #1234)
New keys for list view localization PR #1235
2016-04-24 23:09:46 +06:00
Dynacy ff5714196c Update tr.xml 2016-04-22 12:34:03 +03:00
Dynacy b607ba52f4 Create tr.xml
Turkish Language
2016-04-22 12:26:26 +03:00
Alexander Bryukhov c10534a064 Update UI language ru.xml
Missing keys & some typos found
2016-04-14 23:31:24 +06:00
Simone Chiaretta 227e7a9c70 [U4-8128] Always rejecting promise even with server error
Updated postSaveContent and resourcePromise to always reject the promise (thus always calling callers error handler) even when the error is 500 server error
2016-03-08 11:21:21 +01:00
René Pjengaard f5ceab82f1 Update da.xml
Added translation for contentPublishedFailedAwaitingRelease
2016-02-12 14:00:45 +01:00
621 changed files with 21540 additions and 7744 deletions
+2
View File
@@ -56,6 +56,7 @@ build/*.nupkg
src/Umbraco.Tests/config/applications.config
src/Umbraco.Tests/config/trees.config
src/Umbraco.Web.UI/web.config
src/Umbraco.Web.UI/Config/ClientDependency.config
*.orig
src/Umbraco.Tests/config/404handlers.config
src/Umbraco.Web.UI/[Vv]iews/*.cshtml
@@ -139,3 +140,4 @@ apidocs/api/*
build/docs.zip
build/ui-docs.zip
build/csharp-docs.zip
build/msbuild.log
+5 -3
View File
@@ -3,11 +3,13 @@ Umbraco CMS
Umbraco is a free open source Content Management System built on the ASP.NET platform.
## Building Umbraco from source ##
The easiest way to get started is to run `build/build.bat` which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `grunt dev` in `src\Umbraco.Web.UI.Client`.
The easiest way to get started is to run `build/build.bat` which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `grunt vs` in `src\Umbraco.Web.UI.Client`.
If you're interested in making changes to Belle make sure to read the [Belle ReadMe file](src/Umbraco.Web.UI.Client/README.md). Note that you can always [download a nightly build](http://nightly.umbraco.org/umbraco%207.0.0/) so you don't have to build the code yourself.
If you're interested in making changes to Belle without running Visual Studio make sure to read the [Belle ReadMe file](src/Umbraco.Web.UI.Client/README.md).
## Watch a introduction video ##
Note that you can always [download a nightly build](http://nightly.umbraco.org/?container=umbraco-750) so you don't have to build the code yourself.
## Watch an introduction video ##
[![ScreenShot](http://umbraco.com/images/whatisumbraco.png)](https://umbraco.tv/videos/umbraco-v7/content-editor/basics/introduction/cms-explanation/)
+23 -17
View File
@@ -8,39 +8,45 @@ build_script:
FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SET "release=%%i"
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
ECHO %PATH%
ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER%
SET nuGetFolder=%CD%\..\src\packages\
SET nuGetFolder=C:\Users\appveyor\.nuget\packages
..\src\.nuget\NuGet.exe sources Add -Name MyGetUmbracoCore -Source https://www.myget.org/F/umbracocore/api/v2/ >NUL
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
IF EXIST ..\src\umbraco.businesslogic\packages.config ..\src\.nuget\NuGet.exe install ..\src\umbraco.businesslogic\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Core\packages.config -OutputDirectory %nuGetFolder% -Verbosity quiet
ECHO Building Release %release% build%APPVEYOR_BUILD_NUMBER%
SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
SET MSBUILD="C:\Program Files (x86)\MSBuild\14.0\Bin\MsBuild.exe"
%MSBUILD% "../src/Umbraco.Tests/Umbraco.Tests.csproj" /verbosity:minimal
build.bat %release% build%APPVEYOR_BUILD_NUMBER%
XCOPY "..\src\Umbraco.Tests\unit-test-log4net.CI.config" "..\src\Umbraco.Tests\unit-test-log4net.config" /Y
%MSBUILD% "..\src\Umbraco.Tests\Umbraco.Tests.csproj" /consoleloggerparameters:Summary;ErrorsOnly
build.bat nopause %release% build%APPVEYOR_BUILD_NUMBER%
ECHO %PATH%
test:
assemblies: src\Umbraco.Tests\bin\Debug\Umbraco.Tests.dll
artifacts:
- path: build\UmbracoCms.*
name: UmbracoFiles
- path: build\msbuild.log
name: BuildLog
deploy:
- provider: AzureBlob
storage_account_name: umbraconightlies
storage_access_key:
secure: bmEMml2SF7QLHULiePa/a01XOeIa2SxJeXuaZ+1R27b+Vb2nNUQVYiPlUyF2cZAFSHI/zO/LekRsVU1rTescGhJjF7SSjKybymI3p+F/OWpwqiu2WfFee1ofXBFx8QHw
container: umbraco-750
artifact: UmbracoFiles
on:
branch: dev-v7
notifications:
- provider: Slack
auth_token:
+48 -11
View File
@@ -11,20 +11,28 @@ FOR /F "skip=1 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED release SE
FOR /F "skip=2 delims=" %%i IN (UmbracoVersion.txt) DO IF NOT DEFINED comment SET "comment=%%i"
REM If there's arguments on the command line overrule UmbracoVersion.txt and use that as the version
IF [%1] NEQ [] (SET release=%1)
IF [%2] NEQ [] (SET comment=%2) ELSE (IF [%1] NEQ [] (SET "comment="))
IF [%2] NEQ [] (SET release=%2)
IF [%3] NEQ [] (SET comment=%3) ELSE (IF [%2] NEQ [] (SET "comment="))
REM Get the "is continuous integration" from the parameters
SET "isci=0"
IF [%1] NEQ [] (SET isci=1)
SET version=%release%
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ECHO.
ECHO Building Umbraco %version%
ECHO.
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%
ECHO.
ECHO Removing the belle build folder and bower_components folder to make sure everything is clean as a whistle
RD ..\src\Umbraco.Web.UI.Client\build /Q /S
RD ..\src\Umbraco.Web.UI.Client\bower_components /Q /S
ECHO.
ECHO Removing existing built files to make sure everything is clean as a whistle
RMDIR /Q /S _BuildOutput
DEL /F /Q UmbracoCms.*.zip
@@ -32,27 +40,56 @@ DEL /F /Q UmbracoExamine.*.zip
DEL /F /Q UmbracoCms.*.nupkg
DEL /F /Q webpihash.txt
ECHO.
ECHO Making sure Git is in the path so that the build can succeed
CALL InstallGit.cmd
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% /verbosity:minimal
REM Adding the default Git path so that if it's installed it can actually be found
REM This is necessary because SETLOCAL is on in InstallGit.cmd so that one might find Git,
REM but the path setting is lost due to SETLOCAL
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
ECHO.
ECHO Making sure we have a web.config
IF NOT EXIST %CD%\..\src\Umbraco.Web.UI\web.config COPY %CD%\..\src\Umbraco.Web.UI\web.Template.config %CD%\..\src\Umbraco.Web.UI\web.config
ECHO.
ECHO.
ECHO Performing MSBuild and producing Umbraco binaries zip files
ECHO This takes a few minutes and logging is set to report warnings
ECHO and errors only so it might seems like nothing is happening for a while.
ECHO You can check the msbuild.log file for progress.
ECHO.
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment% /p:NugetPackagesDirectory=%nuGetFolder% /consoleloggerparameters:Summary;ErrorsOnly;WarningsOnly /fileLogger
IF ERRORLEVEL 1 GOTO :error
ECHO.
ECHO Setting node_modules folder to hidden to prevent VS13 from crashing on it while loading the websites project
attrib +h ..\src\Umbraco.Web.UI.Client\node_modules
ECHO.
ECHO Adding Web.config transform files to the NuGet package
REN .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
REN .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
ECHO.
ECHO Packing the NuGet release files
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.Core.nuspec -Version %version% -Symbols -Verbosity quiet
..\src\.nuget\NuGet.exe Pack NuSpecs\UmbracoCms.nuspec -Version %version% -Verbosity quiet
IF ERRORLEVEL 1 GOTO :showerror
IF ERRORLEVEL 1 GOTO :error
ECHO No errors were detected but you still may see some in the output, then it's time to investigate.
ECHO You might see some warnings but that is completely normal.
:success
ECHO.
ECHO No errors were detected!
ECHO There may still be some in the output, which you would need to investigate.
ECHO Warnings are usually normal.
GOTO :EOF
:showerror
PAUSE
:error
ECHO.
ECHO Errors were detected!
REM don't pause if continuous integration else the build server waits forever
REM before cancelling the build (and, there is noone to read the output anyways)
IF isci NEQ 1 PAUSE
+1
View File
@@ -23,6 +23,7 @@ ECHO Change directory to %CD%\..\src\Umbraco.Web.UI.Client\
CD %CD%\..\src\Umbraco.Web.UI.Client\
ECHO Do npm install and the grunt build of Belle
call npm cache clean --quiet
call npm install --quiet
call npm install -g grunt-cli --quiet
call npm install -g bower --quiet
+44 -13
View File
@@ -1,23 +1,33 @@
@ECHO OFF
SETLOCAL
REM SETLOCAL is on, so changes to the path not persist to the actual user's path
:: SETLOCAL is on, so changes to the path not persist to the actual user's path
git.exe 2> NUL
if %ERRORLEVEL%==9009 GOTO :trydefaultpath
git.exe --version
IF %ERRORLEVEL%==9009 GOTO :trydefaultpath
GOTO :EOF
:: Git is installed, no need to to anything else
:trydefaultpath
path=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
git.exe 2> NUL
if %ERRORLEVEL%==9009 GOTO :showerror
PATH=C:\Program Files (x86)\Git\cmd;C:\Program Files\Git\cmd;%PATH%
git.exe --version
IF %ERRORLEVEL%==9009 GOTO :showerror
GOTO :EOF
:: Git is installed, no need to to anything else
:showerror
ECHO Git is not in your path and could not be found in C:\Program Files (x86)\Git\cmd nor in C:\Program Files\Git\cmd
set /p install=" Do you want to install Git through Chocolatey [y/n]? " %=%
if %install%==y (
SET /p install=" Do you want to install Git through Chocolatey [y/n]? " %=%
IF %install%==y (
:: Create a temporary batch file to execute either after elevating to admin or as-is when the user is already admin
ECHO @ECHO OFF > "%temp%\ChocoInstallGit.cmd"
ECHO SETLOCAL >> "%temp%\ChocoInstallGit.cmd"
ECHO ECHO Installing Chocolatey first >> "%temp%\ChocoInstallGit.cmd"
ECHO @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" >> "%temp%\ChocoInstallGit.cmd"
ECHO SET PATH=%%PATH%%;%%ALLUSERSPROFILE%%\chocolatey\bin >> "%temp%\ChocoInstallGit.cmd"
ECHO choco install git -y >> "%temp%\ChocoInstallGit.cmd"
GOTO :installgit
) else (
) ELSE (
GOTO :cantcontinue
)
@@ -26,7 +36,28 @@ ECHO Can't complete the build without Git being in the path. Please add it to be
GOTO :EOF
:installgit
ECHO Installing Chocolatey first
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
ECHO Installing Git through Chocolatey
choco install git
pushd %~dp0
:: Running prompt elevated
:: --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
:: --> If error flag set, we do not have admin.
IF '%errorlevel%' NEQ '0' (
GOTO UACPrompt
) ELSE ( GOTO gotAdmin )
:UACPrompt
ECHO You're not currently running this with admin privileges, we'll now try to execute the install of Git through Chocolatey after elevating to admin privileges
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
ECHO UAC.ShellExecute "%temp%\ChocoInstallGit.cmd", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
EXIT /B
:gotAdmin
IF EXIST "%temp%\getadmin.vbs" ( DEL "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
CALL "%temp%\ChocoInstallGit.cmd"
+8 -6
View File
@@ -27,15 +27,17 @@
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
<dependency id="MySql.Data" version="[6.9.8, 7.0.0)" />
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
<dependency id="ClientDependency" version="[1.8.4, 2.0.0)" />
<dependency id="ClientDependency" version="[1.9.1, 2.0.0)" />
<dependency id="ClientDependency-Mvc5" version="[1.8.0, 2.0.0)" />
<dependency id="AutoMapper" version="[3.0.0, 3.1.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 9.0.0)" />
<dependency id="Examine" version="[0.1.68, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.3.3, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.5.3, 5.0.0)" />
<!-- AutoMapper can not be updated due to: https://github.com/AutoMapper/AutoMapper/issues/373#issuecomment-127644405 -->
<dependency id="AutoMapper" version="[3.3.1, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 10.0.0)" />
<dependency id="Examine" version="[0.1.70, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.4.5, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.6.6, 5.0.0)" />
<dependency id="semver" version="[1.1.2, 2.0.0)" />
<dependency id="UrlRewritingNet" version="[2.0.7, 3.0.0)" />
<!-- Markdown can not be updated due to: https://github.com/hey-red/markdownsharp/issues/71#issuecomment-233585487 -->
<dependency id="Markdown" version="[1.14.4, 2.0.0)" />
</dependencies>
</metadata>
+4 -3
View File
@@ -16,8 +16,8 @@
<tags>umbraco</tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="[$version$]" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 9.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.2, 4.0.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 10.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.4, 4.0.0)" />
</dependencies>
</metadata>
<files>
@@ -32,6 +32,7 @@
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\Config\splashes" />
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
<file src="..\_BuildOutput\WebApp\Media\Web.config" target="Content\Media\Web.config" />
<file src="tools\install.ps1" target="tools\install.ps1" />
<file src="tools\Readme.txt" target="tools\Readme.txt" />
<file src="tools\ReadmeUpgrade.txt" target="tools\ReadmeUpgrade.txt" />
@@ -44,4 +45,4 @@
<file src="tools\Views.Web.config.install.xdt" target="Views\Web.config.install.xdt" />
<file src="build\**" target="build" />
</files>
</package>
</package>
@@ -21,6 +21,12 @@
</section>
<section alias="StartupDeveloperDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
<areas xdt:Transform="InsertIfMissing">
<area xdt:Transform="InsertIfMissing">developer</area>
</areas>
</section>
<section alias="StartupDeveloperDashboardSection">
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Replace">
<control showOnce="true" addPanel="true" panelCaption="">
views/dashboard/developer/developerdashboardvideos.html
@@ -30,16 +36,21 @@
</section>
<section alias="StartupDeveloperDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
<tab caption="Examine Management" xdt:Locator="Match(caption)" xdt:Transform="InsertIfMissing">
<tab caption="Examine Management" xdt:Locator="Match(caption)" xdt:Transform="InsertIfMissing">
<control>
views/dashboard/developer/examinemanagement.html
</control>
</tab>
<tab caption="Xml Data Integrity Report" xdt:Transform="InsertIfMissing">
</tab>
<tab caption="Health Check" xdt:Transform="InsertIfMissing" xdt:Locator="Match(caption)">
<control>
views/dashboard/developer/xmldataintegrityreport.html
views/dashboard/developer/healthcheck.html
</control>
</tab>
</tab>
<tab caption="Redirect URL Management" xdt:Transform="InsertIfMissing" xdt:Locator="Match(caption)">
<control>
views/dashboard/developer/redirecturls.html
</control>
</tab>
</section>
<section alias="StartupMediaDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
@@ -52,19 +63,6 @@
</tab>
</section>
<section alias="StartupDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
<tab caption="Get Started" xdt:Transform="Insert">
<access>
<grant>admin</grant>
</access>
<control showOnce="true" addPanel="true" panelCaption="">
views/dashboard/default/startupdashboardintro.html
</control>
</tab>
<tab caption="Last Edits" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
</section>
<section alias="StartupMemberDashboardSection" xdt:Locator="Match(alias)" xdt:Transform="InsertIfMissing">
<tab caption="Get Started" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
<tab caption="Get Started" xdt:Transform="Insert">
@@ -80,5 +78,6 @@
<section alias="StartupDashboardSection">
<tab caption="Change Password" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
<tab caption="Last Edits" xdt:Locator="Match(caption)" xdt:Transform="Remove" />
</section>
</dashBoard>
@@ -292,6 +292,8 @@
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
<remove fileExtension=".woff" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
<remove fileExtension=".woff2" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
<mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
<remove fileExtension=".less" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
<mimeMap fileExtension=".less" mimeType="text/css" xdt:Locator="Match(fileExtension)" xdt:Transform="InsertIfMissing" />
</staticContent>
@@ -317,6 +319,7 @@
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='HtmlAgilityPack')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='AutoMapper')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Net.Http')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Newtonsoft.Json')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Web.Mvc')" xdt:Transform="Remove" />
@@ -336,6 +339,10 @@
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="AutoMapper" publicKeyToken="be96cd2c38ef1005" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.1.0" newVersion="3.3.1.0" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
+6 -1
View File
@@ -97,7 +97,12 @@ if ($project) {
$umbracoUIXMLSource = Join-Path $installPath "UmbracoFiles\Umbraco\Config\Create\UI.xml"
$umbracoUIXMLDestination = Join-Path $projectPath "Umbraco\Config\Create\UI.xml"
Copy-Item $umbracoUIXMLSource $umbracoUIXMLDestination -Force
}
} else {
$upgradeViewSource = Join-Path $umbracoFolderSource "Views\install\*"
$upgradeView = Join-Path $umbracoFolder "Views\install\"
Write-Host "Copying2 ${upgradeViewSource} to ${upgradeView}"
Copy-Item $upgradeViewSource $upgradeView -Force
}
$installFolder = Join-Path $projectPath "Install"
if(Test-Path $installFolder) {
+17 -9
View File
@@ -55,21 +55,29 @@
xdt:Transform="SetAttributes()" />
<!--Developer-->
<add alias="datatype" application="developer"
<add alias="packager" application="developer"
xdt:Locator="Match(application,alias)"
xdt:Transform="Remove" />
<add initialize="true" sortOrder="0" alias="datatypes" application="developer" title="Data Types" iconClosed="icon-folder" iconOpen="icon-folder" type="Umbraco.Web.Trees.DataTypeTreeController, umbraco"
<add alias="packagerPackages" application="developer"
xdt:Locator="Match(application,alias)"
xdt:Transform="InsertIfMissing" />
xdt:Transform="Remove" />
<add initialize="true" sortOrder="0" alias="packager" application="developer" iconClosed="icon-folder" iconOpen="icon-folder-open" type="Umbraco.Web.Trees.PackagesTreeController, umbraco"
xdt:Locator="Match(application,alias)"
xdt:Transform="InsertIfMissing" />
<!-- Before 7.4 this tree had the alias 'dataType', without the 's' on the end, this is here to rename it -->
<add sortOrder="1" alias="dataTypes" application="developer" type="Umbraco.Web.Trees.DataTypeTreeController, umbraco"
xdt:Locator="Match(application,type)"
xdt:Transform="SetAttributes(alias,sortOrder)" />
<!-- Yes, set the sortOrder again, like above because.. sometimes apparently we already have a dataTypes node and we can't remove more than one.. if they're equal though (same alias,application and sortOrder) it doesn't throw an error -->
<add sortOrder="1" alias="dataTypes" application="developer"
xdt:Locator="Match(application,alias)"
xdt:Transform="SetAttributes(sortOrder)" />
<add application="developer" alias="macros" title="Macros" type="umbraco.loadMacros, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="2"
xdt:Locator="Match(application,alias)"
xdt:Transform="SetAttributes()" />
<add application="developer" alias="packager" title="Packages" type="umbraco.loadPackager, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="3"
xdt:Locator="Match(application,alias)"
xdt:Transform="SetAttributes()" />
<add application="developer" alias="packagerPackages" title="Packager Packages" type="umbraco.loadPackages, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" initialize="false" sortOrder="3"
xdt:Locator="Match(application,alias)"
xdt:Transform="SetAttributes()" />
<add application="developer" alias="relationTypes" title="Relation Types" type="umbraco.loadRelationTypes, umbraco" iconClosed="icon-folder" iconOpen="icon-folder" sortOrder="4"
xdt:Locator="Match(application,alias)"
xdt:Transform="SetAttributes()" />
+1 -1
View File
@@ -1,2 +1,2 @@
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
7.5.0
7.5.4
+4 -9
View File
@@ -40,15 +40,10 @@ namespace SqlCE4Umbraco
var localConnection = new SqlCeConnection(ConnectionString);
if (!System.IO.File.Exists(ReplaceDataDirectory(localConnection.Database)))
{
var sqlCeEngine = new SqlCeEngine(ConnectionString);
sqlCeEngine.CreateDatabase();
// SD: Pretty sure this should be in a using clause but i don't want to cause unknown side-effects here
// since it's been like this for quite some time
//using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
//{
// sqlCeEngine.CreateDatabase();
//}
using (var sqlCeEngine = new SqlCeEngine(ConnectionString))
{
sqlCeEngine.CreateDatabase();
}
}
}
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.5.0")]
[assembly: AssemblyInformationalVersion("7.5.0")]
[assembly: AssemblyFileVersion("7.5.4")]
[assembly: AssemblyInformationalVersion("7.5.4")]
@@ -9,6 +9,9 @@ namespace Umbraco.Core.Cache
/// <summary>
/// A cache provider that caches items in the HttpContext.Items
/// </summary>
/// <remarks>
/// If the Items collection is null, then this provider has no effect
/// </remarks>
internal class HttpRequestCacheProvider : DictionaryCacheProviderBase
{
// context provider
@@ -34,6 +37,11 @@ namespace Umbraco.Core.Cache
get { return _context != null ? _context.Items : HttpContext.Current.Items; }
}
private bool HasContextItems
{
get { return (_context != null && _context.Items != null) || HttpContext.Current != null; }
}
// for unit tests
public HttpRequestCacheProvider(HttpContextBase context)
{
@@ -50,18 +58,23 @@ namespace Umbraco.Core.Cache
protected override IEnumerable<DictionaryEntry> GetDictionaryEntries()
{
const string prefix = CacheItemPrefix + "-";
if (HasContextItems == false) return Enumerable.Empty<DictionaryEntry>();
return ContextItems.Cast<DictionaryEntry>()
.Where(x => x.Key is string && ((string)x.Key).StartsWith(prefix));
}
protected override void RemoveEntry(string key)
{
if (HasContextItems == false) return;
ContextItems.Remove(key);
}
protected override object GetEntry(string key)
{
return ContextItems[key];
return HasContextItems ? ContextItems[key] : null;
}
#region Lock
@@ -81,7 +94,9 @@ namespace Umbraco.Core.Cache
get
{
return new MonitorLock(ContextItems.SyncRoot);
return HasContextItems
? (IDisposable) new MonitorLock(ContextItems.SyncRoot)
: new NoopLocker();
}
}
@@ -91,6 +106,9 @@ namespace Umbraco.Core.Cache
public override object GetCacheItem(string cacheKey, Func<object> getCacheItem)
{
//no place to cache so just return the callback result
if (HasContextItems == false) return getCacheItem();
cacheKey = GetCacheKey(cacheKey);
Lazy<object> result;
@@ -128,5 +146,10 @@ namespace Umbraco.Core.Cache
#region Insert
#endregion
private class NoopLocker : DisposableObject
{
protected override void DisposeResources()
{ }
}
}
}
+12 -21
View File
@@ -5,38 +5,31 @@ using System.Web.Caching;
namespace Umbraco.Core.Cache
{
internal class NullCacheProvider : IRuntimeCacheProvider
/// <summary>
/// Represents a cache provider that does not cache anything.
/// </summary>
public class NullCacheProvider : IRuntimeCacheProvider
{
public virtual void ClearAllCache()
{
}
{ }
public virtual void ClearCacheItem(string key)
{
}
{ }
public virtual void ClearCacheObjectTypes(string typeName)
{
}
{ }
public virtual void ClearCacheObjectTypes<T>()
{
}
{ }
public virtual void ClearCacheObjectTypes<T>(Func<string, T, bool> predicate)
{
}
{ }
public virtual void ClearCacheByKeySearch(string keyStartsWith)
{
}
{ }
public virtual void ClearCacheByKeyExpression(string regexString)
{
}
{ }
public virtual IEnumerable<object> GetCacheItemsByKeySearch(string keyStartsWith)
{
@@ -64,8 +57,6 @@ namespace Umbraco.Core.Cache
}
public void InsertCacheItem(string cacheKey, Func<object> getCacheItem, TimeSpan? timeout = null, bool isSliding = false, CacheItemPriority priority = CacheItemPriority.Normal, CacheItemRemovedCallback removedCallback = null, string[] dependentFiles = null)
{
}
{ }
}
}
@@ -1,23 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.Caching;
using System.Text.RegularExpressions;
using System.Threading;
using System.Web.Caching;
using Umbraco.Core.Logging;
using CacheItemPriority = System.Web.Caching.CacheItemPriority;
namespace Umbraco.Core.Cache
{
/// <summary>
/// Represents a cache provider that caches item in a <see cref="MemoryCache"/>.
/// A cache provider that wraps the logic of a System.Runtime.Caching.ObjectCache
/// </summary>
internal class ObjectCacheRuntimeCacheProvider : IRuntimeCacheProvider
/// <remarks>The <see cref="MemoryCache"/> is created with name "in-memory". That name is
/// used to retrieve configuration options. It does not identify the memory cache, i.e.
/// each instance of this class has its own, independent, memory cache.</remarks>
public class ObjectCacheRuntimeCacheProvider : IRuntimeCacheProvider
{
private readonly ReaderWriterLockSlim _locker = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
internal ObjectCache MemoryCache;
@@ -3,14 +3,13 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.Caching;
namespace Umbraco.Core.Cache
{
/// <summary>
/// A cache provider that statically caches everything in an in memory dictionary
/// Represents a cache provider that statically caches item in a concurrent dictionary.
/// </summary>
internal class StaticCacheProvider : ICacheProvider
public class StaticCacheProvider : ICacheProvider
{
internal readonly ConcurrentDictionary<string, object> StaticCache = new ConcurrentDictionary<string, object>();
@@ -75,7 +74,6 @@ namespace Umbraco.Core.Cache
public virtual object GetCacheItem(string cacheKey, Func<object> getCacheItem)
{
return StaticCache.GetOrAdd(cacheKey, key => getCacheItem());
}
}
}
}
@@ -291,7 +291,19 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
true);
}
}
[ConfigurationProperty("EnableInheritedMediaTypes")]
internal InnerTextConfigurationElement<bool> EnableInheritedMediaTypes
{
get
{
return new OptionalInnerTextConfigurationElement<bool>(
(InnerTextConfigurationElement<bool>)this["EnableInheritedMediaTypes"],
//set the default
true);
}
}
string IContentSection.NotificationEmailAddress
{
get { return Notifications.NotificationEmailAddress; }
@@ -431,5 +443,10 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
{
get { return EnableInheritedDocumentTypes; }
}
bool IContentSection.EnableInheritedMediaTypes
{
get { return EnableInheritedMediaTypes; }
}
}
}
@@ -61,5 +61,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
string DefaultDocumentTypeProperty { get; }
bool EnableInheritedDocumentTypes { get; }
bool EnableInheritedMediaTypes { get; }
}
}
@@ -9,6 +9,8 @@
bool DisableAlternativeTemplates { get; }
bool DisableFindContentByIdPath { get; }
bool DisableRedirectUrlTracking { get; }
string UrlProviderMode { get; }
@@ -27,6 +27,12 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
get { return (bool) base["disableFindContentByIdPath"]; }
}
[ConfigurationProperty("disableRedirectUrlTracking", DefaultValue = "false")]
public bool DisableRedirectUrlTracking
{
get { return (bool) base["disableRedirectUrlTracking"]; }
}
[ConfigurationProperty("urlProviderMode", DefaultValue = "AutoLegacy")]
public string UrlProviderMode
{
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.5.0");
private static readonly Version Version = new Version("7.5.4");
/// <summary>
/// Gets the current version of Umbraco.
@@ -73,6 +73,11 @@
/// </summary>
public const string DataTypes = "dataTypes";
/// <summary>
/// alias for the packages tree
/// </summary>
public const string Packages = "packager";
/// <summary>
/// alias for the dictionary tree.
/// </summary>
+20 -7
View File
@@ -1,15 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Umbraco.Core
namespace Umbraco.Core
{
public static partial class Constants
{
public static class Examine
{
/// <summary>
/// The alias of the internal member indexer
/// </summary>
public const string InternalMemberIndexer = "InternalMemberIndexer";
/// <summary>
/// The alias of the internal content indexer
/// </summary>
public const string InternalIndexer = "InternalIndexer";
/// <summary>
/// The alias of the external content indexer
/// </summary>
public const string ExternalIndexer = "ExternalIndexer";
/// <summary>
/// The alias of the internal member searcher
/// </summary>
@@ -19,6 +27,11 @@ namespace Umbraco.Core
/// The alias of the internal content searcher
/// </summary>
public const string InternalSearcher = "InternalSearcher";
/// <summary>
/// The alias of the external content searcher
/// </summary>
public const string ExternalSearcher = "ExternalSearcher";
}
}
}
@@ -69,6 +69,11 @@ namespace Umbraco.Core
/// </summary>
public const string Document = "C66BA18E-EAF3-4CFF-8A22-41B16D66A972";
/// <summary>
/// Guid for a Document object.
/// </summary>
public static readonly Guid DocumentGuid = new Guid(Document);
/// <summary>
/// Guid for a Document Type object.
/// </summary>
+30 -23
View File
@@ -1,33 +1,40 @@
namespace Umbraco.Core
{
public static partial class Constants
{
/// <summary>
/// Defines the identifiers for Umbraco system nodes.
/// </summary>
public static class System
{
/// <summary>
/// The integer identifier for global system root node.
/// </summary>
public const int Root = -1;
public static partial class Constants
{
/// <summary>
/// Defines the identifiers for Umbraco system nodes.
/// </summary>
public static class System
{
/// <summary>
/// The integer identifier for global system root node.
/// </summary>
public const int Root = -1;
/// <summary>
/// The integer identifier for content's recycle bin.
/// </summary>
public const int RecycleBinContent = -20;
/// <summary>
/// The integer identifier for content's recycle bin.
/// </summary>
public const int RecycleBinContent = -20;
/// <summary>
/// The integer identifier for media's recycle bin.
/// </summary>
public const int RecycleBinMedia = -21;
/// <summary>
/// The integer identifier for media's recycle bin.
/// </summary>
public const int RecycleBinMedia = -21;
public const int DefaultContentListViewDataTypeId = -95;
public const int DefaultContentListViewDataTypeId = -95;
public const int DefaultMediaListViewDataTypeId = -96;
public const int DefaultMembersListViewDataTypeId = -97;
// identifiers for lock objects
public const int ServersLock = -331;
}
}
public const int ServersLock = -331;
}
public static class DatabaseProviders
{
public const string SqlCe = "System.Data.SqlServerCe.4.0";
public const string SqlServer = "System.Data.SqlClient";
public const string MySql = "MySql.Data.MySqlClient";
}
}
}
+20 -70
View File
@@ -135,7 +135,7 @@ namespace Umbraco.Core
if (string.IsNullOrEmpty(_providerName) == false)
return _providerName;
_providerName = "System.Data.SqlClient";
_providerName = Constants.DatabaseProviders.SqlServer;
if (ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName] != null)
{
if (string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName) == false)
@@ -212,10 +212,10 @@ namespace Umbraco.Core
{
var provider = DbConnectionExtensions.DetectProviderFromConnectionString(connectionString);
var databaseProvider = provider.ToString();
var providerName = "System.Data.SqlClient";
var providerName = Constants.DatabaseProviders.SqlServer;
if (databaseProvider.ToLower().Contains("mysql"))
{
providerName = "MySql.Data.MySqlClient";
providerName = Constants.DatabaseProviders.MySql;
}
SaveConnectionString(connectionString, providerName);
Initialize(string.Empty);
@@ -240,10 +240,10 @@ namespace Umbraco.Core
public string GetDatabaseConnectionString(string server, string databaseName, string user, string password, string databaseProvider, out string providerName)
{
providerName = "System.Data.SqlClient";
providerName = Constants.DatabaseProviders.SqlServer;
if (databaseProvider.ToLower().Contains("mysql"))
{
providerName = "MySql.Data.MySqlClient";
providerName = Constants.DatabaseProviders.MySql;
return string.Format("Server={0}; Database={1};Uid={2};Pwd={3}", server, databaseName, user, password);
}
if (databaseProvider.ToLower().Contains("azure"))
@@ -260,7 +260,7 @@ namespace Umbraco.Core
/// <param name="databaseName">Name of the database</param>
public void ConfigureIntegratedSecurityDatabaseConnection(string server, string databaseName)
{
const string providerName = "System.Data.SqlClient";
const string providerName = Constants.DatabaseProviders.SqlServer;
var connectionString = GetIntegratedSecurityDatabaseConnectionString(server, databaseName);
SaveConnectionString(connectionString, providerName);
Initialize(providerName);
@@ -373,7 +373,7 @@ namespace Umbraco.Core
var databaseSettings = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName];
if (databaseSettings != null && string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) == false && string.IsNullOrWhiteSpace(databaseSettings.ProviderName) == false)
{
var providerName = "System.Data.SqlClient";
var providerName = Constants.DatabaseProviders.SqlServer;
string connString = null;
if (!string.IsNullOrEmpty(ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ProviderName))
{
@@ -381,8 +381,7 @@ namespace Umbraco.Core
connString = ConfigurationManager.ConnectionStrings[GlobalSettings.UmbracoConnectionName].ConnectionString;
}
Initialize(providerName, connString);
DetermineSqlServerVersion();
}
else if (ConfigurationManager.AppSettings.ContainsKey(GlobalSettings.UmbracoConnectionName) && string.IsNullOrEmpty(ConfigurationManager.AppSettings[GlobalSettings.UmbracoConnectionName]) == false)
{
@@ -395,8 +394,8 @@ namespace Umbraco.Core
else if (legacyConnString.ToLowerInvariant().Contains("tcp:"))
{
//Must be sql azure
SaveConnectionString(legacyConnString, "System.Data.SqlClient");
Initialize("System.Data.SqlClient");
SaveConnectionString(legacyConnString, Constants.DatabaseProviders.SqlServer);
Initialize(Constants.DatabaseProviders.SqlServer);
}
else if (legacyConnString.ToLowerInvariant().Contains("datalayer=mysql"))
{
@@ -407,20 +406,19 @@ namespace Umbraco.Core
foreach (var variable in legacyConnString.Split(';').Where(x => x.ToLowerInvariant().StartsWith("datalayer") == false))
connectionStringWithoutDatalayer = string.Format("{0}{1};", connectionStringWithoutDatalayer, variable);
SaveConnectionString(connectionStringWithoutDatalayer, "MySql.Data.MySqlClient");
Initialize("MySql.Data.MySqlClient");
SaveConnectionString(connectionStringWithoutDatalayer, Constants.DatabaseProviders.MySql);
Initialize(Constants.DatabaseProviders.MySql);
}
else
{
//Must be sql
SaveConnectionString(legacyConnString, "System.Data.SqlClient");
Initialize("System.Data.SqlClient");
SaveConnectionString(legacyConnString, Constants.DatabaseProviders.SqlServer);
Initialize(Constants.DatabaseProviders.SqlServer);
}
//Remove the legacy connection string, so we don't end up in a loop if something goes wrong.
GlobalSettings.RemoveSetting(GlobalSettings.UmbracoConnectionName);
DetermineSqlServerVersion();
}
else
{
@@ -465,49 +463,6 @@ namespace Umbraco.Core
Initialize(providerName);
}
/// <summary>
/// Set the lazy resolution of determining the SQL server version if that is the db type we're using
/// </summary>
private void DetermineSqlServerVersion()
{
var sqlServerSyntax = SqlSyntax as SqlServerSyntaxProvider;
if (sqlServerSyntax != null)
{
//this will not execute now, it is lazy so will only execute when we need to actually know
// the sql server version.
sqlServerSyntax.VersionName = new Lazy<SqlServerVersionName>(() =>
{
try
{
var database = this._factory.CreateDatabase();
var version = database.ExecuteScalar<string>("SELECT SERVERPROPERTY('productversion')");
var firstPart = version.Split('.')[0];
switch (firstPart)
{
case "11":
return SqlServerVersionName.V2012;
case "10":
return SqlServerVersionName.V2008;
case "9":
return SqlServerVersionName.V2005;
case "8":
return SqlServerVersionName.V2000;
case "7":
return SqlServerVersionName.V7;
default:
return SqlServerVersionName.Other;
}
}
catch (Exception)
{
return SqlServerVersionName.Invalid;
}
});
}
}
internal DatabaseSchemaResult ValidateDatabaseSchema()
{
if (_configured == false || (string.IsNullOrEmpty(_connectionString) || string.IsNullOrEmpty(ProviderName)))
@@ -517,7 +472,7 @@ namespace Umbraco.Core
{
if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted
&& ProviderName == "MySql.Data.MySqlClient")
&& ProviderName == Constants.DatabaseProviders.MySql)
{
throw new InvalidOperationException("Cannot use MySql in Medium Trust configuration");
}
@@ -625,13 +580,8 @@ namespace Umbraco.Core
var installedSchemaVersion = new SemVersion(schemaResult.DetermineInstalledVersion());
var installedMigrationVersion = new SemVersion(0);
//we cannot check the migrations table if it doesn't exist, this will occur when upgrading to 7.3
if (schemaResult.ValidTables.Any(x => x.InvariantEquals("umbracoMigration")))
{
installedMigrationVersion = schemaResult.DetermineInstalledVersionByMigrations(migrationEntryService);
}
var installedMigrationVersion = schemaResult.DetermineInstalledVersionByMigrations(migrationEntryService);
var targetVersion = UmbracoVersion.Current;
//In some cases - like upgrading from 7.2.6 -> 7.3, there will be no migration information in the database and therefore it will
@@ -731,7 +681,7 @@ namespace Umbraco.Core
private Attempt<Result> CheckReadyForInstall()
{
if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted
&& ProviderName == "MySql.Data.MySqlClient")
&& ProviderName == Constants.DatabaseProviders.MySql)
{
throw new InvalidOperationException("Cannot use MySql in Medium Trust configuration");
}
@@ -780,7 +730,7 @@ namespace Umbraco.Core
{
var dbIsSqlCe = false;
if (databaseSettings != null && databaseSettings.ProviderName != null)
dbIsSqlCe = databaseSettings.ProviderName == "System.Data.SqlServerCe.4.0";
dbIsSqlCe = databaseSettings.ProviderName == Constants.DatabaseProviders.SqlCe;
var sqlCeDatabaseExists = false;
if (dbIsSqlCe)
{
+23
View File
@@ -0,0 +1,23 @@
namespace Umbraco.Core
{
/// <summary>
/// Provides extension methods for System.Decimal.
/// </summary>
/// <remarks>See System.Decimal on MSDN and also
/// http://stackoverflow.com/questions/4298719/parse-decimal-and-filter-extra-0-on-the-right/4298787#4298787.
/// </remarks>
public static class DecimalExtensions
{
/// <summary>
/// Gets the normalized value.
/// </summary>
/// <param name="value">The value to normalize.</param>
/// <returns>The normalized value.</returns>
/// <remarks>Normalizing changes the scaling factor and removes trailing zeroes,
/// so 1.2500m comes out as 1.25m.</remarks>
public static decimal Normalize(this decimal value)
{
return value / 1.000000000000000000000000000000000m;
}
}
}
@@ -128,8 +128,14 @@ namespace Umbraco.Core.Events
get { return TargetSemVersion.GetVersion(); }
}
/// <summary>
/// Gets the origin version of the migration, i.e. the one that is currently installed.
/// </summary>
public SemVersion ConfiguredSemVersion { get; private set; }
/// <summary>
/// Gets the target version of the migration.
/// </summary>
public SemVersion TargetSemVersion { get; private set; }
public string ProductName { get; private set; }
+1 -5
View File
@@ -41,11 +41,7 @@ namespace Umbraco.Core.IO
{
using (var file = fs.OpenFile(path))
{
using (var sr = new StreamReader(file))
{
var str = sr.ReadToEnd();
return str.Length;
}
return file.Length;
}
}
+10 -1
View File
@@ -69,7 +69,16 @@ namespace Umbraco.Core.IO
}
}
public static string AppPlugins
public static string AppCode
{
get
{
//NOTE: this is not configurable and shouldn't need to be
return "~/App_Code";
}
}
public static string AppPlugins
{
get
{
+1 -1
View File
@@ -86,7 +86,7 @@ namespace Umbraco.Core.IO
private void Initialize()
{
Filename = _fs.GetFileName(Path);
Extension = _fs.GetExtension(Path) != null
Extension = string.IsNullOrEmpty(_fs.GetExtension(Path)) == false
? _fs.GetExtension(Path).Substring(1).ToLowerInvariant()
: "";
Url = _fs.GetUrl(Path);
@@ -1,20 +1,21 @@
using System;
using log4net.Appender;
using log4net.Core;
using log4net.Util;
using System;
using System.Runtime.Remoting.Messaging;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// </remarks>
/// <summary>
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </summary>
public abstract class AsyncForwardingAppenderBase : ForwardingAppender
{
#region Private Members
private const FixFlags DefaultFixFlags = FixFlags.Partial;
private FixFlags _fixFlags = DefaultFixFlags;
private LoggingEventHelper _loggingEventHelper;
private FixFlags fixFlags = DefaultFixFlags;
private LoggingEventHelper loggingEventHelper;
#endregion Private Members
@@ -22,10 +23,25 @@ namespace Umbraco.Core.Logging
public FixFlags Fix
{
get { return _fixFlags; }
get { return fixFlags; }
set { SetFixFlags(value); }
}
/// <summary>
/// Returns HttpContext.Current
/// </summary>
protected internal object HttpContext
{
get
{
return CallContext.HostContext;
}
set
{
CallContext.HostContext = value;
}
}
/// <summary>
/// The logger name that will be used for logging internal errors.
/// </summary>
@@ -38,7 +54,7 @@ namespace Umbraco.Core.Logging
public override void ActivateOptions()
{
base.ActivateOptions();
_loggingEventHelper = new LoggingEventHelper(InternalLoggerName, DefaultFixFlags);
loggingEventHelper = new LoggingEventHelper(InternalLoggerName, DefaultFixFlags);
InitializeAppenders();
}
@@ -52,10 +68,10 @@ namespace Umbraco.Core.Logging
private void SetFixFlags(FixFlags newFixFlags)
{
if (newFixFlags != _fixFlags)
if (newFixFlags != fixFlags)
{
_loggingEventHelper.Fix = newFixFlags;
_fixFlags = newFixFlags;
loggingEventHelper.Fix = newFixFlags;
fixFlags = newFixFlags;
InitializeAppenders();
}
}
@@ -84,7 +100,7 @@ namespace Umbraco.Core.Logging
protected void ForwardInternalError(string message, Exception exception, Type thisType)
{
LogLog.Error(thisType, message, exception);
var loggingEvent = _loggingEventHelper.CreateLoggingEvent(Level.Error, message, exception);
var loggingEvent = loggingEventHelper.CreateLoggingEvent(Level.Error, message, exception);
ForwardLoggingEvent(loggingEvent, thisType);
}
@@ -1,6 +1,7 @@
using log4net.Core;
using log4net.Util;
using System;
using System.ComponentModel;
using System.Runtime.Remoting.Messaging;
using System.Security.Principal;
using System.Threading;
@@ -12,7 +13,11 @@ namespace Umbraco.Core.Logging
/// <summary>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// which is based on code by Chris Haines http://cjbhaines.wordpress.com/2012/02/13/asynchronous-log4net-appenders/
/// This is an old/deprecated logger and has been superceded by ParallelForwardingAppender which is included in Umbraco and
/// also by AsyncForwardingAppender in the Log4Net.Async library.
/// </summary>
[Obsolete("This is superceded by the ParallelForwardingAppender, this will be removed in v8")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class AsynchronousRollingFileAppender : RollingFileAppender
{
private RingBuffer<LoggingEvent> pendingAppends;
@@ -198,79 +203,4 @@ namespace Umbraco.Core.Logging
}
}
internal interface IQueue<T>
{
void Enqueue(T item);
bool TryDequeue(out T ret);
}
internal class RingBuffer<T> : IQueue<T>
{
private readonly object lockObject = new object();
private readonly T[] buffer;
private readonly int size;
private int readIndex = 0;
private int writeIndex = 0;
private bool bufferFull = false;
public int Size { get { return size; } }
public event Action<object, EventArgs> BufferOverflow;
public RingBuffer(int size)
{
this.size = size;
buffer = new T[size];
}
public void Enqueue(T item)
{
var bufferWasFull = false;
lock (lockObject)
{
buffer[writeIndex] = item;
writeIndex = (++writeIndex) % size;
if (bufferFull)
{
bufferWasFull = true;
readIndex = writeIndex;
}
else if (writeIndex == readIndex)
{
bufferFull = true;
}
}
if (bufferWasFull)
{
if (BufferOverflow != null)
{
BufferOverflow(this, EventArgs.Empty);
}
}
}
public bool TryDequeue(out T ret)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
lock (lockObject)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
ret = buffer[readIndex];
buffer[readIndex] = default(T);
readIndex = (++readIndex) % size;
bufferFull = false;
return true;
}
}
}
}
+12
View File
@@ -0,0 +1,12 @@
namespace Umbraco.Core.Logging
{
/// <summary>
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </summary>
/// <typeparam name="T"></typeparam>
internal interface IQueue<T>
{
void Enqueue(T item);
bool TryDequeue(out T ret);
}
}
@@ -0,0 +1,46 @@
namespace Umbraco.Core.Logging
{
using System;
using System.Runtime.CompilerServices;
using ImageProcessor.Common.Exceptions;
/// <summary>
/// A logger for explicitly logging ImageProcessor exceptions.
/// <remarks>
/// Creating this logger is enough for ImageProcessor to find and replace its in-built debug logger
/// without any additional configuration required. This class currently has to be public in order
/// to do so.
/// </remarks>
/// </summary>
public sealed class ImageProcessorLogger : ImageProcessor.Common.Exceptions.ILogger
{
/// <summary>
/// Logs the specified message as an error.
/// </summary>
/// <typeparam name="T">The type calling the logger.</typeparam>
/// <param name="text">The message to log.</param>
/// <param name="callerName">The property or method name calling the log.</param>
/// <param name="lineNumber">The line number where the method is called.</param>
public void Log<T>(string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0)
{
// Using LogHelper since the ImageProcessor logger expects a parameterless constructor.
var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text);
LogHelper.Error<T>(string.Empty, new ImageProcessingException(message));
}
/// <summary>
/// Logs the specified message as an error.
/// </summary>
/// <param name="type">The type calling the logger.</param>
/// <param name="text">The message to log.</param>
/// <param name="callerName">The property or method name calling the log.</param>
/// <param name="lineNumber">The line number where the method is called.</param>
public void Log(Type type, string text, [CallerMemberName] string callerName = null, [CallerLineNumber] int lineNumber = 0)
{
// Using LogHelper since the ImageProcessor logger expects a parameterless constructor.
var message = string.Format("{0} {1} : {2}", callerName, lineNumber, text);
LogHelper.Error(type, string.Empty, new ImageProcessingException(message));
}
}
}
@@ -3,15 +3,18 @@ using log4net.Core;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </remarks>
internal class LoggingEventContext
internal sealed class LoggingEventContext
{
public LoggingEventContext(LoggingEvent loggingEvent)
public LoggingEventContext(LoggingEvent loggingEvent, object httpContext)
{
LoggingEvent = loggingEvent;
HttpContext = httpContext;
}
public LoggingEvent LoggingEvent { get; set; }
public object HttpContext { get; set; }
}
}
@@ -4,9 +4,9 @@ using log4net.Core;
namespace Umbraco.Core.Logging
{
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </remarks>
internal class LoggingEventHelper
internal sealed class LoggingEventHelper
{
// needs to be a seperate class so that location is determined correctly by log4net when required
@@ -23,8 +23,10 @@ namespace Umbraco.Core.Logging
public LoggingEvent CreateLoggingEvent(Level level, string message, Exception exception)
{
var loggingEvent = new LoggingEvent(HelperType, null, loggerName, level, message, exception);
loggingEvent.Fix = Fix;
var loggingEvent = new LoggingEvent(HelperType, null, loggerName, level, message, exception)
{
Fix = Fix
};
return loggingEvent;
}
}
@@ -1,9 +1,9 @@
using log4net.Core;
using log4net.Util;
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using log4net.Core;
using log4net.Util;
namespace Umbraco.Core.Logging
{
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Logging
/// An asynchronous appender based on <see cref="BlockingCollection{T}"/>
/// </summary>
/// <remarks>
/// Based on https://github.com/cjbhaines/Log4Net.Async
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </remarks>
public class ParallelForwardingAppender : AsyncForwardingAppenderBase, IDisposable
{
@@ -22,11 +22,11 @@ namespace Umbraco.Core.Logging
private CancellationTokenSource _loggingCancelationTokenSource;
private CancellationToken _loggingCancelationToken;
private Task _loggingTask;
private Double _shutdownFlushTimeout = 1;
private TimeSpan _shutdownFlushTimespan = TimeSpan.FromSeconds(1);
private Double _shutdownFlushTimeout = 2;
private TimeSpan _shutdownFlushTimespan = TimeSpan.FromSeconds(2);
private static readonly Type ThisType = typeof(ParallelForwardingAppender);
private volatile bool _shutDownRequested;
private int? _bufferSize = DefaultBufferSize;
private volatile bool shutDownRequested;
private int? bufferSize = DefaultBufferSize;
#endregion Private Members
@@ -37,8 +37,8 @@ namespace Umbraco.Core.Logging
/// </summary>
public override int? BufferSize
{
get { return _bufferSize; }
set { _bufferSize = value; }
get { return bufferSize; }
set { bufferSize = value; }
}
public int BufferEntryCount
@@ -67,7 +67,12 @@ namespace Umbraco.Core.Logging
protected override string InternalLoggerName
{
get { return "ParallelForwardingAppender"; }
get
{
{
return "ParallelForwardingAppender";
}
}
}
#endregion Properties
@@ -83,7 +88,7 @@ namespace Umbraco.Core.Logging
private void StartForwarding()
{
if (_shutDownRequested)
if (shutDownRequested)
{
return;
}
@@ -111,7 +116,7 @@ namespace Umbraco.Core.Logging
private void CompleteSubscriberTask()
{
_shutDownRequested = true;
shutDownRequested = true;
if (_loggingEvents == null || _loggingEvents.IsAddingCompleted)
{
return;
@@ -154,7 +159,7 @@ namespace Umbraco.Core.Logging
loggingEvent.Fix = Fix;
//In the case where blocking on a full collection, and the task is subsequently completed, the cancellation token
//will prevent the entry from attempting to add to the completed collection which would result in an exception.
_loggingEvents.Add(new LoggingEventContext(loggingEvent), _loggingCancelationToken);
_loggingEvents.Add(new LoggingEventContext(loggingEvent, HttpContext), _loggingCancelationToken);
}
protected override void Append(LoggingEvent[] loggingEvents)
@@ -187,6 +192,7 @@ namespace Umbraco.Core.Logging
//This call blocks until an item is available or until adding is completed
foreach (var entry in _loggingEvents.GetConsumingEnumerable(_loggingCancelationToken))
{
HttpContext = entry.HttpContext;
ForwardLoggingEvent(entry.LoggingEvent, ThisType);
}
}
+78
View File
@@ -0,0 +1,78 @@
using System;
namespace Umbraco.Core.Logging
{
/// <summary>
/// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
/// </summary>
/// <typeparam name="T"></typeparam>
internal sealed class RingBuffer<T> : IQueue<T>
{
private readonly object lockObject = new object();
private readonly T[] buffer;
private readonly int size;
private int readIndex = 0;
private int writeIndex = 0;
private bool bufferFull = false;
public int Size { get { return size; } }
public event Action<object, EventArgs> BufferOverflow;
public RingBuffer(int size)
{
this.size = size;
buffer = new T[size];
}
public void Enqueue(T item)
{
var bufferWasFull = false;
lock (lockObject)
{
buffer[writeIndex] = item;
writeIndex = (++writeIndex) % size;
if (bufferFull)
{
bufferWasFull = true;
readIndex = writeIndex;
}
else if (writeIndex == readIndex)
{
bufferFull = true;
}
}
if (bufferWasFull)
{
if (BufferOverflow != null)
{
BufferOverflow(this, EventArgs.Empty);
}
}
}
public bool TryDequeue(out T ret)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
lock (lockObject)
{
if (readIndex == writeIndex && !bufferFull)
{
ret = default(T);
return false;
}
ret = buffer[readIndex];
buffer[readIndex] = default(T);
readIndex = (++readIndex) % size;
bufferFull = false;
return true;
}
}
}
}
+21 -72
View File
@@ -76,14 +76,19 @@ namespace Umbraco.Core.Models
_contentType = contentType;
}
private static readonly PropertyInfo TemplateSelector = ExpressionHelper.GetPropertyInfo<Content, ITemplate>(x => x.Template);
private static readonly PropertyInfo PublishedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.Published);
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.Language);
private static readonly PropertyInfo ReleaseDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ReleaseDate);
private static readonly PropertyInfo ExpireDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ExpireDate);
private static readonly PropertyInfo WriterSelector = ExpressionHelper.GetPropertyInfo<Content, int>(x => x.WriterId);
private static readonly PropertyInfo NodeNameSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.NodeName);
private static readonly PropertyInfo PermissionsChangedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.PermissionsChanged);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo TemplateSelector = ExpressionHelper.GetPropertyInfo<Content, ITemplate>(x => x.Template);
public readonly PropertyInfo PublishedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.Published);
public readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.Language);
public readonly PropertyInfo ReleaseDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ReleaseDate);
public readonly PropertyInfo ExpireDateSelector = ExpressionHelper.GetPropertyInfo<Content, DateTime?>(x => x.ExpireDate);
public readonly PropertyInfo WriterSelector = ExpressionHelper.GetPropertyInfo<Content, int>(x => x.WriterId);
public readonly PropertyInfo NodeNameSelector = ExpressionHelper.GetPropertyInfo<Content, string>(x => x.NodeName);
public readonly PropertyInfo PermissionsChangedSelector = ExpressionHelper.GetPropertyInfo<Content, bool>(x => x.PermissionsChanged);
}
/// <summary>
/// Gets or sets the template used by the Content.
@@ -97,14 +102,7 @@ namespace Umbraco.Core.Models
public virtual ITemplate Template
{
get { return _template; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_template = value;
return _template;
}, _template, TemplateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _template, Ps.Value.TemplateSelector); }
}
/// <summary>
@@ -142,14 +140,7 @@ namespace Umbraco.Core.Models
public bool Published
{
get { return _published; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_published = value;
return _published;
}, _published, PublishedSelector);
}
internal set { SetPropertyValueAndDetectChanges(value, ref _published, Ps.Value.PublishedSelector); }
}
/// <summary>
@@ -160,14 +151,7 @@ namespace Umbraco.Core.Models
public string Language
{
get { return _language; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_language = value;
return _language;
}, _language, LanguageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector); }
}
/// <summary>
@@ -177,14 +161,7 @@ namespace Umbraco.Core.Models
public DateTime? ReleaseDate
{
get { return _releaseDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_releaseDate = value;
return _releaseDate;
}, _releaseDate, ReleaseDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _releaseDate, Ps.Value.ReleaseDateSelector); }
}
/// <summary>
@@ -194,14 +171,7 @@ namespace Umbraco.Core.Models
public DateTime? ExpireDate
{
get { return _expireDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_expireDate = value;
return _expireDate;
}, _expireDate, ExpireDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _expireDate, Ps.Value.ExpireDateSelector); }
}
/// <summary>
@@ -211,14 +181,7 @@ namespace Umbraco.Core.Models
public virtual int WriterId
{
get { return _writer; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_writer = value;
return _writer;
}, _writer, WriterSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _writer, Ps.Value.WriterSelector); }
}
/// <summary>
@@ -231,14 +194,7 @@ namespace Umbraco.Core.Models
internal string NodeName
{
get { return _nodeName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_nodeName = value;
return _nodeName;
}, _nodeName, NodeNameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _nodeName, Ps.Value.NodeNameSelector); }
}
/// <summary>
@@ -248,14 +204,7 @@ namespace Umbraco.Core.Models
internal bool PermissionsChanged
{
get { return _permissionsChanged; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_permissionsChanged = value;
return _permissionsChanged;
}, _permissionsChanged, PermissionsChangedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _permissionsChanged, Ps.Value.PermissionsChangedSelector); }
}
/// <summary>
+23 -67
View File
@@ -81,19 +81,24 @@ namespace Umbraco.Core.Models
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ParentId);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.SortOrder);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.Level);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Path);
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.CreatorId);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentBase, bool>(x => x.Trashed);
private static readonly PropertyInfo DefaultContentTypeIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ContentTypeId);
private readonly static PropertyInfo PropertyCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentBase, PropertyCollection>(x => x.Properties);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ParentId);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.SortOrder);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.Level);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentBase, string>(x => x.Path);
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.CreatorId);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentBase, bool>(x => x.Trashed);
public readonly PropertyInfo DefaultContentTypeIdSelector = ExpressionHelper.GetPropertyInfo<ContentBase, int>(x => x.ContentTypeId);
public readonly PropertyInfo PropertyCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentBase, PropertyCollection>(x => x.Properties);
}
protected void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyCollectionSelector);
}
/// <summary>
@@ -114,7 +119,7 @@ namespace Umbraco.Core.Models
set
{
_parentId = new Lazy<int>(() => value);
OnPropertyChanged(ParentIdSelector);
OnPropertyChanged(Ps.Value.ParentIdSelector);
}
}
@@ -125,14 +130,7 @@ namespace Umbraco.Core.Models
public virtual string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -142,14 +140,7 @@ namespace Umbraco.Core.Models
public virtual int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -159,14 +150,7 @@ namespace Umbraco.Core.Models
public virtual int Level
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
/// <summary>
@@ -176,14 +160,7 @@ namespace Umbraco.Core.Models
public virtual string Path //Setting this value should be handled by the class not the user
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
/// <summary>
@@ -193,14 +170,7 @@ namespace Umbraco.Core.Models
public virtual int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
/// <summary>
@@ -212,14 +182,7 @@ namespace Umbraco.Core.Models
public virtual bool Trashed //Setting this value should be handled by the class not the user
{
get { return _trashed; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
}
internal set { SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector); }
}
/// <summary>
@@ -244,14 +207,7 @@ namespace Umbraco.Core.Models
}
return _contentTypeId;
}
protected set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentTypeId = value;
return _contentTypeId;
}, _contentTypeId, DefaultContentTypeIdSelector);
}
protected set { SetPropertyValueAndDetectChanges(value, ref _contentTypeId, Ps.Value.DefaultContentTypeIdSelector); }
}
/// <summary>
+9 -15
View File
@@ -48,8 +48,13 @@ namespace Umbraco.Core.Models
_allowedTemplates = new List<ITemplate>();
}
private static readonly PropertyInfo DefaultTemplateSelector = ExpressionHelper.GetPropertyInfo<ContentType, int>(x => x.DefaultTemplateId);
private static readonly PropertyInfo AllowedTemplatesSelector = ExpressionHelper.GetPropertyInfo<ContentType, IEnumerable<ITemplate>>(x => x.AllowedTemplates);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo DefaultTemplateSelector = ExpressionHelper.GetPropertyInfo<ContentType, int>(x => x.DefaultTemplateId);
public readonly PropertyInfo AllowedTemplatesSelector = ExpressionHelper.GetPropertyInfo<ContentType, IEnumerable<ITemplate>>(x => x.AllowedTemplates);
}
/// <summary>
/// Gets or sets the alias of the default Template.
@@ -70,14 +75,7 @@ namespace Umbraco.Core.Models
internal int DefaultTemplateId
{
get { return _defaultTemplate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_defaultTemplate = value;
return _defaultTemplate;
}, _defaultTemplate, DefaultTemplateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _defaultTemplate, Ps.Value.DefaultTemplateSelector); }
}
/// <summary>
@@ -92,11 +90,7 @@ namespace Umbraco.Core.Models
get { return _allowedTemplates; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_allowedTemplates = value;
return _allowedTemplates;
}, _allowedTemplates, AllowedTemplatesSelector,
SetPropertyValueAndDetectChanges(value, ref _allowedTemplates, Ps.Value.AllowedTemplatesSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<ITemplate>>(
(templates, enumerable) => templates.UnsortedSequenceEqual(enumerable),
+44 -122
View File
@@ -67,33 +67,38 @@ namespace Umbraco.Core.Models
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.ParentId);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.SortOrder);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.Level);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Path);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Alias);
private static readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Description);
private static readonly PropertyInfo IconSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Icon);
private static readonly PropertyInfo ThumbnailSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Thumbnail);
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.CreatorId);
private static readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
private static readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.Trashed);
private static readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
private static readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
private static readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<PropertyType>>(x => x.PropertyTypes);
private static readonly PropertyInfo HasPropertyTypeBeenRemovedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.HasPropertyTypeBeenRemoved);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.ParentId);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.SortOrder);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.Level);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Path);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Alias);
public readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Description);
public readonly PropertyInfo IconSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Icon);
public readonly PropertyInfo ThumbnailSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.Thumbnail);
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, int>(x => x.CreatorId);
public readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
public readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.Trashed);
public readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
public readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
public readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<PropertyType>>(x => x.PropertyTypes);
public readonly PropertyInfo HasPropertyTypeBeenRemovedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.HasPropertyTypeBeenRemoved);
}
protected void PropertyGroupsChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyGroupCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyGroupCollectionSelector);
}
protected void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyTypeCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
}
/// <summary>
@@ -115,7 +120,7 @@ namespace Umbraco.Core.Models
set
{
_parentId = new Lazy<int>(() => value);
OnPropertyChanged(ParentIdSelector);
OnPropertyChanged(Ps.Value.ParentIdSelector);
}
}
@@ -126,14 +131,7 @@ namespace Umbraco.Core.Models
public virtual string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -143,14 +141,7 @@ namespace Umbraco.Core.Models
public virtual int Level //NOTE Is this relevant for a ContentType?
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
/// <summary>
@@ -160,14 +151,7 @@ namespace Umbraco.Core.Models
public virtual string Path //NOTE Is this relevant for a ContentType?
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
/// <summary>
@@ -179,12 +163,10 @@ namespace Umbraco.Core.Models
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
//_alias = value.ToSafeAlias();
_alias = value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase);
return _alias;
}, _alias, AliasSelector);
SetPropertyValueAndDetectChanges(
value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase),
ref _alias,
Ps.Value.AliasSelector);
}
}
@@ -195,14 +177,7 @@ namespace Umbraco.Core.Models
public virtual string Description
{
get { return _description; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_description = value;
return _description;
}, _description, DescriptionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _description, Ps.Value.DescriptionSelector); }
}
/// <summary>
@@ -212,14 +187,7 @@ namespace Umbraco.Core.Models
public virtual int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -229,14 +197,7 @@ namespace Umbraco.Core.Models
public virtual string Icon
{
get { return _icon; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_icon = value;
return _icon;
}, _icon, IconSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _icon, Ps.Value.IconSelector); }
}
/// <summary>
@@ -246,14 +207,7 @@ namespace Umbraco.Core.Models
public virtual string Thumbnail
{
get { return _thumbnail; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_thumbnail = value;
return _thumbnail;
}, _thumbnail, ThumbnailSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _thumbnail, Ps.Value.ThumbnailSelector); }
}
/// <summary>
@@ -263,14 +217,7 @@ namespace Umbraco.Core.Models
public virtual int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
/// <summary>
@@ -280,14 +227,7 @@ namespace Umbraco.Core.Models
public virtual bool AllowedAsRoot
{
get { return _allowedAsRoot; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_allowedAsRoot = value;
return _allowedAsRoot;
}, _allowedAsRoot, AllowedAsRootSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _allowedAsRoot, Ps.Value.AllowedAsRootSelector); }
}
/// <summary>
@@ -300,14 +240,7 @@ namespace Umbraco.Core.Models
public virtual bool IsContainer
{
get { return _isContainer; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isContainer = value;
return _isContainer;
}, _isContainer, IsContainerSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isContainer, Ps.Value.IsContainerSelector); }
}
/// <summary>
@@ -318,14 +251,7 @@ namespace Umbraco.Core.Models
public virtual bool Trashed //NOTE Is this relevant for a ContentType?
{
get { return _trashed; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector); }
}
private IDictionary<string, object> _additionalData;
@@ -347,15 +273,11 @@ namespace Umbraco.Core.Models
get { return _allowedContentTypes; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_allowedContentTypes = value;
return _allowedContentTypes;
}, _allowedContentTypes, AllowedContentTypesSelector,
SetPropertyValueAndDetectChanges(value, ref _allowedContentTypes, Ps.Value.AllowedContentTypesSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<ContentTypeSort>>(
(sorts, enumerable) => sorts.UnsortedSequenceEqual(enumerable),
sorts => sorts.GetHashCode()));
sorts => sorts.GetHashCode()));
}
}
@@ -418,7 +340,7 @@ namespace Umbraco.Core.Models
private set
{
_hasPropertyTypeBeenRemoved = value;
OnPropertyChanged(HasPropertyTypeBeenRemovedSelector);
OnPropertyChanged(Ps.Value.HasPropertyTypeBeenRemovedSelector);
}
}
@@ -543,7 +465,7 @@ namespace Umbraco.Core.Models
// actually remove the group
PropertyGroups.RemoveItem(propertyGroupName);
OnPropertyChanged(PropertyGroupCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyGroupCollectionSelector);
}
/// <summary>
@@ -32,9 +32,13 @@ namespace Umbraco.Core.Models
AddContentType(parent);
}
private static readonly PropertyInfo ContentTypeCompositionSelector =
ExpressionHelper.GetPropertyInfo<ContentTypeCompositionBase, IEnumerable<IContentTypeComposition>>(
x => x.ContentTypeComposition);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ContentTypeCompositionSelector =
ExpressionHelper.GetPropertyInfo<ContentTypeCompositionBase, IEnumerable<IContentTypeComposition>>(x => x.ContentTypeComposition);
}
/// <summary>
/// Gets or sets the content types that compose this content type.
@@ -46,7 +50,7 @@ namespace Umbraco.Core.Models
set
{
_contentTypeComposition = value.ToList();
OnPropertyChanged(ContentTypeCompositionSelector);
OnPropertyChanged(Ps.Value.ContentTypeCompositionSelector);
}
}
@@ -102,7 +106,7 @@ namespace Umbraco.Core.Models
throw new InvalidCompositionException(Alias, contentType.Alias, conflictingPropertyTypeAliases.ToArray());
_contentTypeComposition.Add(contentType);
OnPropertyChanged(ContentTypeCompositionSelector);
OnPropertyChanged(Ps.Value.ContentTypeCompositionSelector);
return true;
}
return false;
@@ -128,7 +132,7 @@ namespace Umbraco.Core.Models
if (compositionIdsToRemove.Any())
RemovedContentTypeKeyTracker.AddRange(compositionIdsToRemove);
OnPropertyChanged(ContentTypeCompositionSelector);
OnPropertyChanged(Ps.Value.ContentTypeCompositionSelector);
return _contentTypeComposition.Remove(contentTypeComposition);
}
return false;
+23 -73
View File
@@ -65,15 +65,20 @@ namespace Umbraco.Core.Models
_additionalData = new Dictionary<string, object>();
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.ParentId);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.SortOrder);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.Level);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Path);
private static readonly PropertyInfo UserIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.CreatorId);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, bool>(x => x.Trashed);
private static readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.PropertyEditorAlias);
private static readonly PropertyInfo DatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, DataTypeDatabaseType>(x => x.DatabaseType);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.ParentId);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.SortOrder);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.Level);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.Path);
public readonly PropertyInfo UserIdSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, int>(x => x.CreatorId);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, bool>(x => x.Trashed);
public readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, string>(x => x.PropertyEditorAlias);
public readonly PropertyInfo DatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<DataTypeDefinition, DataTypeDatabaseType>(x => x.DatabaseType);
}
/// <summary>
/// Gets or sets the Id of the Parent entity
@@ -83,14 +88,7 @@ namespace Umbraco.Core.Models
public int ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
/// <summary>
@@ -100,14 +98,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -117,14 +108,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -134,14 +118,7 @@ namespace Umbraco.Core.Models
public int Level
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
/// <summary>
@@ -151,14 +128,7 @@ namespace Umbraco.Core.Models
public string Path //Setting this value should be handled by the class not the user
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
/// <summary>
@@ -168,14 +138,7 @@ namespace Umbraco.Core.Models
public int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, UserIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.UserIdSelector); }
}
//NOTE: SD: Why do we have this ??
@@ -189,11 +152,7 @@ namespace Umbraco.Core.Models
get { return _trashed; }
internal set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
_additionalData["Trashed"] = value;
}
@@ -205,11 +164,7 @@ namespace Umbraco.Core.Models
get { return _propertyEditorAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_propertyEditorAlias = value;
return _propertyEditorAlias;
}, _propertyEditorAlias, PropertyEditorAliasSelector);
SetPropertyValueAndDetectChanges(value, ref _propertyEditorAlias, Ps.Value.PropertyEditorAliasSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
_additionalData["DatabaseType"] = value;
}
@@ -245,12 +200,7 @@ namespace Umbraco.Core.Models
get { return _databaseType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_databaseType = value;
return _databaseType;
}, _databaseType, DatabaseTypeSelector);
SetPropertyValueAndDetectChanges(value, ref _databaseType, Ps.Value.DatabaseTypeSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
_additionalData["DatabaseType"] = value;
}
+18 -31
View File
@@ -30,9 +30,14 @@ namespace Umbraco.Core.Models
_translations = new List<IDictionaryTranslation>();
}
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, Guid?>(x => x.ParentId);
private static readonly PropertyInfo ItemKeySelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, string>(x => x.ItemKey);
private static readonly PropertyInfo TranslationsSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, IEnumerable<IDictionaryTranslation>>(x => x.Translations);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, Guid?>(x => x.ParentId);
public readonly PropertyInfo ItemKeySelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, string>(x => x.ItemKey);
public readonly PropertyInfo TranslationsSelector = ExpressionHelper.GetPropertyInfo<DictionaryItem, IEnumerable<IDictionaryTranslation>>(x => x.Translations);
}
/// <summary>
/// Gets or Sets the Parent Id of the Dictionary Item
@@ -41,14 +46,7 @@ namespace Umbraco.Core.Models
public Guid? ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
/// <summary>
@@ -58,14 +56,7 @@ namespace Umbraco.Core.Models
public string ItemKey
{
get { return _itemKey; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_itemKey = value;
return _itemKey;
}, _itemKey, ItemKeySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _itemKey, Ps.Value.ItemKeySelector); }
}
/// <summary>
@@ -77,25 +68,21 @@ namespace Umbraco.Core.Models
get { return _translations; }
set
{
SetPropertyValueAndDetectChanges(o =>
var asArray = value.ToArray();
//ensure the language callback is set on each translation
if (GetLanguage != null)
{
var asArray = value.ToArray();
//ensure the language callback is set on each translation
if (GetLanguage != null)
foreach (var translation in asArray.OfType<DictionaryTranslation>())
{
foreach (var translation in asArray.OfType<DictionaryTranslation>())
{
translation.GetLanguage = GetLanguage;
}
translation.GetLanguage = GetLanguage;
}
}
_translations = asArray;
return _translations;
}, _translations, TranslationsSelector,
SetPropertyValueAndDetectChanges(asArray, ref _translations, Ps.Value.TranslationsSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<IDictionaryTranslation>>(
(enumerable, translations) => enumerable.UnsortedSequenceEqual(translations),
enumerable => enumerable.GetHashCode()));
enumerable => enumerable.GetHashCode()));
}
}
}
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Models
private string _value;
//note: this will be memberwise cloned
private int _languageId;
public DictionaryTranslation(ILanguage language, string value)
{
if (language == null) throw new ArgumentNullException("language");
@@ -50,8 +50,13 @@ namespace Umbraco.Core.Models
Key = uniqueId;
}
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, ILanguage>(x => x.Language);
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, string>(x => x.Value);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, ILanguage>(x => x.Language);
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<DictionaryTranslation, string>(x => x.Value);
}
/// <summary>
/// Gets or sets the <see cref="Language"/> for the translation
@@ -79,12 +84,8 @@ namespace Umbraco.Core.Models
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_language = value;
_languageId = _language == null ? -1 : _language.Id;
return _language;
}, _language, LanguageSelector);
SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector);
_languageId = _language == null ? -1 : _language.Id;
}
}
@@ -100,14 +101,7 @@ namespace Umbraco.Core.Models
public string Value
{
get { return _value; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_value = value;
return _value;
}, _value, ValueSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector); }
}
public override object DeepClone()
+19 -57
View File
@@ -23,13 +23,17 @@ namespace Umbraco.Core.Models.EntityBase
private DateTime _updateDate;
private bool _wasCancelled;
private static readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
private static readonly PropertyInfo KeySelector = ExpressionHelper.GetPropertyInfo<Entity, Guid>(x => x.Key);
private static readonly PropertyInfo CreateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.CreateDate);
private static readonly PropertyInfo UpdateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.UpdateDate);
private static readonly PropertyInfo HasIdentitySelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.HasIdentity);
private static readonly PropertyInfo WasCancelledSelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.WasCancelled);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
public readonly PropertyInfo KeySelector = ExpressionHelper.GetPropertyInfo<Entity, Guid>(x => x.Key);
public readonly PropertyInfo CreateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.CreateDate);
public readonly PropertyInfo UpdateDateSelector = ExpressionHelper.GetPropertyInfo<Entity, DateTime>(x => x.UpdateDate);
public readonly PropertyInfo HasIdentitySelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.HasIdentity);
public readonly PropertyInfo WasCancelledSelector = ExpressionHelper.GetPropertyInfo<Entity, bool>(x => x.WasCancelled);
}
/// <summary>
/// Integer Id
@@ -37,18 +41,11 @@ namespace Umbraco.Core.Models.EntityBase
[DataMember]
public int Id
{
get
{
return _id;
}
get { return _id; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_id = value;
HasIdentity = true; //set the has Identity
return _id;
}, _id, IdSelector);
SetPropertyValueAndDetectChanges(value, ref _id, Ps.Value.IdSelector);
HasIdentity = true; //set the has Identity
}
}
@@ -67,14 +64,7 @@ namespace Umbraco.Core.Models.EntityBase
_key = Guid.NewGuid();
return _key;
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_key = value;
return _key;
}, _key, KeySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _key, Ps.Value.KeySelector); }
}
/// <summary>
@@ -84,14 +74,7 @@ namespace Umbraco.Core.Models.EntityBase
public DateTime CreateDate
{
get { return _createDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_createDate = value;
return _createDate;
}, _createDate, CreateDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _createDate, Ps.Value.CreateDateSelector); }
}
/// <summary>
@@ -105,14 +88,7 @@ namespace Umbraco.Core.Models.EntityBase
internal bool WasCancelled
{
get { return _wasCancelled; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_wasCancelled = value;
return _wasCancelled;
}, _wasCancelled, WasCancelledSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _wasCancelled, Ps.Value.WasCancelledSelector); }
}
/// <summary>
@@ -122,14 +98,7 @@ namespace Umbraco.Core.Models.EntityBase
public DateTime UpdateDate
{
get { return _updateDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_updateDate = value;
return _updateDate;
}, _updateDate, UpdateDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _updateDate, Ps.Value.UpdateDateSelector); }
}
internal virtual void ResetIdentity()
@@ -166,14 +135,7 @@ namespace Umbraco.Core.Models.EntityBase
{
return _hasIdentity;
}
protected set
{
SetPropertyValueAndDetectChanges(o =>
{
_hasIdentity = value;
return _hasIdentity;
}, _hasIdentity, HasIdentitySelector);
}
protected set { SetPropertyValueAndDetectChanges(value, ref _hasIdentity, Ps.Value.HasIdentitySelector); }
}
//TODO: Make this NOT virtual or even exist really!
@@ -18,7 +18,9 @@ namespace Umbraco.Core.Models.EntityBase
//TODO: This needs to go on to ICanBeDirty http://issues.umbraco.org/issue/U4-5662
public virtual IEnumerable<string> GetDirtyProperties()
{
return _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key);
return _propertyChangedInfo == null
? Enumerable.Empty<string>()
: _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key);
}
private bool _changeTrackingEnabled = true;
@@ -26,12 +28,12 @@ namespace Umbraco.Core.Models.EntityBase
/// <summary>
/// Tracks the properties that have changed
/// </summary>
private IDictionary<string, bool> _propertyChangedInfo = new Dictionary<string, bool>();
private IDictionary<string, bool> _propertyChangedInfo;
/// <summary>
/// Tracks the properties that we're changed before the last commit (or last call to ResetDirtyProperties)
/// </summary>
private IDictionary<string, bool> _lastPropertyChangedInfo = null;
private IDictionary<string, bool> _lastPropertyChangedInfo;
/// <summary>
/// Property changed event
@@ -47,12 +49,13 @@ namespace Umbraco.Core.Models.EntityBase
//return if we're not tracking changes
if (_changeTrackingEnabled == false) return;
if (_propertyChangedInfo == null)
_propertyChangedInfo = new Dictionary<string, bool>();
_propertyChangedInfo[propertyInfo.Name] = true;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyInfo.Name));
}
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name));
}
/// <summary>
@@ -62,7 +65,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <returns>True if Property is dirty, otherwise False</returns>
public virtual bool IsPropertyDirty(string propertyName)
{
return _propertyChangedInfo.Any(x => x.Key == propertyName);
return _propertyChangedInfo != null && _propertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
@@ -71,7 +74,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <returns>True if entity is dirty, otherwise False</returns>
public virtual bool IsDirty()
{
return _propertyChangedInfo.Any();
return _propertyChangedInfo != null && _propertyChangedInfo.Any();
}
/// <summary>
@@ -90,7 +93,7 @@ namespace Umbraco.Core.Models.EntityBase
/// <returns>True if Property was changed, otherwise False. Returns false if the entity had not been previously changed.</returns>
public virtual bool WasPropertyDirty(string propertyName)
{
return WasDirty() && _lastPropertyChangedInfo.Any(x => x.Key == propertyName);
return _lastPropertyChangedInfo != null && _lastPropertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
@@ -100,7 +103,7 @@ namespace Umbraco.Core.Models.EntityBase
{
//NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME
// instance as the one on the clone, so we need to create a new instance.
_lastPropertyChangedInfo = new Dictionary<string, bool>();
_lastPropertyChangedInfo = null;
}
/// <summary>
@@ -130,26 +133,29 @@ namespace Umbraco.Core.Models.EntityBase
if (rememberPreviouslyChangedProperties)
{
//copy the changed properties to the last changed properties
_lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value);
if (_propertyChangedInfo != null)
{
_lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value);
}
}
//NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME
// instance as the one on the clone, so we need to create a new instance.
_propertyChangedInfo = new Dictionary<string, bool>();
_propertyChangedInfo = null;
}
protected void ResetChangeTrackingCollections()
public void ResetChangeTrackingCollections()
{
_propertyChangedInfo = new Dictionary<string, bool>();
_lastPropertyChangedInfo = new Dictionary<string, bool>();
_propertyChangedInfo = null;
_lastPropertyChangedInfo = null;
}
protected void DisableChangeTracking()
public void DisableChangeTracking()
{
_changeTrackingEnabled = false;
}
protected void EnableChangeTracking()
public void EnableChangeTracking()
{
_changeTrackingEnabled = true;
}
@@ -158,60 +164,61 @@ namespace Umbraco.Core.Models.EntityBase
/// Used by inheritors to set the value of properties, this will detect if the property value actually changed and if it did
/// it will ensure that the property has a dirty flag set.
/// </summary>
/// <param name="setValue"></param>
/// <param name="value"></param>
/// <param name="newVal"></param>
/// <param name="origVal"></param>
/// <param name="propertySelector"></param>
/// <returns>returns true if the value changed</returns>
/// <remarks>
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// to the same value, so it's really not dirty.
/// </remarks>
internal bool SetPropertyValueAndDetectChanges<T>(Func<T, T> setValue, T value, PropertyInfo propertySelector)
internal void SetPropertyValueAndDetectChanges<T>(T newVal, ref T origVal, PropertyInfo propertySelector)
{
if ((typeof(T) == typeof(string) == false) && TypeHelper.IsTypeAssignableFrom<IEnumerable>(typeof(T)))
{
throw new InvalidOperationException("This method does not support IEnumerable instances. For IEnumerable instances a manual custom equality check will be required");
}
return SetPropertyValueAndDetectChanges(setValue, value, propertySelector,
new DelegateEqualityComparer<T>(
//Standard Equals comparison
(arg1, arg2) => Equals(arg1, arg2),
arg => arg.GetHashCode()));
SetPropertyValueAndDetectChanges(newVal, ref origVal, propertySelector, EqualityComparer<T>.Default);
}
/// <summary>
/// Used by inheritors to set the value of properties, this will detect if the property value actually changed and if it did
/// it will ensure that the property has a dirty flag set.
/// </summary>
/// <param name="setValue"></param>
/// <param name="value"></param>
/// <param name="newVal"></param>
/// <param name="origVal"></param>
/// <param name="propertySelector"></param>
/// <param name="comparer">The equality comparer to use</param>
/// <returns>returns true if the value changed</returns>
/// <remarks>
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we
/// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set
/// to the same value, so it's really not dirty.
/// </remarks>
internal bool SetPropertyValueAndDetectChanges<T>(Func<T, T> setValue, T value, PropertyInfo propertySelector, IEqualityComparer<T> comparer)
internal void SetPropertyValueAndDetectChanges<T>(T newVal, ref T origVal, PropertyInfo propertySelector, IEqualityComparer<T> comparer)
{
var initVal = value;
var newVal = setValue(value);
//don't track changes, just set the value (above)
if (_changeTrackingEnabled == false) return false;
if (comparer.Equals(initVal, newVal) == false)
//don't track changes, just set the value
if (_changeTrackingEnabled == false)
{
OnPropertyChanged(propertySelector);
return true;
//set the original value
origVal = newVal;
}
else
{
//check changed
var changed = comparer.Equals(origVal, newVal) == false;
//set the original value
origVal = newVal;
//raise the event if it was changed
if (changed)
{
OnPropertyChanged(propertySelector);
}
}
return false;
}
}
}
+12 -12
View File
@@ -33,8 +33,14 @@ namespace Umbraco.Core.Models
_content = getFileContent != null ? null : string.Empty;
}
private static readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Content);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Path);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Content);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<File, string>(x => x.Path);
}
private string _alias;
private string _name;
@@ -87,11 +93,7 @@ namespace Umbraco.Core.Models
_alias = null;
_name = null;
SetPropertyValueAndDetectChanges(o =>
{
_path = SanitizePath(value);
return _path;
}, _path, PathSelector);
SetPropertyValueAndDetectChanges(SanitizePath(value), ref _path, Ps.Value.PathSelector);
}
}
@@ -131,11 +133,9 @@ namespace Umbraco.Core.Models
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_content = value ?? string.Empty; // cannot set to null
return _content;
}, _content, ContentSelector);
SetPropertyValueAndDetectChanges(
value ?? string.Empty, // cannot set to null
ref _content, Ps.Value.ContentSelector);
}
}
+37
View File
@@ -0,0 +1,37 @@
using System;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Represents a redirect url.
/// </summary>
public interface IRedirectUrl : IAggregateRoot, IRememberBeingDirty
{
/// <summary>
/// Gets or sets the identifier of the content item.
/// </summary>
[DataMember]
int ContentId { get; set; }
/// <summary>
/// Gets or sets the unique key identifying the content item.
/// </summary>
[DataMember]
Guid ContentKey { get; set; }
/// <summary>
/// Gets or sets the redirect url creation date.
/// </summary>
[DataMember]
DateTime CreateDateUtc { get; set; }
/// <summary>
/// Gets or sets the redirect url route.
/// </summary>
/// <remarks>Is a proper Umbraco route eg /path/to/foo or 123/path/tofoo.</remarks>
[DataMember]
string Url { get; set; }
}
}
@@ -19,7 +19,7 @@ namespace Umbraco.Core.Models.Identity
Culture = Configuration.GlobalSettings.DefaultUILanguage;
}
public virtual async Task<ClaimsIdentity> GenerateUserIdentityAsync(BackOfficeUserManager manager)
public virtual async Task<ClaimsIdentity> GenerateUserIdentityAsync(BackOfficeUserManager<BackOfficeIdentityUser> manager)
{
// NOTE the authenticationType must match the umbraco one
// defined in CookieAuthenticationOptions.AuthenticationType
+9 -18
View File
@@ -21,8 +21,13 @@ namespace Umbraco.Core.Models
IsoCode = isoCode;
}
private static readonly PropertyInfo IsoCodeSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.IsoCode);
private static readonly PropertyInfo CultureNameSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.CultureName);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo IsoCodeSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.IsoCode);
public readonly PropertyInfo CultureNameSelector = ExpressionHelper.GetPropertyInfo<Language, string>(x => x.CultureName);
}
/// <summary>
/// Gets or sets the Iso Code for the Language
@@ -31,14 +36,7 @@ namespace Umbraco.Core.Models
public string IsoCode
{
get { return _isoCode; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isoCode = value;
return _isoCode;
}, _isoCode, IsoCodeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isoCode, Ps.Value.IsoCodeSelector); }
}
/// <summary>
@@ -48,14 +46,7 @@ namespace Umbraco.Core.Models
public string CultureName
{
get { return _cultureName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cultureName = value;
return _cultureName;
}, _cultureName, CultureNameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cultureName, Ps.Value.CultureNameSelector); }
}
/// <summary>
+30 -102
View File
@@ -114,22 +114,27 @@ namespace Umbraco.Core.Models
private List<string> _addedProperties;
private List<string> _removedProperties;
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Alias);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Name);
private static readonly PropertyInfo UseInEditorSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.UseInEditor);
private static readonly PropertyInfo CacheDurationSelector = ExpressionHelper.GetPropertyInfo<Macro, int>(x => x.CacheDuration);
private static readonly PropertyInfo CacheByPageSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByPage);
private static readonly PropertyInfo CacheByMemberSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByMember);
private static readonly PropertyInfo DontRenderSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.DontRender);
private static readonly PropertyInfo ControlPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlType);
private static readonly PropertyInfo ControlAssemblySelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlAssembly);
private static readonly PropertyInfo ScriptPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ScriptPath);
private static readonly PropertyInfo XsltPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.XsltPath);
private static readonly PropertyInfo PropertiesSelector = ExpressionHelper.GetPropertyInfo<Macro, MacroPropertyCollection>(x => x.Properties);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Alias);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.Name);
public readonly PropertyInfo UseInEditorSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.UseInEditor);
public readonly PropertyInfo CacheDurationSelector = ExpressionHelper.GetPropertyInfo<Macro, int>(x => x.CacheDuration);
public readonly PropertyInfo CacheByPageSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByPage);
public readonly PropertyInfo CacheByMemberSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.CacheByMember);
public readonly PropertyInfo DontRenderSelector = ExpressionHelper.GetPropertyInfo<Macro, bool>(x => x.DontRender);
public readonly PropertyInfo ControlPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlType);
public readonly PropertyInfo ControlAssemblySelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ControlAssembly);
public readonly PropertyInfo ScriptPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.ScriptPath);
public readonly PropertyInfo XsltPathSelector = ExpressionHelper.GetPropertyInfo<Macro, string>(x => x.XsltPath);
public readonly PropertyInfo PropertiesSelector = ExpressionHelper.GetPropertyInfo<Macro, MacroPropertyCollection>(x => x.Properties);
}
void PropertiesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertiesSelector);
OnPropertyChanged(Ps.Value.PropertiesSelector);
if (e.Action == NotifyCollectionChangedAction.Add)
{
@@ -167,7 +172,7 @@ namespace Umbraco.Core.Models
/// <param name="e"></param>
void PropertyDataChanged(object sender, PropertyChangedEventArgs e)
{
OnPropertyChanged(PropertiesSelector);
OnPropertyChanged(Ps.Value.PropertiesSelector);
}
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
@@ -204,14 +209,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value.ToCleanString(CleanStringType.Alias);
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value.ToCleanString(CleanStringType.Alias), ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -221,14 +219,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -238,14 +229,7 @@ namespace Umbraco.Core.Models
public bool UseInEditor
{
get { return _useInEditor; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_useInEditor = value;
return _useInEditor;
}, _useInEditor, UseInEditorSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _useInEditor, Ps.Value.UseInEditorSelector); }
}
/// <summary>
@@ -255,14 +239,7 @@ namespace Umbraco.Core.Models
public int CacheDuration
{
get { return _cacheDuration; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cacheDuration = value;
return _cacheDuration;
}, _cacheDuration, CacheDurationSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cacheDuration, Ps.Value.CacheDurationSelector); }
}
/// <summary>
@@ -272,14 +249,7 @@ namespace Umbraco.Core.Models
public bool CacheByPage
{
get { return _cacheByPage; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cacheByPage = value;
return _cacheByPage;
}, _cacheByPage, CacheByPageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cacheByPage, Ps.Value.CacheByPageSelector); }
}
/// <summary>
@@ -289,14 +259,7 @@ namespace Umbraco.Core.Models
public bool CacheByMember
{
get { return _cacheByMember; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_cacheByMember = value;
return _cacheByMember;
}, _cacheByMember, CacheByMemberSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _cacheByMember, Ps.Value.CacheByMemberSelector); }
}
/// <summary>
@@ -306,14 +269,7 @@ namespace Umbraco.Core.Models
public bool DontRender
{
get { return _dontRender; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_dontRender = value;
return _dontRender;
}, _dontRender, DontRenderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _dontRender, Ps.Value.DontRenderSelector); }
}
/// <summary>
@@ -323,14 +279,7 @@ namespace Umbraco.Core.Models
public string ControlType
{
get { return _scriptFile; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_scriptFile = value;
return _scriptFile;
}, _scriptFile, ControlPathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _scriptFile, Ps.Value.ControlPathSelector); }
}
/// <summary>
@@ -341,14 +290,7 @@ namespace Umbraco.Core.Models
public string ControlAssembly
{
get { return _scriptAssembly; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_scriptAssembly = value;
return _scriptAssembly;
}, _scriptAssembly, ControlAssemblySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _scriptAssembly, Ps.Value.ControlAssemblySelector); }
}
/// <summary>
@@ -359,14 +301,7 @@ namespace Umbraco.Core.Models
public string ScriptPath
{
get { return _scriptPath; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_scriptPath = value;
return _scriptPath;
}, _scriptPath, ScriptPathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _scriptPath, Ps.Value.ScriptPathSelector); }
}
/// <summary>
@@ -377,14 +312,7 @@ namespace Umbraco.Core.Models
public string XsltPath
{
get { return _xslt; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_xslt = value;
return _xslt;
}, _xslt, XsltPathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _xslt, Ps.Value.XsltPathSelector); }
}
/// <summary>
+18 -52
View File
@@ -72,11 +72,16 @@ namespace Umbraco.Core.Models
private int _id;
private string _editorAlias;
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Alias);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Name);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, int>(x => x.SortOrder);
private static readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
private static readonly PropertyInfo PropertyTypeSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.EditorAlias);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Alias);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.Name);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, int>(x => x.SortOrder);
public readonly PropertyInfo IdSelector = ExpressionHelper.GetPropertyInfo<Entity, int>(x => x.Id);
public readonly PropertyInfo PropertyTypeSelector = ExpressionHelper.GetPropertyInfo<MacroProperty, string>(x => x.EditorAlias);
}
/// <summary>
/// Gets or sets the Alias of the Property
@@ -85,14 +90,7 @@ namespace Umbraco.Core.Models
public int Id
{
get { return _id; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_id = value;
return _alias;
}, _alias, IdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _id, Ps.Value.IdSelector); }
}
/// <summary>
@@ -102,14 +100,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -119,14 +110,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -136,14 +120,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -159,21 +136,10 @@ namespace Umbraco.Core.Models
get { return _editorAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
//try to get the new mapped parameter editor
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(value, false);
if (mapped.IsNullOrWhiteSpace() == false)
{
_editorAlias = mapped;
}
else
{
_editorAlias = value;
}
return _editorAlias;
}, _editorAlias, PropertyTypeSelector);
//try to get the new mapped parameter editor
var mapped = LegacyParameterEditorAliasConverter.GetNewAliasFromLegacyAlias(value, false);
var newVal = mapped.IsNullOrWhiteSpace() == false ? mapped : value;
SetPropertyValueAndDetectChanges(newVal, ref _editorAlias, Ps.Value.PropertyTypeSelector);
}
}
+13 -36
View File
@@ -109,10 +109,15 @@ namespace Umbraco.Core.Models
IsApproved = true;
}
private static readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Username);
private static readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Email);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.RawPasswordValue);
private static readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Username);
public readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.Email);
public readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<Member, string>(x => x.RawPasswordValue);
public readonly PropertyInfo ProviderUserKeySelector = ExpressionHelper.GetPropertyInfo<Member, object>(x => x.ProviderUserKey);
}
/// <summary>
/// Gets or sets the Username
@@ -121,14 +126,7 @@ namespace Umbraco.Core.Models
public string Username
{
get { return _username; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_username = value;
return _username;
}, _username, UsernameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _username, Ps.Value.UsernameSelector); }
}
/// <summary>
@@ -138,14 +136,7 @@ namespace Umbraco.Core.Models
public string Email
{
get { return _email; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_email = value;
return _email;
}, _email, EmailSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _email, Ps.Value.EmailSelector); }
}
/// <summary>
@@ -155,14 +146,7 @@ namespace Umbraco.Core.Models
public string RawPasswordValue
{
get { return _rawPasswordValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_rawPasswordValue = value;
return _rawPasswordValue;
}, _rawPasswordValue, PasswordSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _rawPasswordValue, Ps.Value.PasswordSelector); }
}
/// <summary>
@@ -490,14 +474,7 @@ namespace Umbraco.Core.Models
{
return _providerUserKey;
}
set
{
SetPropertyValueAndDetectChanges(o =>
{
_providerUserKey = value;
return _providerUserKey;
}, _providerUserKey, ProviderUserKeySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _providerUserKey, Ps.Value.ProviderUserKeySelector); }
}
+15 -21
View File
@@ -21,8 +21,13 @@ namespace Umbraco.Core.Models
private string _name;
private int _creatorId;
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, string>(x => x.Name);
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, int>(x => x.CreatorId);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, string>(x => x.Name);
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<MemberGroup, int>(x => x.CreatorId);
}
[DataMember]
public string Name
@@ -30,33 +35,22 @@ namespace Umbraco.Core.Models
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
if (_name != value)
{
if (_name != value)
{
//if the name has changed, add the value to the additional data,
//this is required purely for event handlers to know the previous name of the group
//so we can keep the public access up to date.
AdditionalData["previousName"] = _name;
}
//if the name has changed, add the value to the additional data,
//this is required purely for event handlers to know the previous name of the group
//so we can keep the public access up to date.
AdditionalData["previousName"] = _name;
}
_name = value;
return _name;
}, _name, NameSelector);
SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector);
}
}
public int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
public IDictionary<string, object> AdditionalData { get; private set; }
+11 -8
View File
@@ -30,7 +30,12 @@ namespace Umbraco.Core.Models
MemberTypePropertyTypes = new Dictionary<string, MemberTypePropertyProfileAccess>();
}
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MemberType, string>(x => x.Alias);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<MemberType, string>(x => x.Alias);
}
/// <summary>
/// The Alias of the ContentType
@@ -50,13 +55,11 @@ namespace Umbraco.Core.Models
// .ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase)
// Need to ask Stephen
SetPropertyValueAndDetectChanges(o =>
{
_alias = value == "_umbracoSystemDefaultProtectType"
? value
: (value == null ? string.Empty : value.ToSafeAlias() );
return _alias;
}, _alias, AliasSelector);
var newVal = value == "_umbracoSystemDefaultProtectType"
? value
: (value == null ? string.Empty : value.ToSafeAlias());
SetPropertyValueAndDetectChanges(newVal, ref _alias, Ps.Value.AliasSelector);
}
}
+42 -153
View File
@@ -77,27 +77,32 @@ namespace Umbraco.Core.Models.Membership
private bool _defaultToLiveEditing;
private static readonly PropertyInfo FailedPasswordAttemptsSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.FailedPasswordAttempts);
private static readonly PropertyInfo LastLockoutDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLockoutDate);
private static readonly PropertyInfo LastLoginDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLoginDate);
private static readonly PropertyInfo LastPasswordChangeDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastPasswordChangeDate);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private static readonly PropertyInfo SecurityStampSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.SecurityStamp);
private static readonly PropertyInfo SessionTimeoutSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.SessionTimeout);
private static readonly PropertyInfo StartContentIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartContentId);
private static readonly PropertyInfo StartMediaIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartMediaId);
private static readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<User, IEnumerable<string>>(x => x.AllowedSections);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Name);
private static readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Username);
private static readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Email);
private static readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.RawPasswordValue);
private static readonly PropertyInfo IsLockedOutSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsLockedOut);
private static readonly PropertyInfo IsApprovedSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsApproved);
private static readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Language);
private class PropertySelectors
{
public readonly PropertyInfo FailedPasswordAttemptsSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.FailedPasswordAttempts);
public readonly PropertyInfo LastLockoutDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLockoutDate);
public readonly PropertyInfo LastLoginDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastLoginDate);
public readonly PropertyInfo LastPasswordChangeDateSelector = ExpressionHelper.GetPropertyInfo<User, DateTime>(x => x.LastPasswordChangeDate);
private static readonly PropertyInfo DefaultToLiveEditingSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.DefaultToLiveEditing);
private static readonly PropertyInfo UserTypeSelector = ExpressionHelper.GetPropertyInfo<User, IUserType>(x => x.UserType);
public readonly PropertyInfo SecurityStampSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.SecurityStamp);
public readonly PropertyInfo SessionTimeoutSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.SessionTimeout);
public readonly PropertyInfo StartContentIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartContentId);
public readonly PropertyInfo StartMediaIdSelector = ExpressionHelper.GetPropertyInfo<User, int>(x => x.StartMediaId);
public readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<User, IEnumerable<string>>(x => x.AllowedSections);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Name);
public readonly PropertyInfo UsernameSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Username);
public readonly PropertyInfo EmailSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Email);
public readonly PropertyInfo PasswordSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.RawPasswordValue);
public readonly PropertyInfo IsLockedOutSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsLockedOut);
public readonly PropertyInfo IsApprovedSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.IsApproved);
public readonly PropertyInfo LanguageSelector = ExpressionHelper.GetPropertyInfo<User, string>(x => x.Language);
public readonly PropertyInfo DefaultToLiveEditingSelector = ExpressionHelper.GetPropertyInfo<User, bool>(x => x.DefaultToLiveEditing);
public readonly PropertyInfo UserTypeSelector = ExpressionHelper.GetPropertyInfo<User, IUserType>(x => x.UserType);
}
#region Implementation of IMembershipUser
@@ -113,124 +118,61 @@ namespace Umbraco.Core.Models.Membership
public string Username
{
get { return _username; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_username = value;
return _username;
}, _username, UsernameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _username, Ps.Value.UsernameSelector); }
}
[DataMember]
public string Email
{
get { return _email; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_email = value;
return _email;
}, _email, EmailSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _email, Ps.Value.EmailSelector); }
}
[DataMember]
public string RawPasswordValue
{
get { return _rawPasswordValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_rawPasswordValue = value;
return _rawPasswordValue;
}, _rawPasswordValue, PasswordSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _rawPasswordValue, Ps.Value.PasswordSelector); }
}
[DataMember]
public bool IsApproved
{
get { return _isApproved; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isApproved = value;
return _isApproved;
}, _isApproved, IsApprovedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isApproved, Ps.Value.IsApprovedSelector); }
}
[IgnoreDataMember]
public bool IsLockedOut
{
get { return _isLockedOut; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isLockedOut = value;
return _isLockedOut;
}, _isLockedOut, IsLockedOutSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isLockedOut, Ps.Value.IsLockedOutSelector); }
}
[IgnoreDataMember]
public DateTime LastLoginDate
{
get { return _lastLoginDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_lastLoginDate = value;
return _lastLoginDate;
}, _lastLoginDate, LastLoginDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _lastLoginDate, Ps.Value.LastLoginDateSelector); }
}
[IgnoreDataMember]
public DateTime LastPasswordChangeDate
{
get { return _lastPasswordChangedDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_lastPasswordChangedDate = value;
return _lastPasswordChangedDate;
}, _lastPasswordChangedDate, LastPasswordChangeDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _lastPasswordChangedDate, Ps.Value.LastPasswordChangeDateSelector); }
}
[IgnoreDataMember]
public DateTime LastLockoutDate
{
get { return _lastLockoutDate; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_lastLockoutDate = value;
return _lastLockoutDate;
}, _lastLockoutDate, LastLockoutDateSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _lastLockoutDate, Ps.Value.LastLockoutDateSelector); }
}
[IgnoreDataMember]
public int FailedPasswordAttempts
{
get { return _failedLoginAttempts; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_failedLoginAttempts = value;
return _failedLoginAttempts;
}, _failedLoginAttempts, FailedPasswordAttemptsSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _failedLoginAttempts, Ps.Value.FailedPasswordAttemptsSelector); }
}
//TODO: Figure out how to support all of this! - we cannot have NotImplementedExceptions because these get used by the IMembershipMemberService<IUser> service so
@@ -251,14 +193,7 @@ namespace Umbraco.Core.Models.Membership
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
public IEnumerable<string> AllowedSections
@@ -294,14 +229,7 @@ namespace Umbraco.Core.Models.Membership
public string SecurityStamp
{
get { return _securityStamp; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_securityStamp = value;
return _securityStamp;
}, _securityStamp, SecurityStampSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _securityStamp, Ps.Value.SecurityStampSelector); }
}
/// <summary>
@@ -330,14 +258,7 @@ namespace Umbraco.Core.Models.Membership
public int SessionTimeout
{
get { return _sessionTimeout; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sessionTimeout = value;
return _sessionTimeout;
}, _sessionTimeout, SessionTimeoutSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sessionTimeout, Ps.Value.SessionTimeoutSelector); }
}
/// <summary>
@@ -350,14 +271,7 @@ namespace Umbraco.Core.Models.Membership
public int StartContentId
{
get { return _startContentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_startContentId = value;
return _startContentId;
}, _startContentId, StartContentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _startContentId, Ps.Value.StartContentIdSelector); }
}
/// <summary>
@@ -370,28 +284,14 @@ namespace Umbraco.Core.Models.Membership
public int StartMediaId
{
get { return _startMediaId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_startMediaId = value;
return _startMediaId;
}, _startMediaId, StartMediaIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _startMediaId, Ps.Value.StartMediaIdSelector); }
}
[DataMember]
public string Language
{
get { return _language; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_language = value;
return _language;
}, _language, LanguageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _language, Ps.Value.LanguageSelector); }
}
//TODO: This should be a private set
@@ -406,14 +306,7 @@ namespace Umbraco.Core.Models.Membership
internal bool DefaultToLiveEditing
{
get { return _defaultToLiveEditing; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_defaultToLiveEditing = value;
return _defaultToLiveEditing;
}, _defaultToLiveEditing, DefaultToLiveEditingSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _defaultToLiveEditing, Ps.Value.DefaultToLiveEditingSelector); }
}
[IgnoreDataMember]
@@ -427,11 +320,7 @@ namespace Umbraco.Core.Models.Membership
throw new InvalidOperationException("Cannot assign a User Type that has not been persisted");
}
SetPropertyValueAndDetectChanges(o =>
{
_userType = value;
return _userType;
}, _userType, UserTypeSelector);
SetPropertyValueAndDetectChanges(value, ref _userType, Ps.Value.UserTypeSelector);
}
}
@@ -457,7 +346,7 @@ namespace Umbraco.Core.Models.Membership
/// <param name="e"></param>
void SectionCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(AllowedSectionsSelector);
OnPropertyChanged(Ps.Value.AllowedSectionsSelector);
if (e.Action == NotifyCollectionChangedAction.Add)
{
+14 -21
View File
@@ -20,9 +20,14 @@ namespace Umbraco.Core.Models.Membership
private string _name;
private IEnumerable<string> _permissions;
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Name);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Alias);
private static readonly PropertyInfo PermissionsSelector = ExpressionHelper.GetPropertyInfo<UserType, IEnumerable<string>>(x => x.Permissions);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Alias);
public readonly PropertyInfo PermissionsSelector = ExpressionHelper.GetPropertyInfo<UserType, IEnumerable<string>>(x => x.Permissions);
}
[DataMember]
public string Alias
@@ -30,11 +35,10 @@ namespace Umbraco.Core.Models.Membership
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase);
return _alias;
}, _alias, AliasSelector);
SetPropertyValueAndDetectChanges(
value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase),
ref _alias,
Ps.Value.AliasSelector);
}
}
@@ -42,14 +46,7 @@ namespace Umbraco.Core.Models.Membership
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -64,11 +61,7 @@ namespace Umbraco.Core.Models.Membership
get { return _permissions; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_permissions = value;
return _permissions;
}, _permissions, PermissionsSelector,
SetPropertyValueAndDetectChanges(value, ref _permissions, Ps.Value.PermissionsSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<string>>(
(enum1, enum2) => enum1.UnsortedSequenceEqual(enum2),
+10 -18
View File
@@ -19,35 +19,27 @@ namespace Umbraco.Core.Models
_version = version;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, string>(x => x.MigrationName);
private static readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, SemVersion>(x => x.Version);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, string>(x => x.MigrationName);
public readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<MigrationEntry, SemVersion>(x => x.Version);
}
private string _migrationName;
private SemVersion _version;
public string MigrationName
{
get { return _migrationName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_migrationName = value;
return _migrationName;
}, _migrationName, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _migrationName, Ps.Value.NameSelector); }
}
public SemVersion Version
{
get { return _version; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_version = value;
return _version;
}, _version, VersionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _version, Ps.Value.VersionSelector); }
}
}
}
+85 -90
View File
@@ -1,11 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Core.Persistence.Mappers;
namespace Umbraco.Core.Models
{
@@ -45,8 +43,42 @@ namespace Umbraco.Core.Models
Value = value;
}
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<Property, object>(x => x.Value);
private static readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<Property, Guid>(x => x.Version);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<Property, object>(x => x.Value);
public readonly PropertyInfo VersionSelector = ExpressionHelper.GetPropertyInfo<Property, Guid>(x => x.Version);
}
private static readonly DelegateEqualityComparer<object> ValueComparer = new DelegateEqualityComparer<object>(
(o, o1) =>
{
if (o == null && o1 == null) return true;
//custom comparer for strings.
if (o is string || o1 is string)
{
//if one is null and another is empty then they are the same
if ((o as string).IsNullOrWhiteSpace() && (o1 as string).IsNullOrWhiteSpace())
{
return true;
}
if (o == null || o1 == null) return false;
return o.Equals(o1);
}
if (o == null || o1 == null) return false;
//Custom comparer for enumerable if it is enumerable
var enum1 = o as IEnumerable;
var enum2 = o1 as IEnumerable;
if (enum1 != null && enum2 != null)
{
return enum1.Cast<object>().UnsortedSequenceEqual(enum2.Cast<object>());
}
return o.Equals(o1);
}, o => o.GetHashCode());
/// <summary>
/// Returns the instance of the tag support, by default tags are not enabled
@@ -98,14 +130,14 @@ namespace Umbraco.Core.Models
public Guid Version
{
get { return _version; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_version = value;
return _version;
}, _version, VersionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _version, Ps.Value.VersionSelector); }
}
private static void ThrowTypeException(object value, Type expected, string alias)
{
throw new InvalidOperationException(string.Format("Value \"{0}\" of type \"{1}\" could not be converted"
+ " to type \"{2}\" which is expected by property type \"{3}\".",
value, value.GetType(), expected, alias));
}
/// <summary>
@@ -121,91 +153,54 @@ namespace Umbraco.Core.Models
get { return _value; }
set
{
bool typeValidation = _propertyType.IsPropertyTypeValid(value);
var isOfExpectedType = _propertyType.IsPropertyTypeValid(value);
if (typeValidation == false)
if (isOfExpectedType == false) // isOfExpectedType is true if value is null - so if false, value is *not* null
{
// Normally we'll throw an exception here. However if the property is of a type that can have it's data field (dataInt, dataVarchar etc.)
// changed, we might have a value of the now "wrong" type. As of May 2016 Label is the only built-in property editor that supports this.
// In that case we should try to parse the value and return null if that's not possible rather than throwing an exception.
if (value != null && _propertyType.CanHaveDataValueTypeChanged())
{
var stringValue = value.ToString();
switch (_propertyType.DataTypeDatabaseType)
{
case DataTypeDatabaseType.Nvarchar:
case DataTypeDatabaseType.Ntext:
value = stringValue;
break;
case DataTypeDatabaseType.Integer:
int integerValue;
if (int.TryParse(stringValue, out integerValue) == false)
{
// Edge case, but if changed from decimal --> integer, the above tryparse will fail. So we'll try going
// via decimal too to return the integer value rather than zero.
decimal decimalForIntegerValue;
if (decimal.TryParse(stringValue, out decimalForIntegerValue))
{
integerValue = (int)decimalForIntegerValue;
}
}
// "garbage-in", accept what we can & convert
// throw only if conversion is not possible
value = integerValue;
break;
case DataTypeDatabaseType.Decimal:
decimal decimalValue;
decimal.TryParse(stringValue, out decimalValue);
value = decimalValue;
break;
case DataTypeDatabaseType.Date:
DateTime dateValue;
DateTime.TryParse(stringValue, out dateValue);
value = dateValue;
break;
}
}
else
var s = value.ToString();
switch (_propertyType.DataTypeDatabaseType)
{
throw new Exception(
string.Format(
"Type validation failed. The value type: '{0}' does not match the DataType in PropertyType with alias: '{1}'",
value == null ? "null" : value.GetType().Name, Alias));
case DataTypeDatabaseType.Nvarchar:
case DataTypeDatabaseType.Ntext:
value = s;
break;
case DataTypeDatabaseType.Integer:
if (s.IsNullOrWhiteSpace()) value = null; // assume empty means null
else
{
var convInt = value.TryConvertTo<int>();
if (convInt == false) ThrowTypeException(value, typeof(int), _propertyType.Alias);
value = convInt.Result;
}
break;
case DataTypeDatabaseType.Decimal:
if (s.IsNullOrWhiteSpace()) value = null; // assume empty means null
else
{
var convDecimal = value.TryConvertTo<decimal>();
if (convDecimal == false) ThrowTypeException(value, typeof (decimal), _propertyType.Alias);
// need to normalize the value (change the scaling factor and remove trailing zeroes)
// because the underlying database is going to mess with the scaling factor anyways.
value = convDecimal.Result.Normalize();
}
break;
case DataTypeDatabaseType.Date:
if (s.IsNullOrWhiteSpace()) value = null; // assume empty means null
else
{
var convDateTime = value.TryConvertTo<DateTime>();
if (convDateTime == false) ThrowTypeException(value, typeof (DateTime), _propertyType.Alias);
value = convDateTime.Result;
}
break;
}
}
SetPropertyValueAndDetectChanges(o =>
{
_value = value;
return _value;
}, _value, ValueSelector,
new DelegateEqualityComparer<object>(
(o, o1) =>
{
if (o == null && o1 == null) return true;
//custom comparer for strings.
if (o is string || o1 is string)
{
//if one is null and another is empty then they are the same
if ((o as string).IsNullOrWhiteSpace() && (o1 as string).IsNullOrWhiteSpace())
{
return true;
}
if (o == null || o1 == null) return false;
return o.Equals(o1);
}
if (o == null || o1 == null) return false;
//Custom comparer for enumerable if it is enumerable
var enum1 = o as IEnumerable;
var enum2 = o1 as IEnumerable;
if (enum1 != null && enum2 != null)
{
return enum1.Cast<object>().UnsortedSequenceEqual(enum2.Cast<object>());
}
return o.Equals(o1);
}, o => o.GetHashCode()));
SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector, ValueComparer);
}
}
+12 -20
View File
@@ -29,12 +29,18 @@ namespace Umbraco.Core.Models
PropertyTypes = propertyTypeCollection;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, string>(x => x.Name);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, int>(x => x.SortOrder);
private readonly static PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, PropertyTypeCollection>(x => x.PropertyTypes);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, string>(x => x.Name);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, int>(x => x.SortOrder);
public readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, PropertyTypeCollection>(x => x.PropertyTypes);
}
void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(PropertyTypeCollectionSelector);
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
}
/// <summary>
@@ -44,14 +50,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -61,14 +60,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
+71 -153
View File
@@ -46,9 +46,9 @@ namespace Umbraco.Core.Models
public PropertyType(IDataTypeDefinition dataTypeDefinition, string propertyTypeAlias)
: this(dataTypeDefinition)
{
SetAlias(propertyTypeAlias);
_alias = GetAlias(propertyTypeAlias);
}
public PropertyType(string propertyEditorAlias, DataTypeDatabaseType dataTypeDatabaseType)
: this(propertyEditorAlias, dataTypeDatabaseType, false)
{
@@ -56,7 +56,7 @@ namespace Umbraco.Core.Models
public PropertyType(string propertyEditorAlias, DataTypeDatabaseType dataTypeDatabaseType, string propertyTypeAlias)
: this(propertyEditorAlias, dataTypeDatabaseType, false, propertyTypeAlias)
{
{
}
/// <summary>
@@ -84,20 +84,25 @@ namespace Umbraco.Core.Models
_isExplicitDbType = isExplicitDbType;
_propertyEditorAlias = propertyEditorAlias;
_dataTypeDatabaseType = dataTypeDatabaseType;
SetAlias(propertyTypeAlias);
_alias = GetAlias(propertyTypeAlias);
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Name);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Alias);
private static readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Description);
private static readonly PropertyInfo DataTypeDefinitionIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.DataTypeDefinitionId);
private static readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.PropertyEditorAlias);
private static readonly PropertyInfo DataTypeDatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<PropertyType, DataTypeDatabaseType>(x => x.DataTypeDatabaseType);
private static readonly PropertyInfo MandatorySelector = ExpressionHelper.GetPropertyInfo<PropertyType, bool>(x => x.Mandatory);
private static readonly PropertyInfo HelpTextSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.HelpText);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.SortOrder);
private static readonly PropertyInfo ValidationRegExpSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.ValidationRegExp);
private static readonly PropertyInfo PropertyGroupIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, Lazy<int>>(x => x.PropertyGroupId);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Alias);
public readonly PropertyInfo DescriptionSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Description);
public readonly PropertyInfo DataTypeDefinitionIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.DataTypeDefinitionId);
public readonly PropertyInfo PropertyEditorAliasSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.PropertyEditorAlias);
public readonly PropertyInfo DataTypeDatabaseTypeSelector = ExpressionHelper.GetPropertyInfo<PropertyType, DataTypeDatabaseType>(x => x.DataTypeDatabaseType);
public readonly PropertyInfo MandatorySelector = ExpressionHelper.GetPropertyInfo<PropertyType, bool>(x => x.Mandatory);
public readonly PropertyInfo HelpTextSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.HelpText);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyType, int>(x => x.SortOrder);
public readonly PropertyInfo ValidationRegExpSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.ValidationRegExp);
public readonly PropertyInfo PropertyGroupIdSelector = ExpressionHelper.GetPropertyInfo<PropertyType, Lazy<int>>(x => x.PropertyGroupId);
}
/// <summary>
/// Gets of Sets the Name of the PropertyType
@@ -106,14 +111,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -123,14 +121,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
SetAlias(value);
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(GetAlias(value), ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -140,14 +131,7 @@ namespace Umbraco.Core.Models
public string Description
{
get { return _description; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_description = value;
return _description;
}, _description, DescriptionSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _description, Ps.Value.DescriptionSelector); }
}
/// <summary>
@@ -158,28 +142,14 @@ namespace Umbraco.Core.Models
public int DataTypeDefinitionId
{
get { return _dataTypeDefinitionId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_dataTypeDefinitionId = value;
return _dataTypeDefinitionId;
}, _dataTypeDefinitionId, DataTypeDefinitionIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _dataTypeDefinitionId, Ps.Value.DataTypeDefinitionIdSelector); }
}
[DataMember]
public string PropertyEditorAlias
{
get { return _propertyEditorAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_propertyEditorAlias = value;
return _propertyEditorAlias;
}, _propertyEditorAlias, PropertyEditorAliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _propertyEditorAlias, Ps.Value.PropertyEditorAliasSelector); }
}
/// <summary>
@@ -213,11 +183,7 @@ namespace Umbraco.Core.Models
//don't allow setting this if an explicit declaration has been made in the ctor
if (_isExplicitDbType) return;
SetPropertyValueAndDetectChanges(o =>
{
_dataTypeDatabaseType = value;
return _dataTypeDatabaseType;
}, _dataTypeDatabaseType, DataTypeDatabaseTypeSelector);
SetPropertyValueAndDetectChanges(value, ref _dataTypeDatabaseType, Ps.Value.DataTypeDatabaseTypeSelector);
}
}
@@ -229,14 +195,7 @@ namespace Umbraco.Core.Models
internal Lazy<int> PropertyGroupId
{
get { return _propertyGroupId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_propertyGroupId = value;
return _propertyGroupId;
}, _propertyGroupId, PropertyGroupIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _propertyGroupId, Ps.Value.PropertyGroupIdSelector); }
}
/// <summary>
@@ -246,14 +205,7 @@ namespace Umbraco.Core.Models
public bool Mandatory
{
get { return _mandatory; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_mandatory = value;
return _mandatory;
}, _mandatory, MandatorySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _mandatory, Ps.Value.MandatorySelector); }
}
/// <summary>
@@ -264,14 +216,7 @@ namespace Umbraco.Core.Models
public string HelpText
{
get { return _helpText; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_helpText = value;
return _helpText;
}, _helpText, HelpTextSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _helpText, Ps.Value.HelpTextSelector); }
}
/// <summary>
@@ -281,14 +226,7 @@ namespace Umbraco.Core.Models
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
/// <summary>
@@ -298,23 +236,16 @@ namespace Umbraco.Core.Models
public string ValidationRegExp
{
get { return _validationRegExp; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_validationRegExp = value;
return _validationRegExp;
}, _validationRegExp, ValidationRegExpSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _validationRegExp, Ps.Value.ValidationRegExpSelector); }
}
private void SetAlias(string value)
private string GetAlias(string value)
{
//NOTE: WE are doing this because we don't want to do a ToSafeAlias when the alias is the special case of
// being prefixed with Constants.PropertyEditors.InternalGenericPropertiesPrefix
// which is used internally
_alias = value.StartsWith(Constants.PropertyEditors.InternalGenericPropertiesPrefix)
return value.StartsWith(Constants.PropertyEditors.InternalGenericPropertiesPrefix)
? value
: value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase);
}
@@ -367,18 +298,21 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Validates the Value from a Property according to its type
/// Gets a value indicating whether the value is of the expected type
/// for the property, and can be assigned to the property "as is".
/// </summary>
/// <param name="value"></param>
/// <returns>True if valid, otherwise false</returns>
/// <param name="value">The value.</param>
/// <returns>True if the value is of the expected type for the property,
/// and can be assigned to the property "as is". Otherwise, false, to indicate
/// that some conversion is required.</returns>
public bool IsPropertyTypeValid(object value)
{
//Can't validate null values, so just allow it to pass the current validation
// null values are assumed to be ok
if (value == null)
return true;
//Check type if the type of the value match the type from the DataType/PropertyEditor
Type type = value.GetType();
// check if the type of the value matches the type from the DataType/PropertyEditor
var valueType = value.GetType();
//TODO Add PropertyEditor Type validation when its relevant to introduce
/*bool isEditorModel = value is IEditorModel;
@@ -395,50 +329,34 @@ namespace Umbraco.Core.Models
return argument == type;
}*/
if (PropertyEditorAlias.IsNullOrWhiteSpace() == false)
if (PropertyEditorAlias.IsNullOrWhiteSpace() == false) // fixme - always true?
{
//Find DataType by Id
//IDataType dataType = DataTypesResolver.Current.GetById(DataTypeControlId);
//Check if dataType is null (meaning that the ControlId is valid) ?
//Possibly cast to BaseDataType and get the DbType from there (which might not be possible because it lives in umbraco.cms.businesslogic.datatype) ?
//Simple validation using the DatabaseType from the DataTypeDefinition and Type of the passed in value
if (DataTypeDatabaseType == DataTypeDatabaseType.Integer && type == typeof(int))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Decimal && type == typeof(decimal))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Date && type == typeof(DateTime))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Nvarchar && type == typeof(string))
return true;
if (DataTypeDatabaseType == DataTypeDatabaseType.Ntext && type == typeof(string))
return true;
// simple validation using the DatabaseType from the DataTypeDefinition
// and the Type of the passed in value
switch (DataTypeDatabaseType)
{
// fixme breaking!
case DataTypeDatabaseType.Integer:
return valueType == typeof(int);
case DataTypeDatabaseType.Decimal:
return valueType == typeof(decimal);
case DataTypeDatabaseType.Date:
return valueType == typeof(DateTime);
case DataTypeDatabaseType.Nvarchar:
return valueType == typeof(string);
case DataTypeDatabaseType.Ntext:
return valueType == typeof(string);
}
}
//Fallback for simple value types when no Control Id or Database Type is set
if (type.IsPrimitive || value is string)
// fixme - never reached + makes no sense?
// fallback for simple value types when no Control Id or Database Type is set
if (valueType.IsPrimitive || value is string)
return true;
return false;
}
/// <summary>
/// Checks the underlying property editor prevalues to see if the one that allows changing of the database field
/// to which data is saved (dataInt, dataVarchar etc.) is included. If so that means the field could be changed when the data
/// type is saved.
/// </summary>
/// <returns></returns>
internal bool CanHaveDataValueTypeChanged()
{
var propertyEditor = PropertyEditorResolver.Current.GetByAlias(_propertyEditorAlias);
return propertyEditor.PreValueEditor.Fields
.SingleOrDefault(x => x.Key == Constants.PropertyEditors.PreValueKeys.DataValueType) != null;
}
/// <summary>
/// Validates the Value from a Property according to the validation settings
/// </summary>
@@ -458,15 +376,15 @@ namespace Umbraco.Core.Models
var regexPattern = new Regex(ValidationRegExp);
return regexPattern.IsMatch(value.ToString());
}
catch
catch
{
throw new Exception(string .Format("Invalid validation expression on property {0}",this.Alias));
}
}
//TODO: We must ensure that the property value can actually be saved based on the specified database type
//TODO Add PropertyEditor validation when its relevant to introduce
/*if (value is IEditorModel && DataTypeControlId != Guid.Empty)
{
@@ -484,19 +402,19 @@ namespace Umbraco.Core.Models
{
if (base.Equals(other)) return true;
//Check whether the PropertyType's properties are equal.
//Check whether the PropertyType's properties are equal.
return Alias.InvariantEquals(other.Alias);
}
public override int GetHashCode()
{
//Get hash code for the Name field if it is not null.
//Get hash code for the Name field if it is not null.
int baseHash = base.GetHashCode();
//Get hash code for the Alias field.
//Get hash code for the Alias field.
int hashAlias = Alias.ToLowerInvariant().GetHashCode();
//Calculate the hash code for the product.
//Calculate the hash code for the product.
return baseHash ^ hashAlias;
}
@@ -508,7 +426,7 @@ namespace Umbraco.Core.Models
//need to manually assign the Lazy value as it will not be automatically mapped
if (PropertyGroupId != null)
{
clone._propertyGroupId = new Lazy<int>(() => PropertyGroupId.Value);
clone._propertyGroupId = new Lazy<int>(() => PropertyGroupId.Value);
}
//this shouldn't really be needed since we're not tracking
clone.ResetDirtyProperties(false);
+15 -31
View File
@@ -44,7 +44,7 @@ namespace Umbraco.Core.Models
void _ruleCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
OnPropertyChanged(AllowedSectionsSelector);
OnPropertyChanged(Ps.Value.AllowedSectionsSelector);
//if (e.Action == NotifyCollectionChangedAction.Add)
//{
@@ -68,10 +68,15 @@ namespace Umbraco.Core.Models
}
}
private static readonly PropertyInfo ProtectedNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.ProtectedNodeId);
private static readonly PropertyInfo LoginNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.LoginNodeId);
private static readonly PropertyInfo NoAccessNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.NoAccessNodeId);
private static readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, IEnumerable<PublicAccessRule>>(x => x.Rules);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ProtectedNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.ProtectedNodeId);
public readonly PropertyInfo LoginNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.LoginNodeId);
public readonly PropertyInfo NoAccessNodeIdSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, int>(x => x.NoAccessNodeId);
public readonly PropertyInfo AllowedSectionsSelector = ExpressionHelper.GetPropertyInfo<PublicAccessEntry, IEnumerable<PublicAccessRule>>(x => x.Rules);
}
internal IEnumerable<Guid> RemovedRules
{
@@ -102,9 +107,9 @@ namespace Umbraco.Core.Models
public void ClearRules()
{
foreach (var rule in _ruleCollection)
for (var i = _ruleCollection.Count - 1; i >= 0; i--)
{
RemoveRule(rule);
RemoveRule(_ruleCollection[i]);
}
}
@@ -112,42 +117,21 @@ namespace Umbraco.Core.Models
public int LoginNodeId
{
get { return _loginNodeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_loginNodeId = value;
return _loginNodeId;
}, _loginNodeId, LoginNodeIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _loginNodeId, Ps.Value.LoginNodeIdSelector); }
}
[DataMember]
public int NoAccessNodeId
{
get { return _noAccessNodeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_noAccessNodeId = value;
return _noAccessNodeId;
}, _noAccessNodeId, NoAccessNodeIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _noAccessNodeId, Ps.Value.NoAccessNodeIdSelector); }
}
[DataMember]
public int ProtectedNodeId
{
get { return _protectedNodeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_protectedNodeId = value;
return _protectedNodeId;
}, _protectedNodeId, ProtectedNodeIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _protectedNodeId, Ps.Value.ProtectedNodeIdSelector); }
}
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
+9 -18
View File
@@ -23,35 +23,26 @@ namespace Umbraco.Core.Models
{
}
private static readonly PropertyInfo RuleValueSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleValue);
private static readonly PropertyInfo RuleTypeSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleType);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo RuleValueSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleValue);
public readonly PropertyInfo RuleTypeSelector = ExpressionHelper.GetPropertyInfo<PublicAccessRule, string>(x => x.RuleType);
}
public Guid AccessEntryId { get; internal set; }
public string RuleValue
{
get { return _ruleValue; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_ruleValue = value;
return _ruleValue;
}, _ruleValue, RuleValueSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _ruleValue, Ps.Value.RuleValueSelector); }
}
public string RuleType
{
get { return _ruleType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_ruleType = value;
return _ruleType;
}, _ruleType, RuleTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _ruleType, Ps.Value.RuleTypeSelector); }
}
@@ -16,7 +16,7 @@ namespace Umbraco.Core.Models.Rdbms
[Column("contentNodeId")]
[ForeignKey(typeof(NodeDto))]
[Index(IndexTypes.NonClustered, Name = "IX_cmsPropertyData_1")]
[Index(IndexTypes.UniqueNonClustered, Name = "IX_cmsPropertyData_1", ForColumns = "contentNodeId,versionId,propertytypeid")]
public int NodeId { get; set; }
[Column("versionId")]
@@ -33,9 +33,23 @@ namespace Umbraco.Core.Models.Rdbms
[NullSetting(NullSetting = NullSettings.Null)]
public int? Integer { get; set; }
private decimal? _decimalValue;
[Column("dataDecimal")]
[NullSetting(NullSetting = NullSettings.Null)]
public decimal? Decimal { get; set; }
public decimal? Decimal
{
get
{
return _decimalValue;
}
set
{
// need to normalize the value (change the scaling factor and remove trailing zeroes)
// because the underlying database probably has messed with the scaling factor.
_decimalValue = value.HasValue ? (decimal?) value.Value.Normalize() : null;
}
}
[Column("dataDate")]
[NullSetting(NullSetting = NullSettings.Null)]
@@ -0,0 +1,50 @@
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Core.Models.Rdbms
{
[TableName("umbracoRedirectUrl")]
[PrimaryKey("id", autoIncrement = false)]
[ExplicitColumns]
class RedirectUrlDto
{
public RedirectUrlDto()
{
CreateDateUtc = DateTime.UtcNow;
}
// notes
//
// we want a unique, non-clustered index on (url ASC, contentId ASC, createDate DESC) but the
// problem is that the index key must be 900 bytes max. should we run without an index? done
// some perfs comparisons, and running with an index on a hash is only slightly slower on
// inserts, and much faster on reads, so... we have an index on a hash.
[Column("id")]
[PrimaryKeyColumn(Name = "PK_umbracoRedirectUrl", AutoIncrement = false)]
public Guid Id { get; set; }
[ResultColumn]
public int ContentId { get; set; }
[Column("contentKey")]
[NullSetting(NullSetting = NullSettings.NotNull)]
[ForeignKey(typeof(NodeDto), Column = "uniqueID")]
public Guid ContentKey { get; set; }
[Column("createDateUtc")]
[NullSetting(NullSetting = NullSettings.NotNull)]
public DateTime CreateDateUtc { get; set; }
[Column("url")]
[NullSetting(NullSetting = NullSettings.NotNull)]
public string Url { get; set; }
[Column("urlHash")]
[NullSetting(NullSetting = NullSettings.NotNull)]
[Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoRedirectUrl", ForColumns = "urlHash, contentKey, createDateUtc")]
[Length(40)]
public string UrlHash { get; set; }
}
}
@@ -1,11 +1,10 @@
using Umbraco.Core.Persistence;
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Core.Models.Rdbms
{
[TableName("cmsStylesheet")]
[PrimaryKey("nodeId", autoIncrement = false)]
[ExplicitColumns]
[Obsolete("This is no longer used and will be removed from Umbraco in future versions")]
internal class StylesheetDto
{
[Column("nodeId")]
@@ -1,11 +1,10 @@
using Umbraco.Core.Persistence;
using System;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Core.Models.Rdbms
{
[TableName("cmsStylesheetProperty")]
[PrimaryKey("nodeId", autoIncrement = false)]
[ExplicitColumns]
[Obsolete("This is no longer used and will be removed from Umbraco in future versions")]
internal class StylesheetPropertyDto
{
[Column("nodeId")]
+67
View File
@@ -0,0 +1,67 @@
using System;
using System.Reflection;
using System.Runtime.Serialization;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Implements <see cref="IRedirectUrl"/>.
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class RedirectUrl : Entity, IRedirectUrl
{
/// <summary>
/// Initializes a new instance of the <see cref="RedirectUrl"/> class.
/// </summary>
public RedirectUrl()
{
CreateDateUtc = DateTime.UtcNow;
}
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
// ReSharper disable once ClassNeverInstantiated.Local
private class PropertySelectors
{
public readonly PropertyInfo ContentIdSelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, int>(x => x.ContentId);
public readonly PropertyInfo ContentKeySelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, Guid>(x => x.ContentKey);
public readonly PropertyInfo CreateDateUtcSelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, DateTime>(x => x.CreateDateUtc);
public readonly PropertyInfo UrlSelector = ExpressionHelper.GetPropertyInfo<RedirectUrl, string>(x => x.Url);
}
private int _contentId;
private Guid _contentKey;
private DateTime _createDateUtc;
private string _url;
/// <inheritdoc />
public int ContentId
{
get { return _contentId; }
set { SetPropertyValueAndDetectChanges(value, ref _contentId, Ps.Value.ContentIdSelector); }
}
/// <inheritdoc />
public Guid ContentKey
{
get { return _contentKey; }
set { SetPropertyValueAndDetectChanges(value, ref _contentKey, Ps.Value.ContentKeySelector); }
}
/// <inheritdoc />
public DateTime CreateDateUtc
{
get { return _createDateUtc; }
set { SetPropertyValueAndDetectChanges(value, ref _createDateUtc, Ps.Value.CreateDateUtcSelector); }
}
/// <inheritdoc />
public string Url
{
get { return _url; }
set { SetPropertyValueAndDetectChanges(value, ref _url, Ps.Value.UrlSelector); }
}
}
}
+13 -36
View File
@@ -26,10 +26,15 @@ namespace Umbraco.Core.Models
_relationType = relationType;
}
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ParentId);
private static readonly PropertyInfo ChildIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ChildId);
private static readonly PropertyInfo RelationTypeSelector = ExpressionHelper.GetPropertyInfo<Relation, IRelationType>(x => x.RelationType);
private static readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Relation, string>(x => x.Comment);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ParentId);
public readonly PropertyInfo ChildIdSelector = ExpressionHelper.GetPropertyInfo<Relation, int>(x => x.ChildId);
public readonly PropertyInfo RelationTypeSelector = ExpressionHelper.GetPropertyInfo<Relation, IRelationType>(x => x.RelationType);
public readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Relation, string>(x => x.Comment);
}
/// <summary>
/// Gets or sets the Parent Id of the Relation (Source)
@@ -38,14 +43,7 @@ namespace Umbraco.Core.Models
public int ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
/// <summary>
@@ -55,14 +53,7 @@ namespace Umbraco.Core.Models
public int ChildId
{
get { return _childId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_childId = value;
return _childId;
}, _childId, ChildIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _childId, Ps.Value.ChildIdSelector); }
}
/// <summary>
@@ -72,14 +63,7 @@ namespace Umbraco.Core.Models
public IRelationType RelationType
{
get { return _relationType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_relationType = value;
return _relationType;
}, _relationType, RelationTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _relationType, Ps.Value.RelationTypeSelector); }
}
/// <summary>
@@ -89,14 +73,7 @@ namespace Umbraco.Core.Models
public string Comment
{
get { return _comment; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_comment = value;
return _comment;
}, _comment, CommentSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _comment, Ps.Value.CommentSelector); }
}
/// <summary>
+15 -45
View File
@@ -35,11 +35,16 @@ namespace Umbraco.Core.Models
Name = name;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Name);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Alias);
private static readonly PropertyInfo IsBidirectionalSelector = ExpressionHelper.GetPropertyInfo<RelationType, bool>(x => x.IsBidirectional);
private static readonly PropertyInfo ParentObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ParentObjectType);
private static readonly PropertyInfo ChildObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ChildObjectType);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Alias);
public readonly PropertyInfo IsBidirectionalSelector = ExpressionHelper.GetPropertyInfo<RelationType, bool>(x => x.IsBidirectional);
public readonly PropertyInfo ParentObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ParentObjectType);
public readonly PropertyInfo ChildObjectTypeSelector = ExpressionHelper.GetPropertyInfo<RelationType, Guid>(x => x.ChildObjectType);
}
/// <summary>
/// Gets or sets the Name of the RelationType
@@ -48,14 +53,7 @@ namespace Umbraco.Core.Models
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
/// <summary>
@@ -65,14 +63,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -82,14 +73,7 @@ namespace Umbraco.Core.Models
public bool IsBidirectional
{
get { return _isBidrectional; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isBidrectional = value;
return _isBidrectional;
}, _isBidrectional, IsBidirectionalSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isBidrectional, Ps.Value.IsBidirectionalSelector); }
}
/// <summary>
@@ -100,14 +84,7 @@ namespace Umbraco.Core.Models
public Guid ParentObjectType
{
get { return _parentObjectType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentObjectType = value;
return _parentObjectType;
}, _parentObjectType, ParentObjectTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentObjectType, Ps.Value.ParentObjectTypeSelector); }
}
/// <summary>
@@ -118,14 +95,7 @@ namespace Umbraco.Core.Models
public Guid ChildObjectType
{
get { return _childObjectType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_childObjectType = value;
return _childObjectType;
}, _childObjectType, ChildObjectTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _childObjectType, Ps.Value.ChildObjectTypeSelector); }
}
}
+13 -36
View File
@@ -15,10 +15,15 @@ namespace Umbraco.Core.Models
private bool _isActive;
private bool _isMaster;
private static readonly PropertyInfo ServerAddressSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerAddress);
private static readonly PropertyInfo ServerIdentitySelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerIdentity);
private static readonly PropertyInfo IsActiveSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsActive);
private static readonly PropertyInfo IsMasterSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsMaster);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ServerAddressSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerAddress);
public readonly PropertyInfo ServerIdentitySelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, string>(x => x.ServerIdentity);
public readonly PropertyInfo IsActiveSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsActive);
public readonly PropertyInfo IsMasterSelector = ExpressionHelper.GetPropertyInfo<ServerRegistration, bool>(x => x.IsMaster);
}
/// <summary>
/// Initialiazes a new instance of the <see cref="ServerRegistration"/> class.
@@ -69,14 +74,7 @@ namespace Umbraco.Core.Models
public string ServerAddress
{
get { return _serverAddress; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_serverAddress = value;
return _serverAddress;
}, _serverAddress, ServerAddressSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _serverAddress, Ps.Value.ServerAddressSelector); }
}
/// <summary>
@@ -85,14 +83,7 @@ namespace Umbraco.Core.Models
public string ServerIdentity
{
get { return _serverIdentity; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_serverIdentity = value;
return _serverIdentity;
}, _serverIdentity, ServerIdentitySelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _serverIdentity, Ps.Value.ServerIdentitySelector); }
}
/// <summary>
@@ -101,14 +92,7 @@ namespace Umbraco.Core.Models
public bool IsActive
{
get { return _isActive; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isActive = value;
return _isActive;
}, _isActive, IsActiveSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isActive, Ps.Value.IsActiveSelector); }
}
/// <summary>
@@ -117,14 +101,7 @@ namespace Umbraco.Core.Models
public bool IsMaster
{
get { return _isMaster; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isMaster = value;
return _isMaster;
}, _isMaster, IsMasterSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _isMaster, Ps.Value.IsMasterSelector); }
}
/// <summary>
+9 -18
View File
@@ -25,8 +25,13 @@ namespace Umbraco.Core.Models
_value = value;
}
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Alias);
private static readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Value);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Alias);
public readonly PropertyInfo ValueSelector = ExpressionHelper.GetPropertyInfo<StylesheetProperty, string>(x => x.Value);
}
/// <summary>
/// The CSS rule name that can be used by Umbraco in the back office
@@ -39,14 +44,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
@@ -55,14 +53,7 @@ namespace Umbraco.Core.Models
public string Value
{
get { return _value; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_value = value;
return _value;
}, _value, ValueSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _value, Ps.Value.ValueSelector); }
}
}
+10 -18
View File
@@ -27,35 +27,27 @@ namespace Umbraco.Core.Models
NodeCount = nodeCount;
}
private static readonly PropertyInfo TextSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Text);
private static readonly PropertyInfo GroupSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Group);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo TextSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Text);
public readonly PropertyInfo GroupSelector = ExpressionHelper.GetPropertyInfo<Tag, string>(x => x.Group);
}
private string _text;
private string _group;
public string Text
{
get { return _text; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_text = value;
return _text;
}, _text, TextSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _text, Ps.Value.TextSelector); }
}
public string Group
{
get { return _group; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_group = value;
return _group;
}, _group, GroupSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _group, Ps.Value.GroupSelector); }
}
public int NodeCount { get; internal set; }
+17 -54
View File
@@ -24,12 +24,17 @@ namespace Umbraco.Core.Models
_taskType = taskType;
}
private static readonly PropertyInfo ClosedSelector = ExpressionHelper.GetPropertyInfo<Task, bool>(x => x.Closed);
private static readonly PropertyInfo TaskTypeSelector = ExpressionHelper.GetPropertyInfo<Task, TaskType>(x => x.TaskType);
private static readonly PropertyInfo EntityIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.EntityId);
private static readonly PropertyInfo OwnerUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.OwnerUserId);
private static readonly PropertyInfo AssigneeUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.AssigneeUserId);
private static readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Task, string>(x => x.Comment);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ClosedSelector = ExpressionHelper.GetPropertyInfo<Task, bool>(x => x.Closed);
public readonly PropertyInfo TaskTypeSelector = ExpressionHelper.GetPropertyInfo<Task, TaskType>(x => x.TaskType);
public readonly PropertyInfo EntityIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.EntityId);
public readonly PropertyInfo OwnerUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.OwnerUserId);
public readonly PropertyInfo AssigneeUserIdSelector = ExpressionHelper.GetPropertyInfo<Task, int>(x => x.AssigneeUserId);
public readonly PropertyInfo CommentSelector = ExpressionHelper.GetPropertyInfo<Task, string>(x => x.Comment);
}
/// <summary>
/// Gets or sets a boolean indicating whether the task is closed
@@ -38,14 +43,7 @@ namespace Umbraco.Core.Models
public bool Closed
{
get { return _closed; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_closed = value;
return _closed;
}, _closed, ClosedSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _closed, Ps.Value.ClosedSelector); }
}
/// <summary>
@@ -55,14 +53,7 @@ namespace Umbraco.Core.Models
public TaskType TaskType
{
get { return _taskType; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_taskType = value;
return _taskType;
}, _taskType, TaskTypeSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _taskType, Ps.Value.TaskTypeSelector); }
}
/// <summary>
@@ -72,14 +63,7 @@ namespace Umbraco.Core.Models
public int EntityId
{
get { return _entityId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_entityId = value;
return _entityId;
}, _entityId, EntityIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _entityId, Ps.Value.EntityIdSelector); }
}
/// <summary>
@@ -89,14 +73,7 @@ namespace Umbraco.Core.Models
public int OwnerUserId
{
get { return _ownerUserId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_ownerUserId = value;
return _ownerUserId;
}, _ownerUserId, OwnerUserIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _ownerUserId, Ps.Value.OwnerUserIdSelector); }
}
/// <summary>
@@ -106,14 +83,7 @@ namespace Umbraco.Core.Models
public int AssigneeUserId
{
get { return _assigneeUserId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_assigneeUserId = value;
return _assigneeUserId;
}, _assigneeUserId, AssigneeUserIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _assigneeUserId, Ps.Value.AssigneeUserIdSelector); }
}
/// <summary>
@@ -123,14 +93,7 @@ namespace Umbraco.Core.Models
public string Comment
{
get { return _comment; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_comment = value;
return _comment;
}, _comment, CommentSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _comment, Ps.Value.CommentSelector); }
}
}
+7 -9
View File
@@ -19,7 +19,12 @@ namespace Umbraco.Core.Models
_alias = alias;
}
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<TaskType, string>(x => x.Alias);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<TaskType, string>(x => x.Alias);
}
/// <summary>
/// Gets or sets the Alias of the TaskType
@@ -28,14 +33,7 @@ namespace Umbraco.Core.Models
public string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value;
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _alias, Ps.Value.AliasSelector); }
}
}
}
+13 -38
View File
@@ -26,10 +26,15 @@ namespace Umbraco.Core.Models
private string _masterTemplateAlias;
private Lazy<int> _masterTemplateId;
private static readonly PropertyInfo MasterTemplateAliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.MasterTemplateAlias);
private static readonly PropertyInfo MasterTemplateIdSelector = ExpressionHelper.GetPropertyInfo<Template, Lazy<int>>(x => x.MasterTemplateId);
private static readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Alias);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Name);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo MasterTemplateAliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.MasterTemplateAlias);
public readonly PropertyInfo MasterTemplateIdSelector = ExpressionHelper.GetPropertyInfo<Template, Lazy<int>>(x => x.MasterTemplateId);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Alias);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<Template, string>(x => x.Name);
}
public Template(string name, string alias)
: this(name, alias, (Func<File, string>) null)
@@ -53,57 +58,27 @@ namespace Umbraco.Core.Models
public Lazy<int> MasterTemplateId
{
get { return _masterTemplateId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_masterTemplateId = value;
return _masterTemplateId;
}, _masterTemplateId, MasterTemplateIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _masterTemplateId, Ps.Value.MasterTemplateIdSelector); }
}
public string MasterTemplateAlias
{
get { return _masterTemplateAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_masterTemplateAlias = value;
return _masterTemplateAlias;
}, _masterTemplateAlias, MasterTemplateAliasSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _masterTemplateAlias, Ps.Value.MasterTemplateAliasSelector); }
}
[DataMember]
public new string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
[DataMember]
public new string Alias
{
get { return _alias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_alias = value.ToCleanString(CleanStringType.UnderscoreAlias);
return _alias;
}, _alias, AliasSelector);
}
set { SetPropertyValueAndDetectChanges(value.ToCleanString(CleanStringType.UnderscoreAlias), ref _alias, Ps.Value.AliasSelector); }
}
/// <summary>
+11 -28
View File
@@ -24,51 +24,34 @@ namespace Umbraco.Core.Models
private int? _languageId;
private string _domainName;
private static readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.RootContentId);
private static readonly PropertyInfo DefaultLanguageSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.LanguageId);
private static readonly PropertyInfo DomainNameSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, string>(x => x.DomainName);
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo ContentSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.RootContentId);
public readonly PropertyInfo DefaultLanguageSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, int?>(x => x.LanguageId);
public readonly PropertyInfo DomainNameSelector = ExpressionHelper.GetPropertyInfo<UmbracoDomain, string>(x => x.DomainName);
}
[DataMember]
public int? LanguageId
{
get { return _languageId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_languageId = value;
return _languageId;
}, _languageId, DefaultLanguageSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _languageId, Ps.Value.DefaultLanguageSelector); }
}
[DataMember]
public string DomainName
{
get { return _domainName; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_domainName = value;
return _domainName;
}, _domainName, DomainNameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _domainName, Ps.Value.DomainNameSelector); }
}
[DataMember]
public int? RootContentId
{
get { return _contentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentId = value;
return _contentId;
}, _contentId, ContentSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _contentId, Ps.Value.ContentSelector); }
}
public bool IsWildcard
+36 -119
View File
@@ -26,22 +26,28 @@ namespace Umbraco.Core.Models
private bool _hasPendingChanges;
private string _contentTypeAlias;
private Guid _nodeObjectTypeId;
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.CreatorId);
public readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.Level);
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.Name);
public readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.ParentId);
public readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.Path);
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.SortOrder);
public readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.Trashed);
public readonly PropertyInfo HasChildrenSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.HasChildren);
public readonly PropertyInfo IsPublishedSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.IsPublished);
public readonly PropertyInfo IsDraftSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.IsDraft);
public readonly PropertyInfo HasPendingChangesSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.HasPendingChanges);
public readonly PropertyInfo ContentTypeAliasSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.ContentTypeAlias);
public readonly PropertyInfo ContentTypeIconSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.ContentTypeIcon);
public readonly PropertyInfo ContentTypeThumbnailSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.ContentTypeThumbnail);
public readonly PropertyInfo NodeObjectTypeIdSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, Guid>(x => x.NodeObjectTypeId);
}
private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.CreatorId);
private static readonly PropertyInfo LevelSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.Level);
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.Name);
private static readonly PropertyInfo ParentIdSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.ParentId);
private static readonly PropertyInfo PathSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.Path);
private static readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, int>(x => x.SortOrder);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.Trashed);
private static readonly PropertyInfo HasChildrenSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.HasChildren);
private static readonly PropertyInfo IsPublishedSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.IsPublished);
private static readonly PropertyInfo IsDraftSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.IsDraft);
private static readonly PropertyInfo HasPendingChangesSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, bool>(x => x.HasPendingChanges);
private static readonly PropertyInfo ContentTypeAliasSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.ContentTypeAlias);
private static readonly PropertyInfo ContentTypeIconSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.ContentTypeIcon);
private static readonly PropertyInfo ContentTypeThumbnailSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, string>(x => x.ContentTypeThumbnail);
private static readonly PropertyInfo NodeObjectTypeIdSelector = ExpressionHelper.GetPropertyInfo<UmbracoEntity, Guid>(x => x.NodeObjectTypeId);
private string _contentTypeIcon;
private string _contentTypeThumbnail;
@@ -66,92 +72,43 @@ namespace Umbraco.Core.Models
public int CreatorId
{
get { return _creatorId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_creatorId = value;
return _creatorId;
}, _creatorId, CreatorIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _creatorId, Ps.Value.CreatorIdSelector); }
}
public int Level
{
get { return _level; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_level = value;
return _level;
}, _level, LevelSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _level, Ps.Value.LevelSelector); }
}
public string Name
{
get { return _name; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_name = value;
return _name;
}, _name, NameSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); }
}
public int ParentId
{
get { return _parentId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_parentId = value;
return _parentId;
}, _parentId, ParentIdSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _parentId, Ps.Value.ParentIdSelector); }
}
public string Path
{
get { return _path; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_path = value;
return _path;
}, _path, PathSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _path, Ps.Value.PathSelector); }
}
public int SortOrder
{
get { return _sortOrder; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_sortOrder = value;
return _sortOrder;
}, _sortOrder, SortOrderSelector);
}
set { SetPropertyValueAndDetectChanges(value, ref _sortOrder, Ps.Value.SortOrderSelector); }
}
public bool Trashed
{
get { return _trashed; }
private set
{
SetPropertyValueAndDetectChanges(o =>
{
_trashed = value;
return _trashed;
}, _trashed, TrashedSelector);
}
private set { SetPropertyValueAndDetectChanges(value, ref _trashed, Ps.Value.TrashedSelector); }
}
public IDictionary<string, object> AdditionalData { get; private set; }
@@ -162,12 +119,7 @@ namespace Umbraco.Core.Models
get { return _hasChildren; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_hasChildren = value;
return _hasChildren;
}, _hasChildren, HasChildrenSelector);
SetPropertyValueAndDetectChanges(value, ref _hasChildren, Ps.Value.HasChildrenSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["HasChildren"] = value;
}
@@ -178,12 +130,7 @@ namespace Umbraco.Core.Models
get { return _isPublished; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isPublished = value;
return _isPublished;
}, _isPublished, IsPublishedSelector);
SetPropertyValueAndDetectChanges(value, ref _isPublished, Ps.Value.IsPublishedSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["IsPublished"] = value;
}
@@ -194,12 +141,7 @@ namespace Umbraco.Core.Models
get { return _isDraft; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_isDraft = value;
return _isDraft;
}, _isDraft, IsDraftSelector);
SetPropertyValueAndDetectChanges(value, ref _isDraft, Ps.Value.IsDraftSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["IsDraft"] = value;
}
@@ -210,12 +152,7 @@ namespace Umbraco.Core.Models
get { return _hasPendingChanges; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_hasPendingChanges = value;
return _hasPendingChanges;
}, _hasPendingChanges, HasPendingChangesSelector);
SetPropertyValueAndDetectChanges(value, ref _hasPendingChanges, Ps.Value.HasPendingChangesSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["HasPendingChanges"] = value;
}
@@ -226,12 +163,7 @@ namespace Umbraco.Core.Models
get { return _contentTypeAlias; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentTypeAlias = value;
return _contentTypeAlias;
}, _contentTypeAlias, ContentTypeAliasSelector);
SetPropertyValueAndDetectChanges(value, ref _contentTypeAlias, Ps.Value.ContentTypeAliasSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["ContentTypeAlias"] = value;
}
@@ -242,12 +174,7 @@ namespace Umbraco.Core.Models
get { return _contentTypeIcon; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentTypeIcon = value;
return _contentTypeIcon;
}, _contentTypeIcon, ContentTypeIconSelector);
SetPropertyValueAndDetectChanges(value, ref _contentTypeIcon, Ps.Value.ContentTypeIconSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["ContentTypeIcon"] = value;
}
@@ -258,12 +185,7 @@ namespace Umbraco.Core.Models
get { return _contentTypeThumbnail; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_contentTypeThumbnail = value;
return _contentTypeThumbnail;
}, _contentTypeThumbnail, ContentTypeThumbnailSelector);
SetPropertyValueAndDetectChanges(value, ref _contentTypeThumbnail, Ps.Value.ContentTypeThumbnailSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["ContentTypeThumbnail"] = value;
}
@@ -274,12 +196,7 @@ namespace Umbraco.Core.Models
get { return _nodeObjectTypeId; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_nodeObjectTypeId = value;
return _nodeObjectTypeId;
}, _nodeObjectTypeId, NodeObjectTypeIdSelector);
SetPropertyValueAndDetectChanges(value, ref _nodeObjectTypeId, Ps.Value.NodeObjectTypeIdSelector);
//This is a custom property that is not exposed in IUmbracoEntity so add it to the additional data
AdditionalData["NodeObjectTypeId"] = value;
}
+14 -3
View File
@@ -1,8 +1,5 @@
using System;
using System.Globalization;
using System.Linq;
using System.Threading;
using Umbraco.Core.Models.Identity;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
@@ -83,5 +80,19 @@ namespace Umbraco.Core.Models
if (media == null) throw new ArgumentNullException("media");
return HasPathAccess(media.Path, user.StartMediaId, Constants.System.RecycleBinMedia);
}
/// <summary>
/// Determines whether this user is an admin.
/// </summary>
/// <param name="user"></param>
/// <returns>
/// <c>true</c> if this user is admin; otherwise, <c>false</c>.
/// </returns>
public static bool IsAdmin(this IUser user)
{
if (user == null) throw new ArgumentNullException("user");
return user.UserType.Alias == "admin";
}
}
}
+128 -79
View File
@@ -9,15 +9,28 @@ using System.Xml;
namespace Umbraco.Core
{
/// <summary>
/// Provides object extension methods.
/// </summary>
public static class ObjectExtensions
{
//private static readonly ConcurrentDictionary<Type, Func<object>> ObjectFactoryCache = new ConcurrentDictionary<Type, Func<object>>();
/// <summary>
///
/// </summary>
/// <param name="input"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static IEnumerable<T> AsEnumerableOfOne<T>(this T input)
{
return Enumerable.Repeat(input, 1);
}
/// <summary>
///
/// </summary>
/// <param name="input"></param>
public static void DisposeIfDisposable(this object input)
{
var disposable = input as IDisposable;
@@ -25,7 +38,8 @@ namespace Umbraco.Core
}
/// <summary>
/// Provides a shortcut way of safely casting an input when you cannot guarantee the <typeparam name="T"></typeparam> is an instance type (i.e., when the C# AS keyword is not applicable)
/// Provides a shortcut way of safely casting an input when you cannot guarantee the <typeparamref name="T"/> is
/// an instance type (i.e., when the C# AS keyword is not applicable).
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="input">The input.</param>
@@ -63,30 +77,30 @@ namespace Umbraco.Core
}
/// <summary>
/// Tries to convert the input object to the output type using TypeConverters. If the destination type is a superclass of the input type,
/// if will use <see cref="Convert.ChangeType(object,System.Type)"/>.
/// Tries to convert the input object to the output type using TypeConverters. If the destination
/// type is a superclass of the input type, if will use <see cref="Convert.ChangeType(object,System.Type)"/>.
/// </summary>
/// <param name="input">The input.</param>
/// <param name="destinationType">Type of the destination.</param>
/// <returns></returns>
public static Attempt<object> TryConvertTo(this object input, Type destinationType)
{
//if it is null and it is nullable, then return success with null
if (input == null && destinationType.IsGenericType && destinationType.GetGenericTypeDefinition() == typeof (Nullable<>))
{
return Attempt<object>.Succeed(null);
// if null...
if (input == null)
{
// nullable is ok
if (destinationType.IsGenericType && destinationType.GetGenericTypeDefinition() == typeof(Nullable<>))
return Attempt<object>.Succeed(null);
// value type is nok, else can be null, so is ok
return Attempt<object>.SucceedIf(destinationType.IsValueType == false, null);
}
//if its not nullable and it is a value type
if (input == null && destinationType.IsValueType) return Attempt<object>.Fail();
//if the type can be null, then no problem
if (input == null && destinationType.IsValueType == false) return Attempt<object>.Succeed(null);
// easy
if (destinationType == typeof(object)) return Attempt.Succeed(input);
if (input.GetType() == destinationType) return Attempt.Succeed(input);
//check for string so that overloaders of ToString() can take advantage of the conversion.
// check for string so that overloaders of ToString() can take advantage of the conversion.
if (destinationType == typeof(string)) return Attempt<object>.Succeed(input.ToString());
// if we've got a nullable of something, we try to convert directly to that thing.
@@ -116,9 +130,10 @@ namespace Umbraco.Core
{
if (input is string)
{
// try convert from string, returns an Attempt if the string could be
// processed (either succeeded or failed), else null if we need to try
// other methods
var result = TryConvertToFromString(input as string, destinationType);
// if we processed the string (succeed or fail), we're done
if (result.HasValue) return result.Value;
}
@@ -201,90 +216,124 @@ namespace Umbraco.Core
return Attempt<object>.Fail();
}
private static Nullable<Attempt<object>> TryConvertToFromString(this string input, Type destinationType)
// returns an attempt if the string has been processed (either succeeded or failed)
// returns null if we need to try other methods
private static Attempt<object>? TryConvertToFromString(this string input, Type destinationType)
{
// easy
if (destinationType == typeof(string))
return Attempt<object>.Succeed(input);
if (string.IsNullOrEmpty(input))
// null, empty, whitespaces
if (string.IsNullOrWhiteSpace(input))
{
if (destinationType == typeof(Boolean))
return Attempt<object>.Succeed(false); // special case for booleans, null/empty == false
if (destinationType == typeof(DateTime))
if (destinationType == typeof(bool)) // null/empty = bool false
return Attempt<object>.Succeed(false);
if (destinationType == typeof(DateTime)) // null/empty = min DateTime value
return Attempt<object>.Succeed(DateTime.MinValue);
// cannot decide here,
// any of the types below will fail parsing and will return a failed attempt
// but anything else will not be processed and will return null
// so even though the string is null/empty we have to proceed
}
// we have a non-empty string, look for type conversions in the expected order of frequency of use...
// look for type conversions in the expected order of frequency of use...
if (destinationType.IsPrimitive)
{
if (destinationType == typeof(Int32))
if (destinationType == typeof(int)) // aka Int32
{
Int32 value;
return Int32.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
}
if (destinationType == typeof(Int64))
{
Int64 value;
return Int64.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
}
if (destinationType == typeof(Boolean))
{
Boolean value;
if (Boolean.TryParse(input, out value))
return Attempt<object>.Succeed(value); // don't declare failure so the CustomBooleanTypeConverter can try
}
else if (destinationType == typeof(Int16))
{
Int16 value;
return Int16.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
}
else if (destinationType == typeof(Double))
{
Double value;
var input2 = NormalizeNumberDecimalSeparator(input);
return Double.TryParse(input2, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
}
else if (destinationType == typeof(Single))
{
Single value;
int value;
if (int.TryParse(input, out value)) return Attempt<object>.Succeed(value);
// because decimal 100.01m will happily convert to integer 100, it
// makes sense that string "100.01" *also* converts to integer 100.
decimal value2;
var input2 = NormalizeNumberDecimalSeparator(input);
return Single.TryParse(input2, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
}
else if (destinationType == typeof(Char))
return Attempt<object>.SucceedIf(decimal.TryParse(input2, out value2), Convert.ToInt32(value2));
}
if (destinationType == typeof(long)) // aka Int64
{
Char value;
return Char.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
long value;
if (long.TryParse(input, out value)) return Attempt<object>.Succeed(value);
// same as int
decimal value2;
var input2 = NormalizeNumberDecimalSeparator(input);
return Attempt<object>.SucceedIf(decimal.TryParse(input2, out value2), Convert.ToInt64(value2));
}
else if (destinationType == typeof(Byte))
// fixme - should we do the decimal trick for short, byte, unsigned?
if (destinationType == typeof(bool)) // aka Boolean
{
Byte value;
return Byte.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
bool value;
if (bool.TryParse(input, out value)) return Attempt<object>.Succeed(value);
// don't declare failure so the CustomBooleanTypeConverter can try
return null;
}
else if (destinationType == typeof(SByte))
if (destinationType == typeof(short)) // aka Int16
{
SByte value;
return SByte.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
short value;
return Attempt<object>.SucceedIf(short.TryParse(input, out value), value);
}
else if (destinationType == typeof(UInt32))
if (destinationType == typeof(double)) // aka Double
{
UInt32 value;
return UInt32.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
double value;
var input2 = NormalizeNumberDecimalSeparator(input);
return Attempt<object>.SucceedIf(double.TryParse(input2, out value), value);
}
else if (destinationType == typeof(UInt16))
if (destinationType == typeof(float)) // aka Single
{
UInt16 value;
return UInt16.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
float value;
var input2 = NormalizeNumberDecimalSeparator(input);
return Attempt<object>.SucceedIf(float.TryParse(input2, out value), value);
}
else if (destinationType == typeof(UInt64))
if (destinationType == typeof(char)) // aka Char
{
UInt64 value;
return UInt64.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
char value;
return Attempt<object>.SucceedIf(char.TryParse(input, out value), value);
}
if (destinationType == typeof(byte)) // aka Byte
{
byte value;
return Attempt<object>.SucceedIf(byte.TryParse(input, out value), value);
}
if (destinationType == typeof(sbyte)) // aka SByte
{
sbyte value;
return Attempt<object>.SucceedIf(sbyte.TryParse(input, out value), value);
}
if (destinationType == typeof(uint)) // aka UInt32
{
uint value;
return Attempt<object>.SucceedIf(uint.TryParse(input, out value), value);
}
if (destinationType == typeof(ushort)) // aka UInt16
{
ushort value;
return Attempt<object>.SucceedIf(ushort.TryParse(input, out value), value);
}
if (destinationType == typeof(ulong)) // aka UInt64
{
ulong value;
return Attempt<object>.SucceedIf(ulong.TryParse(input, out value), value);
}
}
else if (destinationType == typeof(Guid))
{
Guid value;
return Guid.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
return Attempt<object>.SucceedIf(Guid.TryParse(input, out value), value);
}
else if (destinationType == typeof(DateTime))
{
@@ -307,30 +356,30 @@ namespace Umbraco.Core
else if (destinationType == typeof(DateTimeOffset))
{
DateTimeOffset value;
return DateTimeOffset.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
return Attempt<object>.SucceedIf(DateTimeOffset.TryParse(input, out value), value);
}
else if (destinationType == typeof(TimeSpan))
{
TimeSpan value;
return TimeSpan.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
return Attempt<object>.SucceedIf(TimeSpan.TryParse(input, out value), value);
}
else if (destinationType == typeof(Decimal))
else if (destinationType == typeof(decimal)) // aka Decimal
{
Decimal value;
decimal value;
var input2 = NormalizeNumberDecimalSeparator(input);
return Decimal.TryParse(input2, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
return Attempt<object>.SucceedIf(decimal.TryParse(input2, out value), value);
}
else if (destinationType == typeof(Version))
{
Version value;
return Version.TryParse(input, out value) ? Attempt<object>.Succeed(value) : Attempt<object>.Fail();
return Attempt<object>.SucceedIf(Version.TryParse(input, out value), value);
}
// E_NOTIMPL IPAddress, BigInteger
return null; // we can't decide...
}
private static readonly char[] NumberDecimalSeparatorsToNormalize = new[] {'.', ','};
private static readonly char[] NumberDecimalSeparatorsToNormalize = {'.', ','};
private static string NormalizeNumberDecimalSeparator(string s)
{
@@ -107,10 +107,10 @@ namespace Umbraco.Core.Persistence
var foreignSql = _syntaxProvider.Format(tableDefinition.ForeignKeys);
var indexSql = _syntaxProvider.Format(tableDefinition.Indexes);
var tableExist = _db.TableExist(tableName);
var tableExist = TableExist(tableName);
if (overwrite && tableExist)
{
_db.DropTable(tableName);
DropTable(tableName);
tableExist = false;
}
@@ -42,13 +42,13 @@ namespace Umbraco.Core.Persistence
{
case DatabaseProviders.SqlServer:
case DatabaseProviders.SqlAzure:
factory = DbProviderFactories.GetFactory("System.Data.SqlClient");
factory = DbProviderFactories.GetFactory(Constants.DatabaseProviders.SqlServer);
break;
case DatabaseProviders.SqlServerCE:
factory = DbProviderFactories.GetFactory("System.Data.SqlServerCe.4.0");
break;
case DatabaseProviders.MySql:
factory = DbProviderFactories.GetFactory("MySql.Data.MySqlClient");
factory = DbProviderFactories.GetFactory(Constants.DatabaseProviders.MySql);
break;
case DatabaseProviders.PostgreSQL:
case DatabaseProviders.Oracle:
@@ -102,5 +102,14 @@ namespace Umbraco.Core.Persistence
}
}
}
// during tests, the thread static var can leak between tests
// this method provides a way to force-reset the variable
internal void ResetForTests()
{
if (_nonHttpInstance == null) return;
_nonHttpInstance.Dispose();
_nonHttpInstance = null;
}
}
}
@@ -29,32 +29,41 @@ namespace Umbraco.Core.Persistence.Factories
public IContent BuildEntity(DocumentDto dto)
{
var content = new Content(dto.Text, dto.ContentVersionDto.ContentDto.NodeDto.ParentId, _contentType)
var content = new Content(dto.Text, dto.ContentVersionDto.ContentDto.NodeDto.ParentId, _contentType);
try
{
Id = _id,
Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId,
Name = dto.Text,
NodeName = dto.ContentVersionDto.ContentDto.NodeDto.Text,
Path = dto.ContentVersionDto.ContentDto.NodeDto.Path,
CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value,
WriterId = dto.WriterUserId,
Level = dto.ContentVersionDto.ContentDto.NodeDto.Level,
ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId,
SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder,
Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed,
Published = dto.Published,
CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate,
UpdateDate = dto.ContentVersionDto.VersionDate,
ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?)null,
ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?)null,
Version = dto.ContentVersionDto.VersionId,
PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished,
PublishedVersionGuid = dto.DocumentPublishedReadOnlyDto == null ? default(Guid) : dto.DocumentPublishedReadOnlyDto.VersionId
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
content.ResetDirtyProperties(false);
return content;
content.DisableChangeTracking();
content.Id = _id;
content.Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId;
content.Name = dto.Text;
content.NodeName = dto.ContentVersionDto.ContentDto.NodeDto.Text;
content.Path = dto.ContentVersionDto.ContentDto.NodeDto.Path;
content.CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value;
content.WriterId = dto.WriterUserId;
content.Level = dto.ContentVersionDto.ContentDto.NodeDto.Level;
content.ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId;
content.SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder;
content.Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed;
content.Published = dto.Published;
content.CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate;
content.UpdateDate = dto.ContentVersionDto.VersionDate;
content.ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?) null;
content.ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?) null;
content.Version = dto.ContentVersionDto.VersionId;
content.PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished;
content.PublishedVersionGuid = dto.DocumentPublishedReadOnlyDto == null ? default(Guid) : dto.DocumentPublishedReadOnlyDto.VersionId;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
content.ResetDirtyProperties(false);
return content;
}
finally
{
content.EnableChangeTracking();
}
}
public DocumentDto BuildDto(IContent entity)
@@ -21,13 +21,22 @@ namespace Umbraco.Core.Persistence.Factories
public IContentType BuildContentTypeEntity(ContentTypeDto dto)
{
var contentType = new ContentType(dto.NodeDto.ParentId);
BuildCommonEntity(contentType, dto);
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
contentType.ResetDirtyProperties(false);
try
{
contentType.DisableChangeTracking();
return contentType;
BuildCommonEntity(contentType, dto);
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
contentType.ResetDirtyProperties(false);
return contentType;
}
finally
{
contentType.EnableChangeTracking();
}
}
#endregion
@@ -37,11 +46,20 @@ namespace Umbraco.Core.Persistence.Factories
public IMediaType BuildMediaTypeEntity(ContentTypeDto dto)
{
var contentType = new MediaType(dto.NodeDto.ParentId);
BuildCommonEntity(contentType, dto);
try
{
contentType.DisableChangeTracking();
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
contentType.ResetDirtyProperties(false);
BuildCommonEntity(contentType, dto);
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
contentType.ResetDirtyProperties(false);
}
finally
{
contentType.EnableChangeTracking();
}
return contentType;
}
@@ -104,7 +122,7 @@ namespace Umbraco.Core.Persistence.Factories
else if (entity is IMemberType)
nodeObjectType = Constants.ObjectTypes.MemberTypeGuid;
else
throw new Exception("oops: invalid entity.");
throw new Exception("Invalid entity.");
var contentTypeDto = new ContentTypeDto
{
@@ -19,25 +19,35 @@ namespace Umbraco.Core.Persistence.Factories
public IDataTypeDefinition BuildEntity(DataTypeDto dto)
{
var dataTypeDefinition = new DataTypeDefinition(dto.PropertyEditorAlias)
{
CreateDate = dto.NodeDto.CreateDate,
DatabaseType = dto.DbType.EnumParse<DataTypeDatabaseType>(true),
Id = dto.DataTypeId,
Key = dto.NodeDto.UniqueId,
Level = dto.NodeDto.Level,
UpdateDate = dto.NodeDto.CreateDate,
Name = dto.NodeDto.Text,
ParentId = dto.NodeDto.ParentId,
Path = dto.NodeDto.Path,
SortOrder = dto.NodeDto.SortOrder,
Trashed = dto.NodeDto.Trashed,
CreatorId = dto.NodeDto.UserId.Value
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
dataTypeDefinition.ResetDirtyProperties(false);
return dataTypeDefinition;
var dataTypeDefinition = new DataTypeDefinition(dto.PropertyEditorAlias);
try
{
dataTypeDefinition.DisableChangeTracking();
dataTypeDefinition.CreateDate = dto.NodeDto.CreateDate;
dataTypeDefinition.DatabaseType = dto.DbType.EnumParse<DataTypeDatabaseType>(true);
dataTypeDefinition.Id = dto.DataTypeId;
dataTypeDefinition.Key = dto.NodeDto.UniqueId;
dataTypeDefinition.Level = dto.NodeDto.Level;
dataTypeDefinition.UpdateDate = dto.NodeDto.CreateDate;
dataTypeDefinition.Name = dto.NodeDto.Text;
dataTypeDefinition.ParentId = dto.NodeDto.ParentId;
dataTypeDefinition.Path = dto.NodeDto.Path;
dataTypeDefinition.SortOrder = dto.NodeDto.SortOrder;
dataTypeDefinition.Trashed = dto.NodeDto.Trashed;
dataTypeDefinition.CreatorId = dto.NodeDto.UserId.Value;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
dataTypeDefinition.ResetDirtyProperties(false);
return dataTypeDefinition;
}
finally
{
dataTypeDefinition.EnableChangeTracking();
}
}
public DataTypeDto BuildDto(IDataTypeDefinition entity)
@@ -10,15 +10,23 @@ namespace Umbraco.Core.Persistence.Factories
public IDictionaryItem BuildEntity(DictionaryDto dto)
{
var item = new DictionaryItem(dto.Parent, dto.Key)
{
Id = dto.PrimaryKey,
Key = dto.UniqueId
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
item.ResetDirtyProperties(false);
return item;
var item = new DictionaryItem(dto.Parent, dto.Key);
try
{
item.DisableChangeTracking();
item.Id = dto.PrimaryKey;
item.Key = dto.UniqueId;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
item.ResetDirtyProperties(false);
return item;
}
finally
{
item.EnableChangeTracking();
}
}
public DictionaryDto BuildDto(IDictionaryItem entity)
@@ -17,13 +17,23 @@ namespace Umbraco.Core.Persistence.Factories
public IDictionaryTranslation BuildEntity(LanguageTextDto dto)
{
var item = new DictionaryTranslation(dto.LanguageId, dto.Value, _uniqueId)
{Id = dto.PrimaryKey};
var item = new DictionaryTranslation(dto.LanguageId, dto.Value, _uniqueId);
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
item.ResetDirtyProperties(false);
return item;
try
{
item.DisableChangeTracking();
item.Id = dto.PrimaryKey;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
item.ResetDirtyProperties(false);
return item;
}
finally
{
item.EnableChangeTracking();
}
}
public LanguageTextDto BuildDto(IDictionaryTranslation entity)
@@ -12,15 +12,26 @@ namespace Umbraco.Core.Persistence.Factories
public IMacro BuildEntity(MacroDto dto)
{
var model = new Macro(dto.Id, dto.UseInEditor, dto.RefreshRate, dto.Alias, dto.Name, dto.ScriptType, dto.ScriptAssembly, dto.Xslt, dto.CacheByPage, dto.CachePersonalized, dto.DontRender, dto.Python);
foreach (var p in dto.MacroPropertyDtos)
try
{
model.Properties.Add(new MacroProperty(p.Id, p.Alias, p.Name, p.SortOrder, p.EditorAlias));
model.DisableChangeTracking();
foreach (var p in dto.MacroPropertyDtos)
{
model.Properties.Add(new MacroProperty(p.Id, p.Alias, p.Name, p.SortOrder, p.EditorAlias));
}
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
model.ResetDirtyProperties(false);
return model;
}
finally
{
model.EnableChangeTracking();
}
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
model.ResetDirtyProperties(false);
return model;
}
public MacroDto BuildDto(IMacro entity)
@@ -29,24 +29,32 @@ namespace Umbraco.Core.Persistence.Factories
public IMedia BuildEntity(ContentVersionDto dto)
{
var media = new Models.Media(dto.ContentDto.NodeDto.Text, dto.ContentDto.NodeDto.ParentId, _contentType)
{
Id = _id,
Key = dto.ContentDto.NodeDto.UniqueId,
Path = dto.ContentDto.NodeDto.Path,
CreatorId = dto.ContentDto.NodeDto.UserId.Value,
Level = dto.ContentDto.NodeDto.Level,
ParentId = dto.ContentDto.NodeDto.ParentId,
SortOrder = dto.ContentDto.NodeDto.SortOrder,
Trashed = dto.ContentDto.NodeDto.Trashed,
CreateDate = dto.ContentDto.NodeDto.CreateDate,
UpdateDate = dto.VersionDate,
Version = dto.VersionId
};
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
media.ResetDirtyProperties(false);
return media;
var media = new Models.Media(dto.ContentDto.NodeDto.Text, dto.ContentDto.NodeDto.ParentId, _contentType);
try
{
media.DisableChangeTracking();
media.Id = _id;
media.Key = dto.ContentDto.NodeDto.UniqueId;
media.Path = dto.ContentDto.NodeDto.Path;
media.CreatorId = dto.ContentDto.NodeDto.UserId.Value;
media.Level = dto.ContentDto.NodeDto.Level;
media.ParentId = dto.ContentDto.NodeDto.ParentId;
media.SortOrder = dto.ContentDto.NodeDto.SortOrder;
media.Trashed = dto.ContentDto.NodeDto.Trashed;
media.CreateDate = dto.ContentDto.NodeDto.CreateDate;
media.UpdateDate = dto.VersionDate;
media.Version = dto.VersionId;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
media.ResetDirtyProperties(false);
return media;
}
finally
{
media.EnableChangeTracking();
}
}
public ContentVersionDto BuildDto(IMedia entity)
@@ -31,26 +31,35 @@ namespace Umbraco.Core.Persistence.Factories
public IMember BuildEntity(MemberDto dto)
{
var member = new Member(
dto.ContentVersionDto.ContentDto.NodeDto.Text,
dto.Email,dto.LoginName,dto.Password, _contentType)
dto.ContentVersionDto.ContentDto.NodeDto.Text,
dto.Email, dto.LoginName, dto.Password, _contentType);
try
{
Id = _id,
Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId,
Path = dto.ContentVersionDto.ContentDto.NodeDto.Path,
CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value,
Level = dto.ContentVersionDto.ContentDto.NodeDto.Level,
ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId,
SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder,
Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed,
CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate,
UpdateDate = dto.ContentVersionDto.VersionDate,
Version = dto.ContentVersionDto.VersionId
};
member.ProviderUserKey = member.Key;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
member.ResetDirtyProperties(false);
return member;
member.DisableChangeTracking();
member.Id = _id;
member.Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId;
member.Path = dto.ContentVersionDto.ContentDto.NodeDto.Path;
member.CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value;
member.Level = dto.ContentVersionDto.ContentDto.NodeDto.Level;
member.ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId;
member.SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder;
member.Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed;
member.CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate;
member.UpdateDate = dto.ContentVersionDto.VersionDate;
member.Version = dto.ContentVersionDto.VersionId;
member.ProviderUserKey = member.Key;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
member.ResetDirtyProperties(false);
return member;
}
finally
{
member.EnableChangeTracking();
}
}
public MemberDto BuildDto(IMember entity)
@@ -18,18 +18,26 @@ namespace Umbraco.Core.Persistence.Factories
public IMemberGroup BuildEntity(NodeDto dto)
{
var template = new MemberGroup
var group = new MemberGroup();
try
{
CreateDate = dto.CreateDate,
Id = dto.NodeId,
Key = dto.UniqueId,
Name = dto.Text
};
group.DisableChangeTracking();
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
template.ResetDirtyProperties(false);
return template;
group.CreateDate = dto.CreateDate;
group.Id = dto.NodeId;
group.Key = dto.UniqueId;
group.Name = dto.Text;
//on initial construction we don't want to have dirty properties tracked
// http://issues.umbraco.org/issue/U4-1946
group.ResetDirtyProperties(false);
return group;
}
finally
{
group.EnableChangeTracking();
}
}
public NodeDto BuildDto(IMemberGroup entity)
@@ -12,48 +12,56 @@ namespace Umbraco.Core.Persistence.Factories
public IMemberType BuildEntity(MemberTypeReadOnlyDto dto)
{
var standardPropertyTypes = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
var memberType = new MemberType(dto.ParentId)
{
Alias = dto.Alias,
AllowedAsRoot = dto.AllowAtRoot,
CreateDate = dto.CreateDate,
CreatorId = dto.UserId.HasValue ? dto.UserId.Value : 0,
Description = dto.Description,
Icon = dto.Icon,
Id = dto.NodeId,
IsContainer = dto.IsContainer,
Key = dto.UniqueId.Value,
Level = dto.Level,
Name = dto.Text,
Path = dto.Path,
SortOrder = dto.SortOrder,
Thumbnail = dto.Thumbnail,
Trashed = dto.Trashed,
UpdateDate = dto.CreateDate,
AllowedContentTypes = Enumerable.Empty<ContentTypeSort>()
};
var propertyTypeGroupCollection = GetPropertyTypeGroupCollection(dto, memberType, standardPropertyTypes);
memberType.PropertyGroups = propertyTypeGroupCollection;
var memberType = new MemberType(dto.ParentId);
var propertyTypes = GetPropertyTypes(dto, memberType, standardPropertyTypes);
//By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before.
foreach (var standardPropertyType in standardPropertyTypes)
try
{
if(dto.PropertyTypes.Any(x => x.Alias.Equals(standardPropertyType.Key))) continue;
//Add the standard PropertyType to the current list
propertyTypes.Add(standardPropertyType.Value);
memberType.DisableChangeTracking();
//Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType
memberType.MemberTypePropertyTypes.Add(standardPropertyType.Key,
new MemberTypePropertyProfileAccess(false, false));
memberType.Alias = dto.Alias;
memberType.AllowedAsRoot = dto.AllowAtRoot;
memberType.CreateDate = dto.CreateDate;
memberType.CreatorId = dto.UserId.HasValue ? dto.UserId.Value : 0;
memberType.Description = dto.Description;
memberType.Icon = dto.Icon;
memberType.Id = dto.NodeId;
memberType.IsContainer = dto.IsContainer;
memberType.Key = dto.UniqueId.Value;
memberType.Level = dto.Level;
memberType.Name = dto.Text;
memberType.Path = dto.Path;
memberType.SortOrder = dto.SortOrder;
memberType.Thumbnail = dto.Thumbnail;
memberType.Trashed = dto.Trashed;
memberType.UpdateDate = dto.CreateDate;
memberType.AllowedContentTypes = Enumerable.Empty<ContentTypeSort>();
var propertyTypeGroupCollection = GetPropertyTypeGroupCollection(dto, memberType, standardPropertyTypes);
memberType.PropertyGroups = propertyTypeGroupCollection;
var propertyTypes = GetPropertyTypes(dto, memberType, standardPropertyTypes);
//By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before.
foreach (var standardPropertyType in standardPropertyTypes)
{
if (dto.PropertyTypes.Any(x => x.Alias.Equals(standardPropertyType.Key))) continue;
//Add the standard PropertyType to the current list
propertyTypes.Add(standardPropertyType.Value);
//Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType
memberType.MemberTypePropertyTypes.Add(standardPropertyType.Key,
new MemberTypePropertyProfileAccess(false, false));
}
memberType.NoGroupPropertyTypes = propertyTypes;
return memberType;
}
finally
{
memberType.EnableChangeTracking();
}
memberType.NoGroupPropertyTypes = propertyTypes;
return memberType;
}
private PropertyGroupCollection GetPropertyTypeGroupCollection(MemberTypeReadOnlyDto dto, MemberType memberType, Dictionary<string, PropertyType> standardProps)
@@ -71,7 +79,7 @@ namespace Umbraco.Core.Persistence.Factories
{
// note: no idea why Id is nullable here, but better check
if (groupDto.Id.HasValue == false)
throw new Exception("oops: groupDto.Id has no value.");
throw new Exception("GroupDto.Id has no value.");
group.Id = groupDto.Id.Value;
}
@@ -42,12 +42,22 @@ namespace Umbraco.Core.Persistence.Factories
: propertyType.CreatePropertyFromRawValue(propertyDataDto.GetValue,
propertyDataDto.VersionId.Value,
propertyDataDto.Id);
//on initial construction we don't want to have dirty properties tracked
property.CreateDate = _createDate;
property.UpdateDate = _updateDate;
// http://issues.umbraco.org/issue/U4-1946
property.ResetDirtyProperties(false);
properties.Add(property);
try
{
//on initial construction we don't want to have dirty properties tracked
property.DisableChangeTracking();
property.CreateDate = _createDate;
property.UpdateDate = _updateDate;
// http://issues.umbraco.org/issue/U4-1946
property.ResetDirtyProperties(false);
properties.Add(property);
}
finally
{
property.EnableChangeTracking();
}
}
return properties;
@@ -89,7 +99,7 @@ namespace Umbraco.Core.Persistence.Factories
decimal val;
if (decimal.TryParse(property.Value.ToString(), out val))
{
dto.Decimal = val;
dto.Decimal = val; // property value should be normalized already
}
}
else if (property.DataTypeDatabaseType == DataTypeDatabaseType.Date && property.Value != null && string.IsNullOrWhiteSpace(property.Value.ToString()) == false)

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