Compare commits

..

412 Commits

Author SHA1 Message Date
Sebastiaan Janssen d4d21c18b2 Correct little mistake in nuspec file 2013-06-28 14:21:00 +02:00
Morten Christensen f809dec874 Updating repository factory to inject unique name setting into ContentRepository 2013-06-28 13:28:03 +02:00
Morten Christensen 2477500045 Fixes #U4-2414 and removes internal usage of action handlers Yay! 2013-06-28 13:27:23 +02:00
Morten Christensen ca1b05e30d Correcting unit test after update to ContentType ctor 2013-06-27 15:23:15 +02:00
Morten Christensen 5c09ba9a2d Updating nuspec files and build 2013-06-27 15:15:27 +02:00
Sebastiaan Janssen 5f67e85471 Merge branch '6.0.7' of github.com:umbraco/Umbraco-CMS into 6.0.7 2013-06-26 20:55:11 +02:00
Sebastiaan Janssen d9228c368f Fixes U4-2404 Photo gallery broken on Azure - Since the template saving routine is doing ToSafeAlias, we should also do it when setting the default template 2013-06-26 20:54:36 +02:00
Morten Christensen 41b8de09b7 Fixes U4-2234 including test case from issue 2013-06-26 15:49:00 +02:00
Morten Christensen bbf06cd13d Fixes U4-2234 2013-06-26 14:31:36 +02:00
Morten Christensen 639cb17741 Fixes U4-2182 and U4-2167 2013-06-26 14:31:10 +02:00
Sebastiaan Janssen 50035eae49 Merge pull request #33 from bokmadsen/6.0.7
Bugfix for previous pullrequest "Duplicate e-mail addresses: U4-315, U4-...
2013-06-26 02:43:34 -07:00
Bo Kingo Damgaard 2d857a8635 Bugfix for previous pullrequest "Duplicate e-mail addresses: U4-315, U4-2147, U4-304"
There was a bug in the previous pullrequest that didn't allow a member
to saved if the email wasn't changed. Furthermore duplicate emails are
now prevented if requireUniqueEmail was false, but is switched to true
(when saving a member)
2013-06-26 10:47:27 +02:00
Morten Christensen 3040d362ef Fixes #U4-2361 2013-06-25 11:48:37 +02:00
Shannon 1ec7cd3b89 Implements: #U4-2342 - IRenderMvcController 2013-06-25 09:33:48 +10:00
Sebastiaan Janssen 368954226a Update to not require specific version of MVC4, just 4.0.20710.0 and higher 2013-06-24 12:05:22 +02:00
Stefan Kip b01b4f7aa7 Forgot to update XML comments
Signed-off-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2013-06-24 10:29:03 +02:00
Stefan Kip 49a699c858 Added RemovePropertyGroup method
Signed-off-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2013-06-24 10:28:42 +02:00
Stefan Kip 22cf59345c Removed space before UmbracoModule
Removed space before UmbracoModule
Conflicts:
	src/Umbraco.Web.UI/web.Template.config
2013-06-23 16:02:02 +02:00
Michiel van Oosterhout 16a46a4ea4 Changed default user email address to use the example domain, instead of domain.com 2013-06-23 16:01:04 +02:00
Sebastiaan Janssen c0df3e0202 Match IIS Express port number to Umbraco version so it's easier to use a few copies of the repo locally
(you don't have to re-map your port to the correct folder)
2013-06-23 15:13:27 +02:00
Sebastiaan Janssen 507c6c23b9 If you never had VS2010 installed, the build now works, checking if the Publishing Tasks dll exists now 2013-06-23 14:57:53 +02:00
Sebastiaan Janssen 3daf936623 Remove hgignore files 2013-06-23 14:52:45 +02:00
Sebastiaan Janssen 033f981718 Fix unit test 2013-06-22 14:19:22 +02:00
Sebastiaan Janssen 76358e3e13 U4-2374 Mono port to do: dealing with empty string 2013-06-21 17:29:55 +02:00
Sebastiaan Janssen 35c0eb3b0c U4-2377 Mono port to do: Universal currency character does not work as split character unless given in unicode. 2013-06-21 17:22:13 +02:00
Sebastiaan Janssen 7fad8ca98b U4-2378 Mono port to do: TypeFinder needs exclusions for Monodevelop Nunit 2013-06-21 17:15:42 +02:00
Sebastiaan Janssen a2da27121e U4-2335 [Regression] YSOD when editing stylesheet property on 6.0.6 2013-06-21 17:00:40 +02:00
Sebastiaan Janssen 23ec07276a U4-2369 Wrong path for Umbraco/Config/Lang/xx.xml for publish notification mail 2013-06-21 16:56:59 +02:00
Sebastiaan Janssen 96cec0b407 U4-2410 EditRelationType.aspx missing virtual path - 6.0.6 2013-06-21 16:30:44 +02:00
Sebastiaan Janssen 47b94e68e3 Merge branch '6.0.7' of github.com:umbraco/Umbraco-CMS into 6.0.7 2013-06-21 15:26:10 +02:00
Sebastiaan Janssen 0f4b1752e0 U4-2416 Missing colon in file ListChildPagesOrderedByProperty causes Web site not to run 2013-06-21 15:25:46 +02:00
Shannon b2c604f7b3 updated ignore 2013-06-21 11:26:23 +10:00
Shannon 818d22ba61 updates CDF config examples (#U4-2331) 2013-06-21 10:49:27 +10:00
Shannon 27fdb1ebab removed custom dashboard, re-put back in the external index (must have got removed by accident) 2013-06-21 09:19:50 +10:00
Shannon 86ce48ddc8 Fixes: #U4-2312 - Moving content with the new API (and in the old api when calling library.UpdateDocumentCache(p.Id)) The document is actually moved properly in the content XML structure without republishing it and then rebuilding the entire XML structure, it just does it inline. Have also updated MoveAndCopy.aspx dialog to use the new API which now saves on about 20+ queries that were not needed. Also updated the MoveAndCopy dialog to have the correct code behind structure. 2013-06-20 15:34:57 +10:00
Shannon 2161ec98b0 Fixes: #U4-2324 - Umbraco.Field will now work with custom routed pages. 2013-06-20 11:25:33 +10:00
Shannon 52292cab60 Fixes: #U4-2403 2013-06-20 10:08:02 +10:00
WadeKallhoff a6768263d3 image thumb extension fix 2013-06-19 18:11:28 +02:00
kensykora e66306978a macro rendering fix 2013-06-19 17:59:30 +02:00
Phil Dye 7f22809ebf U4-1478 Create button still visible when not active 2013-06-19 17:55:00 +02:00
Edwin de Koning 302ebde422 Translating the word "or" 2013-06-19 16:28:58 +02:00
Murray@tbpc10.terabyte.co.nz cf5624f377 #U4-2326 Added Try Catch for PlatformNotSupportedException
Signed-off-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2013-06-19 16:24:09 +02:00
Morten Bock f386c9d024 U4-1226 Umbraco:image control 2013-06-19 16:18:15 +02:00
Edwin de Koning 530fcf0ea3 Fixes U4-2261 2013-06-19 16:04:56 +02:00
Sebastiaan Janssen 26e4091f28 Due to previous fix we don't need to sort individually any more
(see changeset 32f86f750e)
2013-06-19 16:01:50 +02:00
Dennis Ravn Pedersen 32f86f750e Query would reverse logic sorting of children. Would make move operations ignore sorting.
Signed-off-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2013-06-19 15:36:08 +02:00
Sebastiaan Janssen b8304c03ee Merge branch '6.0.7' of https://github.com/bokmadsen/Umbraco-CMS into bokmadsen-6.0.7 2013-06-19 14:50:41 +02:00
Sebastiaan Janssen aaa4469def Merge branch '6.0.7' of github.com:umbraco/Umbraco-CMS into 6.0.7 2013-06-19 14:36:17 +02:00
Sebastiaan Janssen baa0069262 Merge branch 'master' into 6.0.7
Conflicts:
	README.md
2013-06-19 14:22:57 +02:00
Sebastiaan Janssen 9ac4c7aef5 Merge branch 'master' of https://github.com/umbraco/Umbraco-CMS 2013-06-19 14:14:51 +02:00
Sebastiaan Janssen cb2a35594f Merge branch '6.0.6'
Conflicts:
	src/Umbraco.Core/TypeFinder.cs
2013-06-19 14:13:09 +02:00
Sebastiaan Janssen dd501d0198 Merge pull request #16 from darrenferguson/master
Remove obsoletion of Member methods
2013-06-19 05:07:35 -07:00
Sebastiaan Janssen b724d8fb32 Merge pull request #15 from pynej/master
Fix for U4-2384. Author not changed to current user when a node is copied.
2013-06-19 05:06:23 -07:00
Darren Ferguson 7c6aee17e9 Remove obsolete messages from member class
I've removed the obsolete methods from the member class because many of
the suggested alternatives don't work. and some require a lot of
configuration to get working.

Also, the member methods return Members - so they are not obsolete if
you want a reference to a member, you can choose to use System
membership if you want, but for custom properties and groups you need to
fallback to the Umbraco API, so these shouldn't be obsolete! :)
2013-06-19 13:02:58 +01:00
Jeremy Pyne 5e2c3a0a8b Fixed a type on content copy. 2013-06-18 10:38:08 -04:00
Jeremy Pyne f5121bd183 Fix for U4-2384. Author not changed to current user when a node is copied. 2013-06-18 09:35:33 -04:00
Bo Kingo Damgaard 51b5334126 Duplicate e-mail addresses: U4-315, U4-2147, U4-304
- Allows for duplicate e-mail addresses in member section by opt-in
(requiresUniqueEmail="false" in
web.config/membership/providers/"UmbracoMembershipProvider").
- Fixes issues with backoffice not checking for duplicate emails when
changing member after creation.
- Lower cases email addresses upon creating member and when searching to
prevent duplicates.
- Added Member.GetMembersByEmail to get alle members with specific email
2013-06-18 14:23:05 +02:00
Shannon 120bdca9eb removed constraint names on SurfaceControllers, they don't need to be suffixed with SurfaceController, only Controller. 2013-06-18 15:05:13 +10:00
Shannon a5041aa34e Backported changes to use a real Area to do Umbraco area routes and updates our extension methods with the UseNamespaceFallback data token to only check in one namespace. 2013-06-18 14:59:00 +10:00
Shannon d3780848dc updated ignore file with correct case sensitivity 2013-06-18 14:20:50 +10:00
Shannon 9d15228c68 manually applies patch for drag/drop fix in media for vdir 2013-06-17 03:06:24 +02:00
Shannon c9c3623457 updated ignore
Signed-off-by: Shannon <sdeminick@gmail.com>
2013-06-17 02:59:00 +02:00
Sebastiaan Janssen e0a483ca48 Merge pull request #5 from tcmorris/patch-1
Update README.md
2013-06-13 02:05:43 -07:00
Thomas Morris 95eb00a81c Update README.md
Updating link and formatting
2013-06-12 18:24:54 +02:00
Sebastiaan Janssen 3921b0974e Merge pull request #3 from Jayshoe/patch-1
Sitemap provider be gone! Issue #U4-1950
2013-06-12 07:19:56 -07:00
Jayshoe 2cd07c841f Sitemap provider be gone! Issue #U4-1950 2013-06-12 16:19:14 +02:00
Sebastiaan Janssen 8f80f0e95c Merge pull request #2 from Jeavon/patch-1
Update README.md
2013-06-12 06:38:32 -07:00
Jeavon 73ac2c0309 Update README.md
Readme.md corrections and updates
2013-06-12 15:34:26 +02:00
Sebastiaan Janssen a5ddb6c818 Merge pull request #1 from dpen2000/patch-1
Update README.md
2013-06-12 06:10:28 -07:00
dpen2000 458e61e049 Update README.md
Fix link to Umbraco releases page
2013-06-12 14:45:41 +02:00
Sebastiaan Janssen 0815842640 Update README.md 2013-06-12 11:10:18 +03:00
Sebastiaan Janssen 53b31a5c1b Update README.md 2013-06-12 10:04:31 +02:00
Sebastiaan Janssen a4098b5d25 Update README.md 2013-06-11 00:57:03 +02:00
Sebastiaan Janssen 33ff82e766 Add missing files 2013-06-11 00:47:44 +02:00
Sebastiaan Janssen 5fd90e1c13 Update README.md 2013-06-10 19:17:37 +03:00
Sebastiaan Janssen a6eaec9ecb Update README.md 2013-06-10 19:09:03 +03:00
Sebastiaan Janssen f5553bcc06 Create README.md 2013-06-10 18:05:07 +02:00
leekelleher e0c68a8e1c Resolves #U4-184 Upgrade package when installing a newer version.
Multiple package versions can be installed, only the latest version is listed under "Installed Packages".
When the installed package is viewed, a list of previously installed versions (of that package) are listed.
2013-06-10 13:55:58 -01:00
Shannon Deminick 5212d17f49 Fixes: #U4-2313 - manually adding a reserved route value in BeginUmbracoForm 2013-06-03 14:56:15 -10:00
Sebastiaan Janssen dc2554c6d0 Fixes U4-2254 [Object object] error when selecting media link for content. 2013-06-03 15:08:56 -02:00
Sebastiaan Janssen 159d605434 U4-2262 Release 6.1.0 Build 2 (Beta) has Razor Errors on scripting files 2013-05-31 13:59:35 -02:00
Sebastiaan Janssen 5c0c33a46b Fixes U4-2304 Typo bug in umbraco.cms.businesslogic.packager 2013-05-31 12:14:03 -02:00
Sebastiaan Janssen a1ee352514 Additional fix for U4-335 Image cropper out of memory 2013-05-31 05:46:10 -02:00
Sebastiaan Janssen a8ad8c2a43 Bump version number 2013-05-30 10:23:35 -02:00
Sebastiaan Janssen afbe3ca3b9 Creating branch 6.0.7 2013-05-30 09:57:33 -02:00
Sebastiaan Janssen 32d6f2e50c Closing branch 6.0.6 2013-05-30 09:57:03 -02:00
Sebastiaan Janssen 9909f5b6be Added tag release-6.0.6 for changeset 953c466faf8f 2013-05-30 09:56:32 -02:00
Morten Christensen 6281268954 Updating sort method in Content- and MediaService 2013-05-29 13:18:03 -02:00
Morten Christensen 8e1c45e981 Updating Sort methods to skip items that hasn't been sorted 2013-05-29 05:37:55 -02:00
Sebastiaan Janssen 4a7ee52d63 Merge with 4.11.9 2013-05-29 03:47:26 -02:00
Sebastiaan Janssen b4d88b0361 U4-2279 TryGetRouteDefinitionFromAncestorViewContexts has infinite loop when
currentContext doesnt contain umbraco-route-def
2013-05-29 03:44:01 -02:00
Sebastiaan Janssen b41cf37dd5 U4-2290 Notifications do not handle fields that have null values. 2013-05-29 03:42:20 -02:00
Sebastiaan Janssen fc32100142 Merge with 4.11.9 2013-05-28 15:45:59 -02:00
Sebastiaan Janssen 7ecbc3b391 Fixes U4-2248 Spelling error in back office 2013-05-28 15:44:59 -02:00
Sebastiaan Janssen c3c44df52e Merge with 4.11.9 2013-05-28 15:43:40 -02:00
Sebastiaan Janssen 13a86624ff Fixes U4-2248 Spelling error in back office 2013-05-28 15:39:12 -02:00
Sebastiaan Janssen 2f61bc27c8 Bump version number 2013-05-28 15:15:32 -02:00
Sebastiaan Janssen e7d157a209 Merge with 4.11.9 2013-05-28 12:18:49 -02:00
Sebastiaan Janssen d3ed90c23e Some fixes & refactor 2013-05-28 12:10:29 -02:00
Sebastiaan Janssen b916360771 Merge with 4.11.9 2013-05-27 10:22:20 -02:00
Sebastiaan Janssen db4b93dbc3 Update test because of new added restextension (EmbedMediaService) 2013-05-27 10:21:14 -02:00
Sebastiaan Janssen 40868ac361 Merge 2013-05-27 10:02:01 -02:00
Sebastiaan Janssen f399a9f52b Merge with 4.11.9 2013-05-27 10:00:28 -02:00
Sebastiaan Janssen 562851b93e Possible fix for U4-2251 TreeDataService throws JSON JavaScriptSerializer. The
length of the string exceeds the value set on the maxJsonLength property
2013-05-27 09:59:02 -02:00
Morten Christensen e61b567ee1 Fixes #U4-2270 and #U4-2269 2013-05-27 08:45:07 -02:00
Sebastiaan Janssen 4ce22b836e Merge with 4.11.9 2013-05-27 08:16:18 -02:00
Sebastiaan Janssen f5bf05a6f5 Move embed media service from webservices dll into it's own /base class 2013-05-27 07:19:42 -02:00
Sebastiaan Janssen e50569597b Minor update to legacy ajax calls 2013-05-27 06:10:04 -02:00
Sebastiaan Janssen 071f3dcc01 Fix javascript error with the speechbubble 2013-05-27 06:05:13 -02:00
Morten Christensen 6943a454f3 Implementing Sort-method for the Content/MediaService 2013-05-23 10:29:44 -02:00
Shannon Deminick 532f407260 Merge with 4.11.9 2013-05-14 14:20:52 -10:00
Shannon Deminick 834d04f8ed Fixes: #U4-1469, #U4-1156 2013-05-14 14:18:41 -10:00
dmilic f36ab37f6a Fix for the U4-2229 issue - broken PublishWithSubs method 2013-05-13 15:49:59 -12:00
Sebastiaan Janssen aeff33d0a6 Bump version number 2013-05-28 15:17:55 -02:00
Sebastiaan Janssen 5cfe9e57ce Merge with 4.11.9 2013-05-13 13:47:01 -02:00
Sebastiaan Janssen 4863e657df Fixes U4-2226 Javascript error "tinyMCE is undefined" in IE - THANKS Adriano Buscema! 2013-05-13 13:42:57 -02:00
Shannon Deminick c0e1be4df9 Merge 2013-05-12 23:56:47 -10:00
Sebastiaan Janssen a93e562f14 Fixes U4-2209 6.0.5 - Bug - Empty recycle bin DELETES all content 2013-05-13 07:48:35 -02:00
Shannon Deminick 822cac5d87 Adds test for #U4-2207 which will now pass but it will still fail on the website because of the case
sensitive checking for the default proeprty editor lookup. Need feedback from sebastian before continuing
2013-05-12 21:44:02 -10:00
Shannon Deminick d58487fafc Merge 2013-05-12 21:13:50 -10:00
Shannon Deminick ea9653fa83 patches fix for #U4-2214 2013-05-12 21:12:55 -10:00
Sebastiaan Janssen 8cca1b77b3 Merge with 4.11.9 2013-05-10 08:47:24 -02:00
Sebastiaan Janssen 53e4308c29 Fixes U4-2205 Log.GetLogItems(LogTypes, DateTime) fails with 'Conversion failed
when converting the nvarchar value 'Custom' to data type int'
2013-05-10 08:44:47 -02:00
Shannon Deminick 6f26f7b57c Patching from 6.1 2013-05-08 18:08:55 -10:00
Shannon Deminick bda2614290 Patching from 6.1 2013-05-08 17:49:48 -10:00
Shannon Deminick efc482511e Patching from 6.1 2013-05-08 17:48:17 -10:00
Shannon Deminick 40b90b8a58 Patching from 6.1 2013-05-08 17:45:53 -10:00
Shannon Deminick a009dfe2a1 Patching from 6.1 2013-05-08 17:39:03 -10:00
Shannon Deminick 41e87fca98 Fixes macro tree syncing 2013-05-08 17:04:51 -10:00
Shannon Deminick f23c6c53cc Fixes up created package tree sync. 2013-05-08 17:11:50 -10:00
Shannon Deminick 0762decd92 Fixes up tree syncing for views, stylesheets and partial views. Now ensures we can actually
sync a tree for a file based node that doesn't have a static id. Also ensures that when we change a
Partial view name that we don't end up duplicating some files when we change it twice in the
same session.
2013-05-08 14:18:18 -10:00
Shannon Deminick 0b58c1c03c Patching from 6.1 2013-05-08 17:34:40 -10:00
Shannon Deminick 38c6a21896 Patching from 6.1 2013-05-08 17:33:48 -10:00
Shannon Deminick 15bff44ec1 Patching from 6.1 2013-05-08 17:24:00 -10:00
Shannon Deminick a626efa9b6 Merge with 4.11.9 2013-05-08 17:15:09 -10:00
Hendy 54d2258634 added null checks into the uQuery .ToNameIds() methods 2013-05-08 16:29:29 -01:00
Sebastiaan Janssen 25be0621b2 Whoops, connection string doesn't contain the datalayer here 2013-05-08 13:14:02 -02:00
Sebastiaan Janssen cba09ed817 Merge with 4.11.9 2013-05-08 08:10:48 -02:00
Sebastiaan Janssen d5d00553b4 Fixed U4-2176 MySql Dashboard error for 4.11 as well 2013-05-08 08:09:13 -02:00
Shannon Deminick c52669fb05 Fixes: #U4-2094 - issue with duplicates in getting Descendants for media in mvc. 2013-05-07 18:56:24 -10:00
Shannon Deminick c4a071523e Merge with 4.11.9 2013-05-06 15:12:10 -10:00
Shannon Deminick ca99319ead Fixes: #U4-644 - DynamicNode and MVC don't output RTE values for media 2013-05-06 15:09:24 -10:00
Shannon Deminick 81360f629e Merge with 4.11.9 2013-05-06 12:54:28 -10:00
Sebastiaan Janssen aa36c66f39 Fixes U4-2176 6.0.5 Dashboard error 2013-05-06 12:27:15 -02:00
Sebastiaan Janssen 09e31d6595 Fixes U4-2179 Error with GetChildNodes after upgrade to Umbraco 6.0.5 from
Umbraco 6.0.0
2013-05-06 12:06:45 -02:00
Sebastiaan Janssen f9fc2619fa Fixes U4-2179 Error with GetChildNodes after upgrade to Umbraco 6.0.5 from
Umbraco 6.0.0
2013-05-06 12:06:45 -02:00
Sebastiaan Janssen 5d8cfa5efb Merge 2013-05-06 11:06:54 -02:00
Sebastiaan Janssen 297f8e2a0b Remove reference to v4 in text. 2013-05-06 11:06:28 -02:00
Shannon Deminick 8ddfb5f6ad Merge 2013-05-06 02:09:44 -10:00
Shannon Deminick 9387544865 Fixes test outcome 2013-05-06 02:08:38 -10:00
Shannon Deminick 66ddb21ef8 Fixes null check 2013-05-06 02:03:24 -10:00
Shannon Deminick 9d19ed9463 Fix merge issues 2013-05-05 23:35:51 -10:00
Shannon Deminick df62697477 Merge with 4.11.9 2013-05-05 23:23:24 -10:00
Shannon Deminick f0cacf0d52 Fixed app_code assembly check. 2013-05-05 23:03:31 -10:00
Shannon Deminick d501fcb679 Fixes TypeFinder issue but retains the improved performance. Adds TypeHelper tests. 2013-05-05 22:57:41 -10:00
Shannon Deminick f5994d8442 Fixes up async methods in ContentTypeControlNew to ensure that the UmbracoContext is current since
the actions might run on different threads and therefore some event handlers might need access to the context.
2013-05-04 19:33:49 -10:00
Shannon Deminick 4295cba915 Updated unit tests for TypeFinder - this shows the issue with the new refactored performance changes. 2013-05-04 18:12:02 -10:00
Robert Stocks 6d66fc6cb8 Remove extra space in name of http module in web.config 2013-05-03 07:24:28 -01:00
Robert Stocks 4484f83caa Remove extra space in name of http module in web.config 2013-05-03 07:24:28 -01:00
Sebastiaan Janssen 3ada1770eb Merge with 4.11.9 2013-05-06 09:32:23 -02:00
Shannon Deminick 0b6f05e630 Fixes: #U4-2172 - better single threaded supported for the database instance outside http context 2013-05-02 03:48:14 -10:00
Sebastiaan Janssen 2170380f7b Opening new branch 2013-05-01 13:07:53 -02:00
Sebastiaan Janssen a8ab7e4c35 Open new branch 2013-05-01 13:05:12 -02:00
Sebastiaan Janssen c20c9c638f Merge with 4.11.8 2013-05-01 13:04:06 -02:00
Sebastiaan Janssen 43b2a2185e Fix unit test 2013-05-01 13:02:09 -02:00
Sebastiaan Janssen 2423bdd623 Merge with 4.11.8 2013-05-01 05:33:19 -02:00
Sebastiaan Janssen bcb90d64a5 Fixes U4-1136 Class in MediaPickerDataType.cs wrongly named MemberPickerDataType
+ a bit of code cleanup
2013-05-01 05:32:29 -02:00
Sebastiaan Janssen 7d448d0959 Merge 2013-04-30 05:22:43 -02:00
Sebastiaan Janssen 53fe02db7e And another update for WebPI... 2013-04-30 05:22:21 -02:00
Shannon Deminick af51465a6a Merge 2013-04-29 19:57:44 -10:00
Shannon Deminick a03dd7b11e Merge with 4.11.8 2013-04-29 19:56:18 -10:00
Shannon Deminick 6d994f48ac merged in patch for TypeFinder changes 2013-04-29 19:55:44 -10:00
Shannon Deminick f0e8252e38 Merge with 4.11.8 2013-04-29 12:09:12 -10:00
Shannon Deminick ad06aded1b Removed strange old legacy config section that never did anything 2013-04-29 12:08:36 -10:00
Sebastiaan Janssen 0ca52fcc60 Fix merge issues, update version number 2013-04-29 12:29:15 -02:00
Sebastiaan Janssen c53342ba4c Merge with 4.11.8 2013-04-29 12:13:00 -02:00
Sebastiaan Janssen 25eea8d599 Re-add internals visible to umbraco.webservices in case people install the
seperate project.
2013-04-29 11:17:32 -02:00
Sebastiaan Janssen 22498649b1 Merge 2013-04-29 10:36:30 -02:00
Sebastiaan Janssen 25ce7baa7d Removing the umbraco.webservices project 2013-04-29 10:36:11 -02:00
Shannon Deminick e885384678 Merge with 4.11.8 2013-04-28 13:40:06 -10:00
Shannon Deminick 528209f8da instantly improve performance by 45% for regenerating xml structures for documents when a doc type alias changes
or when a doc type property alias is changed or a doc type property is removed.
2013-04-28 13:37:36 -10:00
Shannon Deminick 153fe248a7 Fixes ContentService fix for issue U4-1772, we don't want to truncate! Plus the truncate term doesn't work in SQLCE anyways. 2013-04-25 19:33:53 -10:00
Shannon Deminick 7fc4822bbe Fixes merge issues. Fixes Fixes for cmsContentXml table since the Content type heirarchy tables are different in v6. 2013-04-25 19:26:06 -10:00
Shannon Deminick d65bee76b2 Merge with 4.11.8 2013-04-25 14:15:09 -10:00
Shannon Deminick 385d6396b0 disables auto-complete on the login page. 2013-04-25 13:28:47 -10:00
Shannon Deminick 46858af1ed Ensures user cookie is encrypted, removes ASP.Net headers from being returned in our response. Ensures
that our auth cookie is httponly.
2013-04-25 13:25:25 -10:00
Shannon Deminick 34163625fe Merge with 4.11.7 - cmsContentXml fixes 2013-04-25 12:20:06 -10:00
Sebastiaan Janssen c2057656bc Merge with 6.0.4 2013-04-25 11:23:31 -02:00
Sebastiaan Janssen 09a4e33f3f Closing again.. 2013-04-25 11:20:21 -02:00
Sebastiaan Janssen e53b388a5e Opening new branch 2013-04-25 11:19:06 -02:00
Sebastiaan Janssen 4fb4af0b4f Added tag release-6.0.4 for changeset 0dee9964687e 2013-04-25 11:18:36 -02:00
Sebastiaan Janssen 461f032777 Added tag release-4.11.7 for changeset ce47176bc6b9 2013-04-25 11:17:07 -02:00
Sebastiaan Janssen ab37f9ae35 Closing 6.0.4 2013-04-25 11:16:29 -02:00
Sebastiaan Janssen a3347c0037 Opening new branch 2013-04-25 11:14:46 -02:00
Sebastiaan Janssen f3835d1ca3 Closing branch 4.11.7 2013-04-25 11:14:09 -02:00
Sebastiaan Janssen 8fae55e44e Correct path to Courier 2013-04-25 09:02:58 -02:00
Sebastiaan Janssen a8ca3a89bd Forgot to uncomment some items 2013-04-25 08:51:31 -02:00
Sebastiaan Janssen 765f959f20 Reverting includes removal of courier/contour files 2013-04-25 08:44:37 -02:00
Sebastiaan Janssen 2cf90477ed Make Selenium Contour install work 2013-04-25 08:44:01 -02:00
Sebastiaan Janssen 6ca6a08233 Add RevertToEmptyInstall which installs an empty DB with credentials admin/test
Also deletes all dlls from /bin and rebuilds the project (to remove packages
that have installed dlls).
2013-04-25 07:15:54 -02:00
Sebastiaan Janssen 0119f1eb1b Merge 2013-04-25 06:11:28 -02:00
Sebastiaan Janssen cd4f66e7c5 Making a start on adding Selenium integration/UI tests for the backoffice 2013-04-25 06:10:57 -02:00
Shannon Deminick d30c4791fe fixed a documentation error 2013-04-24 15:46:38 -10:00
Shannon Deminick 7ee9b9ebcc Fixes: #U4-2144 - ensures that the xml is re-gen'd when a content type alias is changed or a content type property is removed.
Also had to change the property type deletion to be async as well since it might be long running to re-gen the xml.
2013-04-24 15:31:36 -10:00
Shannon Deminick b4caf109f7 Working on #U4-2144 - ensures that xml is re-gen'd when a property alias is changed. 2013-04-24 15:17:20 -10:00
Shannon Deminick 0e8ffe528a Fixes: #U4-2149 - updates the logic for changing aliases for any content type. Now if an alias changes for any content type, the
xml is regenerated for any entity that is of that content type. For DocumentType's this is slightly different because we regenerate
the xml for the doc type and any document of the doc type's descendant types.
2013-04-24 14:57:20 -10:00
Shannon Deminick a8029d1dc5 Fixes: #U4-1772 - ensures that when changing a doc type alias that we only rebuild the data in the cmsContentXml table for Document types, not media types or member types, now we need
to fix all of the other bugs assocated with cmsContentXml table and alias changes.
2013-04-24 13:19:30 -10:00
Morten Christensen 3fdc0e5361 Fixes #U4-2137 Ensuring that existing templates are updated instead of duplicated when installing packages.
Adds test for installing templates and then updating the same templates through another package install.
2013-04-24 07:41:37 -02:00
Shannon Deminick 4bfb8569c8 Fixed up merge issues 2013-04-23 21:37:03 -10:00
Shannon Deminick df9a887032 Merge with 4.11.7 2013-04-23 20:50:30 -10:00
Shannon Deminick 1e0a4690fc Added an error log if timed out 2013-04-23 20:31:32 -10:00
Shannon Deminick 52163494db changed the async state object to be a custom class to hold the original values of alias/text 2013-04-23 20:19:48 -10:00
Shannon Deminick 8416764a83 removed the trace from the page 2013-04-23 20:01:26 -10:00
Shannon Deminick 2d3eb8c208 Working on #U4-493, updated ContentTypeControlNew and EditNodeTypeNew to use correct webforms class structures.
Changed the saving logic in ContentTypeControlNew to use the page's async execution and changed the page to support async.
Changed the page's async timeout to be 5 minutes.
2013-04-23 20:00:48 -10:00
Sebastiaan Janssen aa84a3f7f2 Fixes U4-2138 Copying a node reverses sort order in target 2013-04-23 12:49:33 -02:00
agrath 3594693f4b Backported fix for u4-335 from Commit b15d0ab0b879 into 4.11.7 2013-04-22 11:12:03 -12:00
Morten Christensen c573459626 Fixing nuget related issue #U4-2067 and updating version 2013-04-22 06:01:31 -02:00
Sebastiaan Janssen b99de245bf Fixes U4-2052 for new mediatypes as well 2013-04-21 09:44:08 -02:00
Morten Christensen 222723b8fe Fixes #U4-2004 so GetPublishedDescendants retrieves the published version and not the latest version. 2013-04-21 09:06:22 -02:00
Morten Christensen f758b33da5 Properly fixes #U4-2112 and adds option to determine whether or not to import doc type structues. 2013-04-21 07:25:38 -02:00
Morten Christensen eeb0e0026a Making PropertyCollection, PropertyGroupCollection and PropertyTypeCollection return a proper null when FirstOrDefault should return null. 2013-04-20 19:47:30 -02:00
Morten Christensen 082dacf737 Fixes #U4-2029 Finding scripts and stylesheets recursively. 2013-04-20 12:56:43 -02:00
Morten Christensen afc2fd9420 Ensures that CreateDate and UpdateDate is set on both PropertyTypes and Properties for Content and Media.
Fixes #U4-2028
2013-04-20 12:23:14 -02:00
Morten Christensen ff6715d42a Fixes #U4-2013 Localization lost in packaging for DocumentTypes 2013-04-20 11:23:04 -02:00
Morten Christensen b776675ac8 Fixes #U4-2065 Document.AfterMove legacy event handler returns wrong parent. 2013-04-20 11:19:27 -02:00
Morten Christensen 1e21671b62 Fixes #U4-2008 Umbraco.Core.Models.PropertyType -> change ValidationRegExp from internal to public 2013-04-20 11:10:28 -02:00
Morten Christensen 59184981cb Fixes #U4-2009 Delete of media doesnt delete relations 2013-04-20 11:05:48 -02:00
Morten Christensen 0632ffb93d Fixes #U4-2069 2013-04-20 11:03:57 -02:00
Shannon Deminick 034aa6d8f9 Fixes merge issue 2013-04-20 03:58:15 +06:00
Shannon Deminick 1484fba1ad Merge with 4.11.7 2013-04-20 03:51:22 +06:00
Shannon Deminick 82fc1a5304 updated proj file 2013-04-20 03:47:57 +06:00
Shannon Deminick f0aab6ae81 Fixes: U4-2089 - sort dialog behavior when clicking on column headers. Updated to latest version of table sorting, had to create a custom sort parser
upgraded the sort.aspx to have the proper code behind structure and updated the page to have proper css and js files instead of inline. Fixes missing images.
2013-04-20 03:42:47 +06:00
Shannon Deminick 9ac325c1a4 Fixes: #U4-2130 - regression bug for handling image uploads 2013-04-20 00:04:39 +06:00
Sebastiaan Janssen 8c257d39f9 Fix merge issue 2013-04-19 06:43:58 -02:00
Sebastiaan Janssen 76f040aef4 Merge with 4.11.7 2013-04-19 06:42:33 -02:00
Sebastiaan Janssen 721f813d1e U4-1604 Fix latest edits dashboard control so that it doesn't make a zillion queries - Limit the latestedits query to specified amount of rows 2013-04-19 06:10:58 -02:00
Morten Christensen 7ed5a6f706 Fixes #U4-2068 and #U4-2125
Creating test for verifying path is correctly updated when moving items to the recycle bin.
2013-04-19 06:07:25 -02:00
Shannon Deminick 35a698cdc9 Merge with 4.11.7 2013-04-19 04:40:13 +06:00
Shannon Deminick 6c9e82e735 fixed typo 2013-04-19 04:31:55 +06:00
Shannon Deminick f7ddb1ed49 fixed typo 2013-04-19 04:30:15 +06:00
Shannon Deminick c0fd974cc1 fixes typo on word disallow 2013-04-19 04:20:24 +06:00
Shannon Deminick e9c4a031c9 Fixes up directory browser and removes legacy request params which are prone to xss 2013-04-19 04:10:35 +06:00
Shannon Deminick 123e65c55f Fixes: #U4-2118 - BOM encoding issue 2013-04-18 23:00:57 +06:00
Shannon Deminick e5e4e7b685 Fixes another merge issue and improves performance slightly for sorting so that we are not double saving the entity if it is published already. 2013-04-18 21:44:38 +06:00
Shannon Deminick 88795b86fd Updated merge issue, and removed the call to refreshXmlSortOrder since we are already republishing which already writes the updated xml 2013-04-18 21:16:00 +06:00
Shannon Deminick 378a544c1a Merge with 4.11.7 2013-04-18 20:59:42 +06:00
Shannon Deminick a159b50c05 Fixed a couple threading issues. Improved the performance of the nodeSorter but this should be better improved in 6.x 2013-04-18 20:52:49 +06:00
Shannon Deminick 3891e46549 Fixed a couple threading issues. Improved the performance of the nodeSorter but this should be better improved in 6.x 2013-04-18 20:52:30 +06:00
Shannon Deminick e7bcc642a9 fix build error on build server 2013-04-18 19:50:01 +06:00
Shannon Deminick 4983990d39 Big optimization for content.SortNodes - 92% performance increase for this method which is a big
contributor to CPU time during publishing.
2013-04-18 05:43:05 +06:00
Shannon Deminick e9a496df4f Merge with 4.11.7 2013-04-17 23:31:52 +06:00
Shannon Deminick 2f6dada481 Fixes issue with ctor not setting default property 2013-04-17 23:20:20 +06:00
Shannon Deminick 580123cb87 fixed merge issues 2013-04-17 23:03:51 +06:00
Shannon Deminick de0e47d7ef Merge with 4.11.7 2013-04-17 22:50:31 +06:00
Shannon Deminick ff5dc324fe Fixes: #U4-227 - ensures data is not persisted to the db for members/media if validation fails.
Fixes up (enables) validation summary for members too.
2013-04-17 22:41:43 +06:00
Shannon Deminick 096c5ad69f Fixes: #U4-485, changes name field from saving to the db if it is empty. cleans up some code. 2013-04-17 22:05:10 +06:00
Thomas Skyldahl Sørensen c12f9d0272 Optimization for issue: U4-1187
Url: http://issues.umbraco.org/issue/U4-1187

Added assembly filtering, to stop scanning of third party assemblies
that doesn't reference the types we are looking for.
this limits the amount of possible missing references we encounter
when checking against the types
2013-04-17 14:03:54 -02:00
Sebastiaan Janssen eba7582a97 Eh, yeah, maybe I should start with making a copy of the element first.. d'oh! 2013-04-17 11:16:15 -02:00
Sebastiaan Janssen 0cf2a1fc2a Possible fix for U4-2097 Package import causes template tree to break - modified
closure problem
2013-04-17 10:57:24 -02:00
Sebastiaan Janssen 77ee87178e Merge 2013-04-17 07:04:04 -02:00
Sebastiaan Janssen a6997a5cb7 Revert U4-1922 to resume expected sorting behavior. 2013-04-17 07:03:18 -02:00
Shannon Deminick ff3fc5d825 Merge with 4.11.7 2013-04-17 01:56:20 +06:00
Stephan 3b9bf7b0f9 U4-2117 - fix Ancestor- vs AncestorsOrSelf inconsistencies 2013-04-16 12:58:03 -02:00
Stephan 3882e1984d U4-2117 - fix Ancestor- vs AncestorsOrSelf inconsistencies 2013-04-16 12:29:58 -02:00
Sebastiaan Janssen b32ea68fd0 Merge with 4.11.7 2013-04-15 07:36:58 -02:00
Sebastiaan Janssen eb2db791b8 Additional fix for U4-2105 Saving a document will make it look like it is unpublished 2013-04-15 07:33:26 -02:00
Sebastiaan Janssen 158f4d0614 Merge 2013-04-15 07:32:00 -02:00
Sebastiaan Janssen 7a38970cf4 U4-2109 Regex text-field in DocTypes > (a type) > Properties (a property) >
Validation + Description lack Trimming
2013-04-15 07:31:24 -02:00
Sebastiaan Janssen 7f6d8b6bdd Fixes U4-2105 Saving a document will make it look like it is unpublished 2013-04-12 06:49:06 -02:00
Shannon Deminick 22fb7e1706 Merge 2013-04-12 03:07:53 +06:00
Shannon Deminick 12b1168de9 Fixes merge issues 2013-04-12 02:59:03 +06:00
Shannon Deminick 01290f8174 Merge with 4.11.7 2013-04-12 02:14:59 +06:00
Shannon Deminick 26a7bf8187 Fixes: #U4-2087 2013-04-12 02:11:01 +06:00
Sebastiaan Janssen ba1d0fa193 Improve code for previous fix so we don't need the try/catch any more. 2013-04-11 16:36:26 -02:00
Sebastiaan Janssen 97355bde6f Fixes U4-2091 Inserting image in RTE with mediatype "File" causes YSOD 2013-04-11 13:15:08 -02:00
Sebastiaan Janssen ed35f234de Fixes U4-2100 Media Doesn't Overwrite in 6.0.3 2013-04-11 12:27:11 -02:00
Sebastiaan Janssen c874fa6507 Fixes U4-2097 Package import causes template tree to break 2013-04-11 10:20:17 -02:00
Sebastiaan Janssen ba387598ed Merge with 4.11.7 2013-04-11 07:17:23 -02:00
Sebastiaan Janssen 3ff1b01e46 Add DotSettings file for custom code inspections. In this case: Replace
!someBool with an explicit false check (someBool == false) for readability.
2013-04-11 07:15:06 -02:00
Shannon Deminick 36e803713c Fixed up some code in UmbracoEnsuredPage and moveOrCopy 2013-04-11 02:15:48 +06:00
Shannon Deminick a3e7f644de merges changes for UmbracoHelper from 6.0.x to deal with null objects when using Content method (dynamic) 2013-04-10 22:51:19 +06:00
Sebastiaan Janssen 1586f1679a Merge with 4.11.7 2013-04-10 11:54:24 -02:00
Sebastiaan Janssen 809badd1cf Update version to 4.11.7 2013-04-10 08:54:31 -02:00
Sebastiaan Janssen da92ece774 Update version to 4.11.7 2013-04-10 07:57:56 -02:00
Sebastiaan Janssen a531afb819 Don't need IronPython license any more either. 2013-04-10 07:46:05 -02:00
Sebastiaan Janssen 1d6009e3c7 Merge with 4.11.7 2013-04-10 07:42:21 -02:00
Sebastiaan Janssen 8dfeb1e616 Cleanup solution and folders, removes Linq2Umbraco and IronPython engine from
the project as we don't ship with them any more. Updated readme and docs.
2013-04-10 07:30:14 -02:00
Shannon Deminick 1b086e2267 fixes merge issue 2013-04-10 04:04:33 +06:00
Shannon Deminick 1f86d8c562 fixes merge issues 2013-04-10 03:56:10 +06:00
Shannon Deminick 25b9262cf1 Merge with 4.11.7 2013-04-10 03:51:53 +06:00
Shannon Deminick 1012a4814d updates #U4-2070 for tiny mce plugins 2013-04-10 03:22:11 +06:00
Shannon Deminick bae41cde14 updates #U4-2070 for skin module files in live editing 2013-04-10 03:16:26 +06:00
Shannon Deminick b3260f05c0 updates #U4-2070 for templateskinning.aspx 2013-04-10 03:05:57 +06:00
Shannon Deminick e33a79ac65 updates #U4-2070 for insertMasterpageContent.aspx 2013-04-10 03:02:10 +06:00
Shannon Deminick c4dbabf654 updates #U4-2070 for translation/xml.aspx and translation/preview.aspx 2013-04-10 02:59:47 +06:00
Shannon Deminick 423643d66c updates #U4-2070 for tinymce3/insertmacro.aspx 2013-04-10 02:46:11 +06:00
Shannon Deminick 4ccb655f73 updates #U4-2070 for members/search.aspx 2013-04-10 02:43:03 +06:00
Shannon Deminick c8330d60f9 updates #U4-2070 for sendToTranslation.aspx 2013-04-10 02:41:22 +06:00
Shannon Deminick a9aa3a04b5 updates #U4-2070 for search.aspx 2013-04-10 02:39:32 +06:00
Shannon Deminick 0bffa8e3f4 updates #U4-2070 for preview.aspx 2013-04-10 02:35:31 +06:00
Shannon Deminick 436322f58c updates #U4-2070 for directoryBrowser.aspx 2013-04-10 02:34:44 +06:00
Shannon Deminick e90c46dd78 updates #U4-2070 for canvas.aspx 2013-04-10 02:33:08 +06:00
Shannon Deminick deda2534f8 updates #U4-2070 for SendPublish.aspx 2013-04-10 02:30:53 +06:00
Shannon Deminick 8112c13857 updates #U4-2070 for insertMacro.aspx 2013-04-10 02:28:50 +06:00
Shannon Deminick 57792de185 updates #U4-2070 for imageViewer.aspx 2013-04-10 02:21:59 +06:00
Shannon Deminick e1f93029a5 updates #U4-2070 for assigndomain.aspx 2013-04-10 02:19:29 +06:00
Shannon Deminick f64e0c7eb7 updates #U4-2070 for autodoc.aspx 2013-04-10 02:17:02 +06:00
Shannon Deminick bf024e9011 updates #U4-2070 for assemblyBrowser.aspx 2013-04-10 02:14:13 +06:00
Shannon Deminick 036b888d30 updates #U4-2070 for ShowUmbracoTags.aspx 2013-04-10 02:08:56 +06:00
Shannon Deminick 1838a8dac5 updates #U4-2070 for NewRelationType.aspx 2013-04-10 02:07:16 +06:00
Shannon Deminick 205bf5fe4e updates #U4-2070 for EditRelationType.aspx 2013-04-10 02:05:52 +06:00
Shannon Deminick a50e192ab7 updates #U4-2070 for sort.aspx 2013-04-10 02:03:04 +06:00
Shannon Deminick 9684255e6e ensures validation is correct in editContent, cleans up some code. 2013-04-10 01:58:22 +06:00
Shannon Deminick 72790d74f5 Fixes: #U4-2072 and cleans up some code. 2013-04-10 01:47:17 +06:00
Shannon Deminick bb70bee6ae Fixes: #U4-2071 and cleans up some code. 2013-04-10 01:42:15 +06:00
Shannon Deminick 0430e7966c Fixes: #U4-2074 and cleans up a bit of code 2013-04-10 01:24:06 +06:00
Shannon Deminick 2e9a52b1f8 Fixes: #U4-2075 2013-04-10 00:56:43 +06:00
Sebastiaan Janssen db4ed70d70 Merge with 4.11.7 2013-04-09 11:37:37 -02:00
Sebastiaan Janssen e6ccd8a5b5 Fix for U4-2081 tinymce Image picker does not work in 6.03 2013-04-09 11:33:35 -02:00
Sebastiaan Janssen a9781d79e2 Merge with 4.11.7 2013-04-09 10:22:11 -02:00
Sebastiaan Janssen 7ae8b28466 Fix the medium trust error in the about box 2013-04-09 10:20:34 -02:00
Sebastiaan Janssen 29a4cb8b71 Fixes merge issues 2013-04-09 08:34:03 -02:00
Sebastiaan Janssen ffb39de003 Merge with 4.11.7 2013-04-09 07:55:54 -02:00
Sebastiaan Janssen 527375b238 Fixes U4-2052 Creating a new document type has a bin icon by default
Also deals better with pre-existing selected id's before switching the behaviour
2013-04-09 07:49:22 -02:00
Sebastiaan Janssen a4ed0e266c Merge with 4.11.7 2013-04-09 07:11:54 -02:00
Sebastiaan Janssen 1929f60ea8 Update the webservices version 2013-04-09 07:10:24 -02:00
Sebastiaan Janssen b9cc2efc8c Add authentication to creating templates in webservices 2013-04-09 07:07:13 -02:00
Shannon Deminick eadb1bb194 Fixes merge issues 2013-04-09 07:54:32 +06:00
Shannon Deminick 30be665a40 Merge with 4.11.7 2013-04-09 07:41:55 +06:00
Shannon Deminick bad284515c Fixes: #U4-2076 2013-04-09 07:32:13 +06:00
Shannon Deminick 5b660d95f1 Fixes: #U4-2077 2013-04-09 07:26:21 +06:00
Shannon Deminick 106ac44e64 Fixes: #U4-2073 2013-04-09 07:23:33 +06:00
Shannon Deminick 64bb7e1db0 Fixes up an app check 2013-04-09 07:14:58 +06:00
Shannon Deminick 25b9ca3b0e Works on #U4-2078 - adds new base classes for HttpHandlers just like for web services. 2013-04-09 07:01:43 +06:00
Shannon Deminick b928170103 Works on #U4-2078 2013-04-09 06:40:02 +06:00
Shannon Deminick e25ee246fb Works on #U4-2078 2013-04-09 06:31:26 +06:00
Shannon Deminick 8e8ec41dae Works on #U4-2078 2013-04-09 06:25:47 +06:00
Shannon Deminick fb34c4716a Works on #U4-2078 2013-04-09 06:18:15 +06:00
Shannon Deminick 29bf61b1f2 Starts on #U4-2078, mostly just some initial code cleanup 2013-04-09 06:07:25 +06:00
Shannon Deminick 9803309e34 imports patch from 846d845a5a87 since it belongs in the main dev branch. 2013-04-09 05:04:57 +06:00
Shannon Deminick 3a539629dc imports patch from ed6939e5927f since that fix belongs in the main dev branch 2013-04-09 05:04:21 +06:00
Shannon Deminick 74b970d586 Fixes: #U4-529 - Created 2 base classes for web services - UmbracoWebService and UmbracoAuthorizedWebService for use in
creating asmx classes. This makes it easier to authenticate/authorize per app and also exposes Umbraco standard
objects like UmbracoContext, ApplicationCOntext, etc...
2013-04-09 05:00:22 +06:00
Shannon Deminick 518898b04b Merge 2013-04-09 01:09:27 +06:00
Sebastiaan Janssen d2d1843e03 Fix default branch 2013-04-08 07:03:57 -02:00
Sebastiaan Janssen a773e0a018 Merge with 4.11.7 2013-04-08 06:56:43 -02:00
Sebastiaan Janssen 99fe89addc Fix U4-1864 the same way as in 6.0.x 2013-04-08 06:55:48 -02:00
Sebastiaan Janssen 668d4f9f91 Fixes U4-1864 Publishing document type with Upload field and related
umbracoWidth, umbracoHeight, etc fields added
2013-04-08 05:59:02 -02:00
Shannon Deminick 90e73cb89f cleans up some code in codeEditorSave 2013-04-06 01:59:28 +06:00
Shannon Deminick dcd6477030 Removes un-needed ShowUmbracoTags files from legacy files. 2013-04-06 01:54:41 +06:00
Shannon Deminick 13b73231de Merge with 4.11.7 2013-04-06 01:45:45 +06:00
Shannon Deminick 50a70c28df Merge 2013-04-06 01:45:30 +06:00
Shannon Deminick 7d5589118f Merge 2013-04-06 01:43:41 +06:00
Shannon Deminick c39b698d4c Merge with 4.11.7 2013-04-06 00:31:10 +06:00
Shannon Deminick 103efbdc27 removes config check on p.aspx since we need it to show the feeds when installer is done. 2013-04-06 00:30:37 +06:00
Shannon Deminick 3d51dd767b Fixed merge issues. 2013-04-06 00:27:44 +06:00
Shannon Deminick e22988e435 Merged with 4.11.7 2013-04-06 00:21:06 +06:00
Shannon Deminick 9736aaafaa Fixes authorize issue with insertchar.aspx 2013-04-06 00:09:43 +06:00
Shannon Deminick bf3fa20a53 Cleaned up the code fro rsd and wlwmanifest and ensures wlwmanifest actually returns the results in xml format. 2013-04-06 00:04:23 +06:00
Shannon Deminick f936f8b0dd updates install utility to throw exception if the app is configured already. 2013-04-05 23:40:02 +06:00
Shannon Deminick 1bd20c9b06 Fixes: #U4-2059 and removes un-needed ping.aspx files, cleans up some code 2013-04-05 23:28:43 +06:00
Shannon Deminick 099b713947 Fixed ValidateProxyUrl to check for invalid Urls. 2013-04-05 22:29:45 +06:00
Shannon Deminick 165d9c7dff Fixed nonodes to now show version information and updated it so that it redirects to root if there
is actually content so the page is actually not accessible unless you actually have no nodes.
2013-04-05 21:58:13 +06:00
Stephan 09400be6e0 U4-2030 - failed to update UmbracoContext on some devt webservers 2013-04-05 10:28:19 -02:00
Stephan 7934ba7ec4 U4-2030 - failed to update UmbracoContext on some devt webservers 2013-04-05 10:28:19 -02:00
Shannon Deminick 7edbc34e6c Merge with 4.11.7 2013-04-05 06:46:13 +06:00
Shannon Deminick 60b6608289 patch for fix #U4-2027 2013-04-05 06:42:52 +06:00
Morten Christensen 792599a42f Minor correct to the doc.SaveAndPublish method. 2013-04-04 12:20:50 -02:00
Morten Christensen 7610ee5f8b Adding event proxies to the ContentService for publishing events for easier discoverability.
Fixes U4-2046
2013-04-04 07:16:33 -02:00
Morten Christensen eab9be4ef7 Fixing issue with reimporting document types and the structure of allowed doc types.
Removing old code from Installer.
2013-04-04 06:02:08 -02:00
Shannon Deminick e48a030aab Merge 2013-04-04 05:46:01 +06:00
Morten Christensen e207b1f1e1 Adds new test case for single doc type imports.
Corrects issue with installing/importing single or multiple doc types, which is not part of the usual complete package xml.
2013-04-03 18:26:54 -02:00
Shannon Deminick fd3540f92d Removes unused private method 2013-04-03 20:40:06 +06:00
Shannon Deminick b9d7f0c5a5 Fixes merge issues, merge ensures that js error is fixed and that thread-safe caching is in place
in the ContentType.cs class.
2013-04-02 22:06:15 +06:00
Shannon Deminick 3d76614a78 Merge with 4.11.7 2013-04-02 21:31:21 +06:00
Sebastiaan Janssen de0e6f3179 Merge 2013-04-02 08:08:31 -02:00
Sebastiaan Janssen 39edb9b7e2 Fixes U4-2032 Preview for an RTE field shows published content instead of actual
preview
2013-04-02 08:07:18 -02:00
Shannon Deminick a638488eb7 Fixes unit tests which require the ApplicationContext.Current singleton to be setup 2013-04-01 23:30:19 +06:00
Shannon Deminick a2a539f7db Merge 2013-04-01 23:12:47 +06:00
Shannon Deminick 6768bb4793 Fixes: #U4-1874 - merges in thread-safe fixes for static object caching from 6.1 and cleans up
a bunch of the code in ContentType.cs. Back ports fixes for Languages.cs from 6.1 and cleans up code.
2013-04-01 23:12:17 +06:00
Sebastiaan Janssen 19c2841576 Fixes U4-535 Stylesheet content gets deleted if you change case 2013-04-01 14:27:20 -02:00
Sebastiaan Janssen 71aa248a4e Fixes U4-535 Stylesheet content gets deleted if you change case 2013-04-01 14:27:20 -02:00
Sebastiaan Janssen eeaef5ac5c Merge 2013-04-01 11:51:48 -02:00
Sebastiaan Janssen bea50f4562 Fixes: U4-662 Most icon for document type can't be shown in 4.8.1. 2013-04-01 11:50:27 -02:00
Sebastiaan Janssen ff337457f8 Fixes: U4-662 Most icon for document type can't be shown in 4.8.1. 2013-04-01 11:31:03 -02:00
Morten Christensen 49b5ddf850 Refactor of fix for U4-2014 2013-03-31 18:17:01 -02:00
Shannon Deminick b449b8762b Merge 2013-03-29 23:53:08 +06:00
Shannon Deminick 13e555f50b Fixed merge issue based on overlap with class + namespace name. 2013-03-29 23:52:40 +06:00
Shannon Deminick 48c809a797 Merge with 4.11.7 2013-03-29 23:22:18 +06:00
Shannon Deminick 55c7f72d8e Converts create.aspx to have the correct webforms file/class structure, fixed logging for userTask,
fixed issue with last regex fix for xss
2013-03-29 23:14:42 +06:00
Sebastiaan Janssen 8612113fc0 Merge 2013-03-29 15:02:43 -01:00
Sebastiaan Janssen 69b0c7cf09 Fixes: U4-2024 Umbraco 6.0.3 : Error while importing Document Type 2013-03-29 15:01:04 -01:00
Shannon Deminick 37a97a2e7c Merge with 4.11.7 2013-03-29 21:34:56 +06:00
Shannon Deminick 5f4eaef4a2 Fixes: #U4-2022 2013-03-29 21:31:27 +06:00
Sebastiaan Janssen 44f5c3a34f Fixes U4-2019 Create new Document Type dialog displays poorly in Chrome 2013-03-29 09:13:44 -01:00
Sebastiaan Janssen a33ae696a2 Fixes U4-2014 Can't install XSLTSearch 3.0.4 with Umbraco 6.0.3
Updated the topological sorter to only add items that exist in the indexes
2013-03-29 08:46:09 -01:00
Sebastiaan Janssen 2705efb809 Updated file for WebPI builds 2013-03-29 08:34:34 -01:00
Sebastiaan Janssen 648d631151 Opening new branch 2013-03-27 14:48:13 -01:00
Sebastiaan Janssen 27c0c4d64e Opening new branch 2013-03-27 14:47:35 -01:00
Sebastiaan Janssen 52cf559536 Closing 4.11.6 branch 2013-03-27 12:00:18 -01:00
Sebastiaan Janssen a89a122b09 Merge with 6.0.3 2013-03-27 11:56:44 -01:00
Sebastiaan Janssen c9b0362c62 Closed 6.0.3 branch 2013-03-27 11:54:12 -01:00
Sebastiaan Janssen 11e5bdf556 Added tag release-6.0.3 for changeset aed55cba2900 2013-03-27 11:14:18 -01:00
Sebastiaan Janssen 3d0be3836c Added tag release-4.11.6 for changeset 14338b0ab173 2013-03-27 11:13:56 -01:00
Sebastiaan Janssen 2bc33e0115 Merge 2013-03-27 08:58:34 -01:00
Sebastiaan Janssen 8576d9c67e Bump version to 4.11.6 2013-03-27 08:56:30 -01:00
Shannon Deminick e5e22f75fc Merge 2013-03-11 18:47:36 +06:00
Sebastiaan Janssen cab21e9d48 Merge with 6.0.1 2013-03-01 06:51:38 -01:00
Sebastiaan Janssen 2e7c26fcc0 Closing branch 6.0.1 2013-03-01 06:49:59 -01:00
Sebastiaan Janssen 0f6c41679c Added tag Release-6.0.1 for changeset 92410e141d9c 2013-03-01 06:49:45 -01:00
Sebastiaan Janssen 777d397ae7 Merge with 6.0.0 2013-01-31 14:07:05 -01:00
Adam Nelson 41258104f6 U4-497 - Razor errors should be completely silent when UmbracoDebug=false.
Modified implementation to have a single global setting in UmbracoSettings.config
which can now be overridden when the umbraco.macro.Error event is handled on a
per-macro basis if desired.
2013-01-16 00:45:18 -11:00
Adam Nelson 08a8e6b816 U4-497 : Razor errors should be completely silent when UmbracoDebug=false.
Optionally requires macroErrors.config to define macro error behaviour.
See http://issues.umbraco.org/issue/U4-497.
2013-01-14 00:48:54 -11:00
425 changed files with 14379 additions and 10988 deletions
+81
View File
@@ -0,0 +1,81 @@
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
[Bb]in
[Db]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
_NCrunch_*/
*.ncrunchsolution
*.ncrunchsolution.user
*.ncrunchproject
*.crunchsolution.cache
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
*.suo
[sS]ource
[sS]andbox
umbraco.config
*.vs10x
App_Data/TEMP/*
[Uu]mbraco/[Pp]resentation/[Uu]mbraco/[Pp]lugins/*
[Uu]mbraco/[Pp]resentation/[Uu]ser[Cc]ontrols/*
[Uu]mbraco/[Pp]resentation/[Ss]cripts/*
[Uu]mbraco/[Pp]resentation/[Ff]onts/*
[Uu]mbraco/[Pp]resentation/[Cc]ss/*
src/Umbraco.Web.UI/[Cc]ss/*
src/Umbraco.Web.UI/App_Code/*
src/Umbraco.Web.UI/App_Data/*
src/Umbraco.Tests/App_Data/*
src/Umbraco.Web.UI/[Mm]edia/*
src/Umbraco.Web.UI/[Mm]aster[Pp]ages/*
src/Umbraco.Web.UI/[Mm]acro[Ss]cripts/*
src/Umbraco.Web.UI/[Xx]slt/*
src/Umbraco.Web.UI/[Ii]mages/*
src/Umbraco.Web.UI/[Ss]cripts/*
src/Umbraco.Web.UI/Web.*.config.transformed
umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx
umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx
_BuildOutput/*
build/UmbracoCms.AllBinaries*zip
build/UmbracoCms.WebPI*zip
build/UmbracoCms*zip
build/*.nupkg
src/Umbraco.Tests/config/applications.config
src/Umbraco.Tests/config/trees.config
src/Umbraco.Web.UI/web.config
*.orig
src/Umbraco.Tests/config/404handlers.config
src/Umbraco.Web.UI/[Vv]iews/*.cshtml
src/Umbraco.Web.UI/[Vv]iews/*.vbhtml
src/Umbraco.Tests/[Cc]onfig/umbracoSettings.config
src/Umbraco.Web.UI/[Vv]iews/*
src/packages/
src/packages/repositories.config
src/Umbraco.Web.UI/[Ww]eb.config
*.transformed
webpihash.txt
node_modules
src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ib/*
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/umbraco.*
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js
src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.css
src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.html
src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/*
src/Umbraco.Web.UI.Client/[Bb]uild/*
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
build/_BuildOutput/
tools/NDepend/
-70
View File
@@ -1,70 +0,0 @@
syntax: regexp
^src/packages/(?!repositories.config$)
web.Template.[a-zA-Z0-9]*.Debug.config
syntax: glob
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
[Bb]in
[Db]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
_NCrunch_*/
*.ncrunchsolution
*.ncrunchsolution.user
*.ncrunchproject
*.crunchsolution.cache
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
*.suo
[sS]ource
[sS]andbox
umbraco.config
*.vs10x
App_Data\TEMP\*
umbraco\presentation\umbraco\plugins\*
umbraco\presentation\usercontrols\*
umbraco\presentation\scripts\*
umbraco\presentation\fonts\*
umbraco\presentation\css\*
src\Umbraco.Web.UI\[Cc]ss\*
src\Umbraco.Web.UI\App_Code\*
src\Umbraco.Web.UI\App_Data\*
src\Umbraco.Tests\App_Data\*
src\Umbraco.Web.UI\[Mm]edia\*
src\Umbraco.Web.UI\[Mm]aster[Pp]ages\*
src\Umbraco.Web.UI\[Mm]acro[Ss]cripts\*
src\Umbraco.Web.UI\[Xx]slt\*
src\Umbraco.Web.UI\[Ii]mages\*
src\Umbraco.Web.UI\[Ss]cripts\*
src\Umbraco.Web.UI\Web.*.config.transformed
umbraco\presentation\umbraco\plugins\uComponents\uComponentsInstaller.ascx
umbraco\presentation\packages\uComponents\MultiNodePicker\CustomTreeService.asmx
_BuildOutput/*
*.ncrunchsolution
build/UmbracoCms.AllBinaries*zip
build/UmbracoCms.WebPI*zip
build/UmbracoCms*zip
build/*.nupkg
src/Umbraco.Tests/config/applications.config
src/Umbraco.Tests/config/trees.config
src/Umbraco.Web.UI/web.config
*.orig
src/Umbraco.Tests/config/404handlers.config
src/Umbraco.Web.UI/Views/*.cshtml
src/Umbraco.Web.UI/Views/*.vbhtml
src/Umbraco.Tests/config/umbracoSettings.config
src/Umbraco.Web.UI/App_Plugins/*
src/Umbraco.Web.UI/Views/*
src/packages/
src\Umbraco.Web.UI\[W]eb.config
*.transformed
-29
View File
@@ -1,29 +0,0 @@
d0aba247db91d1b70c39c6397b965ca370a67497 Sprint-Juno-A
0b8f67be2ca8faf008151d87f232c698de69e735 Release-4.5.0
5960c073250926d202861a09472f5f334da6e283 Sprint-Juno-B
f15d4ff81a8368e9d42788f7e0ae726f7a70a3b1 Release-4.0.3
283065df4d3c27245267709dd2644a479c4f62a5 Release-4.0.4.2
ffc34b23e1a03785e4098afa4290d8c03cf10115 Release-4.5.2
d03fcffb8834a9583a56813bb44b6abbd9f042cc Release-4.6.0
1809f7b2593270c192cd47bdcfdb392100686f79 4.7.2
488779dec0ceb1d2874bcef906241b919325c904 4.8.0-beta
096f20bb0575d6199f20fcb3147b63554e765a74 Release-4.8.0
8f8a203857886b373148af29edd57460a42940be Release-4.8.1
de73e687ddf6086ed52b6554676c1632865d07f2 Release-4.9.0
8d7d8609e2e4b971da99cd97f72132ce85ce3333 Release-4.9.1
f6da531fbb4c251ff61d314e2a7effb13c71e74a Release-4.10.0
20e4dff821d8ac2527a5353618fa1a23ea1d8b34 Release-4.11.0
7f827760cb49d749616859f528d19dde64807947 Release-4.11.1
7f827760cb49d749616859f528d19dde64807947 Release-4.11.1
6eb5f2fb5a88aa29ea544499df9160a1b31b5638 Release-4.11.1
73711b806a4044dbf0d7d7c095ddfdda23b09932 4.11.2
73711b806a4044dbf0d7d7c095ddfdda23b09932 4.11.2
0000000000000000000000000000000000000000 4.11.2
73711b806a4044dbf0d7d7c095ddfdda23b09932 Release-4.11.2
77db220b89e166b3c0736ed321ecfd6416cddbcd Release-4.11.2.1
54cde33b809dcb3a1f7e7ae0d5375f6dd0d89c8d Release-4.11.2.2
ff3bb24ea0c915878396a6ae27f1ff164e8ac150 Release-6.0.0-beta
56015ac26f5ab60e3c61b1d09075297b660afa07 Release-6.0.0-RC
1719fbd857f28b376639ac2aa0abada0ef2e7560 Release-6.0.0
e02f5aebb87e3f07d27376647756caa9762931d8 Release-4.11.4
b247b35d821144849f551e02da8ba719f91d5fb0 Release-6.0.2
+33
View File
@@ -0,0 +1,33 @@
Umbraco CMS
===========
## Watch a five minute introduction video ##
[![ScreenShot](http://umbraco.com/images/whatisumbraco.png)](http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco)
## Umbraco - the simple, flexible and friendly ASP.NET CMS ##
**More than 177,000 sites trust Umbraco**
For the first time on the Microsoft platform a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too.
Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)) you can be sure that the technology is proven, stable and scales.
To view more examples please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies)
## Downloading ##
The downloadable Umbraco releases live at [http://our.umbraco.org/contribute/releases](http://our.umbraco.org/contribute/releases).
## Forums ##
We have a forum running on [http://our.umbraco.org](http://our.umbraco.org). The discussions group on [Google Groups](https://groups.google.com/forum/#!forum/umbraco-dev) is for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [http://our.umbraco.org](http://our.umbraco.org).
## Contribute to Umbraco ##
If you want to contribute back to Umbraco you should check out our [guide to contributing](http://our.umbraco.org/contribute).
## Found a bug? ##
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature).
To view existing issues please visit [http://issues.umbraco.org](http://issues.umbraco.org)
+3 -1
View File
@@ -1,10 +1,12 @@
@ECHO OFF
SET release=6.0.3
SET release=6.0.7
SET comment=
SET version=%release%
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
ReplaceIISExpressPortNumber.exe ..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj %release%
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
echo This file is only here so that the containing folder will be included in the NuGet package, it is safe to delete. > .\_BuildOutput\WebApp\App_Code\dummy.txt
+20 -1
View File
@@ -82,6 +82,7 @@
<SolutionBinFolder>$(BuildFolder)bin\</SolutionBinFolder>
<WebAppFolder>$(BuildFolder)WebApp\</WebAppFolder>
<WebPiFolder>$(BuildFolder)WebPi\</WebPiFolder>
<ConfigsFolder>$(BuildFolder)Configs\</ConfigsFolder>
<SolutionBinFolderRelativeToProjects>$(BuildFolderRelativeToProjects)bin\</SolutionBinFolderRelativeToProjects>
<SolutionBinFolderAbsolutePath>$(BuildFolderAbsolutePath)bin\</SolutionBinFolderAbsolutePath>
<WebAppFolderRelativeToProjects>$(BuildFolderRelativeToProjects)WebApp\</WebAppFolderRelativeToProjects>
@@ -194,7 +195,7 @@
</Target>
<!-- Copy the transformed web.config file to the root -->
<Target Name="CopyTransformedWebConfig" DependsOnTargets="CopyXmlDocumentation">
<Target Name="CopyTransformedWebConfig" DependsOnTargets="CopyTransformedConfig">
<ItemGroup>
<WebConfigFile Include="..\src\Umbraco.Web.UI\web.$(BuildConfiguration).Config.transformed" />
</ItemGroup>
@@ -205,6 +206,24 @@
SkipUnchangedFiles="false" />
</Target>
<!-- Copy the config files and rename them to *.config.transform -->
<Target Name="CopyTransformedConfig" DependsOnTargets="CopyXmlDocumentation">
<ItemGroup>
<ConfigFiles Include="$(WebAppFolder)config\*.config" />
<WebConfigTransformFile Include="$(WebAppFolder)Web.config" />
</ItemGroup>
<Copy SourceFiles="@(ConfigFiles)"
DestinationFiles="@(ConfigFiles->'$(ConfigsFolder)\%(RecursiveDir)%(Filename)%(Extension)')"
OverwriteReadOnlyFiles="true"
SkipUnchangedFiles="false" />
<Copy SourceFiles="@(WebConfigTransformFile)"
DestinationFiles="$(ConfigsFolder)Web.config.transform"
OverwriteReadOnlyFiles="true"
SkipUnchangedFiles="false" />
</Target>
<!-- Copy the xml documentation to the bin folder -->
<Target Name="CopyXmlDocumentation" DependsOnTargets="CompileProjects">
<ItemGroup>
+6 -9
View File
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>UmbracoCms.Core</id>
<version>6.0.0-alpha</version>
<version>6.0.7</version>
<title>Umbraco Cms Core Binaries</title>
<authors>Morten Christensen</authors>
<owners>Umbraco HQ</owners>
@@ -15,9 +15,13 @@
<language>en-US</language>
<tags>umbraco</tags>
<dependencies>
<dependency id="Microsoft.AspNet.Mvc" version="[4.0.20710.0]" />
<dependency id="Microsoft.AspNet.Mvc" version="4.0" />
<dependency id="ServiceStack.Text" version="3.9.21" />
<dependency id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="1.0.0" />
<dependency id="HtmlAgilityPack" version="1.4.5" />
<dependency id="Lucene.Net" version="[2.9.4.1]" />
<dependency id="SharpZipLib" version="0.86.0" />
<dependency id="MySql.Data" version="[6.6,6.7)" />
</dependencies>
</metadata>
<files>
@@ -31,16 +35,11 @@
<file src="..\_BuildOutput\WebApp\bin\controls.xml" target="lib\controls.xml" />
<file src="..\_BuildOutput\WebApp\bin\CookComputing.XmlRpcV2.dll" target="lib\CookComputing.XmlRpcV2.dll" />
<file src="..\_BuildOutput\WebApp\bin\Examine.dll" target="lib\Examine.dll" />
<file src="..\_BuildOutput\WebApp\bin\HtmlAgilityPack.dll" target="lib\HtmlAgilityPack.dll" />
<file src="..\_BuildOutput\WebApp\bin\ICSharpCode.SharpZipLib.dll" target="lib\ICSharpCode.SharpZipLib.dll" />
<file src="..\_BuildOutput\WebApp\bin\interfaces.dll" target="lib\interfaces.dll" />
<file src="..\_BuildOutput\WebApp\bin\interfaces.xml" target="lib\interfaces.xml" />
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\log4net.dll" />
<file src="..\_BuildOutput\WebApp\bin\Lucene.Net.dll" target="lib\Lucene.Net.dll" />
<file src="..\_BuildOutput\WebApp\bin\Lucene.Net.xml" target="lib\Lucene.Net.xml" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.Web.Helpers.dll" target="lib\Microsoft.Web.Helpers.dll" />
<file src="..\_BuildOutput\WebApp\bin\MySql.Data.dll" target="lib\MySql.Data.dll" />
<file src="..\_BuildOutput\WebApp\bin\Our.Umbraco.uGoLive.47x.dll" target="lib\Our.Umbraco.uGoLive.47x.dll" />
<file src="..\_BuildOutput\WebApp\bin\Our.Umbraco.uGoLive.Checks.dll" target="lib\Our.Umbraco.uGoLive.Checks.dll" />
<file src="..\_BuildOutput\WebApp\bin\Our.Umbraco.uGoLive.dll" target="lib\Our.Umbraco.uGoLive.dll" />
@@ -63,8 +62,6 @@
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.xml" target="lib\umbraco.providers.xml" />
<file src="..\_BuildOutput\WebApp\bin\Umbraco.Web.UI.dll" target="lib\Umbraco.Web.UI.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.webservices.dll" target="lib\umbraco.webservices.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.webservices.xml" target="lib\umbraco.webservices.xml" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.XmlSerializers.dll" target="lib\umbraco.XmlSerializers.dll" />
<file src="..\_BuildOutput\WebApp\bin\UmbracoExamine.dll" target="lib\UmbracoExamine.dll" />
<file src="..\_BuildOutput\WebApp\bin\UrlRewritingNet.UrlRewriter.dll" target="lib\UrlRewritingNet.UrlRewriter.dll" />
+4 -4
View File
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>UmbracoCms</id>
<version>6.0.0-alpha</version>
<version>6.0.7</version>
<title>Umbraco Cms</title>
<authors>Morten Christensen</authors>
<owners>Umbraco HQ</owners>
@@ -21,14 +21,14 @@
<files>
<file src="..\_BuildOutput\WebApp\bin\amd64\**" target="Content\bin\amd64" />
<file src="..\_BuildOutput\WebApp\bin\x86\**" target="Content\bin\x86" />
<file src="..\_BuildOutput\WebApp\config\*.config" target="Content\config" />
<file src="..\_BuildOutput\Configs\**" target="Content\config" exclude="..\_BuildOutput\Configs\Web.config.transform" />
<file src="..\_BuildOutput\WebApp\css\**" target="Content\css" />
<file src="..\_BuildOutput\WebApp\macroScripts\**" target="Content\macroScripts" />
<file src="..\_BuildOutput\WebApp\masterpages\**" target="Content\masterpages" />
<file src="..\_BuildOutput\WebApp\media\**" target="Content\media" />
<file src="..\_BuildOutput\WebApp\scripts\**" target="Content\scripts" />
<file src="..\_BuildOutput\WebApp\usercontrols\**" target="Content\usercontrols" />
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" />
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" exclude="..\_BuildOutput\WebApp\Views\Web.config" />
<file src="..\_BuildOutput\WebApp\xslt\**" target="Content\xslt" />
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
<file src="..\_BuildOutput\WebApp\Web.config" target="Content\Web.config" />
@@ -36,7 +36,7 @@
<file src="..\_BuildOutput\WebApp\App_Code\**" target="UmbracoFiles\App_Code" />
<file src="..\_BuildOutput\WebApp\App_Data\**" target="UmbracoFiles\App_Data" />
<file src="..\_BuildOutput\WebApp\App_Plugins\**" target="UmbracoFiles\App_Plugins" />
<file src="..\_BuildOutput\WebApp\config\**" target="UmbracoFiles\config" />
<file src="..\_BuildOutput\WebApp\config\splashes\**" target="UmbracoFiles\config\splashes" />
<file src="..\_BuildOutput\WebApp\install\**" target="UmbracoFiles\install" />
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
+8 -5
View File
@@ -1,15 +1,18 @@
A note about running Umbraco from Visual Studio.
When upgrading your website using nuget a backup of config files and web.config will be created and the files will
be overwritten with those from the current release. This means that you'll have to merge the files if you made any
changes to the previous config files.
When upgrading your website using nuget a backup of config files and web.config will be created. Only the web.config will
be overwritten by default to ensure that it has the necessary settings from the current release. This means that you'll
have to merge the files if you made any changes to the previous config files.
The config files found in the config folder will usually not be changed for patch releases, so they can usually be skipped,
but the web.config will have to have its previous "umbracoConfigurationStatus"-appsetting and "umbracoDbDSN" connection string
copied over (as a minimum).
It's not possible to create a deploy package from Visual Studio, which contains everything out of the box. This is
due to a number of files and folders that are not added to the Visual Studio project. These folders include:
install, umbraco and umbraco_client.
A custom deploy script will be added in a later release.
Please read the release notes on Codeplex:
http://umbraco.codeplex.com/releases
Please read the release notes on our.umbraco.org:
http://our.umbraco.org/contribute/releases
- Umbraco
Binary file not shown.
+161
View File
@@ -0,0 +1,161 @@
@ECHO OFF
:choice
set /P c=WARNING! Are you sure you want to continue, this will remove all package files, view files, sqlce database, etc... Press 'Y' to auto-remove all files/folders, 'N' to cancel or 'C' to prompt for each folder removal?
if /I "%c%" EQU "C" goto :prompt
if /I "%c%" EQU "Y" goto :auto
if /I "%c%" EQU "N" goto :exit
goto :choice
:prompt
echo Current folder: %CD%
echo Regenerating SQL CE database
SET buildfolder=%CD%
CD ..\tools\RegenerateUmbracoSQLCEDatabase\
RegenerateUmbracoSQLCEDatabase.exe %CD%\..\..\src\Umbraco.Web.UI
CD %buildfolder%
echo Removing bin files
del ..\src\Umbraco.Web.UI\bin\*.*
echo Building solution
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\src\umbraco.sln /t:Clean,Build
echo Resetting installedPackages.config
echo ^<?xml version="1.0" encoding="utf-8"?^>^<packages^>^</packages^> >..\src\Umbraco.Web.UI\App_Data\packages\installed\installedPackages.config
echo Removing plugin cache files
del ..\src\Umbraco.Web.UI\App_Data\TEMP\PluginCache\*.*
echo Removing cache files and examine index
del ..\src\Umbraco.Web.UI\App_Data\TEMP\*.*
echo Removing log files
del ..\src\Umbraco.Web.UI\App_Data\Logs\*.*
echo Removing packages
del ..\src\Umbraco.Web.UI\App_Data\packages\*.*
echo Removing previews
del ..\src\Umbraco.Web.UI\App_Data\preview\*.*
echo Removing app code files (typically added by starterkits)
del ..\src\Umbraco.Web.UI\App_Code\*.*
echo Removing xslt files
del ..\src\Umbraco.Web.UI\xslt\*.*
echo Removing user control files
del ..\src\Umbraco.Web.UI\UserControls\*.*
echo Removing masterpage files
del ..\src\Umbraco.Web.UI\masterpages\*.*
echo Removing view files
del ..\src\Umbraco.Web.UI\Views\*.*
echo Removing razor files
del ..\src\Umbraco.Web.UI\macroScripts\*.*
echo Removing media files
del ..\src\Umbraco.Web.UI\media\*.*
echo Removing script files
del ..\src\Umbraco.Web.UI\scripts\*.*
echo Removing css files
del ..\src\Umbraco.Web.UI\css\*.*
echo "Umbraco install reverted to clean install"
pause
exit
:auto
echo Current folder: %CD%
echo Regenerating SQL CE database
SET buildfolder=%CD%
CD ..\tools\RegenerateUmbracoSQLCEDatabase\
RegenerateUmbracoSQLCEDatabase.exe %CD%\..\..\src\Umbraco.Web.UI
CD %buildfolder%
echo Removing bin files
FOR %%A IN (..\src\Umbraco.Web.UI\bin\*.*) DO DEL %%A
echo Building solution
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe ..\src\umbraco.sln /t:Clean,Build
echo Resetting installedPackages.config
echo ^<?xml version="1.0" encoding="utf-8"?^>^<packages^>^</packages^> >..\src\Umbraco.Web.UI\App_Data\packages\installed\installedPackages.config
echo Removing plugin cache files
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\TEMP\PluginCache\*.*) DO DEL %%A
echo Removing cache files and examine index
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\TEMP\*.*) DO DEL %%A
echo Removing log files
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\Logs\*.*) DO DEL %%A
echo Removing packages
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\packages\*.*) DO DEL %%A
echo Removing previews
FOR %%A IN (..\src\Umbraco.Web.UI\App_Data\preview\*.*) DO DEL %%A
echo Removing app code files (typically added by starterkits)
FOR %%A IN (..\src\Umbraco.Web.UI\App_Code\*.*) DO DEL %%A
echo Removing xslt files
FOR %%A IN (..\src\Umbraco.Web.UI\xslt\*.*) DO DEL %%A
echo Removing masterpage files
FOR %%A IN (..\src\Umbraco.Web.UI\masterpages\*.*) DO DEL %%A
echo Removing user control files
FOR %%A IN (..\src\Umbraco.Web.UI\usercontrols\*.*) DO DEL %%A
echo Removing view files
FOR %%A IN (..\src\Umbraco.Web.UI\Views\*.*) DO DEL %%A
echo Removing razor files
FOR %%A IN (..\src\Umbraco.Web.UI\macroScripts\*.*) DO DEL %%A
echo Removing media files
FOR %%A IN (..\src\Umbraco.Web.UI\media\*.*) DO DEL %%A
echo Removing script files
FOR %%A IN (..\src\Umbraco.Web.UI\scripts\*.*) DO DEL %%A
echo Removing css files
FOR %%A IN (..\src\Umbraco.Web.UI\css\*.*) DO DEL %%A
echo Removing Courier files
del ..\src\Umbraco.Web.UI\config\courier.config
del ..\src\Umbraco.Web.UI\umbraco\images\tray\courier.jpg
rmdir "..\src\Umbraco.Web.UI\umbraco\plugins\courier\" /S /Q
echo Removing Contour files
del ..\src\Umbraco.Web.UI\umbraco\images\tray\contour.png
FOR %%A IN (..\src\Umbraco.Web.UI\umbraco\images\umbraco\icon_*.*) DO DEL %%A
rmdir "..\src\Umbraco.Web.UI\umbraco\plugins\umbracoContour\" /S /Q
del ..\src\Umbraco.Web.UI\umbraco\xslt\templates\UmbracoContour*.* /S /Q
rmdir "..\src\Umbraco.Web.UI\usercontrols\umbracoContour\" /S /Q
echo Start with a clean web.config
copy ..\src\Umbraco.Web.UI\web.Template.config ..\src\Umbraco.Web.UI\web.config /Y
echo "Umbraco install reverted to clean install"
pause
exit
:exit
exit
Binary file not shown.
-24
View File
@@ -1,24 +0,0 @@
Hi! Thanks for grabbing the Umbraco sourcecode.
===========================================
NOTE - DEFAULT BRANCH EMPTY - December 2010
===========================================
- With the help of CodePlex we have migrated much of our previous changesets (as of Dec 13th 2010) from TFS to Mercurial.
- However, not everything could be migrated to our new branching workflow. So for each nominal group of 4.x changes, we've created named branches. For upcoming 5.x changesets, we'll adhere to our new workflow which we'll describe on the Wiki for contributors.
- FOR THE MOMENT, the 'default' branch is empty - pending the addition of the 5.0 changesets
- To switch to the codebase on which you want to work, 'hg update' to the named branch (e.g. "4.6.0") or tag (e.g. "Release-4.5.2") and browse or work from that point.
Thanks to Matt Hawley at CodePlex for his help in our migration!
Cheers,
The Umbraco Team
http://umbraco.org
http://our.umbraco.org
http://umbraco.codeplex.com
-82
View File
@@ -1,82 +0,0 @@
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f36\fswiss\fcharset0\fprq2{\*\panose 020b0604030504040204}Tahoma;}
{\f39\froman\fcharset238\fprq2 Times New Roman CE;}{\f40\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f42\froman\fcharset161\fprq2 Times New Roman Greek;}{\f43\froman\fcharset162\fprq2 Times New Roman Tur;}
{\f44\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f45\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f46\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f47\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
{\f399\fswiss\fcharset238\fprq2 Tahoma CE;}{\f400\fswiss\fcharset204\fprq2 Tahoma Cyr;}{\f402\fswiss\fcharset161\fprq2 Tahoma Greek;}{\f403\fswiss\fcharset162\fprq2 Tahoma Tur;}{\f404\fswiss\fcharset177\fprq2 Tahoma (Hebrew);}
{\f405\fswiss\fcharset178\fprq2 Tahoma (Arabic);}{\f406\fswiss\fcharset186\fprq2 Tahoma Baltic;}{\f407\fswiss\fcharset163\fprq2 Tahoma (Vietnamese);}{\f408\fswiss\fcharset222\fprq2 Tahoma (Thai);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}{\*\cs10 \additive
\ssemihidden Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}{\s15\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
\f36\fs16\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext15 \ssemihidden \styrsid668380 Balloon Text;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\listtable{\list\listtemplateid130696116{\listlevel\levelnfc0\levelnfcn0\leveljc0
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\jclisttab\tx720\lin720 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
{\leveltext\'02\'01.;}{\levelnumbers\'01;}\fi-360\li1440\jclisttab\tx1440\lin1440 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'02.;}{\levelnumbers\'01;}\fi-360\li2160
\jclisttab\tx2160\lin2160 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'03.;}{\levelnumbers\'01;}\fi-360\li2880\jclisttab\tx2880\lin2880 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'04.;}{\levelnumbers\'01;}\fi-360\li3600\jclisttab\tx3600\lin3600 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
{\leveltext\'02\'05.;}{\levelnumbers\'01;}\fi-360\li4320\jclisttab\tx4320\lin4320 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'06.;}{\levelnumbers\'01;}\fi-360\li5040
\jclisttab\tx5040\lin5040 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'07.;}{\levelnumbers\'01;}\fi-360\li5760\jclisttab\tx5760\lin5760 }{\listlevel\levelnfc0\levelnfcn0\leveljc0
\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'08.;}{\levelnumbers\'01;}\fi-360\li6480\jclisttab\tx6480\lin6480 }{\listname ;}\listid723138990}}{\*\listoverridetable{\listoverride\listid723138990\listoverridecount0\ls1}}
{\*\pgptbl {\pgp\ipgp2\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp4\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}{\pgp\ipgp0\itap0\li0\ri0\sb0\sa0}}{\*\rsidtbl \rsid288726\rsid668380\rsid1077358\rsid1250157\rsid1778664
\rsid2232581\rsid3018318\rsid3766585\rsid4417501\rsid4531485\rsid4807452\rsid5341002\rsid7018004\rsid7880391\rsid10749719\rsid12150908\rsid12939982\rsid13596669\rsid15149892\rsid15551579\rsid16128754\rsid16674677}{\*\generator Microsoft Word 11.0.6359;}
{\info{\title Shared Source License for Software included in Workspaces}{\author suev}{\operator Martin Maly}{\creatim\yr2005\mo3\dy22\hr10\min45}{\revtim\yr2005\mo3\dy22\hr15\min54}{\printim\yr2002\mo9\dy20\hr15\min39}{\version3}{\edmins1}{\nofpages1}
{\nofwords672}{\nofchars3837}{\*\company Microsoft}{\nofcharsws4501}{\vern24703}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984
\dghshow1\dgvshow1\jexpand\viewkind5\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
\asianbrkrule\nojkernpunct\rsidroot15149892 \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\b\fs28\insrsid1250157\charrsid1250157 Shared Source License for }{\b\fs28\insrsid16674677 IronPython}{
\b\fs28\insrsid1250157
\par }{\b\fs28\insrsid5341002
\par }{\b\insrsid5341002\charrsid5341002 This license governs use of the accompanying software}{\b\insrsid5341002 (\'93Software\'94)}{\b\insrsid5341002\charrsid5341002 , and your use of the }{\b\insrsid5341002 S}{\b\insrsid5341002\charrsid5341002
oftware constitutes acceptance of this license.
\par }{\insrsid1250157\charrsid5341002
\par }{\b\insrsid1250157\charrsid1250157 You }{\b\insrsid5341002 may}{\b\insrsid1250157\charrsid1250157 use }{\b\insrsid5341002 the}{\b\insrsid1250157\charrsid1250157 Software for any }{\b\insrsid1250157 commercial or }{\b\insrsid1250157\charrsid1250157
noncommercial purpose, including distributing derivative}{\b\insrsid4417501 work}{\b\insrsid1250157\charrsid1250157 s}{\b\insrsid1250157 .
\par }{\insrsid1250157
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1250157 {\insrsid1250157\charrsid1250157 In return, we simply require that you agree:
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 1.\tab}}\pard \ql \fi-360\li720\ri0\widctlpar\jclisttab\tx720\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\pararsid1250157 {\insrsid1250157\charrsid1250157
Not to remove any copyright}{\insrsid5341002 or other}{\insrsid1250157\charrsid1250157 notices from the Software.
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 2.\tab}That if you distribute the Software in source code form you do so only under this }{\insrsid5341002 l}{\insrsid1250157\charrsid1250157
icense (i.e. you must include a complete copy of this }{\insrsid5341002 l}{\insrsid1250157\charrsid1250157 icense with your distribution), and if you distribute the Software solely in object form you only do so under a license that complies with this }{
\insrsid5341002 l}{\insrsid1250157\charrsid1250157 icense.
\par {\listtext\pard\plain\b\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 3.\tab}}{\b\insrsid1250157\charrsid1250157
That the Software comes "as is", with no warranties. None whatsoever. This means no express, implied or statutory warranty, including without limitation, warranties of merchantability or fitness for a particular purpose or any warranty of }{
\b\insrsid5341002 title or }{\b\insrsid1250157\charrsid1250157 non}{\b\insrsid5341002 -}{\b\insrsid1250157\charrsid1250157 infringement. Also, you must pass this disclaimer on whenever you distribute the Software}{\b\insrsid5341002 or derivative works}{
\b\insrsid1250157\charrsid1250157 .}{\insrsid1250157\charrsid1250157
\par {\listtext\pard\plain\b\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 4.\tab}}{\b\insrsid1250157\charrsid1250157 That neither Microsoft nor }{\b\insrsid1250157 any contributor to the Software}{\b\insrsid1250157\charrsid1250157
will be liable for any of those types of damages known as}{\b\insrsid5341002 }{\b\insrsid1250157\charrsid1250157 indirect, special, consequential, or incidental related to the Software or this }{\b\insrsid5341002 l}{\b\insrsid1250157\charrsid1250157
icense, to the maximum extent the law permits, no matter what legal theory it\rquote s based on. Also, you must pass this limitation of liability on whenever you distribute the Software}{\b\insrsid5341002 or derivative works}{
\b\insrsid1250157\charrsid1250157 .}{\insrsid1250157\charrsid1250157
\par {\listtext\pard\plain\insrsid1250157\charrsid1250157 \hich\af0\dbch\af0\loch\f0 5.\tab}That if you sue anyone over patents that you think may apply to the Software for a person's use of the Software, your license to the Software ends automatically.
\par {\listtext\pard\plain\insrsid1250157 \hich\af0\dbch\af0\loch\f0 6.\tab}}{\insrsid1250157 That the patent rights, if any, }{\insrsid288726 granted in this license}{\insrsid1250157\charrsid1250157 only apply to the Software, not to any derivative}{
\insrsid4417501 work}{\insrsid1250157\charrsid1250157 s you make.}{\insrsid3018318
\par {\listtext\pard\plain\insrsid3018318\charrsid3018318 \hich\af0\dbch\af0\loch\f0 7.\tab}}{\insrsid3018318\charrsid3018318 That if you are an agency of the U.S. Government, (i) Software provided pursuant to a solicitation issued on or after Dece
mber 1, 1995, is provided with the commercial license rights set forth in this license, and (ii) Software provided pursuant to a solicitation issued prior to December 1, 1995, is provided with \'93Restricted Rights\'94
as set forth in FAR, 48 C.F.R. 52.227-14 (June 1987) or DFAR, 48 C.F.R. 252.227-7013 (Oct 1988), as applicable.}{\insrsid1250157
\par {\listtext\pard\plain\insrsid1250157 \hich\af0\dbch\af0\loch\f0 8.\tab}That your rights under this License end automatically if you breach it in any way.
\par {\listtext\pard\plain\insrsid5341002 \hich\af0\dbch\af0\loch\f0 9.\tab}}{\insrsid5341002 That all rights not expressly granted to you in this license are reserved.
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid1778664 {\insrsid1778664
\par }{\insrsid12150908 Read below}{\insrsid1778664 for answers to frequently asked questions about this license.
\par }{\insrsid12150908
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid12150908 {\b\insrsid12150908\charrsid12150908 Q: Is this license OSI compliant?
\par }{\insrsid12150908
A: This license has not been submitted to OSI, but it allows developers to take full advantage of a dynamic language on the CLR and to have the freedom to distribute their works for the benefit of the community at large. The license is half of a
page long and very straight forward. We believe it stands up to what developers demand of an "open" license.
\par
\par }{\b\insrsid12150908\charrsid12150908 Q: What copyright rights does the license grant me?
\par }{\insrsid12150908 A: The license grants you a copyright license to make unlimited copies of the Software in sour
ce or object code form, as well as to create Derivative Works (as that term is defined under US copyright law). This means that in addition to making unlimited copies of the Software, you have a copyright license to modify the Software and to use all or p
art of the Software to create a Derivative Work.
\par
\par }{\b\insrsid12150908\charrsid12150908 Q: What patent rights does the license grant me?
\par }{\insrsid12150908 A: This license grants you a patent license to use and distribute the Software under any Microsoft patent claims that read on the Software itself. In other wo
rds, if you create a modified version of the Software, you still retain the patent license to use and distribute the original portions of the Software under the specific Microsoft patent claims that read on the Software, but you do not have a patent licen
s
e as to the new functionality you may have added by modifying the Software. This result is typical of many common open source licenses, including the Common Public License (CPL) and the Mozilla Public License (MPL). In addition, this license grants no rig
h
ts to any Microsoft patents that read on other components or files not included in the Software. This means that no patent license is granted to use or distribute any other software or technology that may be needed to use the Software or was created from
t
he Software (for example, any compiled output of the Software, the combination of the Software with other hardware or other software, or any additional enabling technologies that may be necessary to make or use the Software or any final product that inclu
des the Software).}{\insrsid12150908
\par }{\insrsid12150908\charrsid1250157
\par }}
+30 -6
View File
@@ -1,9 +1,33 @@
!! Umbraco - the simple, flexible and friendly ASP.NET CMS
Umbraco - the simple, flexible and friendly ASP.NET CMS
=======================================================
For the first time on the Microsoft platform a free user and developer friendly cms that makes it quick and easy to create websites - or a breeze to build complex web applications. umbraco got award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too. Used by more than 57.000 active websites including Heinz.com, Peugeot.com, NAIAS.com and Microsofts documentinteropinitiative.org website you can be sure that the technology is proven, stable and scales.
[url:More info at http://umbraco.org|http://umbraco.org]
!! Forums
We have a forum running on [url:http://our.umbraco.org]. The discussions area on CodePlex will be for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [url:http://our.umbraco.org].
More info at http://umbraco.com
!! Submitting Issues
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [url:online guide|http://our.umbraco.org/wiki/how-tos/submitting-bug-reports].
Exploring the repository
========================
Most contributors will work on their own fork and should pick the branch in which they need their fix. For more information see:
http://our.umbraco.org/contribute/guidelines-for-core-contribution
Exploring the source
====================
The Umbraco source code is never required for you to start building sites. If you are not using the source code for debugging purposes or to contribute to the source then please download the binaries listed at http://umbraco.codeplex.com
With that said, the Umbraco solution can be opened in Visual Studio 2010 with SP1 installed or Visual Studio 2012.
Contributing
============
Umbraco is Open Source which means you can contribute to make it great!
Read all about it at http://our.umbraco.org/contribute
Forums
======
We have a forum running on http://our.umbraco.org for friendly community support.
Documentation
=============
Our documentation section provides help on installing and using Umbraco including API reference documentation: http://our.umbraco.org/documentation
Submitting Issues
=================
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our online guide at http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature
Binary file not shown.
+6 -5
View File
@@ -17,7 +17,8 @@
</PropertyGroup>
<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
<!-- The official NuGet package source (https://nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
<!--
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
@@ -54,10 +55,10 @@
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- We need to ensure packages are restored prior to assembly resolve -->
<ResolveReferencesDependsOn Condition="$(RestorePackages) == 'true'">
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(ResolveReferencesDependsOn);
</ResolveReferencesDependsOn>
$(BuildDependsOn);
</BuildDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
@@ -75,7 +76,7 @@
This effectively acts as a lock that makes sure that the download operation will only happen once and all
parallel builds will have to wait for it to complete.
-->
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT" />
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
</Target>
<Target Name="_DownloadNuGet">
+12 -1
View File
@@ -100,6 +100,18 @@ namespace Umbraco.Core
}
}
/// <summary>
/// The original/first url that the web application executes
/// </summary>
/// <remarks>
/// we need to set the initial url in our ApplicationContext, this is so our keep alive service works and this must
/// exist on a global context because the keep alive service doesn't run in a web context.
/// we are NOT going to put a lock on this because locking will slow down the application and we don't really care
/// if two threads write to this at the exact same time during first page hit.
/// see: http://issues.umbraco.org/issue/U4-2059
/// </remarks>
internal string OriginalRequestUrl { get; set; }
private bool Configured
{
get
@@ -140,7 +152,6 @@ namespace Umbraco.Core
}
}
private void AssertIsReady()
{
if (!this.IsReady)
+35 -1
View File
@@ -19,7 +19,41 @@ namespace Umbraco.Core
return new FileInfo(path);
}
/// <summary>
/// <summary>
/// Returns true if the assembly is the App_Code assembly
/// </summary>
/// <param name="assembly"></param>
/// <returns></returns>
public static bool IsAppCodeAssembly(this Assembly assembly)
{
if (assembly.FullName.StartsWith("App_Code"))
{
try
{
Assembly.Load("App_Code");
return true;
}
catch (FileNotFoundException)
{
//this will occur if it cannot load the assembly
return false;
}
}
return false;
}
/// <summary>
/// Returns true if the assembly is the compiled global asax.
/// </summary>
/// <param name="assembly"></param>
/// <returns></returns>
public static bool IsGlobalAsaxAssembly(this Assembly assembly)
{
//only way I can figure out how to test is by the name
return assembly.FullName.StartsWith("App_global.asax");
}
/// <summary>
/// Returns the file used to load the assembly
/// </summary>
/// <param name="assemblyName"></param>
@@ -671,6 +671,18 @@ namespace Umbraco.Core.Configuration
}
}
/// <summary>
/// File types that will not be allowed to be uploaded via the content/media upload control
/// </summary>
public static IEnumerable<string> DisallowedUploadFiles
{
get
{
var val = GetKey("/settings/content/disallowedUploadFiles");
return val.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries);
}
}
/// <summary>
/// Gets the allowed image file types.
/// </summary>
@@ -1250,6 +1262,41 @@ namespace Umbraco.Core.Configuration
return _macroErrorBehaviour.Value;
}
}
private static IconPickerBehaviour? _iconPickerBehaviour;
/// <summary>
/// This configuration setting defines how to show icons in the document type editor.
/// - ShowDuplicates - Show duplicates in files and sprites. (default and current Umbraco 'normal' behaviour)
/// - HideSpriteDuplicates - Show files on disk and hide duplicates from the sprite
/// - HideFileDuplicates - Show files in the sprite and hide duplicates on disk
/// </summary>
/// <value>MacroErrorBehaviour enum defining how to show icons in the document type editor.</value>
public static IconPickerBehaviour IconPickerBehaviour
{
get
{
if (_iconPickerBehaviour == null)
{
try
{
var behaviour = IconPickerBehaviour.ShowDuplicates;
var value = GetKey("/settings/content/DocumentTypeIconList");
if (value != null)
{
Enum<IconPickerBehaviour>.TryParse(value, true, out behaviour);
}
_iconPickerBehaviour = behaviour;
}
catch (Exception ex)
{
LogHelper.Error<UmbracoSettings>("Could not load /settings/content/DocumentTypeIconList from umbracosettings.config", ex);
_iconPickerBehaviour = IconPickerBehaviour.ShowDuplicates;
}
}
return _iconPickerBehaviour.Value;
}
}
/// <summary>
/// Configuration regarding webservices
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("6.0.3");
private static readonly Version Version = new Version("6.0.7");
/// <summary>
/// Gets the current version of Umbraco.
@@ -5,12 +5,11 @@ using System.Text;
using Umbraco.Core.CodeAnnotations;
namespace Umbraco.Core.IO
{
[UmbracoExperimentalFeature("http://issues.umbraco.org/issue/U4-1156", "Will be declared public after 4.10")]
{
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
internal class FileSystemProviderAttribute : Attribute
public class FileSystemProviderAttribute : Attribute
{
public string Alias { get; set; }
public string Alias { get; private set; }
public FileSystemProviderAttribute(string alias)
{
@@ -6,8 +6,7 @@ using Umbraco.Core.CodeAnnotations;
namespace Umbraco.Core.IO
{
[UmbracoExperimentalFeature("http://issues.umbraco.org/issue/U4-1156", "Will be declared public after 4.10")]
internal class FileSystemProvider
internal class FileSystemProviderConstants
{
public const string Media = "media";
}
@@ -9,9 +9,8 @@ using Umbraco.Core.CodeAnnotations;
using Umbraco.Core.Configuration;
namespace Umbraco.Core.IO
{
[UmbracoExperimentalFeature("http://issues.umbraco.org/issue/U4-1156", "Will be declared public after 4.10")]
internal class FileSystemProviderManager
{
public class FileSystemProviderManager
{
private readonly FileSystemProvidersSection _config;
@@ -28,7 +27,7 @@ namespace Umbraco.Core.IO
#region Constructors
public FileSystemProviderManager()
internal FileSystemProviderManager()
{
_config = (FileSystemProvidersSection)ConfigurationManager.GetSection("FileSystemProviders");
}
@@ -48,7 +47,15 @@ namespace Umbraco.Core.IO
private readonly ConcurrentDictionary<string, ProviderConstructionInfo> _providerLookup = new ConcurrentDictionary<string, ProviderConstructionInfo>();
private readonly ConcurrentDictionary<Type, string> _wrappedProviderLookup = new ConcurrentDictionary<Type, string>();
public IFileSystem GetFileSystemProvider(string alias)
/// <summary>
/// Returns the underlying (non-typed) file system provider for the alias specified
/// </summary>
/// <param name="alias"></param>
/// <returns></returns>
/// <remarks>
/// It is recommended to use the typed GetFileSystemProvider method instead to get a strongly typed provider instance.
/// </remarks>
public IFileSystem GetUnderlyingFileSystemProvider(string alias)
{
//either get the constructor info from cache or create it and add to cache
var ctorInfo = _providerLookup.GetOrAdd(alias, s =>
@@ -88,6 +95,11 @@ namespace Umbraco.Core.IO
return fs;
}
/// <summary>
/// Returns the strongly typed file system provider
/// </summary>
/// <typeparam name="TProviderTypeFilter"></typeparam>
/// <returns></returns>
public TProviderTypeFilter GetFileSystemProvider<TProviderTypeFilter>()
where TProviderTypeFilter : FileSystemWrapper
{
@@ -111,7 +123,7 @@ namespace Umbraco.Core.IO
return attr.Alias;
});
var innerFs = GetFileSystemProvider(alias);
var innerFs = GetUnderlyingFileSystemProvider(alias);
var outputFs = Activator.CreateInstance(typeof (TProviderTypeFilter), innerFs);
return (TProviderTypeFilter)outputFs;
}
+24
View File
@@ -0,0 +1,24 @@
namespace Umbraco.Core
{
public enum IconPickerBehaviour
{
/// <summary>
/// Default umbraco behavior - show duplicates in files and sprites
/// </summary>
ShowDuplicates,
/// <summary>
/// If a file exists on disk with the same name as one in the sprite
/// then the file on disk overrules the one in the sprite, the
/// sprite icon will not be shown
/// </summary>
HideSpriteDuplicates,
/// <summary>
/// If a file exists on disk with the same name as one in the sprite
/// then the file in the sprite overrules the one on disk, the file
/// on disk will be shown
/// </summary>
HideFileDuplicates
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
@@ -14,11 +15,56 @@ using Umbraco.Core.Media;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.UnitOfWork;
using Umbraco.Core.Services;
namespace Umbraco.Core.Models
{
public static class ContentExtensions
{
/// <summary>
/// Checks if the IContentBase has children
/// </summary>
/// <param name="content"></param>
/// <param name="services"></param>
/// <returns></returns>
/// <remarks>
/// This is a bit of a hack because we need to type check!
/// </remarks>
internal static bool HasChildren(IContentBase content, ServiceContext services)
{
if (content is IContent)
{
return services.ContentService.HasChildren(content.Id);
}
if (content is IMedia)
{
return services.MediaService.HasChildren(content.Id);
}
return false;
}
/// <summary>
/// Returns the children for the content base item
/// </summary>
/// <param name="content"></param>
/// <param name="services"></param>
/// <returns></returns>
/// <remarks>
/// This is a bit of a hack because we need to type check!
/// </remarks>
internal static IEnumerable<IContentBase> Children(IContentBase content, ServiceContext services)
{
if (content is IContent)
{
return services.ContentService.GetChildren(content.Id);
}
if (content is IMedia)
{
return services.MediaService.GetChildren(content.Id);
}
return null;
}
/// <summary>
/// Set property values by alias with an annonymous object
/// </summary>
@@ -408,6 +408,15 @@ namespace Umbraco.Core.Models
}
/// <summary>
/// Removes a PropertyGroup from the current ContentType
/// </summary>
/// <param name="propertyGroupName">Name of the <see cref="PropertyGroup"/> to remove</param>
public void RemovePropertyGroup(string propertyGroupName)
{
PropertyGroups.RemoveItem(propertyGroupName);
}
/// <summary>
/// Sets the ParentId from the lazy integer id
/// </summary>
/// <param name="id">Id of the Parent</param>
@@ -20,8 +20,10 @@ namespace Umbraco.Core.Models
{
}
protected ContentTypeCompositionBase(IContentTypeBase parent) : base(parent)
protected ContentTypeCompositionBase(IContentTypeComposition parent)
: base(parent)
{
AddContentType(parent);
}
private static readonly PropertyInfo ContentTypeCompositionSelector =
@@ -73,7 +75,7 @@ namespace Umbraco.Core.Models
if (contentType.ContentTypeComposition.Any(x => x.CompositionAliases().Any(ContentTypeCompositionExists)))
return false;
if (!ContentTypeCompositionExists(contentType.Alias))
if (ContentTypeCompositionExists(contentType.Alias) == false)
{
_contentTypeComposition.Add(contentType);
OnPropertyChanged(ContentTypeCompositionSelector);
@@ -168,19 +168,6 @@ namespace Umbraco.Core.Models.EntityBase
}
}
public static bool operator ==(Entity left, Entity right)
{
if (ReferenceEquals(null, left))
return false;
return left.Equals(right);
}
public static bool operator !=(Entity left, Entity right)
{
return !(left == right);
}
public virtual bool SameIdentityAs(IEntity other)
{
if (ReferenceEquals(null, other))
@@ -65,6 +65,12 @@ namespace Umbraco.Core.Models
void RemovePropertyType(string propertyTypeAlias);
/// <summary>
/// Removes a PropertyGroup from the current ContentType
/// </summary>
/// <param name="propertyGroupName">Name of the <see cref="PropertyGroup"/> to remove</param>
void RemovePropertyGroup(string propertyGroupName);
/// <summary>
/// Sets the ParentId from the lazy integer id
/// </summary>
/// <param name="id">Id of the Parent</param>
+2 -1
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
namespace Umbraco.Core.Models
{
@@ -10,7 +11,7 @@ namespace Umbraco.Core.Models
/// <remarks>
/// A replacement for INode which needs to occur since INode doesn't contain the document type alias
/// and INode is poorly formatted with mutable properties (i.e. Lists instead of IEnumerable)
/// </remarks>
/// </remarks>
public interface IPublishedContent
{
int Id { get; }
@@ -97,6 +97,14 @@ namespace Umbraco.Core.Models
return this.Any(x => x.Name == groupName);
}
public void RemoveItem(string propertyGroupName)
{
var key = IndexOfKey(propertyGroupName);
//Only removes an item if the key was found
if (key != -1)
RemoveItem(key);
}
public int IndexOfKey(string key)
{
for (var i = 0; i < this.Count; i++)
+2 -13
View File
@@ -13,7 +13,6 @@ namespace Umbraco.Core.Models
[DataContract(IsReference = true)]
public class PropertyType : Entity, IEquatable<PropertyType>
{
//private SerializationService _service;
private string _name;
private string _alias;
private string _description;
@@ -33,22 +32,12 @@ namespace Umbraco.Core.Models
DataTypeId = dataTypeDefinition.ControlId;
DataTypeDatabaseType = dataTypeDefinition.DatabaseType;
EnsureSerializationService();
}
internal PropertyType(Guid dataTypeControlId, DataTypeDatabaseType dataTypeDatabaseType)
{
DataTypeId = dataTypeControlId;
DataTypeDatabaseType = dataTypeDatabaseType;
EnsureSerializationService();
}
private void EnsureSerializationService()
{
/*var serviceStackSerializer = new ServiceStackXmlSerializer();
_service = new SerializationService(serviceStackSerializer);*/
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyType, string>(x => x.Name);
@@ -181,6 +170,7 @@ namespace Umbraco.Core.Models
/// Gets of Sets the Help text for the current PropertyType
/// </summary>
[DataMember]
[Obsolete("Not used anywhere in the UI")]
public string HelpText
{
get { return _helpText; }
@@ -209,7 +199,7 @@ namespace Umbraco.Core.Models
/// Gets or Sets the RegEx for validation of legacy DataTypes
/// </summary>
[DataMember]
internal string ValidationRegExp
public string ValidationRegExp
{
get { return _validationRegExp; }
set
@@ -218,7 +208,6 @@ namespace Umbraco.Core.Models
OnPropertyChanged(ValidationRegExpSelector);
}
}
//Note that Validation should eventually come from PropertyEditors like in v5
/// <summary>
/// Create a new Property object from a "raw" database value.
+12 -4
View File
@@ -28,12 +28,8 @@ namespace Umbraco.Core.Models
{
base.Path = path;
ParentId = -1;
Key = name.EncodeAsGuid();
_name = name.Replace("/", ".").Replace("\\", "");
_alias = alias.ToSafeAlias();
CreateDate = DateTime.Now;
UpdateDate = DateTime.Now;
}
[DataMember]
@@ -116,5 +112,17 @@ namespace Umbraco.Core.Models
return validFile && validExtension;
}
/// <summary>
/// Method to call when Entity is being saved
/// </summary>
/// <remarks>Created date is set and a Unique key is assigned</remarks>
internal override void AddingEntity()
{
base.AddingEntity();
if (Key == Guid.Empty)
Key = Guid.NewGuid();
}
}
}
@@ -1,3 +1,4 @@
using System;
using System.Web;
using Umbraco.Core.Configuration;
@@ -16,7 +17,12 @@ namespace Umbraco.Core.Persistence
private readonly string _connectionStringName;
private readonly string _connectionString;
private readonly string _providerName;
private static volatile UmbracoDatabase _globalInstance = null;
//very important to have ThreadStatic:
// see: http://issues.umbraco.org/issue/U4-2172
[ThreadStatic]
private static volatile UmbracoDatabase _nonHttpInstance;
private static readonly object Locker = new object();
/// <summary>
@@ -55,27 +61,27 @@ namespace Umbraco.Core.Persistence
//no http context, create the singleton global object
if (HttpContext.Current == null)
{
if (_globalInstance == null)
if (_nonHttpInstance == null)
{
lock (Locker)
{
//double check
if (_globalInstance == null)
if (_nonHttpInstance == null)
{
_globalInstance = string.IsNullOrEmpty(_providerName) == false && string.IsNullOrEmpty(_providerName) == false
_nonHttpInstance = string.IsNullOrEmpty(_connectionString) == false && string.IsNullOrEmpty(_providerName) == false
? new UmbracoDatabase(_connectionString, _providerName)
: new UmbracoDatabase(_connectionStringName);
}
}
}
return _globalInstance;
return _nonHttpInstance;
}
//we have an http context, so only create one per request
if (!HttpContext.Current.Items.Contains(typeof(DefaultDatabaseFactory)))
if (HttpContext.Current.Items.Contains(typeof(DefaultDatabaseFactory)) == false)
{
HttpContext.Current.Items.Add(typeof (DefaultDatabaseFactory),
string.IsNullOrEmpty(_providerName) == false && string.IsNullOrEmpty(_providerName) == false
string.IsNullOrEmpty(_connectionString) == false && string.IsNullOrEmpty(_providerName) == false
? new UmbracoDatabase(_connectionString, _providerName)
: new UmbracoDatabase(_connectionStringName));
}
@@ -86,7 +92,7 @@ namespace Umbraco.Core.Persistence
{
if (HttpContext.Current == null)
{
_globalInstance.Dispose();
_nonHttpInstance.Dispose();
}
else
{
@@ -51,7 +51,8 @@ namespace Umbraco.Core.Persistence.Factories
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
Version = dto.ContentVersionDto.VersionId,
PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished
};
}
@@ -11,6 +11,8 @@ namespace Umbraco.Core.Persistence.Factories
private readonly IContentTypeComposition _contentType;
private readonly Guid _version;
private readonly int _id;
private readonly DateTime _createDate;
private readonly DateTime _updateDate;
public PropertyFactory(IContentTypeComposition contentType, Guid version, int id)
{
@@ -19,6 +21,15 @@ namespace Umbraco.Core.Persistence.Factories
_id = id;
}
public PropertyFactory(IContentTypeComposition contentType, Guid version, int id, DateTime createDate, DateTime updateDate)
{
_contentType = contentType;
_version = version;
_id = id;
_createDate = createDate;
_updateDate = updateDate;
}
#region Implementation of IEntityFactory<IContent,PropertyDataDto>
public IEnumerable<Property> BuildEntity(IEnumerable<PropertyDataDto> dtos)
@@ -34,6 +45,8 @@ namespace Umbraco.Core.Persistence.Factories
propertyDataDto.VersionId.Value,
propertyDataDto.Id);
property.CreateDate = _createDate;
property.UpdateDate = _updateDate;
property.ResetDirtyProperties();
properties.Add(property);
}
@@ -53,17 +66,18 @@ namespace Umbraco.Core.Persistence.Factories
if (property.HasIdentity)
dto.Id = property.Id;
if (property.DataTypeDatabaseType == DataTypeDatabaseType.Integer && property.Value != null && string.IsNullOrWhiteSpace(property.Value.ToString()) == false)
if (property.DataTypeDatabaseType == DataTypeDatabaseType.Integer)
{
if (property.Value is bool)
if (property.Value is bool || property.PropertyType.DataTypeId == new Guid("38b352c1-e9f8-4fd8-9324-9a2eab06d97a"))
{
int val = Convert.ToInt32(property.Value);
dto.Integer = val;
dto.Integer = property.Value != null && string.IsNullOrEmpty(property.Value.ToString())
? 0
: Convert.ToInt32(property.Value);
}
else
{
int val;
if (int.TryParse(property.Value.ToString(), out val))
if ((property.Value != null && string.IsNullOrWhiteSpace(property.Value.ToString()) == false) && int.TryParse(property.Value.ToString(), out val))
{
dto.Integer = val;
}
@@ -9,12 +9,21 @@ namespace Umbraco.Core.Persistence.Factories
internal class PropertyGroupFactory : IEntityFactory<IEnumerable<PropertyGroup>, IEnumerable<PropertyTypeGroupDto>>
{
private readonly int _id;
private readonly DateTime _createDate;
private readonly DateTime _updateDate;
public PropertyGroupFactory(int id)
{
_id = id;
}
public PropertyGroupFactory(int id, DateTime createDate, DateTime updateDate)
{
_id = id;
_createDate = createDate;
_updateDate = updateDate;
}
#region Implementation of IEntityFactory<IEnumerable<PropertyGroup>,IEnumerable<TabDto>>
public IEnumerable<PropertyGroup> BuildEntity(IEnumerable<PropertyTypeGroupDto> dto)
@@ -58,7 +67,9 @@ namespace Umbraco.Core.Persistence.Factories
Mandatory = typeDto.Mandatory,
SortOrder = typeDto.SortOrder,
ValidationRegExp = typeDto.ValidationRegExp,
PropertyGroupId = new Lazy<int>(() => tempGroupDto.Id)
PropertyGroupId = new Lazy<int>(() => tempGroupDto.Id),
CreateDate = _createDate,
UpdateDate = _updateDate
};
propertyType.ResetDirtyProperties();
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Events;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -54,15 +55,39 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
{34, typeof (TaskTypeDto)},
{35, typeof (TaskDto)},
{36, typeof (ContentType2ContentTypeDto)},
{
37,
typeof (ContentTypeAllowedContentTypeDto)
},
{37, typeof (ContentTypeAllowedContentTypeDto)},
{38, typeof (User2AppDto)},
{39, typeof (User2NodeNotifyDto)},
{40, typeof (User2NodePermissionDto)}
};
#endregion
/// <summary>
/// Drops all Umbraco tables in the db
/// </summary>
internal void UninstallDatabaseSchema()
{
LogHelper.Info<DatabaseSchemaCreation>("Start UninstallDatabaseSchema");
foreach (var item in OrderedTables.OrderByDescending(x => x.Key))
{
var tableNameAttribute = item.Value.FirstAttribute<TableNameAttribute>();
string tableName = tableNameAttribute == null ? item.Value.Name : tableNameAttribute.Value;
LogHelper.Info<DatabaseSchemaCreation>("Uninstall" + tableName);
try
{
_database.DropTable(tableName);
}
catch (Exception ex)
{
//swallow this for now, not sure how best to handle this with diff databases... though this is internal
// and only used for unit tests. If this fails its because the table doesn't exist... generally!
LogHelper.Error<DatabaseSchemaCreation>("Could not drop table " + tableName, ex);
}
}
}
public DatabaseSchemaCreation(Database database)
{
@@ -455,9 +455,12 @@ namespace Umbraco.Core.Persistence.Querying
if (fieldType == typeof(decimal))
return ((decimal)value).ToString(CultureInfo.InvariantCulture);
if(fieldType == typeof(DateTime))
if (fieldType == typeof(DateTime))
return "'" + EscapeParam(((DateTime)value).ToString(CultureInfo.InvariantCulture)) + "'";
if (fieldType == typeof(bool))
return ((bool)value) ? Convert.ToString(1, CultureInfo.InvariantCulture) : Convert.ToString(0, CultureInfo.InvariantCulture);
return ShouldQuoteValue(fieldType)
? "'" + EscapeParam(value) + "'"
: value.ToString();
@@ -27,6 +27,8 @@ namespace Umbraco.Core.Persistence.Repositories
{
_contentTypeRepository = contentTypeRepository;
_templateRepository = templateRepository;
EnsureUniqueNaming = true;
}
public ContentRepository(IDatabaseUnitOfWork work, IRepositoryCacheProvider cache, IContentTypeRepository contentTypeRepository, ITemplateRepository templateRepository)
@@ -34,8 +36,12 @@ namespace Umbraco.Core.Persistence.Repositories
{
_contentTypeRepository = contentTypeRepository;
_templateRepository = templateRepository;
EnsureUniqueNaming = true;
}
public bool EnsureUniqueNaming { get; set; }
#region Overrides of RepositoryBase<IContent>
protected override IContent PerformGet(int id)
@@ -180,6 +186,9 @@ namespace Umbraco.Core.Persistence.Repositories
{
((Content)entity).AddingEntity();
//Ensure unique name on the same level
entity.Name = EnsureUniqueNodeName(entity.ParentId, entity.Name);
var factory = new ContentFactory(NodeObjectTypeId, entity.Id);
var dto = factory.BuildDto(entity);
@@ -260,6 +269,9 @@ namespace Umbraco.Core.Persistence.Repositories
entity.UpdateDate = DateTime.Now;
}
//Ensure unique name on the same level
entity.Name = EnsureUniqueNodeName(entity.ParentId, entity.Name, entity.Id);
//Look up parent to get and set the correct Path and update SortOrder if ParentId has changed
if (((ICanBeDirty)entity).IsPropertyDirty("ParentId"))
{
@@ -401,6 +413,24 @@ namespace Umbraco.Core.Persistence.Repositories
#region Implementation of IContentRepository
public IEnumerable<IContent> GetByPublishedVersion(IQuery<IContent> query)
{
var sqlClause = GetBaseQuery(false);
var translator = new SqlTranslator<IContent>(sqlClause, query);
var sql = translator.Translate()
.Where<DocumentDto>(x => x.Published)
.OrderByDescending<ContentVersionDto>(x => x.VersionDate)
.OrderBy<NodeDto>(x => x.SortOrder);
//NOTE: This doesn't allow properties to be part of the query
var dtos = Database.Fetch<DocumentDto, ContentVersionDto, ContentDto, NodeDto>(sql);
foreach (var dto in dtos)
{
yield return CreateContentFromDto(dto, dto.VersionId);
}
}
public IContent GetByLanguage(int id, string language)
{
var sql = GetBaseQuery(false);
@@ -437,13 +467,13 @@ namespace Umbraco.Core.Persistence.Repositories
content.Template = _templateRepository.Get(dto.TemplateId.Value);
}
content.Properties = GetPropertyCollection(dto.NodeId, versionId, contentType);
content.Properties = GetPropertyCollection(dto.NodeId, versionId, contentType, content.CreateDate, content.UpdateDate);
((ICanBeDirty)content).ResetDirtyProperties();
return content;
}
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IContentType contentType)
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IContentType contentType, DateTime createDate, DateTime updateDate)
{
var sql = new Sql();
sql.Select("*")
@@ -454,7 +484,7 @@ namespace Umbraco.Core.Persistence.Repositories
.Where<PropertyDataDto>(x => x.VersionId == versionId);
var propertyDataDtos = Database.Fetch<PropertyDataDto, PropertyTypeDto>(sql);
var propertyFactory = new PropertyFactory(contentType, versionId, id);
var propertyFactory = new PropertyFactory(contentType, versionId, id, createDate, updateDate);
var properties = propertyFactory.BuildEntity(propertyDataDtos);
var newProperties = properties.Where(x => x.HasIdentity == false);
@@ -469,5 +499,77 @@ namespace Umbraco.Core.Persistence.Repositories
return new PropertyCollection(properties);
}
private string EnsureUniqueNodeName(int parentId, string nodeName, int id = 0)
{
if (EnsureUniqueNaming == false)
return nodeName;
var sql = new Sql();
sql.Select("*")
.From<NodeDto>()
.Where<NodeDto>(x => x.ParentId == parentId && x.Text.StartsWith(nodeName));
int uniqueNumber = 1;
var currentName = nodeName;
var dtos = Database.Fetch<NodeDto>(sql);
if (dtos.Any())
{
var results = dtos.OrderBy(x => x.Text, new SimilarNodeNameComparer());
foreach (var dto in results)
{
if(id != 0 && id == dto.NodeId) continue;
if (dto.Text.ToLowerInvariant().Equals(currentName.ToLowerInvariant()))
{
currentName = nodeName + string.Format(" ({0})", uniqueNumber);
uniqueNumber++;
}
}
}
return currentName;
}
/// <summary>
/// Comparer that takes into account the duplicate index of a node name
/// This is needed as a normal alphabetic sort would go Page (1), Page (10), Page (2) etc.
/// </summary>
private class SimilarNodeNameComparer : IComparer<string>
{
public int Compare(string x, string y)
{
if (x.LastIndexOf(')') == x.Length - 1 && y.LastIndexOf(')') == y.Length - 1)
{
if (x.ToLower().Substring(0, x.LastIndexOf('(')) == y.ToLower().Substring(0, y.LastIndexOf('(')))
{
int xDuplicateIndex = ExtractDuplicateIndex(x);
int yDuplicateIndex = ExtractDuplicateIndex(y);
if (xDuplicateIndex != 0 && yDuplicateIndex != 0)
{
return xDuplicateIndex.CompareTo(yDuplicateIndex);
}
}
}
return String.Compare(x.ToLower(), y.ToLower(), StringComparison.Ordinal);
}
private int ExtractDuplicateIndex(string text)
{
int index = 0;
if (text.LastIndexOf('(') != -1 && text.LastIndexOf('(') < text.Length - 2)
{
int startPos = text.LastIndexOf('(') + 1;
int length = text.Length - 1 - startPos;
int.TryParse(text.Substring(startPos, length), out index);
}
return index;
}
}
}
}
@@ -189,7 +189,7 @@ namespace Umbraco.Core.Persistence.Repositories
.Where<NodeDto>(x => x.NodeObjectType == new Guid("C66BA18E-EAF3-4CFF-8A22-41B16D66A972"))
.Where<ContentDto>(x => x.ContentTypeId == entity.Id);
var contentDtos = Database.Fetch<DocumentDto, ContentVersionDto, ContentDto, NodeDto>(sql);
var contentDtos = Database.Fetch<ContentDto, NodeDto>(sql);
//Loop through all tracked keys, which corresponds to the ContentTypes that has been removed from the composition
foreach (var key in compositionBase.RemovedContentTypeKeyTracker)
{
@@ -312,7 +312,7 @@ namespace Umbraco.Core.Persistence.Repositories
return allowedContentTypeDtos.Select(x => new ContentTypeSort { Id = new Lazy<int>(() => x.AllowedId), SortOrder = x.SortOrder }).ToList();
}
protected PropertyGroupCollection GetPropertyGroupCollection(int id)
protected PropertyGroupCollection GetPropertyGroupCollection(int id, DateTime createDate, DateTime updateDate)
{
var sql = new Sql();
sql.Select("*")
@@ -326,12 +326,12 @@ namespace Umbraco.Core.Persistence.Repositories
var dtos = Database.Fetch<PropertyTypeGroupDto, PropertyTypeDto, DataTypeDto, PropertyTypeGroupDto>(new GroupPropertyTypeRelator().Map, sql);
var propertyGroupFactory = new PropertyGroupFactory(id);
var propertyGroupFactory = new PropertyGroupFactory(id, createDate, updateDate);
var propertyGroups = propertyGroupFactory.BuildEntity(dtos);
return new PropertyGroupCollection(propertyGroups);
}
protected PropertyTypeCollection GetPropertyTypeCollection(int id)
protected PropertyTypeCollection GetPropertyTypeCollection(int id, DateTime createDate, DateTime updateDate)
{
var sql = new Sql();
sql.Select("*")
@@ -357,7 +357,9 @@ namespace Umbraco.Core.Persistence.Repositories
HelpText = dto.HelpText,
Mandatory = dto.Mandatory,
SortOrder = dto.SortOrder,
ValidationRegExp = dto.ValidationRegExp
ValidationRegExp = dto.ValidationRegExp,
CreateDate = createDate,
UpdateDate = updateDate
}).ToList();
//Reset dirty properties
@@ -51,8 +51,8 @@ namespace Umbraco.Core.Persistence.Repositories
var contentType = factory.BuildEntity(dto);
contentType.AllowedContentTypes = GetAllowedContentTypeIds(id);
contentType.PropertyGroups = GetPropertyGroupCollection(id);
((ContentType)contentType).PropertyTypes = GetPropertyTypeCollection(id);
contentType.PropertyGroups = GetPropertyGroupCollection(id, contentType.CreateDate, contentType.UpdateDate);
((ContentType)contentType).PropertyTypes = GetPropertyTypeCollection(id, contentType.CreateDate, contentType.UpdateDate);
var templates = Database.Fetch<DocumentTypeDto>("WHERE contentTypeNodeId = @Id", new { Id = id });
if(templates.Any())
@@ -111,6 +111,20 @@ namespace Umbraco.Core.Persistence.Repositories
#endregion
protected IEnumerable<string> FindAllFiles(string path)
{
var list = new List<string>();
list.AddRange(FileSystem.GetFiles(path, "*"));
var directories = FileSystem.GetDirectories(path);
foreach (var directory in directories)
{
list.AddRange(FindAllFiles(directory));
}
return list;
}
/// <summary>
/// Dispose any disposable properties
/// </summary>
@@ -1,4 +1,6 @@
using Umbraco.Core.Models;
using System.Collections.Generic;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.Querying;
namespace Umbraco.Core.Persistence.Repositories
{
@@ -11,5 +13,12 @@ namespace Umbraco.Core.Persistence.Repositories
/// <param name="language">Culture code for the language to retrieve</param>
/// <returns>An <see cref="IContent"/> item</returns>
IContent GetByLanguage(int id, string language);
/// <summary>
/// Gets all published Content byh the specified query
/// </summary>
/// <param name="query">Query to execute against published versions</param>
/// <returns>An enumerable list of <see cref="IContent"/></returns>
IEnumerable<IContent> GetByPublishedVersion(IQuery<IContent> query);
}
}
@@ -51,7 +51,7 @@ namespace Umbraco.Core.Persistence.Repositories
var factory = new MediaFactory(mediaType, NodeObjectTypeId, id);
var media = factory.BuildEntity(dto);
media.Properties = GetPropertyCollection(id, dto.VersionId, mediaType);
media.Properties = GetPropertyCollection(id, dto.VersionId, mediaType, media.CreateDate, media.UpdateDate);
((ICanBeDirty)media).ResetDirtyProperties();
return media;
@@ -118,6 +118,8 @@ namespace Umbraco.Core.Persistence.Repositories
{
"DELETE FROM umbracoUser2NodeNotify WHERE nodeId = @Id",
"DELETE FROM umbracoUser2NodePermission WHERE nodeId = @Id",
"DELETE FROM umbracoRelation WHERE parentId = @Id",
"DELETE FROM umbracoRelation WHERE childId = @Id",
"DELETE FROM cmsTagRelationship WHERE nodeId = @Id",
"DELETE FROM cmsDocument WHERE NodeId = @Id",
"DELETE FROM cmsPropertyData WHERE contentNodeId = @Id",
@@ -155,7 +157,7 @@ namespace Umbraco.Core.Persistence.Repositories
var factory = new MediaFactory(mediaType, NodeObjectTypeId, dto.NodeId);
var media = factory.BuildEntity(dto);
media.Properties = GetPropertyCollection(dto.NodeId, dto.VersionId, mediaType);
media.Properties = GetPropertyCollection(dto.NodeId, dto.VersionId, mediaType, media.CreateDate, media.UpdateDate);
((ICanBeDirty)media).ResetDirtyProperties();
return media;
@@ -338,7 +340,7 @@ namespace Umbraco.Core.Persistence.Repositories
#endregion
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IMediaType contentType)
private PropertyCollection GetPropertyCollection(int id, Guid versionId, IMediaType contentType, DateTime createDate, DateTime updateDate)
{
var sql = new Sql();
sql.Select("*")
@@ -349,7 +351,7 @@ namespace Umbraco.Core.Persistence.Repositories
.Where<PropertyDataDto>(x => x.VersionId == versionId);
var propertyDataDtos = Database.Fetch<PropertyDataDto, PropertyTypeDto>(sql);
var propertyFactory = new PropertyFactory(contentType, versionId, id);
var propertyFactory = new PropertyFactory(contentType, versionId, id, createDate, updateDate);
var properties = propertyFactory.BuildEntity(propertyDataDtos);
var newProperties = properties.Where(x => x.HasIdentity == false);
@@ -42,8 +42,8 @@ namespace Umbraco.Core.Persistence.Repositories
var contentType = factory.BuildEntity(dto);
contentType.AllowedContentTypes = GetAllowedContentTypeIds(id);
contentType.PropertyGroups = GetPropertyGroupCollection(id);
((MediaType)contentType).PropertyTypes = GetPropertyTypeCollection(id);
contentType.PropertyGroups = GetPropertyGroupCollection(id, contentType.CreateDate, contentType.UpdateDate);
((MediaType)contentType).PropertyTypes = GetPropertyTypeCollection(id, contentType.CreateDate, contentType.UpdateDate);
var list = Database.Fetch<ContentType2ContentTypeDto>("WHERE childContentTypeId = @Id", new{ Id = id});
foreach (var contentTypeDto in list)
@@ -45,12 +45,11 @@ namespace Umbraco.Core.Persistence.Repositories
var path = FileSystem.GetRelativePath(id);
var created = FileSystem.GetCreated(path).UtcDateTime;
var updated = FileSystem.GetLastModified(path).UtcDateTime;
var name = new FileInfo(path).Name;
var script = new Script(path)
{
Content = content,
Key = name.EncodeAsGuid(),
Key = path.EncodeAsGuid(),
CreateDate = created,
UpdateDate = updated
};
@@ -71,7 +70,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
else
{
var files = FileSystem.GetFiles("", "*");
var files = FindAllFiles("");
foreach (var file in files)
{
yield return Get(file);
@@ -47,12 +47,11 @@ namespace Umbraco.Core.Persistence.Repositories
var path = FileSystem.GetRelativePath(id);
var created = FileSystem.GetCreated(path).UtcDateTime;
var updated = FileSystem.GetLastModified(path).UtcDateTime;
var name = new FileInfo(path).Name;
var stylesheet = new Stylesheet(path)
{
Content = content,
Key = name.EncodeAsGuid(),
Key = path.EncodeAsGuid(),
CreateDate = created,
UpdateDate = updated
};
@@ -73,7 +72,7 @@ namespace Umbraco.Core.Persistence.Repositories
}
else
{
var files = FileSystem.GetFiles("", "*");
var files = FindAllFiles("");
foreach (var file in files)
{
yield return Get(file);
@@ -186,6 +186,8 @@ namespace Umbraco.Core.Persistence.Repositories
//Save to db
var template = entity as Template;
template.AddingEntity();
var factory = new TemplateFactory(NodeObjectTypeId);
var dto = factory.BuildDto(template);
@@ -254,6 +256,7 @@ namespace Umbraco.Core.Persistence.Repositories
var templateDto = Database.SingleOrDefault<TemplateDto>("WHERE nodeId = @Id", new { Id = entity.Id });
//Save updated entity to db
var template = entity as Template;
template.UpdateDate = DateTime.Now;
var factory = new TemplateFactory(templateDto.PrimaryKey, NodeObjectTypeId);
var dto = factory.BuildDto(template);
@@ -30,7 +30,7 @@ namespace Umbraco.Core.Persistence
uow,
RuntimeCacheProvider.Current,
CreateContentTypeRepository(uow),
CreateTemplateRepository(uow));
CreateTemplateRepository(uow)) { EnsureUniqueNaming = Umbraco.Core.Configuration.UmbracoSettings.EnsureUniqueNaming };
}
public virtual IContentTypeRepository CreateContentTypeRepository(IDatabaseUnitOfWork uow)
+1 -1
View File
@@ -29,11 +29,11 @@ using System.Security.Permissions;
[assembly: InternalsVisibleTo("businesslogic")]
[assembly: InternalsVisibleTo("cms")]
[assembly: InternalsVisibleTo("umbraco.editorControls")]
[assembly: InternalsVisibleTo("umbraco.webservices")]
[assembly: InternalsVisibleTo("umbraco.datalayer")]
[assembly: InternalsVisibleTo("umbraco.MacroEngines")]
[assembly: InternalsVisibleTo("umbraco.editorControls")]
[assembly: InternalsVisibleTo("umbraco.webservices")]
[assembly: InternalsVisibleTo("Umbraco.Tests")]
[assembly: InternalsVisibleTo("Umbraco.Core")]
[assembly: InternalsVisibleTo("Umbraco.Web")]
File diff suppressed because it is too large Load Diff
+56 -3
View File
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using Umbraco.Core.Models;
namespace Umbraco.Core.Services
@@ -12,8 +11,13 @@ namespace Umbraco.Core.Services
{
/// <summary>
/// Creates an <see cref="IContent"/> object using the alias of the <see cref="IContentType"/>
/// that this Content is based on.
/// that this Content should based on.
/// </summary>
/// <remarks>
/// Note that using this method will simply return a new IContent without any identity
/// as it has not yet been persisted. It is intended as a shortcut to creating new content objects
/// that does not invoke a save operation against the database.
/// </remarks>
/// <param name="name">Name of the Content object</param>
/// <param name="parentId">Id of Parent for the new Content</param>
/// <param name="contentTypeAlias">Alias of the <see cref="IContentType"/></param>
@@ -23,8 +27,13 @@ namespace Umbraco.Core.Services
/// <summary>
/// Creates an <see cref="IContent"/> object using the alias of the <see cref="IContentType"/>
/// that this Content is based on.
/// that this Content should based on.
/// </summary>
/// <remarks>
/// Note that using this method will simply return a new IContent without any identity
/// as it has not yet been persisted. It is intended as a shortcut to creating new content objects
/// that does not invoke a save operation against the database.
/// </remarks>
/// <param name="name">Name of the Content object</param>
/// <param name="parent">Parent <see cref="IContent"/> object for the new Content</param>
/// <param name="contentTypeAlias">Alias of the <see cref="IContentType"/></param>
@@ -288,5 +297,49 @@ namespace Umbraco.Core.Services
/// <param name="content"><see cref="IContent"/> to check if anscestors are published</param>
/// <returns>True if the Content can be published, otherwise False</returns>
bool IsPublishable(IContent content);
/// <summary>
/// Sorts a collection of <see cref="IContent"/> objects by updating the SortOrder according
/// to the ordering of items in the passed in <see cref="IEnumerable{T}"/>.
/// </summary>
/// <remarks>
/// Using this method will ensure that the Published-state is maintained upon sorting
/// so the cache is updated accordingly - as needed.
/// </remarks>
/// <param name="items"></param>
/// <param name="userId"></param>
/// <param name="raiseEvents"></param>
/// <returns>True if sorting succeeded, otherwise False</returns>
bool Sort(IEnumerable<IContent> items, int userId = 0, bool raiseEvents = true);
/// <summary>
/// Creates and saves an <see cref="IContent"/> object using the alias of the <see cref="IContentType"/>
/// that this Content should based on.
/// </summary>
/// <remarks>
/// This method returns an <see cref="IContent"/> object that has been persisted to the database
/// and therefor has an identity.
/// </remarks>
/// <param name="name">Name of the Content object</param>
/// <param name="parent">Parent <see cref="IContent"/> object for the new Content</param>
/// <param name="contentTypeAlias">Alias of the <see cref="IContentType"/></param>
/// <param name="userId">Optional id of the user creating the content</param>
/// <returns><see cref="IContent"/></returns>
IContent CreateContentWithIdentity(string name, IContent parent, string contentTypeAlias, int userId = 0);
/// <summary>
/// Creates and saves an <see cref="IContent"/> object using the alias of the <see cref="IContentType"/>
/// that this Content should based on.
/// </summary>
/// <remarks>
/// This method returns an <see cref="IContent"/> object that has been persisted to the database
/// and therefor has an identity.
/// </remarks>
/// <param name="name">Name of the Content object</param>
/// <param name="parentId">Id of Parent for the new Content</param>
/// <param name="contentTypeAlias">Alias of the <see cref="IContentType"/></param>
/// <param name="userId">Optional id of the user creating the content</param>
/// <returns><see cref="IContent"/></returns>
IContent CreateContentWithIdentity(string name, int parentId, string contentTypeAlias, int userId = 0);
}
}
+52 -2
View File
@@ -11,8 +11,13 @@ namespace Umbraco.Core.Services
{
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media is based on.
/// that this Media should based on.
/// </summary>
/// <remarks>
/// Note that using this method will simply return a new IMedia without any identity
/// as it has not yet been persisted. It is intended as a shortcut to creating new media objects
/// that does not invoke a save operation against the database.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parentId">Id of Parent for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
@@ -22,8 +27,13 @@ namespace Umbraco.Core.Services
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media is based on.
/// that this Media should based on.
/// </summary>
/// <remarks>
/// Note that using this method will simply return a new IMedia without any identity
/// as it has not yet been persisted. It is intended as a shortcut to creating new media objects
/// that does not invoke a save operation against the database.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parent">Parent <see cref="IMedia"/> for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
@@ -184,5 +194,45 @@ namespace Umbraco.Core.Services
/// <param name="mediaPath">Path of the media item to retreive (for example: /media/1024/koala_403x328.jpg)</param>
/// <returns><see cref="IMedia"/></returns>
IMedia GetMediaByPath(string mediaPath);
/// <summary>
/// Sorts a collection of <see cref="IMedia"/> objects by updating the SortOrder according
/// to the ordering of items in the passed in <see cref="IEnumerable{T}"/>.
/// </summary>
/// <param name="items"></param>
/// <param name="userId"></param>
/// <param name="raiseEvents"></param>
/// <returns>True if sorting succeeded, otherwise False</returns>
bool Sort(IEnumerable<IMedia> items, int userId = 0, bool raiseEvents = true);
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media should based on.
/// </summary>
/// <remarks>
/// This method returns an <see cref="IMedia"/> object that has been persisted to the database
/// and therefor has an identity.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parent">Parent <see cref="IMedia"/> for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
/// <param name="userId">Optional id of the user creating the media item</param>
/// <returns><see cref="IMedia"/></returns>
IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = 0);
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media should based on.
/// </summary>
/// <remarks>
/// This method returns an <see cref="IMedia"/> object that has been persisted to the database
/// and therefor has an identity.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parentId">Id of Parent for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
/// <param name="userId">Optional id of the user creating the media item</param>
/// <returns><see cref="IMedia"/></returns>
IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = 0);
}
}
+216 -55
View File
@@ -37,8 +37,13 @@ namespace Umbraco.Core.Services
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media is based on.
/// that this Media should based on.
/// </summary>
/// <remarks>
/// Note that using this method will simply return a new IMedia without any identity
/// as it has not yet been persisted. It is intended as a shortcut to creating new media objects
/// that does not invoke a save operation against the database.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parentId">Id of Parent for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
@@ -46,25 +51,7 @@ namespace Umbraco.Core.Services
/// <returns><see cref="IMedia"/></returns>
public IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = 0)
{
IMediaType mediaType;
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaTypeRepository(uow))
{
var query = Query<IMediaType>.Builder.Where(x => x.Alias == mediaTypeAlias);
var mediaTypes = repository.GetByQuery(query);
if (!mediaTypes.Any())
throw new Exception(string.Format("No MediaType matching the passed in Alias: '{0}' was found",
mediaTypeAlias));
mediaType = mediaTypes.First();
if (mediaType == null)
throw new Exception(string.Format("MediaType matching the passed in Alias: '{0}' was null",
mediaTypeAlias));
}
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
var media = new Models.Media(name, parentId, mediaType);
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IMedia>(media, mediaTypeAlias, parentId), this))
@@ -84,8 +71,13 @@ namespace Umbraco.Core.Services
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media is based on.
/// that this Media should based on.
/// </summary>
/// <remarks>
/// Note that using this method will simply return a new IMedia without any identity
/// as it has not yet been persisted. It is intended as a shortcut to creating new media objects
/// that does not invoke a save operation against the database.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parent">Parent <see cref="IMedia"/> for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
@@ -93,25 +85,7 @@ namespace Umbraco.Core.Services
/// <returns><see cref="IMedia"/></returns>
public IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = 0)
{
IMediaType mediaType;
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaTypeRepository(uow))
{
var query = Query<IMediaType>.Builder.Where(x => x.Alias == mediaTypeAlias);
var mediaTypes = repository.GetByQuery(query);
if (!mediaTypes.Any())
throw new Exception(string.Format("No MediaType matching the passed in Alias: '{0}' was found",
mediaTypeAlias));
mediaType = mediaTypes.First();
if (mediaType == null)
throw new Exception(string.Format("MediaType matching the passed in Alias: '{0}' was null",
mediaTypeAlias));
}
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
var media = new Models.Media(name, parent, mediaType);
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IMedia>(media, mediaTypeAlias, parent), this))
{
@@ -128,6 +102,94 @@ namespace Umbraco.Core.Services
return media;
}
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media should based on.
/// </summary>
/// <remarks>
/// This method returns an <see cref="IMedia"/> object that has been persisted to the database
/// and therefor has an identity.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parentId">Id of Parent for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
/// <param name="userId">Optional id of the user creating the media item</param>
/// <returns><see cref="IMedia"/></returns>
public IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = 0)
{
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
var media = new Models.Media(name, parentId, mediaType);
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IMedia>(media, mediaTypeAlias, parentId), this))
{
media.WasCancelled = true;
return media;
}
using (new WriteLock(Locker))
{
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
media.CreatorId = userId;
repository.AddOrUpdate(media);
uow.Commit();
var xml = media.ToXml();
CreateAndSaveMediaXml(xml, media.Id, uow.Database);
}
}
Created.RaiseEvent(new NewEventArgs<IMedia>(media, false, mediaTypeAlias, parentId), this);
Audit.Add(AuditTypes.New, "", media.CreatorId, media.Id);
return media;
}
/// <summary>
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
/// that this Media should based on.
/// </summary>
/// <remarks>
/// This method returns an <see cref="IMedia"/> object that has been persisted to the database
/// and therefor has an identity.
/// </remarks>
/// <param name="name">Name of the Media object</param>
/// <param name="parent">Parent <see cref="IMedia"/> for the new Media item</param>
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
/// <param name="userId">Optional id of the user creating the media item</param>
/// <returns><see cref="IMedia"/></returns>
public IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = 0)
{
var mediaType = FindMediaTypeByAlias(mediaTypeAlias);
var media = new Models.Media(name, parent, mediaType);
if (Creating.IsRaisedEventCancelled(new NewEventArgs<IMedia>(media, mediaTypeAlias, parent), this))
{
media.WasCancelled = true;
return media;
}
using (new WriteLock(Locker))
{
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
media.CreatorId = userId;
repository.AddOrUpdate(media);
uow.Commit();
var xml = media.ToXml();
CreateAndSaveMediaXml(xml, media.Id, uow.Database);
}
}
Created.RaiseEvent(new NewEventArgs<IMedia>(media, false, mediaTypeAlias, parent), this);
Audit.Add(AuditTypes.New, "", media.CreatorId, media.Id);
return media;
}
/// <summary>
/// Gets an <see cref="IMedia"/> object by Id
/// </summary>
@@ -393,7 +455,7 @@ namespace Umbraco.Core.Services
return;
//Find Descendants, which will be moved to the recycle bin along with the parent/grandparent.
var descendants = GetDescendants(media).ToList();
var descendants = GetDescendants(media).OrderBy(x => x.Level).ToList();
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
@@ -426,8 +488,8 @@ namespace Umbraco.Core.Services
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
var query = Query<IMedia>.Builder.Where(x => x.Path.Contains("-21"));
var contents = repository.GetByQuery(query).OrderByDescending(x => x.ParentId);
var query = Query<IMedia>.Builder.Where(x => x.Trashed == true);
var contents = repository.GetByQuery(query).OrderByDescending(x => x.Level);
foreach (var content in contents)
{
@@ -489,11 +551,11 @@ namespace Umbraco.Core.Services
}
/// <summary>
/// Permanently deletes an <see cref="IMedia"/> object
/// Permanently deletes an <see cref="IMedia"/> object as well as all of its Children.
/// </summary>
/// <remarks>
/// Please note that this method will completely remove the Media from the database,
/// but current not from the file system.
/// as well as associated media files from the file system.
/// </remarks>
/// <param name="media">The <see cref="IMedia"/> to delete</param>
/// <param name="userId">Id of the User deleting the Media</param>
@@ -502,6 +564,13 @@ namespace Umbraco.Core.Services
if (Deleting.IsRaisedEventCancelled(new DeleteEventArgs<IMedia>(media), this))
return;
//Delete children before deleting the 'possible parent'
var children = GetChildren(media.Id);
foreach (var child in children)
{
Delete(child, userId);
}
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
@@ -591,18 +660,14 @@ namespace Umbraco.Core.Services
uow.Commit();
var xml = media.ToXml();
var poco = new ContentXmlDto {NodeId = media.Id, Xml = xml.ToString(SaveOptions.None)};
var exists = uow.Database.FirstOrDefault<ContentXmlDto>("WHERE nodeId = @Id", new {Id = media.Id}) != null;
int result = exists
? uow.Database.Update(poco)
: Convert.ToInt32(uow.Database.Insert(poco));
CreateAndSaveMediaXml(xml, media.Id, uow.Database);
}
if (raiseEvents)
Saved.RaiseEvent(new SaveEventArgs<IMedia>(media, false), this);
Audit.Add(AuditTypes.Save, "Save Media performed by user", media.CreatorId, media.Id);
}
if (raiseEvents)
Saved.RaiseEvent(new SaveEventArgs<IMedia>(media, false), this);
Audit.Add(AuditTypes.Save, "Save Media performed by user", userId, media.Id);
}
/// <summary>
@@ -619,6 +684,7 @@ namespace Umbraco.Core.Services
return;
}
var mediaXml = new Dictionary<int, Lazy<XElement>>();
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
@@ -630,6 +696,11 @@ namespace Umbraco.Core.Services
//commit the whole lot in one go
uow.Commit();
foreach (var media in medias)
{
CreateAndSaveMediaXml(media.ToXml(), media.Id, uow.Database);
}
}
if(raiseEvents)
@@ -638,6 +709,67 @@ namespace Umbraco.Core.Services
Audit.Add(AuditTypes.Save, "Save Media items performed by user", userId, -1);
}
/// <summary>
/// Sorts a collection of <see cref="IMedia"/> objects by updating the SortOrder according
/// to the ordering of items in the passed in <see cref="IEnumerable{T}"/>.
/// </summary>
/// <param name="items"></param>
/// <param name="userId"></param>
/// <param name="raiseEvents"></param>
/// <returns>True if sorting succeeded, otherwise False</returns>
public bool Sort(IEnumerable<IMedia> items, int userId = 0, bool raiseEvents = true)
{
if (raiseEvents)
{
if (Saving.IsRaisedEventCancelled(new SaveEventArgs<IMedia>(items), this))
return false;
}
var shouldBeCached = new List<IMedia>();
using (new WriteLock(Locker))
{
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaRepository(uow))
{
int i = 0;
foreach (var media in items)
{
//If the current sort order equals that of the media
//we don't need to update it, so just increment the sort order
//and continue.
if (media.SortOrder == i)
{
i++;
continue;
}
media.SortOrder = i;
i++;
repository.AddOrUpdate(media);
shouldBeCached.Add(media);
}
uow.Commit();
foreach (var content in shouldBeCached)
{
//Create and Save ContentXml DTO
var xml = content.ToXml();
CreateAndSaveMediaXml(xml, content.Id, uow.Database);
}
}
}
if (raiseEvents)
Saved.RaiseEvent(new SaveEventArgs<IMedia>(items, false), this);
Audit.Add(AuditTypes.Sort, "Sorting Media performed by user", userId, 0);
return true;
}
/// <summary>
/// Updates the Path and Level on a collection of <see cref="IMedia"/> objects
/// based on the Parent's Path and Level.
@@ -664,6 +796,35 @@ namespace Umbraco.Core.Services
return list;
}
private void CreateAndSaveMediaXml(XElement xml, int id, UmbracoDatabase db)
{
var poco = new ContentXmlDto { NodeId = id, Xml = xml.ToString(SaveOptions.None) };
var exists = db.FirstOrDefault<ContentXmlDto>("WHERE nodeId = @Id", new { Id = id }) != null;
int result = exists ? db.Update(poco) : Convert.ToInt32(db.Insert(poco));
}
private IMediaType FindMediaTypeByAlias(string mediaTypeAlias)
{
var uow = _uowProvider.GetUnitOfWork();
using (var repository = _repositoryFactory.CreateMediaTypeRepository(uow))
{
var query = Query<IMediaType>.Builder.Where(x => x.Alias == mediaTypeAlias);
var mediaTypes = repository.GetByQuery(query);
if (mediaTypes.Any() == false)
throw new Exception(string.Format("No MediaType matching the passed in Alias: '{0}' was found",
mediaTypeAlias));
var mediaType = mediaTypes.First();
if (mediaType == null)
throw new Exception(string.Format("MediaType matching the passed in Alias: '{0}' was null",
mediaTypeAlias));
return mediaType;
}
}
#region Event Handlers
/// <summary>
+55 -22
View File
@@ -196,9 +196,21 @@ namespace Umbraco.Core.Services
/// Imports and saves package xml as <see cref="IContentType"/>
/// </summary>
/// <param name="element">Xml to import</param>
/// <param name="userId"></param>
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
/// <returns>An enumrable list of generated ContentTypes</returns>
public IEnumerable<IContentType> ImportContentTypes(XElement element, int userId = 0)
{
return ImportContentTypes(element, true, userId);
}
/// <summary>
/// Imports and saves package xml as <see cref="IContentType"/>
/// </summary>
/// <param name="element">Xml to import</param>
/// <param name="importStructure">Boolean indicating whether or not to import the </param>
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
/// <returns>An enumrable list of generated ContentTypes</returns>
public IEnumerable<IContentType> ImportContentTypes(XElement element, bool importStructure, int userId = 0)
{
var name = element.Name.LocalName;
if (name.Equals("DocumentTypes") == false && name.Equals("DocumentType") == false)
@@ -209,7 +221,7 @@ namespace Umbraco.Core.Services
_importedContentTypes = new Dictionary<string, IContentType>();
var documentTypes = name.Equals("DocumentTypes")
? (from doc in element.Elements("DocumentType") select doc).ToList()
: new List<XElement> {element.Element("DocumentType")};
: new List<XElement> {element};
//NOTE it might be an idea to sort the doctype XElements based on dependencies
//before creating the doc types - should also allow for a better structure/inheritance support.
foreach (var documentType in documentTypes)
@@ -227,22 +239,25 @@ namespace Umbraco.Core.Services
var list = _importedContentTypes.Select(x => x.Value).ToList();
_contentTypeService.Save(list, userId);
var updatedContentTypes = new List<IContentType>();
//Update the structure here - we can't do it untill all DocTypes have been created
foreach (var documentType in documentTypes)
if (importStructure)
{
var alias = documentType.Element("Info").Element("Alias").Value;
var structureElement = documentType.Element("Structure");
//Ensure that we only update ContentTypes which has actual structure-elements
if (structureElement == null || structureElement.Elements("DocumentType").Any() == false) continue;
var updatedContentTypes = new List<IContentType>();
//Update the structure here - we can't do it untill all DocTypes have been created
foreach (var documentType in documentTypes)
{
var alias = documentType.Element("Info").Element("Alias").Value;
var structureElement = documentType.Element("Structure");
//Ensure that we only update ContentTypes which has actual structure-elements
if (structureElement == null || structureElement.Elements("DocumentType").Any() == false) continue;
var updated = UpdateContentTypesStructure(_importedContentTypes[alias], structureElement);
updatedContentTypes.Add(updated);
var updated = UpdateContentTypesStructure(_importedContentTypes[alias], structureElement);
updatedContentTypes.Add(updated);
}
//Update ContentTypes with a newly added structure/list of allowed children
if (updatedContentTypes.Any())
_contentTypeService.Save(updatedContentTypes, userId);
}
//Update ContentTypes with a newly added structure/list of allowed children
if(updatedContentTypes.Any())
_contentTypeService.Save(updatedContentTypes, userId);
return list;
}
@@ -306,9 +321,10 @@ namespace Umbraco.Core.Services
foreach (var templateElement in allowedTemplatesElement.Elements("Template"))
{
var alias = templateElement.Value;
var template = _fileService.GetTemplate(alias);
var template = _fileService.GetTemplate(alias.ToSafeAlias());
if (template != null)
{
if(allowedTemplates.Any(x => x.Id == template.Id)) continue;
allowedTemplates.Add(template);
}
else
@@ -325,7 +341,7 @@ namespace Umbraco.Core.Services
if (string.IsNullOrEmpty(defaultTemplateElement.Value) == false)
{
var defaultTemplate = _fileService.GetTemplate(defaultTemplateElement.Value);
var defaultTemplate = _fileService.GetTemplate(defaultTemplateElement.Value.ToSafeAlias());
if (defaultTemplate != null)
{
contentType.SetDefaultTemplate(defaultTemplate);
@@ -423,6 +439,8 @@ namespace Umbraco.Core.Services
if (_importedContentTypes.ContainsKey(alias))
{
var allowedChild = _importedContentTypes[alias];
if (allowedChild == null || allowedChildren.Any(x => x.Id.IsValueCreated && x.Id.Value == allowedChild.Id)) continue;
allowedChildren.Add(new ContentTypeSort(new Lazy<int>(() => allowedChild.Id), sortOrder, allowedChild.Alias));
sortOrder++;
}
@@ -580,13 +598,26 @@ namespace Umbraco.Core.Services
foreach (XElement tempElement in templateElements)
{
var dependencies = new List<string>();
if(tempElement.Element("Master") != null && string.IsNullOrEmpty(tempElement.Element("Master").Value) == false)
dependencies.Add(tempElement.Element("Master").Value);
var elementCopy = tempElement;
//Ensure that the Master of the current template is part of the import, otherwise we ignore this dependency as part of the dependency sorting.
if (elementCopy.Element("Master") != null &&
string.IsNullOrEmpty(elementCopy.Element("Master").Value) == false &&
templateElements.Any(x => x.Element("Alias").Value == elementCopy.Element("Master").Value))
{
dependencies.Add(elementCopy.Element("Master").Value);
}
else if (elementCopy.Element("Master") != null &&
string.IsNullOrEmpty(elementCopy.Element("Master").Value) == false &&
templateElements.Any(x => x.Element("Alias").Value == elementCopy.Element("Master").Value) ==
false)
{
LogHelper.Info<PackagingService>(string.Format("Template '{0}' has an invalid Master '{1}', so the reference has been ignored.", elementCopy.Element("Alias").Value, elementCopy.Element("Master").Value));
}
var field = new TopologicalSorter.DependencyField<XElement>
{
Alias = tempElement.Element("Alias").Value,
Item = new Lazy<XElement>(() => tempElement),
Alias = elementCopy.Element("Alias").Value,
Item = new Lazy<XElement>(() => elementCopy),
DependsOn = dependencies.ToArray()
};
@@ -604,7 +635,9 @@ namespace Umbraco.Core.Services
var isMasterPage = IsMasterPageSyntax(design);
var path = isMasterPage ? MasterpagePath(alias) : ViewPath(alias);
var template = new Template(path, templateName, alias) { Content = design };
var existingTemplate = _fileService.GetTemplate(alias) as Template;
var template = existingTemplate ?? new Template(path, templateName, alias);
template.Content = design;
if (masterElement != null && string.IsNullOrEmpty(masterElement.Value) == false)
{
template.MasterTemplateAlias = masterElement.Value;
+30 -1
View File
@@ -835,7 +835,7 @@ namespace Umbraco.Core
public static string ToSafeAlias(this string alias)
{
const string validAliasCharacters = "_-abcdefghijklmnopqrstuvwxyz1234567890";
const string invalidFirstCharacters = "01234567890";
const string invalidFirstCharacters = "0123456789";
var safeString = new StringBuilder();
int aliasLength = alias.Length;
for (int i = 0; i < aliasLength; i++)
@@ -870,5 +870,34 @@ namespace Umbraco.Core
return alias;
}
/// <summary>
/// An extension method that returns a new string in which all occurrences of a
/// specified string in the current instance are replaced with another specified string.
/// StringComparison specifies the type of search to use for the specified string.
/// </summary>
/// <param name="source">Current instance of the string</param>
/// <param name="oldString">Specified string to replace</param>
/// <param name="newString">Specified string to inject</param>
/// <param name="stringComparison">String Comparison object to specify search type</param>
/// <returns>Updated string</returns>
public static string Replace(this string source, string oldString, string newString, StringComparison stringComparison)
{
var index = source.IndexOf(oldString, stringComparison);
// Determine if we found a match
var matchFound = index >= 0;
if (matchFound)
{
// Remove the old text
source = source.Remove(index, oldString.Length);
// Add the replacemenet text
source = source.Insert(index, newString);
}
return source;
}
}
}
+8 -3
View File
@@ -131,7 +131,7 @@ namespace Umbraco.Core
//add vertices
for (int i = 0; i < fields.Count(); i++)
{
indexes[fields[i].Alias.ToLower()] = g.AddVertex(i);
indexes[fields[i].Alias.ToLowerInvariant()] = g.AddVertex(i);
}
//add edges
@@ -141,8 +141,13 @@ namespace Umbraco.Core
{
for (int j = 0; j < fields[i].DependsOn.Length; j++)
{
g.AddEdge(i,
indexes[fields[i].DependsOn[j].ToLower()]);
if (indexes.ContainsKey(fields[i].DependsOn[j].ToLowerInvariant()) == false)
throw new IndexOutOfRangeException(
string.Format(
"The alias '{0}' has an invalid dependency. The dependency '{1}' does not exist in the list of aliases",
fields[i], fields[i].DependsOn[j]));
g.AddEdge(i, indexes[fields[i].DependsOn[j].ToLowerInvariant()]);
}
}
}
+179 -65
View File
@@ -19,8 +19,6 @@ using Umbraco.Core.IO;
namespace Umbraco.Core
{
//TODO: Get the App_Code stuff in here from the old one
/// <summary>
/// A utility class to find all classes of a certain type by reflection in the current bin folder
/// of the web application.
@@ -143,7 +141,8 @@ namespace Umbraco.Core
{
try
{
var foundAssembly = safeDomainAssemblies.FirstOrDefault(a => a.GetAssemblyFile() == assemblyName.GetAssemblyFile());
var foundAssembly =
safeDomainAssemblies.FirstOrDefault(a => a.GetAssemblyFile() == assemblyName.GetAssemblyFile());
if (foundAssembly != null)
{
binFolderAssemblies.Add(foundAssembly);
@@ -236,7 +235,7 @@ namespace Umbraco.Core
"umbraco.interfaces,",
"umbraco.providers,",
"Umbraco.Web.UI,",
"umbraco.webservices",
"umbraco.webservices",
"Lucene.",
"Examine,",
"Examine.",
@@ -248,36 +247,66 @@ namespace Umbraco.Core
"CookComputing."
};
/// <summary>
/// Finds any classes derived from the type T that contain the attribute TAttribute
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TAttribute"></typeparam>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>()
where TAttribute : Attribute
{
return FindClassesOfTypeWithAttribute<T, TAttribute>(GetAssembliesWithKnownExclusions(), true);
}
/// <summary>
/// Finds any classes derived from the type T that contain the attribute TAttribute
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TAttribute"></typeparam>
/// <param name="assemblies"></param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly> assemblies)
where TAttribute : Attribute
{
return FindClassesOfTypeWithAttribute<T, TAttribute>(assemblies, true);
}
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
where TAttribute : Attribute
/// <summary>
/// Finds any classes derived from the type T that contain the attribute TAttribute
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TAttribute"></typeparam>
/// <param name="assemblies"></param>
/// <param name="onlyConcreteClasses"></param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(
IEnumerable<Assembly> assemblies,
bool onlyConcreteClasses)
where TAttribute : Attribute
{
return FindClassesOfTypeWithAttribute<TAttribute>(typeof (T), assemblies, onlyConcreteClasses);
}
/// <summary>
/// Finds any classes derived from the assignTypeFrom Type that contain the attribute TAttribute
/// </summary>
/// <typeparam name="TAttribute"></typeparam>
/// <param name="assignTypeFrom"></param>
/// <param name="assemblies"></param>
/// <param name="onlyConcreteClasses"></param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<TAttribute>(
Type assignTypeFrom,
IEnumerable<Assembly> assemblies,
bool onlyConcreteClasses)
where TAttribute : Attribute
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
var l = new List<Type>();
foreach(var a in assemblies)
{
var types = from t in GetTypesWithFormattedException(a)
where !t.IsInterface
&& typeof (T).IsAssignableFrom(t)
&& t.GetCustomAttributes<TAttribute>(false).Any()
&& (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract))
select t;
l.AddRange(types);
}
return l;
return GetClasses(assignTypeFrom, assemblies, onlyConcreteClasses,
//the additional filter will ensure that any found types also have the attribute applied.
t => t.GetCustomAttributes<TAttribute>(false).Any());
}
/// <summary>
@@ -301,7 +330,7 @@ namespace Umbraco.Core
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
return GetAssignablesFromType<T>(assemblies, onlyConcreteClasses);
return GetClasses(typeof(T), assemblies, onlyConcreteClasses);
}
/// <summary>
@@ -328,32 +357,50 @@ namespace Umbraco.Core
return FindClassesWithAttribute(typeof(T), assemblies, onlyConcreteClasses);
}
/// <summary>
/// Finds the classes with attribute.
/// </summary>
/// <param name="type">The attribute type </param>
/// <param name="assemblies">The assemblies.</param>
/// <param name="onlyConcreteClasses">if set to <c>true</c> only concrete classes.</param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesWithAttribute(Type type, IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
if (!TypeHelper.IsTypeAssignableFrom<Attribute>(type))
throw new ArgumentException("The type specified: " + type + " is not an Attribute type");
/// <summary>
/// Finds any classes with the attribute.
/// </summary>
/// <param name="attributeType">The attribute type </param>
/// <param name="assemblies">The assemblies.</param>
/// <param name="onlyConcreteClasses">if set to <c>true</c> only concrete classes.</param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesWithAttribute(
Type attributeType,
IEnumerable<Assembly> assemblies,
bool onlyConcreteClasses)
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
var l = new List<Type>();
foreach (var a in assemblies)
{
var types = from t in GetTypesWithFormattedException(a)
where !t.IsInterface && t.GetCustomAttributes(type, false).Any() && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract))
select t;
l.AddRange(types);
}
if (TypeHelper.IsTypeAssignableFrom<Attribute>(attributeType) == false)
throw new ArgumentException("The type specified: " + attributeType + " is not an Attribute type");
return l;
}
var foundAssignableTypes = new List<Type>();
/// <summary>
var assemblyList = assemblies.ToArray();
//find all assembly references that are referencing the attribute type's assembly since we
//should only be scanning those assemblies because any other assembly will definitely not
//contain a class that has this attribute.
var referencedAssemblies = TypeHelper.GetReferencedAssemblies(attributeType, assemblyList);
foreach (var a in referencedAssemblies)
{
//get all types in the assembly that are sub types of the current type
var allTypes = GetTypesWithFormattedException(a).ToArray();
var types = allTypes.Where(t => TypeHelper.IsNonStaticClass(t)
&& (onlyConcreteClasses == false || t.IsAbstract == false)
//the type must have this attribute
&& t.GetCustomAttributes(attributeType, false).Any());
foundAssignableTypes.AddRange(types);
}
return foundAssignableTypes;
}
/// <summary>
/// Finds the classes with attribute.
/// </summary>
/// <typeparam name="T"></typeparam>
@@ -379,29 +426,96 @@ namespace Umbraco.Core
#region Private methods
/// <summary>
/// Gets a collection of assignables of type T from a collection of assemblies
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="assemblies"></param>
/// <param name="onlyConcreteClasses"></param>
/// <returns></returns>
private static IEnumerable<Type> GetAssignablesFromType<T>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
/// <summary>
/// Finds types that are assignable from the assignTypeFrom parameter and will scan for these types in the assembly
/// list passed in, however we will only scan assemblies that have a reference to the assignTypeFrom Type or any type
/// deriving from the base type.
/// </summary>
/// <param name="assignTypeFrom"></param>
/// <param name="assemblies"></param>
/// <param name="onlyConcreteClasses"></param>
/// <param name="additionalFilter">An additional filter to apply for what types will actually be included in the return value</param>
/// <returns></returns>
private static IEnumerable<Type> GetClasses(
Type assignTypeFrom,
IEnumerable<Assembly> assemblies,
bool onlyConcreteClasses,
Func<Type, bool> additionalFilter = null)
{
return GetTypes(typeof(T), assemblies, onlyConcreteClasses);
}
//the default filter will always return true.
if (additionalFilter == null)
{
additionalFilter = type => true;
}
var foundAssignableTypes = new List<Type>();
var assemblyList = assemblies.ToArray();
//find all assembly references that are referencing the current type's assembly since we
//should only be scanning those assemblies because any other assembly will definitely not
//contain sub type's of the one we're currently looking for
var referencedAssemblies = TypeHelper.GetReferencedAssemblies(assignTypeFrom, assemblyList);
//get a list of non-referenced assemblies (we'll use this when we recurse below)
var otherAssemblies = assemblyList.Where(x => referencedAssemblies.Contains(x) == false).ToArray();
//loop through the referenced assemblies
foreach (var a in referencedAssemblies)
{
//get all types in the assembly that are sub types of the current type
var allSubTypes = GetTypesWithFormattedException(a)
.Where(assignTypeFrom.IsAssignableFrom)
.ToArray();
//now filter the types based on the onlyConcreteClasses flag, not interfaces, not static classes
var filteredTypes = allSubTypes
.Where(t => (TypeHelper.IsNonStaticClass(t)
&& (onlyConcreteClasses == false || t.IsAbstract == false)
&& additionalFilter(t)))
.ToArray();
//add the types to our list to return
foundAssignableTypes.AddRange(filteredTypes);
//now we need to include types that may be inheriting from sub classes of the type being searched for
//so we will search in assemblies that reference those types too.
foreach (var subTypesInAssembly in allSubTypes.GroupBy(x => x.Assembly))
{
//So that we are not scanning too much, we need to group the sub types:
// * if there is more than 1 sub type in the same assembly then we should only search on the 'lowest base' type.
// * We should also not search for sub types if the type is sealed since you cannot inherit from a sealed class
// * We should not search for sub types if the type is static since you cannot inherit from them.
var subTypeList = subTypesInAssembly
.Where(t => t.IsSealed == false && TypeHelper.IsStaticClass(t) == false)
.ToArray();
var baseClassAttempt = TypeHelper.GetLowestBaseType(subTypeList);
//if there's a base class amongst the types then we'll only search for that type.
//otherwise we'll have to search for all of them.
var subTypesToSearch = new List<Type>();
if (baseClassAttempt.Success)
{
subTypesToSearch.Add(baseClassAttempt.Result);
}
else
{
subTypesToSearch.AddRange(subTypeList);
}
foreach (var typeToSearch in subTypesToSearch)
{
//recursively find the types inheriting from this sub type in the other non-scanned assemblies.
var foundTypes = GetClasses(typeToSearch, otherAssemblies, onlyConcreteClasses, additionalFilter);
foundAssignableTypes.AddRange(foundTypes);
}
}
private static IEnumerable<Type> GetTypes(Type assignTypeFrom, IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
{
var l = new List<Type>();
foreach (var a in assemblies)
{
var types = from t in GetTypesWithFormattedException(a)
where !t.IsInterface && assignTypeFrom.IsAssignableFrom(t) && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract))
select t;
l.AddRange(types);
}
return l;
return foundAssignableTypes;
}
private static IEnumerable<Type> GetTypesWithFormattedException(Assembly a)
@@ -420,7 +534,7 @@ namespace Umbraco.Core
sb.AppendLine("Could not load types from assembly " + a.FullName + ", errors:");
foreach (var loaderException in ex.LoaderExceptions.WhereNotNull())
{
sb.AppendLine("Exception: " + loaderException.ToString());
sb.AppendLine("Exception: " + loaderException);
}
throw new ReflectionTypeLoadException(ex.Types, ex.LoaderExceptions, sb.ToString());
}
+108 -7
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
@@ -11,12 +12,113 @@ namespace Umbraco.Core
/// </summary>
internal static class TypeHelper
{
private static readonly ConcurrentDictionary<Tuple<Type, Type>, bool> TypeCheckCache = new ConcurrentDictionary<Tuple<Type, Type>, bool>();
private static readonly ConcurrentDictionary<Type, bool> ValueTypeCache = new ConcurrentDictionary<Type, bool>();
private static readonly ConcurrentDictionary<Type, bool> ImplicitValueTypeCache = new ConcurrentDictionary<Type, bool>();
private static readonly ConcurrentDictionary<Type, FieldInfo[]> GetFieldsCache = new ConcurrentDictionary<Type, FieldInfo[]>();
private static readonly ConcurrentDictionary<Tuple<Type, bool, bool, bool>, PropertyInfo[]> GetPropertiesCache = new ConcurrentDictionary<Tuple<Type, bool, bool, bool>, PropertyInfo[]>();
/// <summary>
/// Find all assembly references that are referencing the assignTypeFrom Type's assembly found in the assemblyList
/// </summary>
/// <param name="assignTypeFrom"></param>
/// <param name="assemblies"></param>
/// <returns></returns>
/// <remarks>
/// If the assembly of the assignTypeFrom Type is in the App_Code assembly, then we return nothing since things cannot
/// reference that assembly, same with the global.asax assembly.
/// </remarks>
public static Assembly[] GetReferencedAssemblies(Type assignTypeFrom, IEnumerable<Assembly> assemblies)
{
//check if it is the app_code assembly.
//check if it is App_global.asax assembly
if (assignTypeFrom.Assembly.IsAppCodeAssembly() || assignTypeFrom.Assembly.IsGlobalAsaxAssembly())
{
return Enumerable.Empty<Assembly>().ToArray();
}
//find all assembly references that are referencing the current type's assembly since we
//should only be scanning those assemblies because any other assembly will definitely not
//contain sub type's of the one we're currently looking for
return assemblies
.Where(assembly =>
assembly == assignTypeFrom.Assembly || HasReferenceToAssemblyWithName(assembly, assignTypeFrom.Assembly.GetName().Name))
.ToArray();
}
/// <summary>
/// checks if the assembly has a reference with the same name as the expected assembly name.
/// </summary>
/// <param name="assembly"></param>
/// <param name="expectedAssemblyName"></param>
/// <returns></returns>
private static bool HasReferenceToAssemblyWithName(Assembly assembly, string expectedAssemblyName)
{
return assembly
.GetReferencedAssemblies()
.Select(a => a.Name)
.Contains(expectedAssemblyName, StringComparer.Ordinal);
}
/// <summary>
/// Returns true if the type is a class and is not static
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
public static bool IsNonStaticClass(Type t)
{
return t.IsClass && IsStaticClass(t) == false;
}
/// <summary>
/// Returns true if the type is a static class
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
/// <remarks>
/// In IL a static class is abstract and sealed
/// see: http://stackoverflow.com/questions/1175888/determine-if-a-type-is-static
/// </remarks>
public static bool IsStaticClass(Type type)
{
return type.IsAbstract && type.IsSealed;
}
/// <summary>
/// Finds a lowest base class amongst a collection of types
/// </summary>
/// <param name="types"></param>
/// <returns></returns>
/// <remarks>
/// The term 'lowest' refers to the most base class of the type collection.
/// If a base type is not found amongst the type collection then an invalid attempt is returned.
/// </remarks>
public static Attempt<Type> GetLowestBaseType(params Type[] types)
{
if (types.Length == 0)
{
return Attempt<Type>.False;
}
if (types.Length == 1)
{
return new Attempt<Type>(true, types[0]);
}
foreach (var curr in types)
{
var others = types.Except(new[] {curr});
//is the curr type a common denominator for all others ?
var isBase = others.All(curr.IsAssignableFrom);
//if this type is the base for all others
if (isBase)
{
return new Attempt<Type>(true, curr);
}
}
return Attempt<Type>.False;
}
/// <summary>
/// Determines whether the type <paramref name="implementation"/> is assignable from the specified implementation <typeparamref name="TContract"/>,
/// and caches the result across the application using a <see cref="ConcurrentDictionary{TKey,TValue}"/>.
@@ -28,8 +130,7 @@ namespace Umbraco.Core
/// </returns>
public static bool IsTypeAssignableFrom(Type contract, Type implementation)
{
// NOTE The use of a Tuple<,> here is because its Equals / GetHashCode implementation is literally 10.5x faster than KeyValuePair<,>
return TypeCheckCache.GetOrAdd(new Tuple<Type, Type>(contract, implementation), x => x.Item1.IsAssignableFrom(x.Item2));
return contract.IsAssignableFrom(implementation);
}
/// <summary>
@@ -49,7 +150,7 @@ namespace Umbraco.Core
/// <param name="implementation">The implementation.</param>
public static bool IsValueType(Type implementation)
{
return ValueTypeCache.GetOrAdd(implementation, x => x.IsValueType || x.IsPrimitive);
return implementation.IsValueType || implementation.IsPrimitive;
}
/// <summary>
@@ -58,7 +159,7 @@ namespace Umbraco.Core
/// <param name="implementation">The implementation.</param>
public static bool IsImplicitValueType(Type implementation)
{
return ImplicitValueTypeCache.GetOrAdd(implementation, x => IsValueType(implementation) || implementation.IsEnum || implementation == typeof(string));
return IsValueType(implementation) || implementation.IsEnum || implementation == typeof (string);
}
public static bool IsTypeAssignableFrom<TContract>(object implementation)
+2 -2
View File
@@ -145,6 +145,7 @@
<Compile Include="Enum.cs" />
<Compile Include="Events\MacroErrorEventArgs.cs" />
<Compile Include="HashCodeCombiner.cs" />
<Compile Include="IconPickerBehaviour.cs" />
<Compile Include="IO\FileSystemWrapper.cs" />
<Compile Include="MacroErrorBehaviour.cs" />
<Compile Include="Media\IImageUrlProvider.cs" />
@@ -674,7 +675,7 @@
<Compile Include="IfExtensions.cs" />
<Compile Include="PluginManager.cs" />
<Compile Include="IO\FileSecurityException.cs" />
<Compile Include="IO\FileSystemProvider.cs" />
<Compile Include="IO\FileSystemProviderConstants.cs" />
<Compile Include="IO\FileSystemProviderManager.cs" />
<Compile Include="IO\IFileSystem.cs" />
<Compile Include="IO\IOHelper.cs" />
@@ -695,7 +696,6 @@
<Compile Include="Xml\DynamicContext.cs" />
<Compile Include="Xml\XmlNamespaces.cs" />
<Compile Include="Xml\XmlNodeListFactory.cs" />
<Compile Include="Xml\XmlNodeExtensions.cs" />
<Compile Include="Xml\XPathVariable.cs" />
</ItemGroup>
<ItemGroup>
@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Web;
using System.Web.Hosting;
using System.Web.Mvc;
using Umbraco.Core.Logging;
namespace Umbraco.Core
@@ -27,6 +28,9 @@ namespace Umbraco.Core
/// </summary>
internal void StartApplication(object sender, EventArgs e)
{
//don't output the MVC version header (security)
MvcHandler.DisableMvcResponseHeader = true;
//boot up the application
GetBootManager()
.Initialize()
-51
View File
@@ -1,51 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.XPath;
// source: mvpxml.codeplex.com
namespace Umbraco.Core.Xml
{
internal static class XmlNodeExtensions
{
static XPathNodeIterator Select(string expression, XPathNavigator source, params XPathVariable[] variables)
{
var expr = source.Compile(expression);
var context = new DynamicContext();
foreach (var variable in variables)
context.AddVariable(variable.Name, variable.Value);
expr.SetContext(context);
return source.Select(expr);
}
public static XmlNodeList SelectNodes(this XmlNode source, string expression, IEnumerable<XPathVariable> variables)
{
var av = variables == null ? null : variables.ToArray();
return SelectNodes(source, expression, av);
}
public static XmlNodeList SelectNodes(this XmlNode source, string expression, params XPathVariable[] variables)
{
if (variables == null || variables.Length == 0 || variables[0] == null)
return source.SelectNodes(expression);
var iterator = Select(expression, source.CreateNavigator(), variables);
return XmlNodeListFactory.CreateNodeList(iterator);
}
public static XmlNode SelectSingleNode(this XmlNode source, string expression, IEnumerable<XPathVariable> variables)
{
var av = variables == null ? null : variables.ToArray();
return SelectSingleNode(source, expression, av);
}
public static XmlNode SelectSingleNode(this XmlNode source, string expression, params XPathVariable[] variables)
{
if (variables == null || variables.Length == 0 || variables[0] == null)
return source.SelectSingleNode(expression);
return SelectNodes(source, expression, variables).Cast<XmlNode>().FirstOrDefault();
}
}
}
+116
View File
@@ -1,6 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using Umbraco.Core.Xml;
namespace Umbraco.Core
{
@@ -9,6 +13,118 @@ namespace Umbraco.Core
/// </summary>
internal static class XmlExtensions
{
static XPathNodeIterator Select(string expression, XPathNavigator source, params XPathVariable[] variables)
{
var expr = source.Compile(expression);
var context = new DynamicContext();
foreach (var variable in variables)
context.AddVariable(variable.Name, variable.Value);
expr.SetContext(context);
return source.Select(expr);
}
public static XmlNodeList SelectNodes(this XmlNode source, string expression, IEnumerable<XPathVariable> variables)
{
var av = variables == null ? null : variables.ToArray();
return SelectNodes(source, expression, av);
}
public static XmlNodeList SelectNodes(this XmlNode source, string expression, params XPathVariable[] variables)
{
if (variables == null || variables.Length == 0 || variables[0] == null)
return source.SelectNodes(expression);
var iterator = Select(expression, source.CreateNavigator(), variables);
return XmlNodeListFactory.CreateNodeList(iterator);
}
public static XmlNode SelectSingleNode(this XmlNode source, string expression, IEnumerable<XPathVariable> variables)
{
var av = variables == null ? null : variables.ToArray();
return SelectSingleNode(source, expression, av);
}
public static XmlNode SelectSingleNode(this XmlNode source, string expression, params XPathVariable[] variables)
{
if (variables == null || variables.Length == 0 || variables[0] == null)
return source.SelectSingleNode(expression);
return SelectNodes(source, expression, variables).Cast<XmlNode>().FirstOrDefault();
}
/// <summary>
/// Converts from an XDocument to an XmlDocument
/// </summary>
/// <param name="xDocument"></param>
/// <returns></returns>
public static XmlDocument ToXmlDocument(this XDocument xDocument)
{
var xmlDocument = new XmlDocument();
using (var xmlReader = xDocument.CreateReader())
{
xmlDocument.Load(xmlReader);
}
return xmlDocument;
}
/// <summary>
/// Converts from an XmlDocument to an XDocument
/// </summary>
/// <param name="xmlDocument"></param>
/// <returns></returns>
public static XDocument ToXDocument(this XmlDocument xmlDocument)
{
using (var nodeReader = new XmlNodeReader(xmlDocument))
{
nodeReader.MoveToContent();
return XDocument.Load(nodeReader);
}
}
/// <summary>
/// Converts from an XElement to an XmlElement
/// </summary>
/// <param name="xElement"></param>
/// <returns></returns>
public static XmlNode ToXmlElement(this XElement xElement)
{
var xmlDocument = new XmlDocument();
using (var xmlReader = xElement.CreateReader())
{
xmlDocument.Load(xmlReader);
}
return xmlDocument.DocumentElement;
}
/// <summary>
/// Converts from an XmlElement to an XElement
/// </summary>
/// <param name="xmlElement"></param>
/// <returns></returns>
public static XElement ToXElement(this XmlNode xmlElement)
{
using (var nodeReader = new XmlNodeReader(xmlElement))
{
nodeReader.MoveToContent();
return XElement.Load(nodeReader);
}
}
public static T AttributeValue<T>(this XElement xml, string attributeName)
{
if (xml == null) throw new ArgumentNullException("xml");
if (xml.HasAttributes == false) return default(T);
if (xml.Attribute(attributeName) == null)
return default(T);
var val = xml.Attribute(attributeName).Value;
var result = val.TryConvertTo<T>();
if (result.Success)
return result.Result;
return default(T);
}
public static T AttributeValue<T>(this XmlNode xml, string attributeName)
{
if (xml == null) throw new ArgumentNullException("xml");
+126 -2
View File
@@ -5,6 +5,9 @@ using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
namespace Umbraco.Core
@@ -14,7 +17,127 @@ namespace Umbraco.Core
/// </summary>
public class XmlHelper
{
/// <summary>
/// Gets a value indicating whether a specified string contains only xml whitespace characters.
/// </summary>
/// <param name="s">The string.</param>
/// <returns><c>true</c> if the string contains only xml whitespace characters.</returns>
/// <remarks>As per XML 1.1 specs, space, \t, \r and \n.</remarks>
public static bool IsXmlWhitespace(string s)
{
// as per xml 1.1 specs - anything else is significant whitespace
s = s.Trim(' ', '\t', '\r', '\n');
return s.Length == 0;
}
/// <summary>
/// Creates a new <c>XPathDocument</c> from an xml string.
/// </summary>
/// <param name="xml">The xml string.</param>
/// <returns>An <c>XPathDocument</c> created from the xml string.</returns>
public static XPathDocument CreateXPathDocument(string xml)
{
return new XPathDocument(new XmlTextReader(new StringReader(xml)));
}
/// <summary>
/// Tries to create a new <c>XPathDocument</c> from an xml string.
/// </summary>
/// <param name="xml">The xml string.</param>
/// <param name="doc">The XPath document.</param>
/// <returns>A value indicating whether it has been possible to create the document.</returns>
public static bool TryCreateXPathDocument(string xml, out XPathDocument doc)
{
try
{
doc = new XPathDocument(new XmlTextReader(new StringReader(xml)));
return true;
}
catch (Exception)
{
doc = null;
return false;
}
}
/// <summary>
/// Tries to create a new <c>XPathDocument</c> from a property value.
/// </summary>
/// <param name="alias">The alias of the property.</param>
/// <param name="value">The value of the property.</param>
/// <param name="doc">The XPath document.</param>
/// <returns>A value indicating whether it has been possible to create the document.</returns>
public static bool TryCreateXPathDocumentFromPropertyValue(string alias, object value, out XPathDocument doc)
{
// In addition, DynamicNode strips dashes in elements or attributes
// names but really, this is ugly enough, and using dashes should be
// illegal in content type or property aliases anyway.
doc = null;
var xml = value as string;
if (xml == null) return false;
xml = xml.Trim();
if (xml.StartsWith("<") == false || xml.EndsWith(">") == false || xml.Contains('/') == false) return false;
if (UmbracoSettings.NotDynamicXmlDocumentElements.Any(x => x.InvariantEquals(alias))) return false;
return TryCreateXPathDocument(xml, out doc);
}
/// <summary>
/// Sorts the children of the parentNode that match the xpath selector
/// </summary>
/// <param name="parentNode"></param>
/// <param name="childXPathSelector">An xpath expression used to select child nodes of the XmlElement</param>
/// <param name="childSelector">An expression that returns true if the XElement passed in is a valid child node to be sorted</param>
/// <param name="orderByValue">The value to order the results by</param>
internal static void SortNodes(
XmlNode parentNode,
string childXPathSelector,
Func<XElement, bool> childSelector,
Func<XElement, object> orderByValue)
{
var xElement = parentNode.ToXElement();
var children = xElement.Elements().Where(x => childSelector(x)).ToArray(); //(DONT conver to method group, the build server doesn't like it)
var data = children
.OrderByDescending(orderByValue) //order by the sort order desc
.Select(x => children.IndexOf(x)) //store the current item's index (DONT conver to method group, the build server doesn't like it)
.ToList();
//get the minimum index that a content node exists in the parent
var minElementIndex = xElement.Elements()
.TakeWhile(x => childSelector(x) == false)
.Count();
//if the minimum index is zero, then it is the very first node inside the parent,
// if it is not, we need to store the child property node that exists just before the
// first content node found so we can insert elements after it when we're sorting.
var insertAfter = minElementIndex == 0 ? null : parentNode.ChildNodes[minElementIndex - 1];
var selectedChildren = parentNode.SelectNodes(childXPathSelector);
if (selectedChildren == null)
{
throw new InvalidOperationException(string.Format("The childXPathSelector value did not return any results {0}", childXPathSelector));
}
var childElements = selectedChildren.Cast<XmlElement>().ToArray();
//iterate over the ndoes starting with the node with the highest sort order.
//then we insert this node at the begginning of the parent so that by the end
//of the iteration the node with the least sort order will be at the top.
foreach (var node in data.Select(index => childElements[index]))
{
if (insertAfter == null)
{
parentNode.PrependChild(node);
}
else
{
parentNode.InsertAfter(node, insertAfter);
}
}
}
public static string StripDashesInElementOrAttributeNames(string xml)
{
using (var outputms = new MemoryStream())
@@ -68,6 +191,7 @@ namespace Umbraco.Core
}
}
/// <summary>
/// Imports a XML node from text.
/// </summary>
@@ -164,11 +288,11 @@ namespace Umbraco.Core
/// </returns>
public static bool CouldItBeXml(string xml)
{
if (!string.IsNullOrEmpty(xml))
if (string.IsNullOrEmpty(xml) == false)
{
xml = xml.Trim();
if (xml.StartsWith("<") && xml.EndsWith(">"))
if (xml.StartsWith("<") && xml.EndsWith(">") && xml.Contains("/"))
{
return true;
}
@@ -3,6 +3,7 @@ using System.Xml;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Tests.PublishedContent;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web;
using Umbraco.Web.Routing;
@@ -11,7 +12,7 @@ using umbraco.BusinessLogic;
namespace Umbraco.Tests.ContentStores
{
[TestFixture]
public class PublishContentStoreTests
public class PublishContentStoreTests
{
private FakeHttpContextFactory _httpContextFactory;
private UmbracoContext _umbracoContext;
@@ -74,6 +75,8 @@ namespace Umbraco.Tests.ContentStores
_umbracoContext = new UmbracoContext(_httpContextFactory.HttpContext,
new ApplicationContext(),
new DefaultRoutesCache(false));
UmbracoSettings.UseLegacyXmlSchema = false;
_umbracoContext.GetXmlDelegate = () =>
{
+29 -11
View File
@@ -7,16 +7,34 @@ using umbraco.BusinessLogic;
namespace Umbraco.Tests
{
[TestFixture]
[TestFixture]
public class EnumerableExtensionsTests
{
[Test]
public void Flatten_List()
{
var hierarchy = new TestItem()
{
Children = new List<TestItem>()
[Test]
public void Flatten_List_2()
{
var hierarchy = new TestItem()
{
Children = new List<TestItem>()
{
new TestItem(),
new TestItem(),
new TestItem()
}
};
var flattened = hierarchy.Children.FlattenList(x => x.Children);
Assert.AreEqual(3, flattened.Count());
}
[Test]
public void Flatten_List()
{
var hierarchy = new TestItem()
{
Children = new List<TestItem>()
{
new TestItem()
{
@@ -65,12 +83,12 @@ namespace Umbraco.Tests
}
},
}
};
};
var flattened = hierarchy.Children.FlattenList(x => x.Children);
var flattened = hierarchy.Children.FlattenList(x => x.Children);
Assert.AreEqual(10, flattened.Count());
}
}
private class TestItem
{
@@ -78,7 +96,7 @@ namespace Umbraco.Tests
{
Children = Enumerable.Empty<TestItem>();
}
public IEnumerable<TestItem> Children { get; set; }
public IEnumerable<TestItem> Children { get; set; }
}
[Test]
@@ -14,7 +14,7 @@ namespace Umbraco.Tests.IO
[Test]
public void Can_Get_Base_File_System()
{
var fs = FileSystemProviderManager.Current.GetFileSystemProvider(FileSystemProvider.Media);
var fs = FileSystemProviderManager.Current.GetUnderlyingFileSystemProvider(FileSystemProviderConstants.Media);
Assert.NotNull(fs);
}
@@ -0,0 +1,155 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Interactions;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Integration
{
[Ignore("We don't want to run Selenium tests on TeamCity")]
[TestFixture]
public class CreateContent : BaseSeleniumTest
{
[SetUp]
public override void Initialize()
{
base.Initialize();
}
[TearDown]
public void TearDown()
{
base.TearDown();
}
[Test]
public void Install_StarterKit_And_Create_Textpage()
{
// Login to Umbraco
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
Driver.FindElement(By.Id("lname")).Clear();
Driver.FindElement(By.Id("lname")).SendKeys("admin");
Driver.FindElement(By.Id("passw")).Clear();
Driver.FindElement(By.Id("passw")).SendKeys("test");
Driver.FindElement(By.Id("Button1")).Click();
Thread.Sleep(500);
// Install starter kit
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
Thread.Sleep(2000);
var builder = new Actions(Driver);
var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
Thread.Sleep(500);
var installStarterKitNode = Driver.FindElement(By.XPath("(//li[@id='-1']/a/div)[4]"));
builder.MoveToElement(installStarterKitNode).Click().Build().Perform();
Thread.Sleep(500);
var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
Driver.SwitchTo().Frame(rightFrame);
Thread.Sleep(500);
var simpleKit = Driver.FindElement(By.XPath("/html/body/form/div[2]/div[2]/div/div/div/div/div[4]/nav/ul/li[1]/a"));
builder.MoveToElement(simpleKit).Click().Build().Perform();
Thread.Sleep(6000);
// Create new content
Driver.SwitchTo().DefaultContent();
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#content");
Thread.Sleep(500);
var contentNode = Driver.FindElement(By.XPath("//*[@id = 'JTree_TreeContainer']/div/ul/li/ul/li/a/div"));
builder.MoveToElement(contentNode).ContextClick().Build().Perform();
Thread.Sleep(1000);
var createButton = Driver.FindElement(By.XPath("//*[@id = 'jstree-contextmenu']/li[1]/a/span/div[2]"));
createButton.Click();
Thread.Sleep(500);
var umbracoModalBoxIframe = Driver.FindElement(By.CssSelector(".umbModalBoxIframe"));
Driver.SwitchTo().Frame(umbracoModalBoxIframe);
var createTextBox = Driver.FindElement(By.XPath("//input[@type='text'][1]"));
createTextBox.Clear();
createTextBox.SendKeys("Test Page");
var submitButton = Driver.FindElement(By.XPath("//input[@type='submit'][1]"));
submitButton.Click();
Thread.Sleep(2000);
Driver.SwitchTo().Frame(rightFrame);
var saveAndPublishButton = Driver.FindElement(By.XPath("//*[@id='body_TabView1_tab01layer_publish']"));
saveAndPublishButton.Click();
Thread.Sleep(2000);
var contentArea = Driver.FindElement(By.XPath("//*[@id='body_TabView1']"));
Assert.IsNotNull(contentArea);
Thread.Sleep(500);
// Perform delete
Driver.SwitchTo().DefaultContent();
var installingModulesNode = Driver.FindElement(By.XPath("//*[@id='1052']/a/div"));
builder.MoveToElement(installingModulesNode).ContextClick().Build().Perform();
Thread.Sleep(1000);
var deleteButton = Driver.FindElement(By.CssSelector(".sprDelete"));
deleteButton.Click();
var alert = Driver.SwitchTo().Alert();
alert.Accept();
Thread.Sleep(1000);
// Perform move
var goFurtherNode = Driver.FindElement(By.XPath("//*[@id='1053']/a/div"));
builder.MoveToElement(goFurtherNode).ContextClick().Build().Perform();
Thread.Sleep(1000);
var moveButton = Driver.FindElement(By.CssSelector(".sprMove"));
moveButton.Click();
Thread.Sleep(2000);
umbracoModalBoxIframe = Driver.FindElement(By.CssSelector(".umbModalBoxIframe"));
Driver.SwitchTo().Frame(umbracoModalBoxIframe);
var rootNode = Driver.FindElement(By.XPath("//*[@id='1051']"));
builder.MoveToElement(rootNode).DoubleClick().Build().Perform();
Thread.Sleep(500);
var gettinStartedNode = Driver.FindElement(By.XPath("//*[@id='1055']/a/div"));
builder.MoveToElement(gettinStartedNode).Click().Build().Perform();
Thread.Sleep(500);
submitButton = Driver.FindElement(By.XPath("//input[@type='submit'][1]"));
builder.MoveToElement(submitButton).Click().Build().Perform();
Thread.Sleep(2000);
var closeLink = Driver.FindElement(By.XPath("/html/body/form/div[2]/p[2]/a"));
builder.MoveToElement(closeLink).Click().Build().Perform();
Driver.SwitchTo().DefaultContent();
Thread.Sleep(1000);
// Perform copy
var gettingStartedNode = Driver.FindElement(By.XPath("//*[@id='1054']/a/div"));
builder.MoveToElement(gettingStartedNode).ContextClick().Build().Perform();
Thread.Sleep(1000);
var copyButton = Driver.FindElement(By.CssSelector(".sprCopy"));
copyButton.Click();
Thread.Sleep(2000);
umbracoModalBoxIframe = Driver.FindElement(By.CssSelector(".umbModalBoxIframe"));
Driver.SwitchTo().Frame(umbracoModalBoxIframe);
rootNode = Driver.FindElement(By.XPath("//*[@id='1051']"));
builder.MoveToElement(rootNode).DoubleClick().Build().Perform();
Thread.Sleep(500);
submitButton = Driver.FindElement(By.XPath("//input[@type='submit'][1]"));
builder.MoveToElement(submitButton).Click().Build().Perform();
Thread.Sleep(2000);
closeLink = Driver.FindElement(By.XPath("/html/body/form/div[2]/p[2]/a"));
builder.MoveToElement(closeLink).Click().Build().Perform();
}
}
}
@@ -0,0 +1,145 @@
using System.IO;
using System.Linq;
using System.Threading;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Interactions;
using Umbraco.Core;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Integration
{
[Ignore("We don't want to run Selenium tests on TeamCity")]
[TestFixture]
public class InstallPackage : BaseSeleniumTest
{
[SetUp]
public override void Initialize()
{
base.Initialize();
}
[TearDown]
public void TearDown()
{
base.TearDown();
}
[Test]
public void Install_Courier_Package()
{
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
Driver.FindElement(By.Id("lname")).Clear();
Driver.FindElement(By.Id("lname")).SendKeys("admin");
Driver.FindElement(By.Id("passw")).Clear();
Driver.FindElement(By.Id("passw")).SendKeys("test");
Driver.FindElement(By.Id("Button1")).Click();
Thread.Sleep(1000);
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
Thread.Sleep(2000);
var builder = new Actions(Driver);
var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
Thread.Sleep(1000);
var installPackageNode = Driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/div/div/ul/li/ul/li[3]/ul/li[4]/a/div"));
builder.MoveToElement(installPackageNode).Click().Build().Perform();
Thread.Sleep(1000);
var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
Driver.SwitchTo().Frame(rightFrame);
const string packagesDir = @"C:\\Downloads\\Packages\\";
var file = new DirectoryInfo(packagesDir).GetFiles().First(f => f.Name.ToLowerInvariant().StartsWith("Courier".ToLowerInvariant()));
Driver.FindElement(By.Id("cb")).Click();
Driver.FindElement(By.XPath("//input[@type='file']")).SendKeys(file.FullName);
Driver.FindElement(By.Id("body_ButtonLoadPackage")).Click();
Driver.FindElement(By.Id("body_acceptCheckbox")).Click();
Driver.FindElement(By.Id("body_ButtonInstall")).Click();
Thread.Sleep(1000);
var successPanel = Driver.FindElement(By.XPath("//*[@id='body_Panel1_content']"));
Assert.IsNotNull(successPanel);
}
[Test]
public void Install_Contour_Package()
{
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
Driver.FindElement(By.Id("lname")).Clear();
Driver.FindElement(By.Id("lname")).SendKeys("admin");
Driver.FindElement(By.Id("passw")).Clear();
Driver.FindElement(By.Id("passw")).SendKeys("test");
Driver.FindElement(By.Id("Button1")).Click();
Thread.Sleep(1000);
Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
Thread.Sleep(2000);
var builder = new Actions(Driver);
var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
Thread.Sleep(1000);
var installPackageNode = Driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/div/div/ul/li/ul/li[3]/ul/li[4]/a/div"));
builder.MoveToElement(installPackageNode).Click().Build().Perform();
Thread.Sleep(1000);
var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
Driver.SwitchTo().Frame(rightFrame);
const string packagesDir = @"C:\\Downloads\\Packages\\";
var file = new DirectoryInfo(packagesDir).GetFiles().First(f => f.Name.ToLowerInvariant().StartsWith("UmbracoContour".ToLowerInvariant()));
Driver.FindElement(By.Id("cb")).Click();
Driver.FindElement(By.XPath("//input[@type='file']")).SendKeys(file.FullName);
Driver.FindElement(By.Id("body_ButtonLoadPackage")).Click();
Driver.FindElement(By.Id("body_acceptCheckbox")).Click();
Driver.FindElement(By.Id("body_ButtonInstall")).Click();
Thread.Sleep(1000);
var successPanel = Driver.FindElement(By.XPath("//*[@id='body_Panel1_content']"));
Assert.IsNotNull(successPanel);
}
//[Test]
//public void Install_CMS_Import_Package()
//{
// Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/login.aspx?redir=");
// Driver.FindElement(By.Id("lname")).Clear();
// Driver.FindElement(By.Id("lname")).SendKeys("admin");
// Driver.FindElement(By.Id("passw")).Clear();
// Driver.FindElement(By.Id("passw")).SendKeys("test");
// Driver.FindElement(By.Id("Button1")).Click();
// Thread.Sleep(1000);
// Driver.Navigate().GoToUrl(BaseUrl + "/umbraco/umbraco.aspx#developer");
// Thread.Sleep(2000);
// var builder = new Actions(Driver);
// var packagesNode = Driver.FindElement(By.XPath("//*[@id='init'][3]"));
// builder.MoveToElement(packagesNode).DoubleClick().Build().Perform();
// Thread.Sleep(1000);
// var installPackageNode = Driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/div/div/ul/li/ul/li[3]/ul/li[4]/a/div"));
// builder.MoveToElement(installPackageNode).Click().Build().Perform();
// Thread.Sleep(1000);
// var rightFrame = Driver.FindElement(By.XPath("//*[@id='right']"));
// Driver.SwitchTo().Frame(rightFrame);
// Driver.FindElement(By.Id("cb")).Click();
// Driver.FindElement(By.Id("body_file1")).SendKeys("C:\\Downloads\\Packages\\CMSImport-2.3.1.zip");
// Driver.FindElement(By.Id("body_ButtonLoadPackage")).Click();
// Driver.FindElement(By.Id("body_acceptCheckbox")).Click();
// Driver.FindElement(By.Id("body_ButtonInstall")).Click();
// Thread.Sleep(1000);
// var successPanel = Driver.FindElement(By.XPath("//*[@id='body_Panel1_content']"));
// Assert.IsNotNull(successPanel);
//}
}
}
@@ -0,0 +1,423 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.EntityBase;
using Umbraco.Tests.TestHelpers.Entities;
namespace Umbraco.Tests.Models.Collections
{
[TestFixture]
public class PropertyCollectionTests
{
[Test]
public void SimpleOrder_Returns_Null_On_FirstOrDefault_When_Empty()
{
var orders = new SimpleOrder();
var item = orders.FirstOrDefault();
Assert.That(item == null, Is.True);
}
[Test]
public void PropertyCollection_Returns_Null_On_FirstOrDefault_When_Empty()
{
var list = new List<Property>();
var collection = new PropertyCollection(list);
var first = collection.FirstOrDefault();
var second = collection.FirstOrDefault(x => x.Alias.InvariantEquals("Test"));
Assert.That(first, Is.Null);
Assert.That(first == null, Is.True);
Assert.That(second == null, Is.True);
}
[Test]
public void PropertyTypeCollection_Returns_Null_On_FirstOrDefault_When_Empty()
{
var list = new List<PropertyType>();
var collection = new PropertyTypeCollection(list);
Assert.That(collection.FirstOrDefault(), Is.Null);
Assert.That(collection.FirstOrDefault(x => x.Alias.InvariantEquals("Test")) == null, Is.True);
}
[Test]
public void PropertyGroupCollection_Returns_Null_On_FirstOrDefault_When_Empty()
{
var list = new List<PropertyGroup>();
var collection = new PropertyGroupCollection(list);
Assert.That(collection.FirstOrDefault(), Is.Null);
Assert.That(collection.FirstOrDefault(x => x.Name.InvariantEquals("Test")) == null, Is.True);
}
[Test]
public void PropertyGroups_Collection_FirstOrDefault_Returns_Null()
{
var contentType = MockedContentTypes.CreateTextpageContentType();
Assert.That(contentType.PropertyGroups, Is.Not.Null);
Assert.That(contentType.PropertyGroups.FirstOrDefault(x => x.Name.InvariantEquals("Content")) == null, Is.False);
Assert.That(contentType.PropertyGroups.FirstOrDefault(x => x.Name.InvariantEquals("Test")) == null, Is.True);
Assert.That(contentType.PropertyGroups.Any(x => x.Name.InvariantEquals("Test")), Is.False);
}
}
public class SimpleOrder : KeyedCollection<int, OrderItem>, INotifyCollectionChanged
{
// The parameterless constructor of the base class creates a
// KeyedCollection with an internal dictionary. For this code
// example, no other constructors are exposed.
//
public SimpleOrder() : base() { }
public SimpleOrder(IEnumerable<OrderItem> properties)
{
Reset(properties);
}
// This is the only method that absolutely must be overridden,
// because without it the KeyedCollection cannot extract the
// keys from the items. The input parameter type is the
// second generic type argument, in this case OrderItem, and
// the return value type is the first generic type argument,
// in this case int.
//
protected override int GetKeyForItem(OrderItem item)
{
// In this example, the key is the part number.
return item.PartNumber;
}
internal void Reset(IEnumerable<OrderItem> properties)
{
Clear();
properties.ForEach(Add);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
protected override void SetItem(int index, OrderItem item)
{
base.SetItem(index, item);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index));
}
protected override void RemoveItem(int index)
{
var removed = this[index];
base.RemoveItem(index);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, removed));
}
protected override void InsertItem(int index, OrderItem item)
{
base.InsertItem(index, item);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item));
}
protected override void ClearItems()
{
base.ClearItems();
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
}
public new bool Contains(int partNumber)
{
return this.Any(x => x.PartNumber == partNumber);
}
public event NotifyCollectionChangedEventHandler CollectionChanged;
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs args)
{
if (CollectionChanged != null)
{
CollectionChanged(this, args);
}
}
}
public class OrderItem : Item
{
public readonly int PartNumber;
public readonly string Description;
public readonly double UnitPrice;
private int _quantity = 0;
public OrderItem(int partNumber, string description,
int quantity, double unitPrice)
{
this.PartNumber = partNumber;
this.Description = description;
this.Quantity = quantity;
this.UnitPrice = unitPrice;
}
public int Quantity
{
get { return _quantity; }
set
{
if (value < 0)
throw new ArgumentException("Quantity cannot be negative.");
_quantity = value;
}
}
public override string ToString()
{
return String.Format(
"{0,9} {1,6} {2,-12} at {3,8:#,###.00} = {4,10:###,###.00}",
PartNumber, _quantity, Description, UnitPrice,
UnitPrice * _quantity);
}
}
public abstract class Item : IEntity, ICanBeDirty
{
private bool _hasIdentity;
private int? _hash;
private int _id;
private Guid _key;
protected Item()
{
_propertyChangedInfo = new Dictionary<string, bool>();
}
/// <summary>
/// Integer Id
/// </summary>
[DataMember]
public int Id
{
get
{
return _id;
}
set
{
_id = value;
HasIdentity = true;
}
}
/// <summary>
/// Guid based Id
/// </summary>
/// <remarks>The key is currectly used to store the Unique Id from the
/// umbracoNode table, which many of the entities are based on.</remarks>
[DataMember]
public Guid Key
{
get
{
if (_key == Guid.Empty)
return _id.ToGuid();
return _key;
}
set { _key = value; }
}
/// <summary>
/// Gets or sets the Created Date
/// </summary>
[DataMember]
public DateTime CreateDate { get; set; }
/// <summary>
/// Gets or sets the Modified Date
/// </summary>
[DataMember]
public DateTime UpdateDate { get; set; }
/// <summary>
/// Gets or sets the WasCancelled flag, which is used to track
/// whether some action against an entity was cancelled through some event.
/// This only exists so we have a way to check if an event was cancelled through
/// the new api, which also needs to take effect in the legacy api.
/// </summary>
[IgnoreDataMember]
internal bool WasCancelled { get; set; }
/// <summary>
/// Property changed event
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Method to call on a property setter.
/// </summary>
/// <param name="propertyInfo">The property info.</param>
protected virtual void OnPropertyChanged(PropertyInfo propertyInfo)
{
_propertyChangedInfo[propertyInfo.Name] = true;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyInfo.Name));
}
}
internal virtual void ResetIdentity()
{
_hasIdentity = false;
_id = default(int);
}
/// <summary>
/// Method to call on entity saved when first added
/// </summary>
internal virtual void AddingEntity()
{
CreateDate = DateTime.Now;
UpdateDate = DateTime.Now;
}
/// <summary>
/// Method to call on entity saved/updated
/// </summary>
internal virtual void UpdatingEntity()
{
UpdateDate = DateTime.Now;
}
/// <summary>
/// Tracks the properties that have changed
/// </summary>
//private readonly IDictionary<string, bool> _propertyChangedInfo = new Dictionary<string, bool>();
private IDictionary<string, bool> _propertyChangedInfo;
/// <summary>
/// Indicates whether a specific property on the current entity is dirty.
/// </summary>
/// <param name="propertyName">Name of the property to check</param>
/// <returns>True if Property is dirty, otherwise False</returns>
public virtual bool IsPropertyDirty(string propertyName)
{
return _propertyChangedInfo.Any(x => x.Key == propertyName);
}
/// <summary>
/// Indicates whether the current entity is dirty.
/// </summary>
/// <returns>True if entity is dirty, otherwise False</returns>
public virtual bool IsDirty()
{
return _propertyChangedInfo.Any();
}
/// <summary>
/// Resets dirty properties by clearing the dictionary used to track changes.
/// </summary>
/// <remarks>
/// Please note that resetting the dirty properties could potentially
/// obstruct the saving of a new or updated entity.
/// </remarks>
public virtual void ResetDirtyProperties()
{
_propertyChangedInfo.Clear();
}
/// <summary>
/// Indicates whether the current entity has an identity, eg. Id.
/// </summary>
public virtual bool HasIdentity
{
get
{
return _hasIdentity;
}
protected set
{
_hasIdentity = value;
}
}
public static bool operator ==(Item left, Item right)
{
/*if (ReferenceEquals(null, left))
return false;
if(ReferenceEquals(null, right))
return false;*/
return ReferenceEquals(left, right);
return left.Equals(right);
}
public static bool operator !=(Item left, Item right)
{
return !(left == right);
}
/*public virtual bool SameIdentityAs(IEntity other)
{
if (ReferenceEquals(null, other))
return false;
if (ReferenceEquals(this, other))
return true;
return SameIdentityAs(other as Entity);
}
public virtual bool Equals(Entity other)
{
if (ReferenceEquals(null, other))
return false;
if (ReferenceEquals(this, other))
return true;
return SameIdentityAs(other);
}
public virtual Type GetRealType()
{
return GetType();
}
public virtual bool SameIdentityAs(Entity other)
{
if (ReferenceEquals(null, other))
return false;
if (ReferenceEquals(this, other))
return true;
if (GetType() == other.GetRealType() && HasIdentity && other.HasIdentity)
return other.Id.Equals(Id);
return false;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
return SameIdentityAs(obj as IEntity);
}
public override int GetHashCode()
{
if (!_hash.HasValue)
_hash = !HasIdentity ? new int?(base.GetHashCode()) : new int?(Id.GetHashCode() * 397 ^ GetType().GetHashCode());
return _hash.Value;
}*/
}
}
+2 -2
View File
@@ -303,7 +303,7 @@ namespace Umbraco.Tests
public void Resolves_DataTypes()
{
var types = PluginManager.Current.ResolveDataTypes();
Assert.AreEqual(37, types.Count());
Assert.AreEqual(38, types.Count());
}
[Test]
@@ -317,7 +317,7 @@ namespace Umbraco.Tests
public void Resolves_RestExtensions()
{
var types = PluginManager.Current.ResolveRestExtensions();
Assert.AreEqual(2, types.Count());
Assert.AreEqual(3, types.Count());
}
[Test]
@@ -16,7 +16,7 @@ namespace Umbraco.Tests.PublishedContent
public override void Initialize()
{
base.Initialize();
UmbracoSettings.SettingsFilePath = Core.IO.IOHelper.MapPath(Core.IO.SystemDirectories.Config + Path.DirectorySeparatorChar, false);
PropertyEditorValueConvertersResolver.Current = new PropertyEditorValueConvertersResolver(
@@ -30,7 +30,7 @@ namespace Umbraco.Tests.PublishedContent
//need to specify a custom callback for unit tests
PublishedContentHelper.GetDataTypeCallback = (docTypeAlias, propertyAlias) =>
{
if (propertyAlias == "content")
if (propertyAlias.InvariantEquals("content"))
{
//return the rte type id
return Guid.Parse("5e9b75ae-face-41c8-b47e-5f4b0fd82f83");
@@ -47,7 +47,7 @@ namespace Umbraco.Tests.PublishedContent
public override void TearDown()
{
base.TearDown();
PropertyEditorValueConvertersResolver.Reset();
PublishedContentStoreResolver.Reset();
PublishedMediaStoreResolver.Reset();
@@ -222,6 +222,10 @@ namespace Umbraco.Tests.PublishedContent
var propVal2 = doc.GetPropertyValue<IHtmlString>("content");
Assert.IsTrue(TypeHelper.IsTypeAssignableFrom<IHtmlString>(propVal2.GetType()));
Assert.AreEqual("<div>This is some content</div>", propVal2.ToString());
var propVal3 = doc.GetPropertyValue("Content");
Assert.IsTrue(TypeHelper.IsTypeAssignableFrom<IHtmlString>(propVal3.GetType()));
Assert.AreEqual("<div>This is some content</div>", propVal3.ToString());
}
[Test]
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
@@ -218,6 +219,7 @@ namespace Umbraco.Tests.PublishedContent
}
}
[DebuggerDisplay("Content Id: {Id}, Name: {Name}")]
public class PublishedContentWrapper : IPublishedContent, IOwnerCollectionAware<IPublishedContent>
{
protected IPublishedContent WrappedContent { get; private set; }
@@ -25,9 +25,6 @@ namespace Umbraco.Tests.Routing
{
base.Initialize();
//the module requires that the singleton is setup
ApplicationContext.Current = ApplicationContext;
//create the module
_module = new UmbracoModule();
@@ -468,6 +468,50 @@ namespace Umbraco.Tests.Services
Assert.That(published, Is.True);
}
[Test]
public void Can_Get_Published_Descendant_Versions()
{
// Arrange
var contentService = ServiceContext.ContentService;
var root = contentService.GetById(1046);
var rootPublished = contentService.Publish(root);
var content = contentService.GetById(1048);
content.Properties["title"].Value = content.Properties["title"].Value + " Published";
bool published = contentService.SaveAndPublish(content);
var publishedVersion = content.Version;
content.Properties["title"].Value = content.Properties["title"].Value + " Saved";
contentService.Save(content);
var savedVersion = content.Version;
// Act
var publishedDescendants = ((ContentService) contentService).GetPublishedDescendants(root);
// Assert
Assert.That(rootPublished, Is.True);
Assert.That(published, Is.True);
Assert.That(publishedDescendants.Any(x => x.Version == publishedVersion), Is.True);
Assert.That(publishedDescendants.Any(x => x.Version == savedVersion), Is.False);
//Ensure that the published content version has the correct property value and is marked as published
var publishedContentVersion = publishedDescendants.First(x => x.Version == publishedVersion);
Assert.That(publishedContentVersion.Published, Is.True);
Assert.That(publishedContentVersion.Properties["title"].Value, Contains.Substring("Published"));
//Ensure that the saved content version has the correct property value and is not marked as published
var savedContentVersion = contentService.GetByVersion(savedVersion);
Assert.That(savedContentVersion.Published, Is.False);
Assert.That(savedContentVersion.Properties["title"].Value, Contains.Substring("Saved"));
//Ensure that the latest version of the content is the saved and not-yet-published one
var currentContent = contentService.GetById(1048);
Assert.That(currentContent.Published, Is.False);
Assert.That(currentContent.Properties["title"].Value, Contains.Substring("Saved"));
Assert.That(currentContent.Version, Is.EqualTo(savedVersion));
}
[Test]
public void Can_Save_Content()
{
@@ -567,6 +611,34 @@ namespace Umbraco.Tests.Services
Assert.That(content.Trashed, Is.True);
}
[Test]
public void Can_Move_Content_Structure_To_RecycleBin_And_Empty_RecycleBin()
{
// Arrange
var contentService = ServiceContext.ContentService;
var contentType = ServiceContext.ContentTypeService.GetContentType("umbTextpage");
Content subsubpage = MockedContent.CreateSimpleContent(contentType, "Text Page 3", 1047);
contentService.Save(subsubpage, 0);
var content = contentService.GetById(1046);
// Act
contentService.MoveToRecycleBin(content, 0);
var descendants = contentService.GetDescendants(content);
// Assert
Assert.That(content.ParentId, Is.EqualTo(-20));
Assert.That(content.Trashed, Is.True);
Assert.That(descendants.Count(), Is.EqualTo(3));
Assert.That(descendants.Any(x => x.Path.Contains("-20") == false), Is.False);
//Empty Recycle Bin
contentService.EmptyRecycleBin();
var trashed = contentService.GetContentInRecycleBin();
Assert.That(trashed.Any(), Is.False);
}
[Test]
public void Can_Empty_RecycleBin()
{
@@ -68,7 +68,141 @@ namespace Umbraco.Tests.Services
Assert.That(ctHomePage.HasIdentity, Is.True);
Assert.That(homeDoc.HasIdentity, Is.True);
Assert.That(homeDoc.ContentTypeId, Is.EqualTo(ctHomePage.Id));
Assert.That(addedContentType, Is.True);
Assert.That(addedContentType, Is.False);//False because its already added via the ContentType ctor
}
[Test]
public void Can_Remove_ContentType_Composition_From_ContentType()
{
//Test for U4-2234
var cts = ServiceContext.ContentTypeService;
//Arrange
var component = CreateComponent();
cts.Save(component);
var banner = CreateBannerComponent(component);
cts.Save(banner);
var site = CreateSite();
cts.Save(site);
var homepage = CreateHomepage(site);
cts.Save(homepage);
//Add banner to homepage
var added = homepage.AddContentType(banner);
cts.Save(homepage);
//Assert composition
var bannerExists = homepage.ContentTypeCompositionExists(banner.Alias);
var bannerPropertyExists = homepage.CompositionPropertyTypes.Any(x => x.Alias.Equals("bannerName"));
Assert.That(added, Is.True);
Assert.That(bannerExists, Is.True);
Assert.That(bannerPropertyExists, Is.True);
Assert.That(homepage.CompositionPropertyTypes.Count(), Is.EqualTo(6));
//Remove banner from homepage
var removed = homepage.RemoveContentType(banner.Alias);
cts.Save(homepage);
//Assert composition
var bannerStillExists = homepage.ContentTypeCompositionExists(banner.Alias);
var bannerPropertyStillExists = homepage.CompositionPropertyTypes.Any(x => x.Alias.Equals("bannerName"));
Assert.That(removed, Is.True);
Assert.That(bannerStillExists, Is.False);
Assert.That(bannerPropertyStillExists, Is.False);
Assert.That(homepage.CompositionPropertyTypes.Count(), Is.EqualTo(4));
}
private ContentType CreateComponent()
{
var component = new ContentType(-1)
{
Alias = "component",
Name = "Component",
Description = "ContentType used for Component grouping",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
var contentCollection = new PropertyTypeCollection();
contentCollection.Add(new PropertyType(new Guid(), DataTypeDatabaseType.Ntext) { Alias = "componentGroup", Name = "Component Group", Description = "", HelpText = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 });
component.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Component", SortOrder = 1 });
return component;
}
private ContentType CreateBannerComponent(ContentType parent)
{
var banner = new ContentType(parent)
{
Alias = "banner",
Name = "Banner Component",
Description = "ContentType used for Banner Component",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
var propertyType = new PropertyType(new Guid(), DataTypeDatabaseType.Ntext)
{
Alias = "bannerName",
Name = "Banner Name",
Description = "",
HelpText = "",
Mandatory = false,
SortOrder = 2,
DataTypeDefinitionId = -88
};
banner.AddPropertyType(propertyType, "Component");
return banner;
}
private ContentType CreateSite()
{
var site = new ContentType(-1)
{
Alias = "site",
Name = "Site",
Description = "ContentType used for Site inheritence",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 2,
CreatorId = 0,
Trashed = false
};
var contentCollection = new PropertyTypeCollection();
contentCollection.Add(new PropertyType(new Guid(), DataTypeDatabaseType.Ntext) { Alias = "hostname", Name = "Hostname", Description = "", HelpText = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 });
site.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Site Settings", SortOrder = 1 });
return site;
}
private ContentType CreateHomepage(ContentType parent)
{
var contentType = new ContentType(parent)
{
Alias = "homepage",
Name = "Homepage",
Description = "ContentType used for the Homepage",
Icon = ".sprTreeDoc3",
Thumbnail = "doc.png",
SortOrder = 1,
CreatorId = 0,
Trashed = false
};
var contentCollection = new PropertyTypeCollection();
contentCollection.Add(new PropertyType(new Guid(), DataTypeDatabaseType.Ntext) { Alias = "title", Name = "Title", Description = "", HelpText = "", Mandatory = false, SortOrder = 1, DataTypeDefinitionId = -88 });
contentCollection.Add(new PropertyType(new Guid(), DataTypeDatabaseType.Ntext) { Alias = "bodyText", Name = "Body Text", Description = "", HelpText = "", Mandatory = false, SortOrder = 2, DataTypeDefinitionId = -87 });
contentCollection.Add(new PropertyType(new Guid(), DataTypeDatabaseType.Ntext) { Alias = "author", Name = "Author", Description = "Name of the author", HelpText = "", Mandatory = false, SortOrder = 3, DataTypeDefinitionId = -88 });
contentType.PropertyGroups.Add(new PropertyGroup(contentCollection) { Name = "Content", SortOrder = 1 });
return contentType;
}
private IEnumerable<IContentType> CreateContentTypeHierarchy()
@@ -85,6 +85,34 @@ namespace Umbraco.Tests.Services.Importing {
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
///&lt;DocumentType&gt;
/// &lt;Info&gt;
/// &lt;Name&gt;test&lt;/Name&gt;
/// &lt;Alias&gt;test&lt;/Alias&gt;
/// &lt;Icon&gt;folder.gif&lt;/Icon&gt;
/// &lt;Thumbnail&gt;folder.png&lt;/Thumbnail&gt;
/// &lt;Description&gt;
/// &lt;/Description&gt;
/// &lt;AllowAtRoot&gt;False&lt;/AllowAtRoot&gt;
/// &lt;AllowedTemplates&gt;
/// &lt;Template&gt;test&lt;/Template&gt;
/// &lt;/AllowedTemplates&gt;
/// &lt;DefaultTemplate&gt;test&lt;/DefaultTemplate&gt;
/// &lt;/Info&gt;
/// &lt;Structure&gt;
/// &lt;DocumentType&gt;test&lt;/DocumentType&gt;
/// &lt;/Structure&gt;
/// &lt;GenericProperties&gt;
/// &lt;GenericProperty&gt; [rest of string was truncated]&quot;;.
/// </summary>
internal static string SingleDocType {
get {
return ResourceManager.GetString("SingleDocType", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
///&lt;umbPackage&gt;
@@ -112,6 +140,58 @@ namespace Umbraco.Tests.Services.Importing {
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
///&lt;umbPackage&gt;
/// &lt;files /&gt;
/// &lt;info&gt;
/// &lt;package&gt;
/// &lt;name&gt;Template-Update&lt;/name&gt;
/// &lt;version&gt;0.1&lt;/version&gt;
/// &lt;license url=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;MIT license&lt;/license&gt;
/// &lt;url&gt;http://our.umbraco.org/projects&lt;/url&gt;
/// &lt;requirements&gt;
/// &lt;major&gt;3&lt;/major&gt;
/// &lt;minor&gt;0&lt;/minor&gt;
/// &lt;patch&gt;0&lt;/patch&gt;
/// &lt;/requirements&gt;
/// &lt;/package&gt;
/// &lt;author&gt;
/// &lt;name&gt;Morten Christensen&lt;/name&gt;
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string TemplateOnly_Package {
get {
return ResourceManager.GetString("TemplateOnly_Package", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
///&lt;umbPackage&gt;
/// &lt;files /&gt;
/// &lt;info&gt;
/// &lt;package&gt;
/// &lt;name&gt;Template-Update&lt;/name&gt;
/// &lt;version&gt;0.1&lt;/version&gt;
/// &lt;license url=&quot;http://www.opensource.org/licenses/mit-license.php&quot;&gt;MIT license&lt;/license&gt;
/// &lt;url&gt;http://our.umbraco.org/projects&lt;/url&gt;
/// &lt;requirements&gt;
/// &lt;major&gt;3&lt;/major&gt;
/// &lt;minor&gt;0&lt;/minor&gt;
/// &lt;patch&gt;0&lt;/patch&gt;
/// &lt;/requirements&gt;
/// &lt;/package&gt;
/// &lt;author&gt;
/// &lt;name&gt;Morten Christensen&lt;/name&gt;
/// [rest of string was truncated]&quot;;.
/// </summary>
internal static string TemplateOnly_Updated_Package {
get {
return ResourceManager.GetString("TemplateOnly_Updated_Package", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
///&lt;umbPackage&gt;
@@ -136,5 +216,32 @@ namespace Umbraco.Tests.Services.Importing {
return ResourceManager.GetString("uBlogsy_Package", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;
///&lt;umbPackage&gt;
/// &lt;files&gt;
/// &lt;file&gt;
/// &lt;guid&gt;XSLTsearch.xslt&lt;/guid&gt;
/// &lt;orgPath&gt;/xslt&lt;/orgPath&gt;
/// &lt;orgName&gt;XSLTsearch.xslt&lt;/orgName&gt;
/// &lt;/file&gt;
/// &lt;file&gt;
/// &lt;guid&gt;XSLTsearch.cs&lt;/guid&gt;
/// &lt;orgPath&gt;/App_Code&lt;/orgPath&gt;
/// &lt;orgName&gt;XSLTsearch.cs&lt;/orgName&gt;
/// &lt;/file&gt;
/// &lt;/files&gt;
/// &lt;info&gt;
/// &lt;package&gt;
/// &lt;name&gt;XSLTsearch&lt;/name&gt;
/// &lt;version&gt;3.0.4&lt;/version&gt;
/// &lt;license url=&quot;http://www.opensource.org/licenses/mit-li [rest of string was truncated]&quot;;.
/// </summary>
internal static string XsltSearch_Package {
get {
return ResourceManager.GetString("XsltSearch_Package", resourceCulture);
}
}
}
}
@@ -127,4 +127,16 @@
<data name="uBlogsy_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>ublogsy-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="XsltSearch_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>xsltsearch-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="SingleDocType" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>singledoctype.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="TemplateOnly_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>templateonly-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="TemplateOnly_Updated_Package" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>templateonly-updated-package.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>
@@ -162,6 +162,30 @@ namespace Umbraco.Tests.Services.Importing
Assert.That(contentMaster.PropertyGroups["SEO"].PropertyTypes.Any(x => x.PropertyGroupId.Value != propertyGroupId), Is.False);
}
[Test]
public void PackagingService_Can_Import_StandardMvc_ContentTypes_And_Templates_Xml()
{
// Arrange
string strXml = ImportResources.StandardMvc_Package;
var xml = XElement.Parse(strXml);
var dataTypeElement = xml.Descendants("DataTypes").First();
var templateElement = xml.Descendants("Templates").First();
var docTypeElement = xml.Descendants("DocumentTypes").First();
// Act
var dataTypeDefinitions = ServiceContext.PackagingService.ImportDataTypeDefinitions(dataTypeElement);
var templates = ServiceContext.PackagingService.ImportTemplates(templateElement);
var contentTypes = ServiceContext.PackagingService.ImportContentTypes(docTypeElement);
var numberOfDocTypes = (from doc in docTypeElement.Elements("DocumentType") select doc).Count();
//Assert - Re-Import contenttypes doesn't throw
Assert.DoesNotThrow(() => ServiceContext.PackagingService.ImportContentTypes(docTypeElement));
Assert.That(contentTypes.Count(), Is.EqualTo(numberOfDocTypes));
Assert.That(dataTypeDefinitions, Is.Not.Null);
Assert.That(dataTypeDefinitions.Any(), Is.True);
Assert.That(templates.Any(), Is.True);
}
[Test]
public void PackagingService_Can_Import_Content_Package_Xml()
{
@@ -188,5 +212,88 @@ namespace Umbraco.Tests.Services.Importing
Assert.That(contents.Any(), Is.True);
Assert.That(contents.Count(), Is.EqualTo(numberOfDocs));
}
[Test]
public void PackagingService_Can_Import_Templates_Package_Xml_With_Invalid_Master()
{
// Arrange
string strXml = ImportResources.XsltSearch_Package;
var xml = XElement.Parse(strXml);
var templateElement = xml.Descendants("Templates").First();
var packagingService = ServiceContext.PackagingService;
// Act
var templates = packagingService.ImportTemplates(templateElement);
var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count();
// Assert
Assert.That(templates.Any(), Is.True);
Assert.That(templates.Count(), Is.EqualTo(numberOfTemplates));
}
[Test]
public void PackagingService_Can_Import_Single_DocType()
{
// Arrange
string strXml = ImportResources.SingleDocType;
var docTypeElement = XElement.Parse(strXml);
var packagingService = ServiceContext.PackagingService;
// Act
var contentTypes = packagingService.ImportContentTypes(docTypeElement);
// Assert
Assert.That(contentTypes.Any(), Is.True);
Assert.That(contentTypes.Any(x => x.HasIdentity == false), Is.False);
Assert.That(contentTypes.Count(), Is.EqualTo(1));
}
[Test]
public void PackagingService_Can_ReImport_Single_DocType()
{
// Arrange
string strXml = ImportResources.SingleDocType;
var docTypeElement = XElement.Parse(strXml);
// Act
var contentTypes = ServiceContext.PackagingService.ImportContentTypes(docTypeElement);
var contentTypesUpdated = ServiceContext.PackagingService.ImportContentTypes(docTypeElement);
// Assert
Assert.That(contentTypes.Any(), Is.True);
Assert.That(contentTypes.Any(x => x.HasIdentity == false), Is.False);
Assert.That(contentTypes.Count(), Is.EqualTo(1));
Assert.That(contentTypes.First().AllowedContentTypes.Count(), Is.EqualTo(1));
Assert.That(contentTypesUpdated.Any(), Is.True);
Assert.That(contentTypesUpdated.Any(x => x.HasIdentity == false), Is.False);
Assert.That(contentTypesUpdated.Count(), Is.EqualTo(1));
Assert.That(contentTypesUpdated.First().AllowedContentTypes.Count(), Is.EqualTo(1));
}
[Test]
public void PackagingService_Can_ReImport_Templates_To_Update()
{
var newPackageXml = XElement.Parse(ImportResources.TemplateOnly_Package);
var updatedPackageXml = XElement.Parse(ImportResources.TemplateOnly_Updated_Package);
var templateElement = newPackageXml.Descendants("Templates").First();
var templateElementUpdated = updatedPackageXml.Descendants("Templates").First();
var packagingService = ServiceContext.PackagingService;
var fileService = ServiceContext.FileService;
// Act
var numberOfTemplates = (from doc in templateElement.Elements("Template") select doc).Count();
var templates = packagingService.ImportTemplates(templateElement);
var templatesAfterUpdate = packagingService.ImportTemplates(templateElementUpdated);
var allTemplates = fileService.GetTemplates();
// Assert
Assert.That(templates.Any(), Is.True);
Assert.That(templates.Count(), Is.EqualTo(numberOfTemplates));
Assert.That(templatesAfterUpdate.Count(), Is.EqualTo(numberOfTemplates));
Assert.That(allTemplates.Count(), Is.EqualTo(numberOfTemplates));
Assert.That(allTemplates.First(x => x.Alias == "umbHomepage").Content, Contains.Substring("THIS HAS BEEN UPDATED!"));
}
}
}
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<DocumentType>
<Info>
<Name>test</Name>
<Alias>test</Alias>
<Icon>folder.gif</Icon>
<Thumbnail>folder.png</Thumbnail>
<Description>
</Description>
<AllowAtRoot>False</AllowAtRoot>
<AllowedTemplates>
<Template>test</Template>
</AllowedTemplates>
<DefaultTemplate>test</DefaultTemplate>
</Info>
<Structure>
<DocumentType>test</DocumentType>
</Structure>
<GenericProperties>
<GenericProperty>
<Name>test</Name>
<Alias>test</Alias>
<Type>b4471851-82b6-4c75-afa4-39fa9c6a75e9</Type>
<Definition>fbaf13a8-4036-41f2-93a3-974f678c312a</Definition>
<Tab>
</Tab>
<Mandatory>False</Mandatory>
<Validation>
</Validation>
<Description><![CDATA[]]></Description>
</GenericProperty>
</GenericProperties>
<Tabs />
</DocumentType>
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<umbPackage>
<files />
<info>
<package>
<name>Template-Update</name>
<version>0.1</version>
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
<url>http://our.umbraco.org/projects</url>
<requirements>
<major>3</major>
<minor>0</minor>
<patch>0</patch>
</requirements>
</package>
<author>
<name>Morten Christensen</name>
<website>http://blog.sitereactor.dk</website>
</author>
<readme><![CDATA[]]></readme>
</info>
<DocumentTypes />
<Templates>
<Template>
<Name>Homepage</Name>
<Alias>umbHomepage</Alias>
<Master>umbMaster</Master>
<Design>
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
<asp:content id="Content1" contentplaceholderid="cp_content" runat="server">
<div id="skinHeader" class="clearfix">
<h1>
don't panic<br>
just yet*
</h1>
<p>
*<br>
Most of the time ghosts are friendly and there is really no need to panic.
Ghosts are lost souls looking to be released and pass on to whatever
heaven they attend (depending on religion).
</p>
</div>
<div id="content" class="frontPage">
<umbraco:item id="Item1" runat="server" field="bodyText"></umbraco:item>
</div>
</asp:content>]]>
</Design>
</Template>
<Template>
<Name>Textpage</Name>
<Alias>umbTextpage</Alias>
<Master>umbMaster</Master>
<Design>
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cp_top" runat="server">
<div id="top">
<div id="topInner">
<h1 id="siteName"><a href="/"><umbraco:Item runat="server" field="siteName" recursive="true" /></a></h1>
<h2 id="siteDescription"><umbraco:Item runat="server" field="siteDescription" recursive="true" /></h2>
</div>
<div id="naviWrap">
<umbraco:Macro ID="Macro1" Alias="umbTopNavigation" runat="server" />
</div>
<div id="subNavigation">
<umbraco:Macro ID="Macro2" Alias="umb2ndLevelNavigation" runat="server"></umbraco:Macro>
</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cp_content" runat="server">
<div id="content" class="textpage">
<div id="contentHeader">
<h2><umbraco:Item runat="server" field="pageName"/></h2>
</div>
<umbraco:Item runat="server" field="bodyText" />
</div>
</asp:Content>]]>
</Design>
</Template>
</Templates>
<Stylesheets />
<Macros />
<DictionaryItems />
<Languages />
<DataTypes />
</umbPackage>
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<umbPackage>
<files />
<info>
<package>
<name>Template-Update</name>
<version>0.1</version>
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
<url>http://our.umbraco.org/projects</url>
<requirements>
<major>3</major>
<minor>0</minor>
<patch>0</patch>
</requirements>
</package>
<author>
<name>Morten Christensen</name>
<website>http://blog.sitereactor.dk</website>
</author>
<readme><![CDATA[]]></readme>
</info>
<DocumentTypes />
<Templates>
<Template>
<Name>Homepage</Name>
<Alias>umbHomepage</Alias>
<Master>umbMaster</Master>
<Design>
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
<asp:content id="Content1" contentplaceholderid="cp_content" runat="server">
<div id="skinHeader" class="clearfix">
<h1> THIS HAS BEEN UPDATED! </h1>
<p>
*<br>
Most of the time ghosts are friendly and there is really no need to panic.
Ghosts are lost souls looking to be released and pass on to whatever
heaven they attend (depending on religion).
</p>
</div>
<div id="content" class="frontPage">
<umbraco:item id="Item1" runat="server" field="bodyText"></umbraco:item>
</div>
</asp:content>]]>
</Design>
</Template>
<Template>
<Name>Textpage</Name>
<Alias>umbTextpage</Alias>
<Master>umbMaster</Master>
<Design>
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/umbMaster.master" AutoEventWireup="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cp_top" runat="server">
<div id="top">
<div id="topInner">
<h1 id="siteName"><a href="/"><umbraco:Item runat="server" field="siteName" recursive="true" /></a></h1>
<h2 id="siteDescription"><umbraco:Item runat="server" field="siteDescription" recursive="true" /></h2>
</div>
<div id="naviWrap">
<umbraco:Macro ID="Macro1" Alias="umbTopNavigation" runat="server" />
</div>
<div id="subNavigation">
<umbraco:Macro ID="Macro2" Alias="umb2ndLevelNavigation" runat="server"></umbraco:Macro>
</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cp_content" runat="server">
<div id="content" class="textpage">
<div id="contentHeader">
<h2><umbraco:Item runat="server" field="pageName"/></h2>
</div>
<umbraco:Item runat="server" field="bodyText" />
</div>
</asp:Content>]]>
</Design>
</Template>
</Templates>
<Stylesheets />
<Macros />
<DictionaryItems />
<Languages />
<DataTypes />
</umbPackage>
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<umbPackage>
<files>
<file>
<guid>XSLTsearch.xslt</guid>
<orgPath>/xslt</orgPath>
<orgName>XSLTsearch.xslt</orgName>
</file>
<file>
<guid>XSLTsearch.cs</guid>
<orgPath>/App_Code</orgPath>
<orgName>XSLTsearch.cs</orgName>
</file>
</files>
<info>
<package>
<name>XSLTsearch</name>
<version>3.0.4</version>
<license url="http://www.opensource.org/licenses/mit-license.php">MIT license</license>
<url>http://www.percipientstudios.com</url>
<requirements>
<major>3</major>
<minor>0</minor>
<patch>0</patch>
</requirements>
</package>
<author>
<name>Percipient Studios</name>
<website>http://www.percipientstudios.com</website>
</author>
<readme>
<![CDATA[XSLTsearch is the easy search solution for Umbraco web sites with up to a few thousand pages. It is fast, completely self-contained, and extremely configurable.
With XSLTsearch you can search for all words and phrases in all document properties and attributes, including your custom properties. Search results are automatically sorted by relevance with search terms highlighted in the results.
XSLTsearch installs in all Umbraco sites.
New in 3.0:
- Multi-lingual support with dictionary items
- Medium trust support (helper functions now in /app_code/xsltsearch.cs)
- Many bug fixes
Version 3.0.1
- For umbraco 4.5+ and new XML schema
- Fixed xslt error when a previewed field had fewer than six characters
- Changed default behavior to only search within current site if source node id is not specified (better for multiple sites in one installation)
- Multi-site searching made easier. Now searches only within the current site if the source= parameter is not specified (better for multiple sites in one installation)
Version 3.0.2
- Fixed issue of PreviewMode="CONTEXT" in which the search term would not be highlighted if it were the last word in the content being searched
Version 3.0.3
- Removed extraneous whitespace and empty quotes from search term
Version 3.0.4
- Additional fix for PreviewMode="CONTEXT" in which the search term would not be displayed if it were the last word in the content being search and the search term were more than $maxChars from the beginning of the search field
- Removed errant 'xmp' debug statement that appeared in v3.0.3
]]>
</readme>
</info>
<Documents>
<DocumentSet importMode="root">
<XSLTsearch id="1090" parentID="-1" level="1" writerID="0" creatorID="0" nodeType="1087" template="1086" sortOrder="39" createDate="2010-11-09T13:45:22" updateDate="2010-11-09T14:18:04" nodeName="Search" urlName="search" writerName="Administrator" creatorName="Administrator" path="-1,1090" isDoc="">
<umbracoNaviHide>0</umbracoNaviHide>
</XSLTsearch>
</DocumentSet>
</Documents>
<DocumentTypes>
<DocumentType>
<Info>
<Name>XSLTsearch</Name>
<Alias>XSLTsearch</Alias>
<Icon>.sprTreeDoc2</Icon>
<Thumbnail>doc.png</Thumbnail>
<Description>
XSLTsearch page.
(adjust settings via the macro in the XSLTsearch template)
</Description>
<AllowedTemplates>
<Template>XSLTsearch</Template>
</AllowedTemplates>
<DefaultTemplate>XSLTsearch</DefaultTemplate>
</Info>
<Structure />
<GenericProperties>
<GenericProperty>
<Name>Hide in navigation</Name>
<Alias>umbracoNaviHide</Alias>
<Type>38b352c1-e9f8-4fd8-9324-9a2eab06d97a</Type>
<Definition>92897bc6-a5f3-4ffe-ae27-f2e7e33dda49</Definition>
<Tab>
</Tab>
<Mandatory>False</Mandatory>
<Validation>
</Validation>
<Description><![CDATA[]]></Description>
</GenericProperty>
</GenericProperties>
<Tabs />
</DocumentType>
</DocumentTypes>
<Templates>
<Template>
<Name>XSLTsearch</Name>
<Alias>XSLTsearch</Alias>
<Master>RunwayMaster</Master>
<Design>
<![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/RunwayMaster.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderId="RunwayMasterContentPlaceHolder" runat="server">
<div id="content">
<div id="contentHeader">
<h2><umbraco:Item runat="server" field="pageName"/></h2>
</div>
<umbraco:Macro runat="server" Alias="XSLTsearch"
macroAlias="XSLTsearch"
source="-1"
searchFields="@nodeName,metaKeywords,metaDescription,bodyText"
previewFields="bodyText,metaDescription"
previewType="beginning"
searchBoxLocation="bottom"
resultsPerPage="5"
previewChars="255"
showPageRange="0"
showOrdinals="0"
showScores="0"
showStats="1">
</umbraco:Macro>
</div>
</asp:Content>]]>
</Design>
</Template>
</Templates>
<Stylesheets>
<Stylesheet>
<Name>XSLTsearch</Name>
<FileName>
</FileName>
<Content>
<![CDATA[#xsltsearch {margin: 0; padding-bottom: 20px;}
#xsltsearch_navigation {text-align: center;}
#xsltsearch_navigation .disabled {color: #AAA;}
#xsltsearch_stats {font-size: 75%; color: #999;}
#xsltsearch_results {padding-bottom: 20px;}
#xsltsearch h2 {font-size: 150%;}
.xsltsearch_result p {margin: 0; padding: 0;}
.xsltsearch_result:hover {background: #fafafa;}
.xsltsearch_ordinal {font-weight: bold; font-size: 75%;}
.xsltsearch_title {font-weight: bold;}
.xsltsearch_score {font-size: 75%;}
p.xsltsearch_result_description {padding-bottom: 10px;}
.xsltsearch_description strong {background: #FFD;} /* highlighting */
]]>
</Content>
</Stylesheet>
</Stylesheets>
<Macros>
<macro>
<name>XSLTsearch</name>
<alias>XSLTsearch</alias>
<scriptType>
</scriptType>
<scriptAssembly>
</scriptAssembly>
<xslt>XSLTsearch.xslt</xslt>
<useInEditor>False</useInEditor>
<refreshRate>0</refreshRate>
<scriptingFile>
</scriptingFile>
<properties>
<property name="Source" alias="source" show="True" propertyType="contentTree" />
<property name="Umbraco fields to search" alias="searchFields" show="True" propertyType="text" />
<property name="Umbraco fields shown in results preview" alias="previewFields" show="True" propertyType="text" />
<property name="Display search box at TOP, BOTTOM, BOTH, or NONE" alias="searchBoxLocation" show="True" propertyType="text" />
<property name="Display BEGINNING or CONTEXT of each result" alias="previewType" show="True" propertyType="text" />
<property name="Number of search results to display per page" alias="resultsPerPage" show="True" propertyType="number" />
<property name="Number of characters of preview text to display" alias="previewChars" show="True" propertyType="number" />
<property name="Display 'Showing result X to Y'?" alias="showPageRange" show="True" propertyType="bool" />
<property name="Display numbers before each result?" alias="showOrdinals" show="True" propertyType="bool" />
<property name="Display search score for each result?" alias="showScores" show="True" propertyType="bool" />
<property name="Display 'Searched X documents in Y seconds'?" alias="showStats" show="True" propertyType="bool" />
</properties>
</macro>
</Macros>
<DictionaryItems>
<DictionaryItem Key="XSLTsearch">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[]]></Value>
<DictionaryItem Key="[XSLTsearch]Button-Search">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Search]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Description-Context">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Context]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Description-ContextUnavailable">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[unavailable]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Heading-SearchResults">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Search Results]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Navigation-Next">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Next]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Navigation-Previous">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Previous]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]PageRange-ShowingResults">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Showing results]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]PageRange-To">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[to]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Score-Score">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[score]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Stats-PagesIn">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[pages in]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Stats-Searched">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Searched]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Stats-Seconds">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[seconds]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Summary-Matches">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[matches]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Summary-NoMatchesWereFoundFor">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[No matches were found for]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Summary-Page">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[page]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Summary-Pages">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[pages]]></Value>
</DictionaryItem>
<DictionaryItem Key="[XSLTsearch]Summary-YourSearchFor">
<Value LanguageId="1" LanguageCultureAlias="en-US"><![CDATA[Your search for]]></Value>
</DictionaryItem>
</DictionaryItem>
</DictionaryItems>
<Languages>
<Language Id="2" CultureAlias="en-US" FriendlyName="English (United States)" />
</Languages>
<DataTypes />
<Actions>
<Action runat="install" alias="addStringToHtmlElement" templateAlias="RunwayMaster" htmlElementId="head" position="end"><![CDATA[ <link rel="stylesheet" type="text/css" href="/css/XSLTsearch.css" />]]></Action>
<Action runat="install" alias="publishRootDocument" documentName="Search" />
<Action runat="install" alias="allowDocumenttype" documentTypeAlias="XSLTsearch" parentDocumentTypeAlias="RunwayHomepage" />
<Action runat="install" alias="moveRootDocument" documentName="Search" parentDocumentType="RunwayHomepage" />
</Actions>
</umbPackage>
@@ -0,0 +1,151 @@
using System;
using System.Data.SqlServerCe;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Dynamic;
using System.Runtime.InteropServices;
using System.Text;
using System.Web.Management;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using Umbraco.Core;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Migrations.Initial;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Tests.TestHelpers
{
public class BaseSeleniumTest
{
internal IWebDriver Driver;
internal string BaseUrl;
private StringBuilder _verificationErrors;
private UmbracoDatabase _database;
protected ApplicationContext ApplicationContext
{
get { return ApplicationContext.Current; }
}
[SetUp]
public virtual void Initialize()
{
// Disable medium trust
var transform = TransformWebConfig("Release");
var assemblyPath = TestHelper.CurrentAssemblyDirectory;
assemblyPath = Path.Combine(assemblyPath, @"..\..\..\Umbraco.Web.UI\");
var webUiPath = Path.GetFullPath(new Uri(assemblyPath).LocalPath);
var installedPackagesConfig = string.Format("{0}App_Data\\packages\\installed\\installedPackages.config", webUiPath);
if (File.Exists(installedPackagesConfig))
File.Delete(installedPackagesConfig);
var databaseDataPath = string.Format(@"{0}\App_Data\Umbraco.sdf", webUiPath);
var connectionString = string.Format(@"Data Source={0}", databaseDataPath);
//Create the Sql CE database
var engine = new SqlCeEngine(connectionString);
if (File.Exists(databaseDataPath) == false)
engine.CreateDatabase();
SqlSyntaxContext.SqlSyntaxProvider = new SqlCeSyntaxProvider();
_database = new UmbracoDatabase(connectionString, "System.Data.SqlServerCe.4.0");
// First remove anything in the database
var creation = new DatabaseSchemaCreation(_database);
creation.UninstallDatabaseSchema();
// Then populate it with fresh data
_database.CreateDatabaseSchema(false);
_database.Execute("UPDATE umbracoUser SET userName = 'admin', userPassword = 'W477AMlLwwJQeAGlPZKiEILr8TA=', userEmail = 'none' WHERE id = 0"); // password: test
// Recycle app pool so the new user can log in
//var webConfigFilePath = string.Format(@"{0}\web.config", webUiPath);
//File.SetLastWriteTime(webConfigFilePath, DateTime.Now);
// Disable medium trust
transform = TransformWebConfig("Release");
Driver = new FirefoxDriver();
BaseUrl = "http://localhost:61639/";
_verificationErrors = new StringBuilder();
}
[TearDown]
public virtual void TearDown()
{
try
{
Driver.Quit();
}
catch (Exception)
{
// Ignore errors if unable to close the browser
}
// Re-enable medium trust
var transform = TransformWebConfig("Debug");
Assert.AreEqual("", _verificationErrors.ToString());
}
private static string TransformWebConfig(string configurationToUse)
{
var assemblyPath = TestHelper.CurrentAssemblyDirectory;
var toolsPath = Path.Combine(assemblyPath, @"..\..\..\..\tools\ConfigTransformTool\");
var webUiPath = Path.GetFullPath(new Uri(Path.Combine(assemblyPath, @"..\..\..\Umbraco.Web.UI\")).LocalPath);
var fileToTransform = webUiPath + "web.config";
var transformFile = string.Format("{0}web.Template.{1}.config", webUiPath, configurationToUse);
var psi = new ProcessStartInfo(string.Format("{0}ctt.exe", toolsPath), string.Format("s:\"{0}\" t:\"{1}\" d:\"{2}\" pw v", fileToTransform, transformFile, fileToTransform))
{
WorkingDirectory = Environment.CurrentDirectory,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true
};
string[] result = {string.Empty};
using (var process = new Process { StartInfo = psi })
{
// delegate for writing the process output to the response output
Action<Object, DataReceivedEventArgs> dataReceived = ((sender, e) =>
{
if (e.Data != null) // sometimes a random event is received with null data, not sure why - I prefer to leave it out
{
result[0] += e.Data;
result[0] += "\r\n";
}
});
process.OutputDataReceived += new DataReceivedEventHandler(dataReceived);
process.ErrorDataReceived += new DataReceivedEventHandler(dataReceived);
// start the process and start reading the standard and error outputs
process.Start();
process.BeginErrorReadLine();
process.BeginOutputReadLine();
// wait for the process to exit
process.WaitForExit();
// an exit code other than 0 generally means an error
if (process.ExitCode != 0)
{
result[0] = result[0] + "\r\n - Exited with exitcode " + process.ExitCode;
}
}
return result[0];
}
}
}
@@ -34,6 +34,8 @@ namespace Umbraco.Tests.TestHelpers
{
if (RequiresDbSetup)
base.InitializeDatabase();
//init the singleton too!
ApplicationContext.Current = ApplicationContext;
}
[TearDown]
+579 -32
View File
@@ -1,25 +1,37 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security;
using System.Text;
using System.Threading;
using System.Web;
using System.Web.Compilation;
using NUnit.Framework;
using SqlCE4Umbraco;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Tests;
using Umbraco.Tests.PartialTrust;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.BaseRest;
using umbraco;
using umbraco.DataLayer;
using umbraco.MacroEngines;
using umbraco.businesslogic;
using umbraco.cms.businesslogic;
using umbraco.editorControls.tags;
using umbraco.interfaces;
using umbraco.uicontrols;
namespace Umbraco.Tests
{
/// <summary>
/// Full Trust benchmark tests for typefinder and the old typefinder
/// <summary>
/// Tests for typefinder
/// </summary>
[TestFixture]
public class TypeFinderTests
@@ -50,45 +62,580 @@ namespace Umbraco.Tests
typeof(System.Web.Mvc.ActionResult).Assembly,
typeof(TypeFinder).Assembly,
typeof(ISqlHelper).Assembly,
typeof(ICultureDictionary).Assembly
typeof(ICultureDictionary).Assembly,
typeof(Tag).Assembly,
typeof(UmbracoExamine.BaseUmbracoIndexer).Assembly
};
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class MyTestAttribute : Attribute
{
}
public abstract class TestEditor
{
}
[MyTestAttribute]
public class BenchmarkTestEditor : TestEditor
{
}
[MyTestAttribute]
public class MyOtherTestEditor : TestEditor
{
}
[Test]
public void Get_Type_With_Attribute()
public void Find_Class_Of_Type_With_Attribute()
{
var typesFound = TypeFinder.FindClassesOfTypeWithAttribute<TestEditor, MyTestAttribute>(_assemblies);
Assert.AreEqual(2, typesFound.Count());
}
[Test]
public void Find_Classes_Of_Type()
{
var typesFound = TypeFinder.FindClassesOfType<IApplicationStartupHandler>(_assemblies);
var originalTypesFound = TypeFinderOriginal.FindClassesOfType<IApplicationStartupHandler>(_assemblies);
Assert.AreEqual(originalTypesFound.Count(), typesFound.Count());
Assert.AreEqual(6, typesFound.Count());
Assert.AreEqual(6, originalTypesFound.Count());
}
[Test]
public void Find_Classes_With_Attribute()
{
var typesFound = TypeFinder.FindClassesWithAttribute<RestExtensionAttribute>(_assemblies);
Assert.AreEqual(1, typesFound.Count());
}
[Ignore]
[Test]
public void Benchmark_Original_Finder()
{
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting test", "Finished test"))
{
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting FindClassesOfType", "Finished FindClassesOfType"))
{
for (var i = 0; i < 1000; i++)
{
Assert.Greater(TypeFinderOriginal.FindClassesOfType<DisposableObject>(_assemblies).Count(), 0);
}
}
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting FindClassesOfTypeWithAttribute", "Finished FindClassesOfTypeWithAttribute"))
{
for (var i = 0; i < 1000; i++)
{
Assert.Greater(TypeFinderOriginal.FindClassesOfTypeWithAttribute<TestEditor, MyTestAttribute>(_assemblies).Count(), 0);
}
}
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting FindClassesWithAttribute", "Finished FindClassesWithAttribute"))
{
for (var i = 0; i < 1000; i++)
{
Assert.Greater(TypeFinderOriginal.FindClassesWithAttribute<XsltExtensionAttribute>(_assemblies).Count(), 0);
}
}
}
}
[Ignore]
[Test]
public void Benchmark_New_Finder()
{
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting test", "Finished test"))
{
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting FindClassesOfType", "Finished FindClassesOfType"))
{
for (var i = 0; i < 1000; i++)
{
Assert.Greater(TypeFinder.FindClassesOfType<DisposableObject>(_assemblies).Count(), 0);
}
}
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting FindClassesOfTypeWithAttribute", "Finished FindClassesOfTypeWithAttribute"))
{
for (var i = 0; i < 1000; i++)
{
Assert.Greater(TypeFinder.FindClassesOfTypeWithAttribute<TestEditor, MyTestAttribute>(_assemblies).Count(), 0);
}
}
using (DisposableTimer.TraceDuration<TypeFinderTests>("Starting FindClassesWithAttribute", "Finished FindClassesWithAttribute"))
{
for (var i = 0; i < 1000; i++)
{
Assert.Greater(TypeFinder.FindClassesWithAttribute<XsltExtensionAttribute>(_assemblies).Count(), 0);
}
}
}
}
public class MyTag : ITag
{
public int Id { get; private set; }
public string TagCaption { get; private set; }
public string Group { get; private set; }
}
public class MySuperTag : MyTag
{
}
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class MyTestAttribute : Attribute
{
}
public abstract class TestEditor
{
}
[MyTestAttribute]
public class BenchmarkTestEditor : TestEditor
{
}
[MyTestAttribute]
public class MyOtherTestEditor : TestEditor
{
}
//USED FOR THE ABOVE TESTS
// see this issue for details: http://issues.umbraco.org/issue/U4-1187
internal static class TypeFinderOriginal
{
private static readonly ConcurrentBag<Assembly> LocalFilteredAssemblyCache = new ConcurrentBag<Assembly>();
private static readonly ReaderWriterLockSlim LocalFilteredAssemblyCacheLocker = new ReaderWriterLockSlim();
private static ReadOnlyCollection<Assembly> _allAssemblies = null;
private static ReadOnlyCollection<Assembly> _binFolderAssemblies = null;
private static readonly ReaderWriterLockSlim Locker = new ReaderWriterLockSlim();
/// <summary>
/// lazily load a reference to all assemblies and only local assemblies.
/// This is a modified version of: http://www.dominicpettifer.co.uk/Blog/44/how-to-get-a-reference-to-all-assemblies-in-the--bin-folder
/// </summary>
/// <remarks>
/// We do this because we cannot use AppDomain.Current.GetAssemblies() as this will return only assemblies that have been
/// loaded in the CLR, not all assemblies.
/// See these threads:
/// http://issues.umbraco.org/issue/U5-198
/// http://stackoverflow.com/questions/3552223/asp-net-appdomain-currentdomain-getassemblies-assemblies-missing-after-app
/// http://stackoverflow.com/questions/2477787/difference-between-appdomain-getassemblies-and-buildmanager-getreferencedassembl
/// </remarks>
internal static IEnumerable<Assembly> GetAllAssemblies()
{
if (_allAssemblies == null)
{
using (new WriteLock(Locker))
{
List<Assembly> assemblies = null;
try
{
var isHosted = HttpContext.Current != null;
try
{
if (isHosted)
{
assemblies = new List<Assembly>(BuildManager.GetReferencedAssemblies().Cast<Assembly>());
}
}
catch (InvalidOperationException e)
{
if (!(e.InnerException is SecurityException))
throw;
}
if (assemblies == null)
{
//NOTE: we cannot use AppDomain.CurrentDomain.GetAssemblies() because this only returns assemblies that have
// already been loaded in to the app domain, instead we will look directly into the bin folder and load each one.
var binFolder = Assembly.GetExecutingAssembly().GetAssemblyFile().Directory;
var binAssemblyFiles = Directory.GetFiles(binFolder.FullName, "*.dll", SearchOption.TopDirectoryOnly).ToList();
assemblies = new List<Assembly>();
foreach (var a in binAssemblyFiles)
{
try
{
var assName = AssemblyName.GetAssemblyName(a);
var ass = Assembly.Load(assName);
assemblies.Add(ass);
}
catch (Exception e)
{
if (e is SecurityException || e is BadImageFormatException)
{
//swallow these exceptions
}
else
{
throw;
}
}
}
}
//if for some reason they are still no assemblies, then use the AppDomain to load in already loaded assemblies.
if (!assemblies.Any())
{
assemblies.AddRange(AppDomain.CurrentDomain.GetAssemblies().ToList());
}
//here we are trying to get the App_Code assembly
var fileExtensions = new[] { ".cs", ".vb" }; //only vb and cs files are supported
var appCodeFolder = new DirectoryInfo(IOHelper.MapPath(IOHelper.ResolveUrl("~/App_code")));
//check if the folder exists and if there are any files in it with the supported file extensions
if (appCodeFolder.Exists && (fileExtensions.Any(x => appCodeFolder.GetFiles("*" + x).Any())))
{
var appCodeAssembly = Assembly.Load("App_Code");
if (!assemblies.Contains(appCodeAssembly)) // BuildManager will find App_Code already
assemblies.Add(appCodeAssembly);
}
//now set the _allAssemblies
_allAssemblies = new ReadOnlyCollection<Assembly>(assemblies);
}
catch (InvalidOperationException e)
{
if (!(e.InnerException is SecurityException))
throw;
_binFolderAssemblies = _allAssemblies;
}
}
}
return _allAssemblies;
}
/// <summary>
/// Returns only assemblies found in the bin folder that have been loaded into the app domain.
/// </summary>
/// <returns></returns>
/// <remarks>
/// This will be used if we implement App_Plugins from Umbraco v5 but currently it is not used.
/// </remarks>
internal static IEnumerable<Assembly> GetBinAssemblies()
{
if (_binFolderAssemblies == null)
{
using (new WriteLock(Locker))
{
var assemblies = GetAssembliesWithKnownExclusions().ToArray();
var binFolder = Assembly.GetExecutingAssembly().GetAssemblyFile().Directory;
var binAssemblyFiles = Directory.GetFiles(binFolder.FullName, "*.dll", SearchOption.TopDirectoryOnly).ToList();
var domainAssemblyNames = binAssemblyFiles.Select(AssemblyName.GetAssemblyName);
var safeDomainAssemblies = new List<Assembly>();
var binFolderAssemblies = new List<Assembly>();
foreach (var a in assemblies)
{
try
{
//do a test to see if its queryable in med trust
var assemblyFile = a.GetAssemblyFile();
safeDomainAssemblies.Add(a);
}
catch (SecurityException)
{
//we will just ignore this because this will fail
//in medium trust for system assemblies, we get an exception but we just want to continue until we get to
//an assembly that is ok.
}
}
foreach (var assemblyName in domainAssemblyNames)
{
try
{
var foundAssembly = safeDomainAssemblies.FirstOrDefault(a => a.GetAssemblyFile() == assemblyName.GetAssemblyFile());
if (foundAssembly != null)
{
binFolderAssemblies.Add(foundAssembly);
}
}
catch (SecurityException)
{
//we will just ignore this because if we are trying to do a call to:
// AssemblyName.ReferenceMatchesDefinition(a.GetName(), assemblyName)))
//in medium trust for system assemblies, we get an exception but we just want to continue until we get to
//an assembly that is ok.
}
}
_binFolderAssemblies = new ReadOnlyCollection<Assembly>(binFolderAssemblies);
}
}
return _binFolderAssemblies;
}
/// <summary>
/// Return a list of found local Assemblies excluding the known assemblies we don't want to scan
/// and exluding the ones passed in and excluding the exclusion list filter, the results of this are
/// cached for perforance reasons.
/// </summary>
/// <param name="excludeFromResults"></param>
/// <returns></returns>
internal static IEnumerable<Assembly> GetAssembliesWithKnownExclusions(
IEnumerable<Assembly> excludeFromResults = null)
{
if (LocalFilteredAssemblyCache.Any()) return LocalFilteredAssemblyCache;
using (new WriteLock(LocalFilteredAssemblyCacheLocker))
{
var assemblies = GetFilteredAssemblies(excludeFromResults, KnownAssemblyExclusionFilter);
assemblies.ForEach(LocalFilteredAssemblyCache.Add);
}
return LocalFilteredAssemblyCache;
}
/// <summary>
/// Return a list of found local Assemblies and exluding the ones passed in and excluding the exclusion list filter
/// </summary>
/// <param name="excludeFromResults"></param>
/// <param name="exclusionFilter"></param>
/// <returns></returns>
private static IEnumerable<Assembly> GetFilteredAssemblies(
IEnumerable<Assembly> excludeFromResults = null,
string[] exclusionFilter = null)
{
if (excludeFromResults == null)
excludeFromResults = new List<Assembly>();
if (exclusionFilter == null)
exclusionFilter = new string[] { };
return GetAllAssemblies()
.Where(x => !excludeFromResults.Contains(x)
&& !x.GlobalAssemblyCache
&& !exclusionFilter.Any(f => x.FullName.StartsWith(f)));
}
/// <summary>
/// this is our assembly filter to filter out known types that def dont contain types we'd like to find or plugins
/// </summary>
/// <remarks>
/// NOTE the comma vs period... comma delimits the name in an Assembly FullName property so if it ends with comma then its an exact name match
/// </remarks>
internal static readonly string[] KnownAssemblyExclusionFilter = new[]
{
"mscorlib,",
"System.",
"Antlr3.",
"Autofac.",
"Autofac,",
"Castle.",
"ClientDependency.",
"DataAnnotationsExtensions.",
"DataAnnotationsExtensions,",
"Dynamic,",
"HtmlDiff,",
"Iesi.Collections,",
"log4net,",
"Microsoft.",
"Newtonsoft.",
"NHibernate.",
"NHibernate,",
"NuGet.",
"RouteDebugger,",
"SqlCE4Umbraco,",
"umbraco.datalayer,",
"umbraco.interfaces,",
"umbraco.providers,",
"Umbraco.Web.UI,",
"umbraco.webservices",
"Lucene.",
"Examine,",
"Examine.",
"ServiceStack.",
"MySql.",
"HtmlAgilityPack.",
"TidyNet.",
"ICSharpCode.",
"CookComputing.",
/* Mono */
"MonoDevelop.NUnit"
};
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>()
where TAttribute : Attribute
{
return FindClassesOfTypeWithAttribute<T, TAttribute>(GetAssembliesWithKnownExclusions(), true);
}
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly> assemblies)
where TAttribute : Attribute
{
return FindClassesOfTypeWithAttribute<T, TAttribute>(assemblies, true);
}
public static IEnumerable<Type> FindClassesOfTypeWithAttribute<T, TAttribute>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
where TAttribute : Attribute
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
var l = new List<Type>();
foreach (var a in assemblies)
{
var types = from t in GetTypesWithFormattedException(a)
where !t.IsInterface
&& typeof(T).IsAssignableFrom(t)
&& t.GetCustomAttributes<TAttribute>(false).Any()
&& (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract))
select t;
l.AddRange(types);
}
return l;
}
/// <summary>
/// Searches all filtered local assemblies specified for classes of the type passed in.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfType<T>()
{
return FindClassesOfType<T>(GetAssembliesWithKnownExclusions(), true);
}
/// <summary>
/// Returns all types found of in the assemblies specified of type T
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="assemblies"></param>
/// <param name="onlyConcreteClasses"></param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfType<T>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
return GetAssignablesFromType<T>(assemblies, onlyConcreteClasses);
}
/// <summary>
/// Returns all types found of in the assemblies specified of type T
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="assemblies"></param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesOfType<T>(IEnumerable<Assembly> assemblies)
{
return FindClassesOfType<T>(assemblies, true);
}
/// <summary>
/// Finds the classes with attribute.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="assemblies">The assemblies.</param>
/// <param name="onlyConcreteClasses">if set to <c>true</c> only concrete classes.</param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesWithAttribute<T>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
where T : Attribute
{
return FindClassesWithAttribute(typeof(T), assemblies, onlyConcreteClasses);
}
/// <summary>
/// Finds the classes with attribute.
/// </summary>
/// <param name="type">The attribute type </param>
/// <param name="assemblies">The assemblies.</param>
/// <param name="onlyConcreteClasses">if set to <c>true</c> only concrete classes.</param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesWithAttribute(Type type, IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
{
if (assemblies == null) throw new ArgumentNullException("assemblies");
if (!TypeHelper.IsTypeAssignableFrom<Attribute>(type))
throw new ArgumentException("The type specified: " + type + " is not an Attribute type");
var l = new List<Type>();
foreach (var a in assemblies)
{
var types = from t in GetTypesWithFormattedException(a)
where !t.IsInterface && t.GetCustomAttributes(type, false).Any() && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract))
select t;
l.AddRange(types);
}
return l;
}
/// <summary>
/// Finds the classes with attribute.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="assemblies">The assemblies.</param>
/// <returns></returns>
public static IEnumerable<Type> FindClassesWithAttribute<T>(IEnumerable<Assembly> assemblies)
where T : Attribute
{
return FindClassesWithAttribute<T>(assemblies, true);
}
/// <summary>
/// Finds the classes with attribute in filtered local assemblies
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static IEnumerable<Type> FindClassesWithAttribute<T>()
where T : Attribute
{
return FindClassesWithAttribute<T>(GetAssembliesWithKnownExclusions());
}
#region Private methods
/// <summary>
/// Gets a collection of assignables of type T from a collection of assemblies
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="assemblies"></param>
/// <param name="onlyConcreteClasses"></param>
/// <returns></returns>
private static IEnumerable<Type> GetAssignablesFromType<T>(IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
{
return GetTypes(typeof(T), assemblies, onlyConcreteClasses);
}
private static IEnumerable<Type> GetTypes(Type assignTypeFrom, IEnumerable<Assembly> assemblies, bool onlyConcreteClasses)
{
var l = new List<Type>();
foreach (var a in assemblies)
{
var types = from t in GetTypesWithFormattedException(a)
where !t.IsInterface && assignTypeFrom.IsAssignableFrom(t) && (!onlyConcreteClasses || (t.IsClass && !t.IsAbstract))
select t;
l.AddRange(types);
}
return l;
}
private static IEnumerable<Type> GetTypesWithFormattedException(Assembly a)
{
//if the assembly is dynamic, do not try to scan it
if (a.IsDynamic)
return Enumerable.Empty<Type>();
try
{
return a.GetExportedTypes();
}
catch (ReflectionTypeLoadException ex)
{
var sb = new StringBuilder();
sb.AppendLine("Could not load types from assembly " + a.FullName + ", errors:");
foreach (var loaderException in ex.LoaderExceptions.WhereNotNull())
{
sb.AppendLine("Exception: " + loaderException.ToString());
}
throw new ReflectionTypeLoadException(ex.Types, ex.LoaderExceptions, sb.ToString());
}
}
#endregion
}
}
}
+84
View File
@@ -0,0 +1,84 @@
using System;
using System.ComponentModel;
using System.Data.Common;
using System.Data.Odbc;
using System.Data.OleDb;
using System.Data.SqlClient;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Tests.PartialTrust;
using Umbraco.Web;
using UmbracoExamine;
using umbraco;
using umbraco.presentation;
using umbraco.presentation.nodeFactory;
using umbraco.presentation.umbraco.Search;
namespace Umbraco.Tests
{
/// <summary>
/// Tests for TypeHelper
/// </summary>
[TestFixture]
public class TypeHelperTests : AbstractPartialTrustFixture<TypeHelperTests>
{
[Test]
public void Is_Static_Class()
{
Assert.IsTrue(TypeHelper.IsStaticClass(typeof(TypeHelper)));
Assert.IsFalse(TypeHelper.IsStaticClass(typeof(TypeHelperTests)));
}
[Test]
public void Find_Common_Base_Class()
{
var t1 = TypeHelper.GetLowestBaseType(typeof (OleDbCommand),
typeof (OdbcCommand),
typeof (SqlCommand));
Assert.IsFalse(t1.Success);
var t2 = TypeHelper.GetLowestBaseType(typeof (OleDbCommand),
typeof (OdbcCommand),
typeof (SqlCommand),
typeof (Component));
Assert.IsTrue(t2.Success);
Assert.AreEqual(typeof(Component), t2.Result);
var t3 = TypeHelper.GetLowestBaseType(typeof (OleDbCommand),
typeof (OdbcCommand),
typeof (SqlCommand),
typeof (Component),
typeof (Component).BaseType);
Assert.IsTrue(t3.Success);
Assert.AreEqual(typeof(MarshalByRefObject), t3.Result);
var t4 = TypeHelper.GetLowestBaseType(typeof(OleDbCommand),
typeof(OdbcCommand),
typeof(SqlCommand),
typeof(Component),
typeof(Component).BaseType,
typeof(int));
Assert.IsFalse(t4.Success);
var t5 = TypeHelper.GetLowestBaseType(typeof(UmbracoEventManager));
Assert.IsTrue(t5.Success);
Assert.AreEqual(typeof(UmbracoEventManager), t5.Result);
var t6 = TypeHelper.GetLowestBaseType(typeof (IApplicationEventHandler),
typeof (LegacyScheduledTasks),
typeof(CacheHelperExtensions.CacheHelperApplicationEventListener));
Assert.IsTrue(t6.Success);
Assert.AreEqual(typeof(IApplicationEventHandler), t6.Result);
}
public override void TestSetup()
{
}
public override void TestTearDown()
{
}
}
}
+15
View File
@@ -86,6 +86,7 @@
<Private>True</Private>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Helpers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
@@ -121,6 +122,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\UmbracoExamine.0.1.42.2941\lib\UmbracoExamine.dll</HintPath>
</Reference>
<Reference Include="WebDriver">
<HintPath>..\packages\Selenium.WebDriver.2.32.0\lib\net40\WebDriver.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Auditing\AuditTests.cs" />
@@ -160,6 +164,9 @@
<Compile Include="CodeFirst\TypeInheritanceTest.cs" />
<Compile Include="Configurations\FileSystemProviderTests.cs" />
<Compile Include="ContentStores\PublishMediaStoreTests.cs" />
<Compile Include="Integration\CreateContent.cs" />
<Compile Include="TestHelpers\BaseSeleniumTest.cs" />
<Compile Include="Integration\InstallPackage.cs" />
<Compile Include="LegacyApi\MediaTypeTests.cs" />
<Compile Include="Migrations\AlterMigrationTests.cs" />
<Compile Include="Migrations\Upgrades\BaseUpgradeTest.cs" />
@@ -178,6 +185,7 @@
<Compile Include="Migrations\Upgrades\SqlCeUpgradeTest.cs" />
<Compile Include="Migrations\Upgrades\SqlServerUpgradeTest.cs" />
<Compile Include="Migrations\Upgrades\ValidateOlderSchemaTest.cs" />
<Compile Include="Models\Collections\PropertyCollectionTests.cs" />
<Compile Include="Models\MediaXmlTest.cs" />
<Compile Include="Persistence\Mappers\MappingResolverTests.cs" />
<Compile Include="Persistence\Querying\ContentRepositorySqlClausesTest.cs" />
@@ -298,6 +306,7 @@
<Compile Include="TestHelpers\Entities\MockedEntity.cs" />
<Compile Include="TestHelpers\Entities\MockedMedia.cs" />
<Compile Include="TestHelpers\ExamineHelpers\IndexInitializer.cs" />
<Compile Include="TypeHelperTests.cs" />
<Compile Include="UriUtilityTests.cs" />
<Compile Include="Resolvers\MacroFieldEditorsResolverTests.cs" />
<Compile Include="MacroEngineFactoryTests.cs" />
@@ -325,6 +334,7 @@
<Compile Include="TestHelpers\FakeHttpContextFactory.cs" />
<Compile Include="TypeFinderTests.cs" />
<Compile Include="Routing\UmbracoModuleTests.cs" />
<Compile Include="XmlHelperTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config">
@@ -426,12 +436,17 @@
<Content Include="Migrations\SqlScripts\SqlCeTotal-480.sql" />
<Content Include="Migrations\SqlScripts\SqlServerTotal-480.sql" />
<Content Include="Services\Importing\InheritedDocTypes-Package.xml" />
<Content Include="Services\Importing\SingleDocType.xml" />
<Content Include="Services\Importing\StandardMvc-Package.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="Services\Importing\TemplateOnly-Package.xml" />
<Content Include="Services\Importing\TemplateOnly-Updated-Package.xml" />
<Content Include="Services\Importing\uBlogsy-Package.xml" />
<Content Include="Services\Importing\XsltSearch-Package.xml" />
<Content Include="TestHelpers\ExamineHelpers\media.xml" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D
+279
View File
@@ -0,0 +1,279 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.Xml.XPath;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Tests.TestHelpers;
using umbraco;
namespace Umbraco.Tests
{
[TestFixture]
public class XmlHelperTests
{
[SetUp]
public void Setup()
{
TestHelper.SetupLog4NetForTests();
}
[Ignore("This is a benchmark test so is ignored by default")]
[Test]
public void Sort_Nodes_Benchmark_Legacy()
{
var xmlContent = GetXmlContent(1);
var xml = new XmlDocument();
xml.LoadXml(xmlContent);
var original = xml.GetElementById(1173.ToString());
Assert.IsNotNull(original);
long totalTime = 0;
var watch = new Stopwatch();
var iterations = 10000;
for (var i = 0; i < iterations; i++)
{
//don't measure the time for clone!
var parentNode = original.Clone();
watch.Start();
LegacySortNodes(ref parentNode);
watch.Stop();
totalTime += watch.ElapsedMilliseconds;
watch.Reset();
//do assertions just to make sure it is working properly.
var currSort = 0;
foreach (var child in parentNode.SelectNodes("./* [@id]").Cast<XmlNode>())
{
Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value));
currSort++;
}
//ensure the parent node's properties still exist first
Assert.AreEqual("content", parentNode.ChildNodes[0].Name);
Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name);
//then the child nodes should come straight after
Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null);
}
Debug.WriteLine("Total time for " + iterations + " iterations is " + totalTime);
}
[Ignore("This is a benchmark test so is ignored by default")]
[Test]
public void Sort_Nodes_Benchmark_New()
{
var xmlContent = GetXmlContent(1);
var xml = new XmlDocument();
xml.LoadXml(xmlContent);
var original = xml.GetElementById(1173.ToString());
Assert.IsNotNull(original);
long totalTime = 0;
var watch = new Stopwatch();
var iterations = 10000;
for (var i = 0; i < iterations; i++)
{
//don't measure the time for clone!
var parentNode = (XmlElement)original.Clone();
watch.Start();
XmlHelper.SortNodes(
parentNode,
"./* [@id]",
element => element.Attribute("id") != null,
element => element.AttributeValue<int>("sortOrder"));
watch.Stop();
totalTime += watch.ElapsedMilliseconds;
watch.Reset();
//do assertions just to make sure it is working properly.
var currSort = 0;
foreach (var child in parentNode.SelectNodes("./* [@id]").Cast<XmlNode>())
{
Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value));
currSort++;
}
//ensure the parent node's properties still exist first
Assert.AreEqual("content", parentNode.ChildNodes[0].Name);
Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name);
//then the child nodes should come straight after
Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null);
}
Debug.WriteLine("Total time for " + iterations + " iterations is " + totalTime);
}
[Test]
public void Sort_Nodes()
{
var xmlContent = GetXmlContent(1);
var xml = new XmlDocument();
xml.LoadXml(xmlContent);
var original = xml.GetElementById(1173.ToString());
Assert.IsNotNull(original);
var parentNode = (XmlElement)original.Clone();
XmlHelper.SortNodes(
parentNode,
"./* [@id]",
element => element.Attribute("id") != null,
element => element.AttributeValue<int>("sortOrder"));
//do assertions just to make sure it is working properly.
var currSort = 0;
foreach (var child in parentNode.SelectNodes("./* [@id]").Cast<XmlNode>())
{
Assert.AreEqual(currSort, int.Parse(child.Attributes["sortOrder"].Value));
currSort++;
}
//ensure the parent node's properties still exist first
Assert.AreEqual("content", parentNode.ChildNodes[0].Name);
Assert.AreEqual("umbracoUrlAlias", parentNode.ChildNodes[1].Name);
//then the child nodes should come straight after
Assert.IsTrue(parentNode.ChildNodes[2].Attributes["id"] != null);
}
/// <summary>
/// This was the logic to sort before and now lives here just to show the benchmarks tests above.
/// </summary>
/// <param name="parentNode"></param>
private static void LegacySortNodes(ref XmlNode parentNode)
{
XmlNode n = parentNode.CloneNode(true);
// remove all children from original node
string xpath = UmbracoSettings.UseLegacyXmlSchema ? "./node" : "./* [@id]";
foreach (XmlNode child in parentNode.SelectNodes(xpath))
parentNode.RemoveChild(child);
XPathNavigator nav = n.CreateNavigator();
XPathExpression expr = nav.Compile(xpath);
expr.AddSort("@sortOrder", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Number);
XPathNodeIterator iterator = nav.Select(expr);
while (iterator.MoveNext())
parentNode.AppendChild(
((IHasXmlNode)iterator.Current).GetNode());
}
/// <summary>
/// returns xml with a reverse sort order
/// </summary>
/// <param name="templateId"></param>
/// <returns></returns>
private string GetXmlContent(int templateId)
{
return @"<?xml version=""1.0"" encoding=""utf-8""?>
<!DOCTYPE root[
<!ELEMENT Home ANY>
<!ATTLIST Home id ID #REQUIRED>
<!ELEMENT CustomDocument ANY>
<!ATTLIST CustomDocument id ID #REQUIRED>
]>
<root id=""-1"">
<Home id=""1046"" parentID=""-1"" level=""1"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""0"" createDate=""2012-06-12T14:13:17"" updateDate=""2012-07-20T18:50:43"" nodeName=""Home"" urlName=""home"" writerName=""admin"" creatorName=""admin"" path=""-1,1046"" isDoc="""">
<content><![CDATA[]]></content>
<umbracoUrlAlias><![CDATA[this/is/my/alias, anotheralias]]></umbracoUrlAlias>
<umbracoNaviHide>1</umbracoNaviHide>
<Home id=""1173"" parentID=""1046"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""0"" createDate=""2012-07-20T18:06:45"" updateDate=""2012-07-20T19:07:31"" nodeName=""Sub1"" urlName=""sub1"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173"" isDoc="""">
<content><![CDATA[<div>This is some content</div>]]></content>
<umbracoUrlAlias><![CDATA[page2/alias, 2ndpagealias]]></umbracoUrlAlias>
<Home id=""1174"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""3"" createDate=""2012-07-20T18:07:54"" updateDate=""2012-07-20T19:10:27"" nodeName=""Sub2"" urlName=""sub2"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1174"" isDoc="""">
<content><![CDATA[]]></content>
<umbracoUrlAlias><![CDATA[only/one/alias]]></umbracoUrlAlias>
<creatorName><![CDATA[Custom data with same property name as the member name]]></creatorName>
</Home>
<Home id=""1176"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""2"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<CustomDocument id=""1177"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1234"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-18T14:23:35"" nodeName=""custom sub 1"" urlName=""custom-sub-1"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1177"" isDoc="""" />
<CustomDocument id=""1178"" parentID=""1173"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1234"" template=""" + templateId + @""" sortOrder=""0"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-16T14:23:35"" nodeName=""custom sub 2"" urlName=""custom-sub-2"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1178"" isDoc="""" />
<Home id=""1176"" parentID=""1179"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""26"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1180"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""25"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1181"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""24"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1182"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""23"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1183"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""22"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1184"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""21"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1185"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""20"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1186"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""19"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1187"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""18"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1188"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""17"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1189"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""16"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1190"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""15"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1191"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""14"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1192"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""13"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1193"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""12"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1194"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""11"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1195"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""10"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1196"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""9"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1197"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""8"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1198"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""7"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1199"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""6"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1200"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""5"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
<Home id=""1176"" parentID=""1201"" level=""3"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""4"" createDate=""2012-07-20T18:08:08"" updateDate=""2012-07-20T19:10:52"" nodeName=""Sub 3"" urlName=""sub-3"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1173,1176"" isDoc="""">
<content><![CDATA[]]></content>
</Home>
</Home>
<Home id=""1175"" parentID=""1046"" level=""2"" writerID=""0"" creatorID=""0"" nodeType=""1044"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-07-20T18:08:01"" updateDate=""2012-07-20T18:49:32"" nodeName=""Sub 2"" urlName=""sub-2"" writerName=""admin"" creatorName=""admin"" path=""-1,1046,1175"" isDoc=""""><content><![CDATA[]]></content>
</Home>
</Home>
<CustomDocument id=""1172"" parentID=""-1"" level=""1"" writerID=""0"" creatorID=""0"" nodeType=""1234"" template=""" + templateId + @""" sortOrder=""1"" createDate=""2012-07-16T15:26:59"" updateDate=""2012-07-18T14:23:35"" nodeName=""Test"" urlName=""test-page"" writerName=""admin"" creatorName=""admin"" path=""-1,1172"" isDoc="""" />
</root>";
}
}
}
+1
View File
@@ -9,6 +9,7 @@
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="NUnit" version="2.6.2" targetFramework="net40" />
<package id="RhinoMocks" version="3.6.1" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.32.0" targetFramework="net40" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
<package id="UmbracoExamine" version="0.1.42.2941" targetFramework="net40" />
+97 -18
View File
@@ -236,10 +236,6 @@
<Project>{511F6D8D-7717-440A-9A57-A507E9A8B27F}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
</ProjectReference>
<ProjectReference Include="..\umbraco.webservices\umbraco.webservices.csproj">
<Project>{CBDB56AC-FF02-4421-9FD4-ED82E339D8E2}</Project>
<Name>umbraco.webservices</Name>
</ProjectReference>
<ProjectReference Include="..\Umbraco.Web\Umbraco.Web.csproj">
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>Umbraco.Web</Name>
@@ -260,6 +256,14 @@
<DependentUpon>default.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="config\splashes\NoNodes.aspx.cs">
<DependentUpon>noNodes.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="config\splashes\NoNodes.aspx.designer.cs">
<DependentUpon>noNodes.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Install\Default.aspx.designer.cs">
<DependentUpon>default.aspx</DependentUpon>
</Compile>
@@ -277,6 +281,20 @@
<DependentUpon>loadStarterKits.ascx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Umbraco\controls\ContentTypeControlNew.ascx.cs">
<DependentUpon>ContentTypeControlNew.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\controls\ContentTypeControlNew.ascx.designer.cs">
<DependentUpon>ContentTypeControlNew.ascx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Create.aspx.cs">
<DependentUpon>create.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Create.aspx.designer.cs">
<DependentUpon>create.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Create\PartialViewMacro.ascx.cs">
<DependentUpon>PartialViewMacro.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -291,17 +309,46 @@
<Compile Include="Umbraco\Developer\Macros\EditMacro.aspx.designer.cs">
<DependentUpon>editMacro.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Developer\Packages\StarterKits.aspx.cs">
<Compile Include="Umbraco\developer\Packages\DirectoryBrowser.aspx.cs">
<DependentUpon>directoryBrowser.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\developer\Packages\DirectoryBrowser.aspx.designer.cs">
<DependentUpon>directoryBrowser.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\developer\Packages\StarterKits.aspx.cs">
<DependentUpon>StarterKits.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Developer\Packages\StarterKits.aspx.designer.cs">
<DependentUpon>StarterKits.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Developer\Python\EditPython.aspx.cs">
<DependentUpon>editPython.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Developer\Python\EditPython.aspx.designer.cs">
<DependentUpon>editPython.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Dialogs\EditMacro.aspx.cs">
<DependentUpon>EditMacro.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Dialogs\MoveOrCopy.aspx.cs">
<DependentUpon>moveOrCopy.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Dialogs\MoveOrCopy.aspx.designer.cs">
<DependentUpon>moveOrCopy.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\dialogs\Sort.aspx.cs">
<DependentUpon>sort.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\dialogs\Sort.aspx.designer.cs">
<DependentUpon>sort.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Dialogs\EditMacro.aspx.designer.cs">
<DependentUpon>EditMacro.aspx</DependentUpon>
</Compile>
@@ -324,12 +371,33 @@
<Compile Include="Umbraco\Search\QuickSearch.ascx.designer.cs">
<DependentUpon>QuickSearch.ascx</DependentUpon>
</Compile>
<Compile Include="Umbraco\settings\EditNodeTypeNew.aspx.cs">
<DependentUpon>EditNodeTypeNew.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\settings\EditNodeTypeNew.aspx.designer.cs">
<DependentUpon>EditNodeTypeNew.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Settings\EditTemplate.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Settings\EditTemplate.aspx.designer.cs">
<DependentUpon>editTemplate.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\settings\Stylesheet\editstylesheet.aspx.cs">
<DependentUpon>editstylesheet.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\settings\Stylesheet\editstylesheet.aspx.designer.cs">
<DependentUpon>editstylesheet.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\settings\Stylesheet\Property\EditStyleSheetProperty.aspx.cs">
<DependentUpon>EditStyleSheetProperty.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\settings\Stylesheet\Property\EditStyleSheetProperty.aspx.designer.cs">
<DependentUpon>EditStyleSheetProperty.aspx</DependentUpon>
</Compile>
<Compile Include="Umbraco\Settings\Views\EditView.aspx.cs">
<DependentUpon>EditView.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -383,6 +451,7 @@
</None>
<None Include="Config\umbracoSettings.Release.config">
<DependentUpon>umbracoSettings.config</DependentUpon>
<SubType>Designer</SubType>
</None>
<None Include="Config\trees.Release.config">
<DependentUpon>trees.config</DependentUpon>
@@ -427,8 +496,10 @@
<Content Include="Umbraco\Config\Lang\ru.xml" />
<Content Include="Umbraco\Config\Lang\zh.xml" />
<Content Include="Umbraco\Controls\Tree\CustomTreeService.asmx" />
<Content Include="Umbraco\create.aspx" />
<Content Include="Umbraco\Create\PartialViewMacro.ascx" />
<Content Include="Umbraco\Dashboard\Images\access-denied.png" />
<Content Include="Umbraco\developer\Packages\directoryBrowser.aspx" />
<Content Include="Umbraco\Dashboard\Scripts\swfobject.js" />
<Content Include="Umbraco\Dashboard\MediaDashboardFolderBrowser.ascx" />
<Content Include="Umbraco\Developer\RelationTypes\EditRelationType.aspx" />
@@ -471,13 +542,6 @@
<Content Include="Umbraco\Plugins\UGoLive\throbber.gif" />
<Content Include="Umbraco\Plugins\UGoLive\tick.png" />
<Content Include="Umbraco\Settings\Views\EditView.aspx" />
<Content Include="Umbraco\Webservices\Api\DocumentService.asmx" />
<Content Include="Umbraco\Webservices\Api\FileService.asmx" />
<Content Include="Umbraco\Webservices\Api\MaintanceService.asmx" />
<Content Include="Umbraco\Webservices\Api\MediaService.asmx" />
<Content Include="Umbraco\Webservices\Api\MemberService.asmx" />
<Content Include="Umbraco\Webservices\Api\StylesheetService.asmx" />
<Content Include="Umbraco\Webservices\Api\TemplateService.asmx" />
<Content Include="Umbraco_Client\CodeMirror\Js\Lib\codemirror.css" />
<Content Include="Umbraco_Client\CodeMirror\Js\Lib\codemirror.js" />
<Content Include="Umbraco_Client\CodeMirror\Js\Lib\Util\closetag.js" />
@@ -639,11 +703,20 @@
<Content Include="Umbraco_Client\CodeMirror\Js\Theme\xq-dark.css" />
<Content Include="Umbraco_Client\ContextMenu\Css\jquery.contextMenu.css" />
<Content Include="Umbraco_Client\ContextMenu\Js\jquery.contextMenu.js" />
<Content Include="umbraco_Client\Dialogs\SortDialog.css" />
<Content Include="umbraco_client\Dialogs\SortDialog.js" />
<Content Include="Umbraco_Client\Dialogs\CreateDialog.css" />
<Content Include="Umbraco_Client\Dialogs\EditMacro.css" />
<Content Include="umbraco_Client\Editors\DirectoryBrowser.css" />
<Content Include="Umbraco_Client\Dialogs\EditMacro.js" />
<Content Include="Umbraco_Client\Dialogs\UmbracoField.js" />
<Content Include="Umbraco_Client\Editors\EditMacroScripts.js" />
<Content Include="Umbraco_Client\Editors\EditXslt.css" />
<Content Include="Umbraco_Client\Editors\EditXslt.js" />
<Content Include="Umbraco_Client\Editors\EditScript.js" />
<Content Include="Umbraco_Client\Editors\EditMacro.css" />
<Content Include="Umbraco_Client\Editors\EditStyleSheet.js" />
<Content Include="Umbraco_Client\Editors\EditTemplate.js" />
<Content Include="Umbraco_Client\Editors\EditView.js" />
<Content Include="Umbraco_Client\FileUploader\Js\jquery.fileUploader.js" />
<Content Include="Umbraco_Client\FolderBrowser\Css\folderbrowser.css" />
@@ -658,6 +731,9 @@
<Content Include="Umbraco_Client\Installer\Images\pbar.gif" />
<Content Include="Umbraco_Client\Installer\Js\PackageInstaller.js" />
<Content Include="Umbraco_Client\Splitbutton\InsertMacroSplitButton.js" />
<Content Include="umbraco_Client\tablesorting\img\asc.gif" />
<Content Include="umbraco_Client\tablesorting\img\desc.gif" />
<Content Include="umbraco_Client\tablesorting\jquery.tablesorter.min.js" />
<Content Include="Umbraco_Client\Splitbutton\jquery.splitbutton.js" />
<Content Include="Umbraco_Client\Tags\Css\jquery.tagsinput.css" />
<Content Include="Umbraco_Client\Tags\Js\jquery.tagsinput.js" />
@@ -1700,7 +1776,6 @@
<Content Include="Umbraco\Images\Umbraco\uploadpackage.gif" />
<Content Include="Umbraco_Client\Application\JQuery\jquery.autocomplete.js" />
<Content Include="Umbraco\Developer\Packages\BrowseRepository.aspx" />
<Content Include="Umbraco\Developer\Packages\directoryBrowser.aspx" />
<Content Include="Umbraco\Developer\Packages\editPackage.aspx" />
<Content Include="Umbraco\Developer\Packages\installedPackage.aspx" />
<Content Include="Umbraco\Developer\Packages\LoadNitros.ascx" />
@@ -1830,7 +1905,9 @@
<Content Include="Config\feedProxy.config" />
<Content Include="Umbraco_Client\ui\ui-lightness\jquery-ui.custom.css" />
<Content Include="Config\applications.config" />
<Content Include="Config\trees.config" />
<Content Include="Config\trees.config">
<SubType>Designer</SubType>
</Content>
<None Include="Config\applications.Release.config">
<DependentUpon>applications.config</DependentUpon>
<SubType>Designer</SubType>
@@ -1864,6 +1941,7 @@
<Content Include="Web.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Views\Web.config.transform" />
<None Include="web.Template.Debug.config">
<DependentUpon>Web.Template.config</DependentUpon>
<SubType>Designer</SubType>
@@ -1906,7 +1984,6 @@
<Content Include="Umbraco\Translation\default.aspx" />
<Content Include="Umbraco\Translation\preview.aspx" />
<Content Include="Umbraco\Translation\xml.aspx" />
<Content Include="Umbraco\create.aspx" />
<Content Include="Umbraco\Create\content.ascx" />
<Content Include="Umbraco\Create\language.ascx">
<SubType>UserControl</SubType>
@@ -2283,7 +2360,9 @@
<SubType>Designer</SubType>
</None>
<Content Include="Config\404handlers.config" />
<Content Include="Config\Dashboard.config" />
<Content Include="Config\Dashboard.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Config\metablogConfig.config" />
<Content Include="Config\restExtensions.config">
<SubType>Designer</SubType>
@@ -2329,9 +2408,9 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\"
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>61637</DevelopmentServerPort>
<DevelopmentServerPort>6070</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:61639/</IISUrl>
<IISUrl>http://localhost:6070</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
@@ -0,0 +1,55 @@
<?xml version="1.0"?>
<configuration>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="Umbraco.Web" />
<add namespace="Umbraco.Core" />
<add namespace="Umbraco.Core.Models" />
<add namespace="Umbraco.Web.Mvc" />
</namespaces>
</pages>
</system.web.webPages.razor>
<appSettings>
<add key="webpages:Enabled" value="false" />
</appSettings>
<system.web>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur
after the input has already been processed by the controller. By default
MVC performs request validation before a controller processes the input.
To change this behavior apply the ValidateInputAttribute to a
controller or action.
-->
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>
</configuration>
@@ -2,7 +2,7 @@
<!--
For full details of the client dependency framework, visit
the CodePlex site @ http://clientdependency.codeplex.com
https://github.com/Shandem/ClientDependency
It manages CSS and JS file dependencies per control without having to worry about duplicates.
It also manages the combination, compression and minification of all JS & CSS files.
@@ -12,24 +12,38 @@ NOTES:
-->
<clientDependency version="1" fileDependencyExtensions=".js,.css">
<!--
This section is used for Web Forms only, the enableCompositeFiles="true" is optional and by default is set to true.
The LoaderControlProvider is set to default, the javascriptPlaceHolderId, cssPlaceHolderId attributes are optional and default to what is listed below. If using
this provider, then you must specify both PlaceHolder controls on your page in order to render the JS/CSS.
-->
<fileRegistration defaultProvider="LoaderControlProvider">
<providers>
<add name="PageHeaderProvider" type="ClientDependency.Core.FileRegistration.Providers.PageHeaderProvider, ClientDependency.Core"/>
<add name="LazyLoadProvider" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadProvider, ClientDependency.Core"/>
<add name="LoaderControlProvider" type="ClientDependency.Core.FileRegistration.Providers.LoaderControlProvider, ClientDependency.Core"/>
<add name="PageHeaderProvider" type="ClientDependency.Core.FileRegistration.Providers.PageHeaderProvider, ClientDependency.Core" />
<add name="LazyLoadProvider" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadProvider, ClientDependency.Core" />
<add name="LoaderControlProvider" type="ClientDependency.Core.FileRegistration.Providers.LoaderControlProvider, ClientDependency.Core" />
<add name="PlaceHolderProvider" type="ClientDependency.Core.FileRegistration.Providers.PlaceHolderProvider, ClientDependency.Core" enableCompositeFiles="true" javascriptPlaceHolderId="JavaScriptPlaceHolder" cssPlaceHolderId="CssPlaceHolder" />
<!-- Used for loading dependencies in Canvas mode -->
<add name="CanvasProvider" type="umbraco.presentation.LiveEditing.CanvasClientDependencyProvider, umbraco" />
</providers>
</fileRegistration>
<!--
The composite file section configures the compression/combination/minification of files.
You can enable/disable minification of either JS/CSS files and you can enable/disable the
persistence of composite files. By default, minification and persistence is enabled. Persisting files
means that the system is going to save the output of the compressed/combined/minified files
to disk so that on any subsequent request (when output cache expires) that these files don't have
to be recreated again and will be based on the persisted file on disk. This saves on processing time.
-->
<!-- This section is used for MVC only -->
<mvc defaultRenderer="StandardRenderer">
<renderers>
<add name="StandardRenderer" type="ClientDependency.Core.FileRegistration.Providers.StandardRenderer, ClientDependency.Core" />
<add name="LazyLoadRenderer" type="ClientDependency.Core.FileRegistration.Providers.LazyLoadRenderer, ClientDependency.Core" />
</renderers>
</mvc>
<!--
The composite file section configures the compression/combination/minification of files.
You can enable/disable minification of either JS/CSS files and you can enable/disable the
persistence of composite files. By default, minification and persistence is enabled. Persisting files
means that the system is going to save the output of the compressed/combined/minified files
to disk so that on any subsequent request (when output cache expires) that these files don't have
to be recreated again and will be based on the persisted file on disk. This saves on processing time.
-->
<compositeFiles defaultProvider="defaultFileProcessingProvider" compositeFileHandlerPath="~/DependencyHandler.axd">
<fileProcessingProviders>
<add name="CompositeFileProcessor"
@@ -38,30 +52,42 @@ NOTES:
enableJsMinify="true"
persistFiles="true"
compositeFilePath="~/App_Data/TEMP/ClientDependency"
urlType="Base64QueryStrings" />
bundleDomains="localhost:123456"
urlType="Base64QueryStrings"
pathUrlFormat="{dependencyId}/{version}/{type}"/>
</fileProcessingProviders>
<!-- A file map provider stores references to dependency files by an id to be used in the handler URL when using the MappedId Url type -->
<fileMapProviders>
<add name="XmlFileMap"
type="ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper, ClientDependency.Core"
mapPath="~/App_Data/TEMP/ClientDependency" />
</fileMapProviders>
<!--
Defines the mime types to compress when requested by the client.
Path is a regex selector, or a * can be used as in place of 'any'.
Generally mime types are only set by client browsers in the request for things
such as JSON or XML ajax requests.
-->
Defines the mime types to compress when requested by the client.
Path is a regex selector, or a * can be used as in place of 'any'.
Generally mime types are only set by client browsers in the request for things
such as JSON or XML ajax requests.
-->
<mimeTypeCompression>
<!-- Compress all json requests for the tree -->
<add type="application/json" path="^.*?/webservices/Tree.*" />
</mimeTypeCompression>
<!--
Defines the paths to match on to enable rogue file compression.
Path is a regex selector, or a * can be used as in place of 'any'.
jsExt and cssExt are comma seperated list of extensions to match to have the dependencies
replaced with the composite file handler. You can even include ASP.Net web service JS proxies.
-->
<rogueFileCompression>
<!--<add path="*" compressJs="true" compressCss="true" jsExt=".js,asmx/js" cssExt=".css">
<exclusions>
<add path="^.*test.aspx.*"/>
</exclusions>
</add>-->
</rogueFileCompression>
</compositeFiles>
<!-- ClientDependency also supports the ASP.Net MVC framework, see codeplex URL for full details -->
<!--
<mvc defaultRenderer="StandardRenderer">
<renderers>
<add name="StandardRenderer" type="ClientDependency.Core.Mvc.Providers.StandardRenderer, ClientDependency.Core"/>
<add name="LazyLoadRenderer" type="ClientDependency.Core.Mvc.Providers.LazyLoadRenderer, ClientDependency.Core"/>
</renderers>
</mvc>
-->
</clientDependency>
@@ -2,7 +2,7 @@
<!--
For full details of the client dependency framework, visit
the CodePlex site @ http://clientdependency.codeplex.com
https://github.com/Shandem/ClientDependency
It manages CSS and JS file dependencies per control without having to worry about duplicates.
It also manages the combination, compression and minification of all JS & CSS files.
@@ -10,8 +10,13 @@ NOTES:
* Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config
* A new version will invalidate both client and server cache and create new persisted files
-->
<clientDependency version="2" fileDependencyExtensions=".js,.css">
<clientDependency version="7" fileDependencyExtensions=".js,.css">
<!--
This section is used for Web Forms only, the enableCompositeFiles="true" is optional and by default is set to true.
The LoaderControlProvider is set to default, the javascriptPlaceHolderId, cssPlaceHolderId attributes are optional and default to what is listed below. If using
this provider, then you must specify both PlaceHolder controls on your page in order to render the JS/CSS.
-->
<fileRegistration defaultProvider="LoaderControlProvider">
<providers>
<add name="PageHeaderProvider" type="ClientDependency.Core.FileRegistration.Providers.PageHeaderProvider, ClientDependency.Core" />
@@ -31,17 +36,17 @@ NOTES:
</renderers>
</mvc>
<!--
The composite file section configures the compression/combination/minification of files.
You can enable/disable minification of either JS/CSS files and you can enable/disable the
persistence of composite files. By default, minification and persistence is enabled. Persisting files
means that the system is going to save the output of the compressed/combined/minified files
to disk so that on any subsequent request (when output cache expires) that these files don't have
to be recreated again and will be based on the persisted file on disk. This saves on processing time.
-->
<compositeFiles defaultProvider="defaultFileProcessingProvider" compositeFileHandlerPath="~/DependencyHandler.axd">
<!--
The composite file section configures the compression/combination/minification of files.
You can enable/disable minification of either JS/CSS files and you can enable/disable the
persistence of composite files. By default, minification and persistence is enabled. Persisting files
means that the system is going to save the output of the compressed/combined/minified files
to disk so that on any subsequent request (when output cache expires) that these files don't have
to be recreated again and will be based on the persisted file on disk. This saves on processing time.
-->
<compositeFiles defaultProvider="defaultFileProcessingProvider" compositeFileHandlerPath="~/DependencyHandler.axd">
<fileProcessingProviders>
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="true" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/TEMP/ClientDependency" urlType="Base64QueryStrings" />
<add name="CompositeFileProcessor" type="ClientDependency.Core.CompositeFiles.Providers.CompositeFileProcessingProvider, ClientDependency.Core" enableCssMinify="true" enableJsMinify="true" persistFiles="true" compositeFilePath="~/App_Data/TEMP/ClientDependency" bundleDomains="localhost:123456" urlType="Base64QueryStrings" pathUrlFormat="{dependencyId}/{version}/{type}" />
</fileProcessingProviders>
<!-- A file map provider stores references to dependency files by an id to be used in the handler URL when using the MappedId Url type -->
@@ -49,17 +54,31 @@ NOTES:
<add name="XmlFileMap" type="ClientDependency.Core.CompositeFiles.Providers.XmlFileMapper, ClientDependency.Core" mapPath="~/App_Data/TEMP/ClientDependency" />
</fileMapProviders>
<!--
Defines the mime types to compress when requested by the client.
Path is a regex selector, or a * can be used as in place of 'any'.
Generally mime types are only set by client browsers in the request for things
such as JSON or XML ajax requests.
-->
<!--
Defines the mime types to compress when requested by the client.
Path is a regex selector, or a * can be used as in place of 'any'.
Generally mime types are only set by client browsers in the request for things
such as JSON or XML ajax requests.
-->
<mimeTypeCompression>
<!-- Compress all json requests for the tree -->
<add type="application/json" path="^.*?/webservices/Tree.*" />
</mimeTypeCompression>
</compositeFiles>
<!--
Defines the paths to match on to enable rogue file compression.
Path is a regex selector, or a * can be used as in place of 'any'.
jsExt and cssExt are comma seperated list of extensions to match to have the dependencies
replaced with the composite file handler. You can even include ASP.Net web service JS proxies.
-->
<rogueFileCompression>
<!--<add path="*" compressJs="true" compressCss="true" jsExt=".js,asmx/js" cssExt=".css">
<exclusions>
<add path="^.*test.aspx.*"/>
</exclusions>
</add>-->
</rogueFileCompression>
</compositeFiles>
</clientDependency>
@@ -22,4 +22,8 @@ More information and documentation can be found on CodePlex: http://umbracoexami
<add Name="nodeTypeAlias" />
</IndexAttributeFields>
</IndexSet>
<!-- Default Indexset for external searches, this indexes all fields on all types of nodes-->
<IndexSet SetName="ExternalIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/External/" />
</ExamineLuceneIndexSets>
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<!--
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<urlrewritingnet xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<!--

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