Compare commits

...

369 Commits

Author SHA1 Message Date
Sebastiaan Janssen 1628dfaa2f Update version to 4.11.10 2013-06-20 17:20:17 +02:00
Shannon 3ff888f77a Fixes: #U4-2403 2013-06-20 14:47:59 +02:00
Murray@tbpc10.terabyte.co.nz 9af3a10da8 #U4-2326 Added Try Catch for PlatformNotSupportedException
Signed-off-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2013-06-20 14:46:21 +02:00
Sebastiaan Janssen 0470a0ca51 Add gitignore 2013-06-20 14:46:13 +02:00
Sebastiaan Janssen 7b6cda6b44 Closing branch 4.11.9 2013-05-30 09:46:32 -02:00
Sebastiaan Janssen 332d91b6dc Added tag release-4.11.9 for changeset fb8fd83e8e70 2013-05-30 09:46:21 -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 7ecbc3b391 Fixes U4-2248 Spelling error in back office 2013-05-28 15:44:59 -02:00
Sebastiaan Janssen 13a86624ff Fixes U4-2248 Spelling error in back office 2013-05-28 15:39:12 -02: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 d3ed90c23e Some fixes & refactor 2013-05-28 12:10:29 -02:00
Sebastiaan Janssen db4b93dbc3 Update test because of new added restextension (EmbedMediaService) 2013-05-27 10:21:14 -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
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
Shannon Deminick 834d04f8ed Fixes: #U4-1469, #U4-1156 2013-05-14 14:18:41 -10: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
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 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
Sebastiaan Janssen 25be0621b2 Whoops, connection string doesn't contain the datalayer here 2013-05-08 13:14:02 -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 ca99319ead Fixes: #U4-644 - DynamicNode and MVC don't output RTE values for media 2013-05-06 15:09:24 -10: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
Robert Stocks 6d66fc6cb8 Remove extra space in name of http module in web.config 2013-05-03 07:24:28 -01: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
Sebastiaan Janssen 2170380f7b Opening new branch 2013-05-01 13:07:53 -02:00
Sebastiaan Janssen 43b2a2185e Fix unit test 2013-05-01 13:02:09 -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
Shannon Deminick 6d994f48ac merged in patch for TypeFinder changes 2013-04-29 19:55:44 -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 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 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 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 461f032777 Added tag release-4.11.7 for changeset ce47176bc6b9 2013-04-25 11:17:07 -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
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
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
agrath 3594693f4b Backported fix for u4-335 from Commit b15d0ab0b879 into 4.11.7 2013-04-22 11:12:03 -12:00
Sebastiaan Janssen b99de245bf Fixes U4-2052 for new mediatypes as well 2013-04-21 09:44:08 -02: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
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
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 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 2f6dada481 Fixes issue with ctor not setting default property 2013-04-17 23:20:20 +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
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
Stephan 3b9bf7b0f9 U4-2117 - fix Ancestor- vs AncestorsOrSelf inconsistencies 2013-04-16 12:58:03 -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
Shannon Deminick 26a7bf8187 Fixes: #U4-2087 2013-04-12 02:11:01 +06: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 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 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 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 e6ccd8a5b5 Fix for U4-2081 tinymce Image picker does not work in 6.03 2013-04-09 11:33:35 -02:00
Sebastiaan Janssen 7ae8b28466 Fix the medium trust error in the about box 2013-04-09 10:20:34 -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 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 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 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 7d5589118f Merge 2013-04-06 01:43:41 +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 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 7934ba7ec4 U4-2030 - failed to update UmbracoContext on some devt webservers 2013-04-05 10:28:19 -02:00
Shannon Deminick 60b6608289 patch for fix #U4-2027 2013-04-05 06:42:52 +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 71aa248a4e Fixes U4-535 Stylesheet content gets deleted if you change case 2013-04-01 14:27:20 -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
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
Shannon Deminick 5f4eaef4a2 Fixes: #U4-2022 2013-03-29 21:31:27 +06: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 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 9452d5fd09 adds patch for #U4-1754 and updates 2013-03-27 03:08:37 +06:00
Shannon Deminick 1f40d726de adds patch for #U4-1754 2013-03-27 02:59:42 +06:00
Shannon Deminick 2699611ba3 adds patch for #U4-1754 2013-03-27 02:58:59 +06:00
Shannon Deminick b1fa06bfe8 Removes unused code. 2013-03-26 22:02:49 +06:00
Shannon Deminick 4dc22b6ce4 Applies patch for #U4-497 for getting exceptions for xslt 2013-03-26 22:02:08 +06:00
Sebastiaan Janssen 883277125a Can't use parameters here as the query gets butchered. 2013-03-26 13:27:46 -01:00
Sebastiaan Janssen ff961abaab Actual fix for U4-1987 Error when attempting to save document type 2013-03-26 09:50:48 -01:00
Sebastiaan Janssen b2414c1ab8 Fixes U4-1987 Error when attempting to save document type 2013-03-26 09:33:08 -01:00
Stephen Roberts 0e392b398c Fixed Property order for document types with Master document types. 2013-03-14 11:08:02 +00:00
Sebastiaan Janssen 5914690ad8 Allow leading sign in number field so that negative numbers are supported 2013-03-25 10:09:02 -01:00
Shannon Deminick dbbdd16bb9 Fixes: #U4-497 2013-03-23 02:34:34 +06:00
Shannon Deminick 762cca145f Fixes: #U4-1931 - allow empty string in dictionary item. 2013-03-22 21:59:21 +06:00
Morten Christensen 5cd2d568e3 Fixes U4-1938 by actually calling and checking the Before/AfterDelete events for DataTypeDefinitions.
Backported from 32fb51f603a3
2013-03-22 11:12:32 -01:00
Sebastiaan Janssen 259fbcb8f0 Fixed U4-1934 Error in comments of config files 2013-03-18 08:50:24 -01:00
Shannon Deminick db3f21429e Fixes infinite loop bug with string trimming. 2013-03-15 11:31:11 +06:00
Shannon Deminick 04b9607741 Fixes: #U4-1916 and another issue for vdirs, added unit tests, changed UI web project to always
launch in a VDIR.
2013-03-15 08:03:19 +04:00
Shannon Deminick 5bd2571395 Merge 2013-03-12 00:01:14 +04:00
Shannon Deminick c0cd157e60 applies patch for #U4-1890 2013-03-12 00:00:55 +04:00
Sebastiaan Janssen ac2f9b172c .transformed files are auto-generated and shouldn't be under source control 2013-03-11 17:15:30 -01:00
Sebastiaan Janssen b8e4a73c3b Revert Casey's mistakenly added files 2013-03-11 15:55:35 -01:00
Shannon Deminick 68c4255a51 updates proper error handling for razor script macros 2013-03-11 21:49:04 +06:00
Shannon Deminick d07212c89b Fixed changes with new MacroErrors config and how macros are rendered so it supports all macro types and also fixes up a bit of code
in the umbraco.macro class.
2013-03-11 21:06:02 +06:00
Shannon Deminick 28c55320a1 Updates the pull request for handling macro errors.
Backports fixes for partial view macros from 6.x - U4-1488, U4-1844, U4-1730, U4-1843
2013-03-11 20:11:11 +06:00
Shannon Deminick fd58017e97 imported patches for pull request spudstuff/u4497 2013-03-11 18:49:45 +06:00
Casey Neehouse 09408b898e Merge 2013-03-08 19:38:33 +05:00
Morten Christensen d1b05332c5 Manually adds fix for U4-1869 from 6.0.3 branch 2013-03-07 20:28:13 -01:00
Casey Neehouse caad0afed8 Corrects u4-1870 - Refactor Load Content SQL to check if ID is in published list
versus using a join that can cause duplicate entries.
2013-03-07 21:00:31 +05:00
Shannon Deminick 62d365573f Back ports fixes for: #U4-1614, #U4-793 - preview working properly in mvc 2013-03-06 03:17:18 +06:00
Shannon Deminick f3b7a8a581 Fixes: #U4-1471 - issue with having NewRelic installed and some sort of conflict with shutting down
our logger.
2013-03-05 23:49:45 +06:00
Shannon Deminick a765f36d24 Adds unit tests for DynamicNode and DynamicPublishedContent, fixes both when querying for recursive properties.
Fixes: #U4-1839
2013-03-05 21:00:16 +06:00
Shannon Deminick 046da1a8ce Fixes: #U4-1824 - issue with razor dynamic node property access performance enhancements. 2013-03-05 07:06:41 +06:00
Shannon Deminick ca7abd6c78 Merge 2013-03-05 06:08:59 +06:00
Shannon Deminick 7cc0f2a514 Fixes: #U4-1819 2013-03-05 05:56:53 +06:00
Shannon Deminick 4882df43bd Back merged from 6.1 the changes required for #U4-1822 and #U4-1797 2013-03-02 01:50:53 +06:00
Sebastiaan Janssen ee2943b9fb Created branch 4.11.6 2013-03-01 06:56:34 -01:00
Sebastiaan Janssen c250fa560e Restrict the NuGet .Core dependency to the same version. 2013-02-28 15:08:30 -01:00
Sebastiaan Janssen b017e8690a Fix errors in log caused by no prevalues beind selected. 2013-02-28 09:53:57 -01:00
Shannon Deminick 8a9680e75c updated unit test logic 2013-02-27 23:13:48 +06:00
Shannon Deminick 36c66e676a Fixed unit tests 2013-02-27 22:35:27 +06:00
Sebastiaan Janssen ba530061a0 Merge 2013-02-27 13:53:14 -01:00
Sebastiaan Janssen 89ae3bc143 Add RevertToCleanInstall.bat to 4.11.5 too, it's handy. 2013-02-27 13:51:58 -01:00
Shannon Deminick 3951f59d09 Merge 2013-02-27 20:46:06 +06:00
Shannon Deminick cd8c998ebf Fixes: U4-1788 - ensures internal reserved paths and urls (that cannot be modified) are stored staticly in code,
Also fixes that the _reservedPathsCache and _reservedUrlsCache actually works, before we were doing an
object.ReferenceEquals comparison which would never have worked and it was also not thread safe.
2013-02-27 20:42:11 +06:00
Sebastiaan Janssen 2cb544591b Pull in new translations 2013-02-27 12:43:21 -01:00
Stephan 1b1b5c047c U4-1779 - Web.BaseRest supports rest extensions over multiple classes 2013-02-26 16:52:06 -01:00
Sebastiaan Janssen fa5b9e5689 Typo: U4-512 "Memebertype saved" 2013-02-26 17:29:53 -01:00
Sebastiaan Janssen c26df8da6f U4-591 Access bug in dashboard 2013-02-26 15:48:22 -01:00
Shannon Deminick 1e02d85fca Fixes: #U4-1773 (backport fix from 6.0.1) 2013-02-26 21:35:09 +06:00
Shannon Deminick d1dc2331f8 Merge 2013-02-26 21:15:31 +06:00
Shannon Deminick d503deb8c5 reverted member index config, for pre 6.1 we will still need to manually set the member fields. 2013-02-26 21:07:59 +06:00
Morten Christensen 0859b92aaf Fixes U4-1781 so Saved is called when saving a DataTypeDefinition in the backoffice 2013-02-26 13:59:08 -01:00
Sebastiaan Janssen 695d26434c U4-600 Wrong membersearch.png path in MemberSearch.ascx 2013-02-26 09:48:14 -01:00
Shannon Deminick a19de645e4 Merge 2013-02-26 00:59:06 +06:00
Shannon Deminick de9a27db10 Updates to latest Examine lib (another bug fixed) 2013-02-26 00:45:42 +06:00
Sebastiaan Janssen b6d5b7d603 Fixes U4-1776 SafeAlias culture problem 2013-02-25 13:33:51 -01:00
Sebastiaan Janssen 93d7cf4dc3 Fixes U4-1776 SafeAlias culture problem 2013-02-25 13:28:54 -01:00
Tom Fulton 0c42596dc8 Fixed: U4-1678 Saving a Media should show a SpeechBubble 2013-02-25 08:39:18 -01:00
Sebastiaan Janssen 8cf9c1ba97 Fixes: U4-1769 Dictionary Item with "Illigal" character can not be deleted 2013-02-22 14:15:22 -01:00
Shannon Deminick 7a47d63b48 Fixed remaining tests 2013-02-22 19:55:22 +06:00
Sebastiaan Janssen 4648a8c103 Fixes U4-1746 Duplicate image source (src) when inserting resized image in tiny
mce (richtext editor)
2013-02-22 11:41:01 -01:00
Sebastiaan Janssen 87947871d1 Have to add new Examine version to Web.UI as well, else the build output from
build.bat file will not be able to find it.
2013-02-22 09:57:58 -01:00
Sebastiaan Janssen 87fee572ff Enable nuget package restore for teamcity, upgrade examine dll 2013-02-22 09:47:23 -01:00
Shannon Deminick 89f7a3ec63 Clearly these files shouldn't be deleted :P 2013-02-22 06:23:03 +06:00
Shannon Deminick 7092a9ccbb Reverted the macro engines and web proj's, it would seem as though 4.x on the build server hasn't
been configured for nuget package restor (or something like that)
2013-02-22 06:05:10 +06:00
Shannon Deminick e9ea9b5e1b Updates DynamicNode with some performance enhancements especially around things like HasProperty and GetProperty.
Also when it returned children, it was actually re-iterating over all children (going to the repo to find them even though
they were already resolved).
2013-02-22 05:44:17 +06:00
Shannon Deminick fd1efb29ec Fixes issue when saving settings to web.config, not sure how this error never came up before. Was missing a "\" between the path and "web.config".
Using Path.Combine is much safer than just string.Concat!
2013-02-22 04:45:20 +06:00
Shannon Deminick cf4781153e Fixes: #U4-873, #U4-888 - fixes media sorting in razor + MVC. Updates Nunit libs and Examine lib. Adds unit tests to
support new sorting fixes. Fixes up a few other issues with the legacy ExamineBackedMedia class, it will now handle all data
stored in Examine. Simplifies the Examine internal index sets to include all data.
2013-02-22 04:12:24 +06:00
Shannon Deminick ebed142cd5 Another fix for file sys test 2013-02-21 23:47:16 +06:00
Shannon Deminick d162aba14a Fix for file system test 2013-02-21 23:07:37 +06:00
Shannon Deminick ec075f5807 Merge 2013-02-21 22:38:38 +06:00
Sebastiaan Janssen dca90e6316 Merge 2013-02-21 15:09:20 -01:00
Sebastiaan Janssen df31fafec5 Update en_us umbracoembed file, had the wrong content 2013-02-21 15:06:37 -01:00
Shannon Deminick 828dc64035 Backports fix for FullpathToRoot in GlobalSettings... not sure how some unit tests have been working this whole time.
Changes UseLegacySchema default value to false... was set to true!?
un-ignores LookupByNiceUrl tests and still ensures it doesn't require a database to test by passing in an optional parameter
to LookupByNiceUrl to specify if we want to include domain lookups or not (default is true)
2013-02-21 22:02:56 +06:00
Shannon Deminick 0b74164a8e New base test class for anything relating to published content/media, un-ignores strongly typed tests. 2013-02-21 21:01:00 +06:00
Shannon Deminick 62be1b1267 un-ignores Can_Get_File_Dates in AbstractFileSystemTests... not sure why it was ignored seems to work properly. 2013-02-21 20:42:49 +06:00
Sebastiaan Janssen 85ae7e764f Merge 2013-02-21 08:52:48 -01:00
Sebastiaan Janssen 3daa624627 Fixes U4-1668 4.11.4 NiceUrl property on dynamicnode does not work until a
property has been requested from the dynamic node
2013-02-21 08:52:23 -01:00
Shannon Deminick d8af1aaf7b Changed logging in unit tests to filter out things we don't need to see 2013-02-21 03:13:16 +06:00
Shannon Deminick f2d105d8b9 Fixed #U4-814 and got all possible unit tests that were not working for DynamicNode but were working for
DynamicPublishedContent working. And fixed up the DynamicPublishedContent unit tests as these weren't working at all...
but seemed to say they did on the build server. strange.
2013-02-21 05:44:44 +06:00
Stephan 5b0a8c0668 Tests - fix build broken by back-porting 6.x code 2013-02-20 10:12:41 -01:00
Stephan c3ccf3a609 Tests - cleanup settings handling for more reliable tests 2013-02-19 18:01:52 -01:00
Stephan 60bbede408 U4-1441 - fix, fix and fix! 2013-02-19 17:49:49 -01:00
Stephan 1d0299af89 U4-1611 - bugfix 2013-02-19 13:58:16 -01:00
Shannon Deminick c2d0e255df Fixes: #U4-1537 2013-02-19 20:17:17 +06:00
Shannon Deminick 005d3e7d64 Removes area routing for local surface controllers and BeginUmbracoForm, adds strongly typed Html.Action<T>
method for rendering SurfaceController child actions regardless of area (so you don't have to specify).
All relates to #U4-1727
2013-02-19 06:19:26 +06:00
Shannon Deminick 12f8638223 Fixes: #U4-1727 2013-02-19 06:18:51 +06:00
Shannon Deminick e3f9e8c842 Fixes: #U4-552 2013-02-19 03:42:19 +06:00
Shannon Deminick a475f72d50 Fixes: #U4-1695 2013-02-19 02:25:57 +06:00
Shannon Deminick a559ef9f90 Fixes: #U4-1732 2013-02-19 00:59:21 +06:00
Sebastiaan Janssen be83302b14 Fixes U4-1451 2013-02-18 13:22:12 -01:00
Sebastiaan Janssen 83d7ea9ef1 Ignoring wrong unit test for now 2013-02-18 12:53:15 -01:00
Sebastiaan Janssen 95024442de Copy the umbracoSettings for PublishMediaStoreTests as well 2013-02-18 12:22:53 -01:00
Sebastiaan Janssen 69f54b5f22 Copy the umbracoSettings for LibraryTests as well 2013-02-18 11:57:58 -01:00
Sebastiaan Janssen 3404f95b2e Forgot one trailing slash in previous commit 2013-02-18 11:42:45 -01:00
Sebastiaan Janssen e56738481b Adding trailing slash to failing routing tests.
The issue with these tests might again be because of the UmbracoSettings file, which has the trailing slash setting. But with the settings being reset after teardown the tests were still failing, so made these minor corrections which shoudl correspond to the default setting.
2013-02-18 11:38:07 -01:00
Sebastiaan Janssen cb59dc353b Update version to 4.11.5 2013-02-18 10:31:43 -01:00
Sebastiaan Janssen d1b75eac08 Update wrong config path in unit tests 2013-02-18 10:31:17 -01:00
Sebastiaan Janssen 8fabd4e4ed Merge 2013-02-15 12:05:46 -01:00
Sebastiaan Janssen 564d92bed7 Possible fix for TeamCity 2013-02-15 12:05:25 -01:00
Shannon Deminick 95f103ccc2 Merge 2013-02-15 18:55:50 +06:00
Stephan 0ace2fdae7 U4-1611 - fix xpath special chars escaping issues in published content store 2013-02-14 16:31:45 -01:00
Stephan 5da3541584 U4-1441 - bugfix 2013-02-14 16:27:27 -01:00
Shannon Deminick ef86d2f1f1 Manually applies patch for #U4-1718 2013-02-14 23:26:29 +06:00
Sebastiaan Janssen a10a6d1af8 Need to wrap the login javascript in a placeholder for Concorde 2013-02-14 09:06:15 -01:00
Stephan 6d87174cc1 U4-1441 - improve logging 2013-02-08 07:54:16 -01:00
Stephan 9af9c3fe77 U4-1441 - change trySkipIisCustomError config key 2013-02-08 07:36:35 -01:00
Stephan 9cedf5da4c U4-1441 - make trySkipIisCustomError value a setting 2013-02-08 08:08:36 -01:00
Shannon Deminick 906d675dca Merge 2013-02-07 02:09:32 +06:00
Shannon Deminick f1b3105202 Patch for #U4-1653 - media library cache refresh issue 2013-02-06 20:56:47 +06:00
Shannon Deminick 3ebb213916 Patches installer issue. 2013-02-06 19:18:42 +06:00
Stephan a65ca205de U4-1441 - fix issue with IIS taking over custom errors 2013-02-05 16:29:10 -01:00
Stephan 3e1120612b Update version number 2013-02-04 12:00:58 -01:00
Stephan 8d06d39a62 Create branch for 4.11.5 2013-02-04 11:59:30 -01:00
Stephan da7fea47c6 U4-1441 - refactor (fix) legacy NotFoundHandler support 2013-02-03 14:34:04 -01:00
Shannon Deminick f2442b25f6 Close 4.11.4 branch 2013-02-01 19:25:12 +06:00
Sebastiaan Janssen 300d3ff09b Added tag Release-4.11.4 for changeset e02f5aebb87e 2013-02-01 08:41:26 -01:00
Sebastiaan Janssen e6337b8f14 Properly reference uGoLive MyGet package 2013-02-01 08:38:13 -01:00
Sebastiaan Janssen 2be785ace3 Merge 2013-02-01 08:16:18 -01:00
Sebastiaan Janssen 5e2d991fab Update uGoLive 2013-02-01 08:16:10 -01:00
Morten Christensen 536cb4caf1 Fixes U4-1571 2013-02-01 07:42:51 -01:00
Morten Christensen 27745ea141 Fixes U4-1483 2013-02-01 07:35:48 -01:00
Sebastiaan Janssen 5289c55740 Translation updates 2013-02-01 07:24:21 -01:00
Sebastiaan Janssen 791773fc8a Add some more translations 2013-02-01 07:23:33 -01:00
Shannon Deminick 1da27e6c2b Removes all upgrade script stuff since we've deployed the fix in a package. 2013-02-01 06:42:42 +06:00
Shannon Deminick a909b7904e Fixes uGoLive ascx 2013-02-01 05:29:54 +06:00
Shannon Deminick 1b1abce7da Merge 2013-01-31 04:48:29 +06:00
Shannon Deminick fbc10be381 Reverted logic of Document to be what it used to be... Published and HasPublishedVersion() are the same and will
return the same thing, though we've kept the lazy loading and optimizations.
2013-01-31 04:46:51 +06:00
Shannon Deminick 61f2647b62 missing file 2013-01-31 04:26:47 +06:00
Shannon Deminick a5bea7fc59 Added the ability to automate any c# scripts for an upgrade process. I realize this is superceded already in 6.0
but we need a way to do this in 4.x too especially for this release since we need to run a script to fix some db
issues. I've added a framework using an UpgradeScriptManager and another install step + unit tests for some of the
UpgradeScriptManager methods.
2013-01-31 04:26:37 +06:00
Sebastiaan Janssen b9be5c2561 Also implement optimization in fdfa687e6f41 to v4: no need to try and republish
the child pages if the page you are trying to publish was already published
2013-01-30 15:01:38 -01:00
Shannon Deminick 97556de447 Changed methods created yesterday to internal so we can port to 6+ nicely. 2013-01-30 18:58:42 +06:00
netaddicts d5bde0d8df Makes sure preview is not using cached versions of any macro 2013-01-24 11:00:15 -01:00
Sebastiaan Janssen cc5ca0b5fe Fixing U4-359 Previewing new nested pages doesn't work 2013-01-30 09:21:43 -01:00
Shannon Deminick 0cb9cc6840 just cleaned up some code formatting. 2013-01-30 07:59:15 +06:00
Shannon Deminick d38d7b1ff4 Updates all code calling UnPublishSingleNode & UpdateDocumentCache to pass in the already existing Document object if there is one
instead of the ID... this'll save a another ton of SQL calls.
2013-01-30 07:59:03 +06:00
Shannon Deminick 2d87f933d5 Updates Document's Published property to return true if the document is 100% published (viewable on the front-end)
Reverts Document's HasPublishedVersion() to return true if the document has any published version (may or may not be viewable on the front-end)
Updates the Document's new UpdatePublishedOnDescendants to set both the Published and PathPublished fields.
Reverts some stuff in the editContent to use HasPublishedContent() to set the _documentHasPublishedVersion field.
Reverts the BaseContentTree to use the Published property now that it returns the correct value.
Updates the editContent method to use the UpdateDocumentCache overload accepting an object so there's not another N+1 SQL call made.
2013-01-30 07:57:31 +06:00
Shannon Deminick a734a0cff7 Fixes unit tests for Umbraco_Route_User_Defined_Controller_Action 2013-01-30 05:37:32 +06:00
Shannon Deminick d0ace55d03 Fixes: #U4-1593 - Content tree doesn't check for correct publish state. 2013-01-30 05:04:31 +06:00
Shannon Deminick 3fda0308ac Fixes: #U4-1594 - SQL for SqlOptimizedSingle not correct for published state
Fixes: #U4-1596 - new GetPathPublishedDescendants method on Document for optimizations
Fixes: #U4-1595 - Obsoletes HasPublishedVersion() method and ensures lazy loading of Published property,
as well as ensuring that the backing property is set correctly on first load (optmization)
Fixes: #U4-1597 - PathPublished property should be set in an optimized way and/or lazy loaded if it cannot be
2013-01-30 04:56:28 +06:00
Shannon Deminick d796b2afc1 Fixes: #U4-1170 - template with hyphen or dash 2013-01-29 21:19:16 +06:00
Shannon Deminick f95cfc2ee0 Changes v4.x config transforms 2013-01-29 21:18:17 +06:00
Shannon Deminick c5d1439422 Fixes: #U4-1458 - due to a null check on PublishedContentRequest on UmbracoContext 2013-01-29 08:35:09 +06:00
Shannon Deminick 5e9f4559b6 Fixes: #U4-1536 2013-01-29 07:49:14 +06:00
Shannon Deminick 4bbb0441a6 Merge 2013-01-29 05:50:50 +06:00
Shannon Deminick 4cf1d7d9a4 Fixes: #U4-1577 - HasPublishedVersion checks for trashed 2013-01-29 05:48:18 +06:00
Shannon Deminick a6a3ddca75 Fixes: #U4-1580 - m_SQLOptimizedMany includes the 'trashed' flag which can be used by business logic. 2013-01-29 05:37:14 +06:00
Shannon Deminick 27cfa85d3a Fixes: #U4-1579 - moving a node doesn't update the descendants of that node's level or path. 2013-01-29 04:39:44 +06:00
Shannon Deminick a9e1e7b634 Updating: #U4-1491 - Updated HasPublishedVersion() to ensure it checks for 'newest' 2013-01-29 03:42:58 +06:00
leekelleher 9f5f920c81 MNTP: Corrected a typo in the example XPath (additional apostrophe) 2013-01-28 17:18:20 +00:00
Shannon Deminick f9a0d91299 Fixes: #U4-1527 - Creates a public property on UmbracoHelper to return the currently assigned IPublishedContent of the UmbracoHelper. 2013-01-25 06:04:10 +03:00
Shannon Deminick 82c2560822 Ensures all resolvers are sealed. Changes CacheRefreshersResolver, DataTypesResolver, MacroFieldEditorsResolver, PackageActionsResolver, ActionsResolver
to all be lazy resolvers as they are not needed instantly on app startup (not needed by the front-end) This will
make app startup a lot quicker. Fixes ActionsResolver to not use the PluginManager to resolve the types when it
is instantiating them since these are passed in the ctor. Updates all unit tests to use lazy delegate for these resolvers
and they are all passing.
2013-01-23 18:40:40 +03:00
Shannon Deminick f467b8cb6c Adds more functionality for LazyManyObjectsResolverBase - adding type list delegates for lazy resolution. 2013-01-23 17:39:07 +03:00
Shannon Deminick aea1a03453 Updates ManyObjectsResolverBase to properly check for resolution freezing and fixes a few issues found regarding
inheritance in complex situations like the new LazyManyObjectsResolverBase.
Creates the new LazyManyObjectsResolverBase to lazily resolve types in order to create them. This is for
work item : #U4-1522
Adds unit test to support.
2013-01-23 07:45:00 +03:00
Shannon Deminick 1568e5f19c updated comments. 2013-01-23 01:44:01 +03:00
Shannon Deminick 8dff47db78 Merge 2013-01-23 01:39:45 +03:00
Shannon Deminick 987e48733a Merge 2013-01-23 01:39:25 +03:00
pcw@pcw-PC.shout.local ac5142443a Fixed EncryptWithMachineKey to handle values longer than FormsAuthentication.Encrypt max length limit
http://issues.umbraco.org/issue/U4-1455
2013-01-15 20:40:28 +00:00
pcw@pcw-PC.shout.local 44360d83aa Fixed EncryptWithMachineKey to handle values longer than FormsAuthentication.Encrypt max length limit
http://issues.umbraco.org/issue/U4-1455
2013-01-15 20:20:05 +00:00
pcw@pcw-PC.shout.local 021cb817d4 Fixed EncryptWithMachineKey to handle values longer than FormsAuthentication.Encrypt max length limit
http://issues.umbraco.org/issue/U4-1455
2013-01-15 20:17:12 +00:00
pcw@pcw-PC.shout.local f4f91fba78 Fixed EncryptWithMachineKey to handle values longer than FormsAuthentication.Encrypt max length limit
http://issues.umbraco.org/issue/U4-1455
2013-01-15 20:09:29 +00:00
pcw@pcw-PC.shout.local dec5e8ad6c Fixed EncryptWithMachineKey to handle values longer than FormsAuthentication.Encrypt max length limit
http://issues.umbraco.org/issue/U4-1455
2013-01-15 20:07:07 +00:00
Sebastiaan Janssen a6b2196c10 Make sure the filename gets set correctly if we're building the release locally 2013-01-15 16:18:24 -01:00
Max Rotvel 4321c8d24e Fix part of U4-1355 by making umbracoembed translatable and supply da lang files 2013-01-15 14:33:25 -01:00
NielsHartvig@UMBRACORATI.localdomain 4cff3a3c28 Fixed U4-1439 4.11.2 DataEditorSetting not working for UserControl wrapper. 2013-01-15 13:18:37 -01:00
Shannon Deminick 5458c9a310 Adds Encryption/Decryption string extension methods that work in medium trust, with unit tests. 2013-01-15 01:35:10 +03:00
Shannon Deminick 0045ec353f Apply patch for #U4-1156 - IFileSystem public changes. 2013-01-15 01:27:44 +03:00
Shannon Deminick 716d3e95f1 Imported patches from 6.0 for #U4-1453, #U4-1454 2013-01-15 00:58:11 +03:00
Shannon Deminick beeb28f390 Fixes #U4-1467 2013-01-15 00:23:40 +03:00
Sebastiaan Janssen 080e8816a5 Remove non-existing files from project.. 2013-01-14 17:01:32 -01:00
Sebastiaan Janssen f7eb323bd5 Updated razor templates 2013-01-14 14:04:33 -01:00
Sebastiaan Janssen 0f484fdf49 Improve build so that you can't forget to set the version number, the version in
GlobalSettings.cs will be updated with the version configured in build.bat
2013-01-14 10:55:59 -01:00
Sebastiaan Janssen d779422bf4 U4-1457 Missing File for "English (US)" Language Option 2013-01-14 09:08:23 -01:00
Stephan 11ea698969 U4-1017 - more explicit error message on internal cache errors 2013-01-12 10:40:42 -01:00
Shannon Deminick 0e0e6b5c41 Fixes: #U4-1451 2013-01-13 23:24:02 +03:00
Sebastiaan Janssen 4c218621c6 Fixes: #U4-1405 - Added DynamicXmlConverter's 2013-01-14 08:57:49 -01:00
Sebastiaan Janssen c150a91e50 Update uGoLive & Fixes U4-1447 uGolive result: Unable to find node
/configuration/system.web/compilation/@debug in config file web.config
2013-01-14 08:43:50 -01:00
Sebastiaan Janssen 7be9a0a987 Update version to 4.11.4 2013-01-14 08:42:54 -01:00
Sebastiaan Janssen 50589c0911 Removed tag Release-4.11.3.1 2013-01-12 17:30:08 -01:00
Sebastiaan Janssen e61ae618e8 Added tag Release-4.11.3.1 for changeset e4d0c7e74055 2013-01-12 17:30:05 -01:00
Sebastiaan Janssen 930e6a0989 Forgot some parenthesis .. 2013-01-12 17:29:48 -01:00
Sebastiaan Janssen 7c50b32684 Merge with 4.11.3 2013-01-12 17:06:10 -01:00
Sebastiaan Janssen 0f7daf7ebd Closing branch 4.11.3 2013-01-12 17:05:45 -01:00
Sebastiaan Janssen 12cbc2a9c5 Added tag Release-4.11.3 for changeset baa44b79cf90 2013-01-12 17:04:25 -01:00
Sebastiaan Janssen 959d263619 Update the build files to build more automatically (like v6) 2013-01-12 17:02:52 -01:00
Sebastiaan Janssen 6a1fb52b25 Fixes U4-1442 This must be a bug. 4.11.2.2 can't create Macro. 2013-01-12 14:41:21 -01:00
Sebastiaan Janssen 18cd043421 Open branch for 4.11.3 and updated version number 2013-01-12 14:24:27 -01:00
Sebastiaan Janssen ddb2f82aba Added tag Release-4.11.2.2 for changeset 54cde33b809d 2013-01-11 12:31:27 -01:00
Sebastiaan Janssen 6c99e7951f Forgot to update the version for 4.11.2.1 - oops.. Updating again! 2013-01-11 12:25:23 -01:00
Sebastiaan Janssen e44e745761 Merge with 4.11.2 2013-01-11 09:35:46 -01:00
Sebastiaan Janssen 30c11439e4 Re-closing branch 4.11.2 2013-01-11 09:34:55 -01:00
Sebastiaan Janssen 0883f621f6 Update NuGet and making automation better for the dummy files 2013-01-11 09:24:47 -01:00
Sebastiaan Janssen 2d0784d1e5 Added tag Release-4.11.2.1 for changeset 77db220b89e1 2013-01-11 08:31:58 -01:00
Sebastiaan Janssen af0011f32a Fixes U4-1432 4.11.2 - Tinymce strips 'src' attribute from images 2013-01-11 08:23:31 -01:00
Stephan 6cb3fcf9ad U4-1411 - fix post-4.9 regression in NotFoundHandler url 2013-01-08 16:41:31 -01:00
Sebastiaan Janssen e5878554bd Fixes U4-1482 Regression - RTE unable to edit hyperlink on image 2013-01-21 14:21:29 -01:00
Sebastiaan Janssen 44c8c4b5b8 Revert 024896ba7bcf as it's a breaking change 2013-01-18 08:47:38 -01:00
Shannon Deminick c0b5525dd7 Removed 'Boot' method from WebBootManager as it was never supposed to be there in the first place.
Removed test code from 'SurfaceController'.
Added comments to IApplicationEventHandler.
2013-01-18 02:31:51 +03:00
Sebastiaan Janssen 36f8a8e1dd Fixed U4-1492 Insert image in RTE gives null reference error 2013-01-17 14:17:04 -01:00
Sebastiaan Janssen 16f73b56ab Weird failing test for getting the date of a file, works only 10% of the time.. 2013-01-17 09:53:47 -01:00
Sebastiaan Janssen 47dc2e6214 Merge 2013-01-17 09:18:12 -01:00
Sebastiaan Janssen c6483f0380 Revert e4bb9041cf54 as it was a breaking change 2013-01-17 09:16:45 -01:00
NielsHartvig@UMBRACORATI.localdomain 168b38b2a3 Update to U4-1485 for 4.11.4 2013-01-17 08:47:42 -01:00
NielsHartvig@UMBRACORATI.localdomain 70ca4ac913 Fixes U4-1485 Booting.aspx has potential Open Redirect flaw 2013-01-17 08:38:09 -01:00
Sebastiaan Janssen 72099192b5 My bad, teamcity wasn't building the test project before running tests :) 2013-01-16 17:01:00 -01:00
Sebastiaan Janssen ea48128869 The nunit console runner is being such a tease, ignoring the [Ignore] attribute 2013-01-16 16:44:50 -01:00
Sebastiaan Janssen f0b22146c8 Ignore tests that have been failing for AGES 2013-01-16 16:31:15 -01:00
Sebastiaan Janssen fe0d94687a Use the original workaround for now 2013-01-16 16:25:54 -01:00
Sebastiaan Janssen 238c3d38e8 Un-ignore .exe files 2013-01-16 15:37:31 -01:00
Sebastiaan Janssen 6af4f1f2c6 Corrected the path for the tools folder 2013-01-16 15:21:43 -01:00
Sebastiaan Janssen e215fb056f Work around for TeamCity NUnit test runner see:
http://umbraco.com/follow-us/blog-archive/2013/1/16/make-teamcity-respect-failing-nunit-tests-and-stop-the-build.aspx
2013-01-16 15:19:45 -01:00
648 changed files with 29558 additions and 62453 deletions
+80
View File
@@ -0,0 +1,80 @@
*.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/
+4 -2
View File
@@ -2,7 +2,6 @@
syntax: glob
*.obj
*.exe
*.pdb
*.user
*.aps
@@ -38,6 +37,7 @@ src\Umbraco.Web.UI\macroScripts\*
src\Umbraco.Web.UI\xslt\*
src\Umbraco.Web.UI\images\*
src\Umbraco.Web.UI\scripts\*
src\Umbraco.Web.UI\Web.*.config.transformed
umbraco\presentation\umbraco\plugins\uComponents\uComponentsInstaller.ascx
umbraco\presentation\packages\uComponents\MultiNodePicker\CustomTreeService.asmx
@@ -58,4 +58,6 @@ src/Umbraco.Tests/config/umbracoSettings.config
src/Umbraco.Web.UI/App_Plugins/*
src/Umbraco.Web.UI/Views/*
src\Umbraco.Web.UI\[W]eb.config
src\Umbraco.Web.UI\[W]eb.config
src/packages/
build/*.zip
+10
View File
@@ -20,3 +20,13 @@ f6da531fbb4c251ff61d314e2a7effb13c71e74a Release-4.10.0
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
baa44b79cf90a60631e38e11f771c200b08a4583 Release-4.11.3
e4d0c7e740555d8707ba71f55a623a3f96da8e65 Release-4.11.3.1
e4d0c7e740555d8707ba71f55a623a3f96da8e65 Release-4.11.3.1
0000000000000000000000000000000000000000 Release-4.11.3.1
e02f5aebb87e3f07d27376647756caa9762931d8 Release-4.11.4
14338b0ab1738fbd8987677ecdb9a73d79fc229d release-4.11.6
ce47176bc6b9298741783e20f1fe2672c811f744 release-4.11.7
fb8fd83e8e706f8249f423e8acf52f5c12aa9f73 release-4.11.9
-3
View File
@@ -1,3 +0,0 @@
NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec
NuGet.exe pack NuSpecs\UmbracoCms.nuspec
REM pause
+17 -1
View File
@@ -1,5 +1,21 @@
@ECHO OFF
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj"
set version=4.11.10
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%version%
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
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_Data\dummy.txt
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_Plugins\dummy.txt
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\css\dummy.txt
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\macroScripts\dummy.txt
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\masterpages\dummy.txt
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\media\dummy.txt
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\scripts\dummy.txt
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\usercontrols\dummy.txt
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\xslt\dummy.txt
NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
NuGet.exe pack NuSpecs\UmbracoCms.nuspec -Version %version%
if ERRORLEVEL 1 goto :showerror
+12 -29
View File
@@ -24,6 +24,9 @@
<PropertyGroup Condition="'$(BUILD_NUMBER)'!=''">
<DECIMAL_BUILD_NUMBER>.$(BUILD_NUMBER)</DECIMAL_BUILD_NUMBER>
</PropertyGroup>
<PropertyGroup Condition="'$(BUILD_RELEASE)'!=''">
<DECIMAL_BUILD_NUMBER>.$(BUILD_RELEASE)</DECIMAL_BUILD_NUMBER>
</PropertyGroup>
<PropertyGroup>
<BuildConfiguration>Release</BuildConfiguration>
@@ -160,7 +163,7 @@
<Message Text="Finished offsetting timestamps" Importance="high" />
</Target>
<Target Name="CompileProjects">
<Target Name="CompileProjects" DependsOnTargets="SetVersionNumber">
<Message Text="Compiling web project to build\$(BuildFolder)" Importance="high" />
<!-- For UseWPP_CopyWebApplication=True see http://stackoverflow.com/questions/1983575/copywebapplication-with-web-config-transformations -->
@@ -169,7 +172,7 @@
<!--
Now, because of all the circular dependencies we need to build those projects and have them dump their DLLs/assets out to the same folder. Really wish this wasn't the case!
These are: umbraco.editorControls umbraco.webservices umbraco.MacroEngines
These are: umbraco.editorControls umbraco.MacroEngines
Each of these projects has a post build to put their stuff in the correct location based on the solution and unfortunately for us each
of these projects references the web application! So if we specify an OutDir parameter it will also trigger a web deploy and chuck another
@@ -201,37 +204,17 @@
<Copy SourceFiles="@(EditorControlsDll)"
DestinationFolder="$(WebAppFolder)\bin" OverwriteReadOnlyFiles="True"/>
<!-- WEBSERVICES -->
<Message Text="Compiling webservices project" Importance="high" />
<MSBuild Projects="..\src\umbraco.webservices\umbraco.webservices.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);" Targets="Clean;Build;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
</MSBuild>
<ItemGroup>
<WebServicesDll Include="..\src\umbraco.webservices\bin\$(BuildConfiguration)\umbraco.webservices.dll"/>
<WebServicesASMX Include="..\src\umbraco.webservices\*.asmx"/>
</ItemGroup>
<Copy SourceFiles="@(WebServicesDll)"
DestinationFolder="$(SolutionBinFolder)" OverwriteReadOnlyFiles="True"/>
<Copy SourceFiles="@(WebServicesDll)"
DestinationFolder="$(WebAppFolder)\bin" OverwriteReadOnlyFiles="True"/>
<Copy SourceFiles="@(WebServicesASMX)"
DestinationFolder="$(WebAppFolder)\umbraco\webservices\api" OverwriteReadOnlyFiles="True"/>
<!-- SQLCE4UMBRACO -->
<!--<Message Text="Compiling SQLCE4Umbraco project" Importance="high" />
<MSBuild Projects="..\src\SQLCE4Umbraco\SQLCE4Umbraco.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);" Targets="Clean;Build;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
</MSBuild>
<ItemGroup>
<SQLCE4UmbracoDll Include="..\src\SQLCE4Umbraco\bin\$(BuildConfiguration)\SQLCE4Umbraco.dll" />
</ItemGroup>
<Copy SourceFiles="@(SQLCE4UmbracoDll)"
DestinationFolder="$(SolutionBinFolder)" OverwriteReadOnlyFiles="True"/>
<Copy SourceFiles="@(SQLCE4UmbracoDll)"
DestinationFolder="$(WebAppFolder)\bin" OverwriteReadOnlyFiles="True"/>-->
<!-- DONE -->
<Message Text="Finished compiling projects" Importance="high" />
</Target>
<Target Name="SetVersionNumber" Condition="'$(BUILD_RELEASE)'!=''">
<!-- Match & replace 3 and 4 digit version numbers and -beta (if it's there) -->
<FileUpdate Files="..\src\Umbraco.Core\Configuration\GlobalSettings.cs"
Regex="(\d+)\.(\d+)\.(\d+)(.(\d+))?(-([a-zA-Z]+))?"
ReplacementText="$(BUILD_RELEASE)"/>
</Target>
<Target Name="AfterBuild">
<Message Text="Hi" />
</Target>
+2 -2
View File
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>UmbracoCms.Core</id>
<version>4.11.2</version>
<version>$version$</version>
<title>Umbraco Cms Core Binaries</title>
<authors>Morten Christensen</authors>
<owners>Umbraco HQ</owners>
@@ -26,6 +26,7 @@
<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\Lucene.Net.dll" target="lib\Lucene.Net.dll" />
<file src="..\_BuildOutput\WebApp\bin\log4net.dll" target="lib\log4net.dll" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.ApplicationBlocks.Data.dll" target="lib\Microsoft.ApplicationBlocks.Data.dll" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.Web.Helpers.dll" target="lib\Microsoft.Web.Helpers.dll" />
<file src="..\_BuildOutput\WebApp\bin\Microsoft.Web.Infrastructure.dll" target="lib\Microsoft.Web.Infrastructure.dll" />
@@ -50,7 +51,6 @@
<file src="..\_BuildOutput\WebApp\bin\umbraco.macroRenderings.dll" target="lib\umbraco.macroRenderings.dll" />
<file src="..\_BuildOutput\WebApp\bin\umbraco.providers.dll" target="lib\umbraco.providers.dll" />
<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.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" />
+5 -2
View File
@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>UmbracoCms</id>
<version>4.11.2</version>
<version>$version$</version>
<title>Umbraco Cms</title>
<authors>Morten Christensen</authors>
<owners>Umbraco HQ</owners>
@@ -15,7 +15,7 @@
<language>en-US</language>
<tags>umbraco</tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="4.11.2" />
<dependency id="UmbracoCms.Core" version="[$version$]" />
</dependencies>
</metadata>
<files>
@@ -27,16 +27,19 @@
<file src="..\_BuildOutput\WebApp\scripts\**" target="Content\scripts" />
<file src="..\_BuildOutput\WebApp\usercontrols\**" target="Content\usercontrols" />
<file src="..\_BuildOutput\WebApp\xslt\**" target="Content\xslt" />
<file src="..\_BuildOutput\WebApp\Views\**" target="Content\Views" />
<file src="..\_BuildOutput\WebApp\default.aspx" target="Content\default.aspx" />
<file src="..\_BuildOutput\WebApp\Web.config" target="Content\Web.config" />
<file src="..\_BuildOutput\WebApp\App_Browsers\**" target="UmbracoFiles\App_Browsers" />
<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\install\**" target="UmbracoFiles\install" />
<file src="..\_BuildOutput\WebApp\umbraco\**" target="UmbracoFiles\umbraco" />
<file src="..\_BuildOutput\WebApp\umbraco_client\**" target="UmbracoFiles\umbraco_client" />
<file src="..\_BuildOutput\WebApp\Web.config" target="UmbracoFiles\Web.config" />
<file src="..\_BuildOutput\WebApp\Global.asax" target="UmbracoFiles\Global.asax" />
<file src="tools\install.ps1" target="tools\install.ps1" />
<file src="tools\Readme.txt" target="tools\Readme.txt" />
</files>
+128
View File
@@ -0,0 +1,128 @@
@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 Removing sqlce database
del ..\src\Umbraco.Web.UI\App_Data\Umbraco.sdf
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 Removing sqlce database
del ..\src\Umbraco.Web.UI\App_Data\Umbraco.sdf
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 "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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
</configuration>
Binary file not shown.
+152
View File
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
<!-- Property that enables building a package from a project -->
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
<!-- Determines if package restore consent is required to restore packages -->
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
</PropertyGroup>
<ItemGroup Condition=" '$(PackageSources)' == '' ">
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
<!--
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="https://my-nuget-source/nuget/" />
-->
<PackageSource Include="https://nuget.org/api/v2/" />
<PackageSource Include="http://www.myget.org/F/umbracocore/" />
</ItemGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
<!-- Windows specific commands -->
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
<PackagesConfig>packages.config</PackagesConfig>
</PropertyGroup>
<PropertyGroup>
<!-- NuGet command -->
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\nuget.exe</NuGetExePath>
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
<!-- Commands -->
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) "</RestoreCommand>
<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'">
RestorePackages;
$(ResolveReferencesDependsOn);
</ResolveReferencesDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>
<Target Name="CheckPrerequisites">
<!-- Raise an error if we're unable to locate nuget.exe -->
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
<SetEnvironmentVariable EnvKey="VisualStudioVersion" EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' " />
<!--
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
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" />
</Target>
<Target Name="_DownloadNuGet">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
</Target>
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
Condition=" '$(OS)' != 'Windows_NT' " />
<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true"
Condition=" '$(OS)' == 'Windows_NT' " />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Net" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
OutputFilename = Path.GetFullPath(OutputFilename);
Log.LogMessage("Downloading latest version of NuGet.exe...");
WebClient webClient = new WebClient();
webClient.DownloadFile("https://nuget.org/nuget.exe", OutputFilename);
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<EnvKey ParameterType="System.String" Required="true" />
<EnvValue ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
}
catch {
}
]]>
</Code>
</Task>
</UsingTask>
</Project>
-38
View File
@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="INDIGO64 Tests" id="338122db-6049-471e-b696-cbaf25469edc" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Description>This is a default test run configuration for a local test run.</Description>
<Execution>
<Hosts type="ASP.NET" skipUnhostableTests="false">
<AspNet name="ASP.NET" executionType="Iis" urlToTest="http://sandbox1.umbraco.local">
<DevelopmentServer pathToWebSite="C:\Development\CodePlex\Umbraco\branches\4.1.0\umbraco\presentation" webApplicationRoot="/" />
</AspNet>
</Hosts>
<TestTypeSpecific>
<UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
<AssemblyResolution>
<TestDirectory useLoadContext="true" />
</AssemblyResolution>
</UnitTestRunConfig>
<WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
<Browser name="Internet Explorer 7.0">
<Headers>
<Header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" />
<Header name="Accept" value="*/*" />
<Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
<Header name="Accept-Encoding" value="GZIP" />
</Headers>
</Browser>
</WebTestRunConfiguration>
</TestTypeSpecific>
<AgentRule name="LocalMachineDefaultRole">
<DataCollectors>
<DataCollector uri="datacollector://microsoft/TraceDebugger/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.TraceDebuggerDataCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="IntelliTrace">
</DataCollector>
<DataCollector uri="datacollector://microsoft/HttpProxy/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TraceCollector.HttpProxyCollector, Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Client Proxy for IntelliTrace and Test Impact">
</DataCollector>
<DataCollector uri="datacollector://microsoft/AspNetProfiler/1.0" assemblyQualifiedName="Microsoft.VisualStudio.PerformanceTools.DataCollection.AspNetProfileDataCollector, Microsoft.VisualStudio.PerformanceTools.DataCollection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="ASP.NET Profiler">
</DataCollector>
</DataCollectors>
</AgentRule>
</Execution>
</TestSettings>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--Created with Liquid XML Studio - FREE Community Edition 7.0.5.906 (http://www.liquid-technologies.com)-->
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="DocumentTypes">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="DocumentType">
<xs:annotation>
<xs:documentation>Repesents an Umbraco Document Type and its known properties</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent mixed="false">
<xs:extension base="BaseStructure">
<xs:sequence>
<xs:element name="Description" type="xs:string" />
<xs:element name="Properties">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Property">
<xs:complexType>
<xs:complexContent mixed="false">
<xs:extension base="BaseStructure">
<xs:sequence>
<xs:element name="Mandatory" type="xs:boolean" />
<xs:element name="RegularExpression" type="xs:string" />
<xs:element name="Type" type="xs:string" />
<xs:element name="ControlId" type="xs:string" />
<xs:element name="Description" type="xs:string" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Associations">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="Association" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ParentId" type="xs:int" use="required" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="DataContextName" use="required">
<xs:annotation>
<xs:documentation>Name prefix for the DataContext that will be generated</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string" />
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Serialization" use="required">
<xs:annotation>
<xs:documentation>Serialization mode of the generated classes</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="None" />
<xs:enumeration value="Unidirectional" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="PluralizeCollections" type="xs:boolean" use="required" />
</xs:complexType>
</xs:element>
<xs:complexType name="BaseStructure">
<xs:annotation>
<xs:documentation>Pairing of ID and Name</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Id" type="xs:int" />
<xs:element name="Name" type="xs:string" />
<xs:element name="Alias" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:schema>
@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="nodeType">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="data">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="alias" type="xs:string" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="node" type="nodeType" />
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required" />
<xs:attribute name="version" type="xs:string" use="required" />
<xs:attribute name="parentID" type="xs:int" use="required" />
<xs:attribute name="level" type="xs:int" use="required" />
<xs:attribute name="writerID" type="xs:int" use="required" />
<xs:attribute name="creatorID" type="xs:int" use="required" />
<xs:attribute name="nodeType" type="xs:int" use="required" />
<xs:attribute name="template" type="xs:int" use="required" />
<xs:attribute name="sortOrder" type="xs:int" use="required" />
<xs:attribute name="createDate" type="xs:dateTime" use="required" />
<xs:attribute name="updateDate" type="xs:dateTime" use="required" />
<xs:attribute name="nodeName" type="xs:string" use="required" />
<xs:attribute name="urlName" type="xs:string" use="required" />
<xs:attribute name="writerName" type="xs:string" use="required" />
<xs:attribute name="creatorName" type="xs:string" use="required" />
<xs:attribute name="nodeTypeAlias" type="xs:string" use="required" />
<xs:attribute name="path" type="xs:string" use="required" />
</xs:complexType>
<xs:element name="root">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="node" type="nodeType" />
</xs:sequence>
<xs:attribute name="id" type="xs:int" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>
@@ -1,83 +0,0 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{324A7FA9-8F19-4D4D-B96A-6F673C82BC92}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>umbraco.LinqCore.Mockable.Tests</RootNamespace>
<AssemblyName>umbraco.LinqCore.Mockable.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug - Fixed Version|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug - Fixed Version\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Rhino.Mocks, Version=3.5.0.1337, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\dep\Reference Assemblies\Mocking\Rhino.Mocks.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Solution Items\SolutionInfo.cs">
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="DataContextMockTest.cs" />
<Compile Include="MyUmbraco.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\umbraco.Linq.Core.csproj">
<Project>{31CAEC36-0C3D-4D69-B092-84866811EA07}</Project>
<Name>umbraco.Linq.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,84 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Rhino.Mocks;
using umbraco.Linq.Core;
using umbraco.Test;
namespace umbraco.LinqCore.Mockable.Tests
{
/// <summary>
/// Summary description for DataContextMockTest
/// </summary>
[TestClass]
public class DataContextMockTest
{
public DataContextMockTest()
{
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod]
public void DataContextMockTest_MockProvider()
{
var dataProvider = MockRepository.GenerateMock<UmbracoDataProvider>();
using (var ctx = new MyUmbracoDataContext(dataProvider))
{
}
}
[TestMethod, ExpectedException(typeof(NotImplementedException))]
public void DataContextMockTest_MockProviderThrowsException()
{
var dataProvider = MockRepository.GenerateMock<UmbracoDataProvider>();
dataProvider.Stub(d => d.LoadTree<CwsHome>()).Throw(new NotImplementedException());
using (var ctx = new MyUmbracoDataContext(dataProvider))
{
var homes = ctx.CwsHomes;
}
}
}
}
File diff suppressed because it is too large Load Diff
@@ -1,9 +0,0 @@
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Core")]
@@ -1,118 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for AncestorTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class AncestorTest
{
public AncestorTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void AncestorTest_NoWhereCondition_Exists()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var textPage = ctx.CWSTextpages.First();
var hp = textPage.AncestorOrDefault<CWSHome>();
Assert.IsNotNull(hp);
}
}
[TestMethod, Isolated]
public void AncestorTest_NoWhereCondition_NotExists()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var textPage = ctx.CWSTextpages.First();
var a = textPage.AncestorOrDefault<CWSPhoto>();
Assert.IsNull(a);
}
}
[TestMethod, Isolated]
public void AncestorTest_Where_Exists()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var photo = ctx.CWSPhotos.First(p => p.Name.Contains("Umbraco"));
var gallery = photo.AncestorOrDefault<CWSGallery>(g => g.Name.Contains("Codegarden"));
Assert.IsNotNull(gallery);
}
}
[TestMethod, Isolated]
public void AncestorTest_Where_NotExists()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var photo = ctx.CWSPhotos.First(p => p.Name.Contains("Umbraco"));
var gallery = photo.AncestorOrDefault<CWSGallery>(g => g.Name.Contains("Bookhouses"));
Assert.IsNull(gallery);
}
}
}
}
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="umbracoPath" value="umbraco.config"/>
</appSettings>
</configuration>
@@ -1,136 +0,0 @@
==========================================================================
Visual Studio Team System: Overview of Authoring and Running Tests
==========================================================================
This overview describes the features for authoring and running tests in
Visual Studio Team System and Visual Studio Team Edition for Software Testers.
Opening Tests
-------------
To open a test, open a test project or a test metadata file (a file with
extension .vsmdi) that contains the definition of the test. You can find
test projects and metadata files in Solution Explorer.
Viewing Tests
-------------
To see which tests are available to you, open the Test View window. Or,
if you have installed Team Edition for Software Testers, you can also open
the Test List Editor window to view tests.
To open the Test View window, click the Test menu, point to Windows, and
then click Test View. To open the Test List Editor window (if you have
installed Team Edition for Software Testers), click Test, point to Windows,
and then click Test List Editor.
Running Tests
-------------
You can run tests from the Test View window and the Test List Editor window.
See Viewing Tests to learn how to open these windows. To run one or more
tests displayed in the Test View window, first select the tests in that
window; to select multiple tests, hold either the Shift or CTRL key while
clicking tests. Then click the Run Tests button in the Test View window
toolbar.
If you have installed Visual Studio Team Edition for Software Testers, you can
also use the Test List Editor window to run tests. To run tests in Test List Editor,
select the check box next to each test that you want to run. Then click the
Run Tests button in the Test List Editor window toolbar.
Viewing Test Results
--------------------
When you run a test or a series of tests, the results of the test run will be
shown in the Test Results window. Each individual test in the run is shown on
a separate line so that you can see its status. The window contains an
embedded status bar in the top half of the window that provides you with
summary details of the complete test run.
To see more detailed results for a particular test result, double-click it in
the Test Results window. This opens a window that provides more information
about the particular test result, such as any specific error messages returned
by the test.
Changing the way that tests are run
-----------------------------------
Each time you run one or more tests, a collection of settings is used to
determine how those tests are run. These settings are contained in a “test
run configuration” file.
Here is a partial list of the changes you can make with a test run
configuration file:
- Change the naming scheme for each test run.
- Change the test controller that the tests are run on so that you can run
tests remotely.
- Gather code coverage data for the code being tested so that you can see
which lines of code are covered by your tests.
- Enable and disable test deployment.
- Specify additional files to deploy before tests are run.
- Select a different host, ASP.NET, for running ASP.NET unit tests.
- Select a different host, the smart device test host, for running smart device unit tests.
- Set various properties for the test agents that run your tests.
- Run custom scripts at the start and end of each test run so that you can
set up the test environment exactly as required each time tests are run.
- Set time limits for tests and test runs.
- Set the browser mix and the number of times to repeat Web tests in the
test run.
By default, a test run configuration file is created whenever you create a
new test project. You make changes to this file by double-clicking it in
Solution Explorer and then changing its settings. (Test run configuration
files have the extension .testrunconfig.)
A solution can contain multiple test run configuration files. Only one of
those files, known as the “Active” test run configuration file, is used to
determine the settings that are currently used for test runs. You select
the active test run configuration by clicking Select Active Test Run
Configuration on the Test menu.
-------------------------------------------------------------------------------
Test Types
----------
Using Visual Studio Team Edition for Software Testers, you can create a number
of different test types:
Unit test: Use a unit test to create a programmatic test in C++, Visual C# or
Visual Basic that exercises source code. A unit test calls the methods of a
class, passing suitable parameters, and verifies that the returned value is
what you expect.
There are three specialized variants of unit tests:
- Data-driven unit tests are created when you configure a unit test to be
called repeatedly for each row of a data source. The data from each row
is used by the unit test as input data.
- ASP.NET unit tests are unit tests that exercise code in an ASP.NET Web
application.
- Smart device unit tests are unit tests that are deployed to a smart device
or emulator and then executed by the smart device test host.
Web Test: Web tests consist of an ordered series of HTTP requests that you
record in a browser session using Microsoft Internet Explorer. You can have
the test report specific details about the pages or sites it requests, such
as whether a particular page contains a specified string.
Load Test: You use a load test to encapsulate non-manual tests, such as
unit, Web, and generic tests, and then run them simultaneously by using
virtual users. Running these tests under load generates test results,
including performance and other counters, in tables and in graphs.
Generic test: A generic test is an existing program wrapped to function as a
test in Visual Studio. The following are examples of tests or programs that
you can turn into generic tests:
- An existing test that uses process exit codes to communicate whether the
test passed or failed. 0 indicates passing and any other value indicates
a failure.
- A general program to obtain specific functionality during a test scenario.
- A test or program that uses a special XML file (called a “summary results
file”), to communicate detailed results.
Manual test: The manual test type is used when the test tasks are to be
completed by a test engineer as opposed to an automated script.
Ordered test: Use an ordered test to execute a set of tests in an order you
specify.
-------------------------------------------------------------------------------
@@ -1,93 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for CacheTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class CacheTest
{
public CacheTest()
{
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void CacheTest_ForcedRefresh()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var hps = ctx.CWSHomes;
ctx.CWSHomes.ReloadCache();
var reloadedHps = ctx.CWSHomes;
Assert.AreNotSame(reloadedHps, hps, "Force reload should result in a different object");
}
}
[TestMethod, Isolated]
public void CacheTest_RequeryLoadFromCache()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var hps = ctx.CWSHomes;
var requeriedHps = ctx.CWSHomes;
Assert.AreSame(requeriedHps, hps, "Requeried objects should result in the same collection");
}
}
}
}
@@ -1,102 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for ChildTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class ChildTest
{
public ChildTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void ChildTest_ChildExist()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var pages = ctx.CWSHomes.First().CWSTextpages;
Assert.AreNotEqual(0, pages.Count());
}
}
[TestMethod, Isolated]
public void ChildTest_ChildToParent()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var page = ctx.CWSHomes.First().CWSTextpages.First();
Assert.AreEqual(ctx.CWSHomes.First().Id, page.Parent<CWSHome>().Id);
}
}
[TestMethod, Isolated]
public void ChildTest_AllChildren()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var hp = ctx.CWSHomes.First();
Assert.IsTrue(hp.Children.Count() > 0);
Assert.IsInstanceOfType(hp.Children.First(), typeof(CWSTextpage));
Assert.IsInstanceOfType(hp.Children.Skip(1).First(), typeof(CWSGalleryList));
}
}
}
}
@@ -1,130 +0,0 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A80528D0-E68C-4A94-9489-C712216665B0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>umbraco.Linq.Core.Tests</RootNamespace>
<AssemblyName>umbraco.Linq.Core.Tests</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug - Fixed Version|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug - Fixed Version\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="TypeMock, Version=5.3.0.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\dep\Reference Assemblies\Mocking\TypeMock.dll</HintPath>
</Reference>
<Reference Include="Typemock.ArrangeActAssert, Version=5.3.0.0, Culture=neutral, PublicKeyToken=3dae460033b8d8e2, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\dep\Reference Assemblies\Mocking\Typemock.ArrangeActAssert.Dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Solution Items\SolutionInfo.cs">
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="AncestorTest.cs" />
<Compile Include="CacheTest.cs" />
<Compile Include="ChildTest.cs" />
<Compile Include="CwsReplicationTest.cs" />
<Compile Include="DataContextTest.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="InheritanceTest.cs" />
<Compile Include="MockHelpers.cs" />
<Compile Include="MyUmbraco.Abstractions.cs" />
<Compile Include="MyUmbraco.designer.cs" />
<Compile Include="OrderingTest.cs" />
<Compile Include="ParentTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SelectTest.cs" />
<Compile Include="WhereTest.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="AuthoringTests.txt" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\..\dep\Test Helpers\umbraco.config">
<Link>umbraco.config</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\umbraco\businesslogic\umbraco.businesslogic.csproj">
<Project>{E469A9CE-1BEC-423F-AC44-713CD72457EA}</Project>
<Name>umbraco.businesslogic</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\umbraco\datalayer\umbraco.datalayer.csproj">
<Project>{C7CB79F0-1C97-4B33-BFA7-00731B579AE2}</Project>
<Name>umbraco.datalayer</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\umbraco\presentation\umbraco.presentation.csproj">
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>umbraco.presentation</Name>
</ProjectReference>
<ProjectReference Include="..\Core\umbraco.Linq.Core.csproj">
<Project>{31CAEC36-0C3D-4D69-B092-84866811EA07}</Project>
<Name>umbraco.Linq.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,85 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Tests to replicate the functionality of the CWS2 xslt's
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class CwsReplicationTest
{
public CwsReplicationTest()
{
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void CwsReplicationTest_ListGalleries()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var galleryList = ctx.CWSGalleryLists.First(); //this would really be a Where(g => g.Id == umbracoContext.Current.PageId.Value) but since I'm not really on a page...
var galleries = from g in galleryList.CWSGalleries
where g.CWSPhotos.Count() >= 1
orderby g.Name
select new
{
g.Name,
Url = umbraco.library.NiceUrl(g.Id),
Thumbnail = (string.IsNullOrEmpty(g.GalleryThumbnail) ? "/Assets/Placeholders/gallery_placeholder.gif" : g.GalleryThumbnail),
PhotoCount = g.CWSPhotos.Count(),
};
Assert.AreEqual(3, galleries.Count());
}
}
}
}
@@ -1,145 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Linq.Core.Node;
using umbraco.Test;
using System.IO;
using System.Web;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for DataContextTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class DataContextTest
{
public DataContextTest()
{
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, ExpectedException(typeof(ArgumentNullException))]
public void DataContextTest_FileNameRequired()
{
var nodeProvider = new NodeDataProvider(string.Empty);
}
[TestMethod, ExpectedException(typeof(FileNotFoundException))]
public void DataContextTest_FileMustExist()
{
var nodeProvider = new NodeDataProvider(@"C:\fakeFile.config");
}
[TestMethod]
public void DataContextTest_ConstructFromExistingProvider()
{
var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"));
MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);
}
[TestMethod]
public void DataContextTest_EnsureSchemaValidation()
{
var nodeProvider = new NodeDataProvider(Path.Combine(Environment.CurrentDirectory, "umbraco.config"), true);
MyUmbracoDataContext ctx = new MyUmbracoDataContext(nodeProvider);
var hp = ctx.CWSHomes.First();
Assert.IsNotNull(hp);
}
[TestMethod, Isolated]
public void DataContextTest_DefaultConstructorIsNodeProvider()
{
MockHelpers.SetupFakeHttpContext();
var ctx = new MyUmbracoDataContext();
Assert.IsInstanceOfType(ctx.DataProvider, typeof(NodeDataProvider));
}
[TestMethod, Isolated]
public void DataContextTest_NodeCached()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var hp = ctx.CWSHomes.First();
var hp2 = ctx.CWSHomes.First();
Assert.AreSame(hp, hp2);
}
}
[TestMethod, Isolated]
public void DataContextTest_FullCache()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var one = ctx.CWSHomes;
var two = ctx.CWSHomes;
Assert.AreSame(one, two);
}
}
[TestMethod, Isolated]
public void DataContextTest_OfNodeTypes()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var tree = ctx.CWSHomes;
Assert.IsInstanceOfType(tree, typeof(NodeTree<CWSHome>));
Assert.IsInstanceOfType(tree.First().CWSTextpages, typeof(NodeAssociationTree<CWSTextpage>));
}
}
}
}
@@ -1,42 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TypeMock.ArrangeActAssert;
namespace umbraco.Linq.Core.Tests
{
public static class Extensions
{
public static ActionRepeater<TReturn> WillReturnRepeat<TReturn>(this IPublicNonVoidMethodHandler<TReturn> ret, TReturn value, int numberOfReturns)
{
for (var i = 0; i < numberOfReturns; i++)
ret.WillReturn(value);
return new ActionRepeater<TReturn>(ret);
}
public static ActionRepeater<TReturn> CallOriginalRepeat<TReturn>(this IPublicNonVoidMethodHandler<TReturn> ret, int numberOfReturns)
{
for (var i = 0; i < numberOfReturns; i++)
ret.CallOriginal();
return new ActionRepeater<TReturn>(ret);
}
}
public class ActionRepeater<TReturn>
{
private IPublicNonVoidMethodHandler<TReturn> _actionRepeater;
public ActionRepeater(IPublicNonVoidMethodHandler<TReturn> actionRepeater)
{
_actionRepeater = actionRepeater;
}
public IPublicNonVoidMethodHandler<TReturn> AndThen()
{
return _actionRepeater;
}
}
}
@@ -1,80 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for InheritanceTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class InheritanceTest
{
public InheritanceTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod]
public void InheritanceTest_ImplementsBaseClass()
{
var tmp = new TextPageThreeCol();
Assert.AreEqual(typeof(CWSTextpageTwoCol), tmp.GetType().BaseType);
}
[TestMethod, Isolated]
public void InheritanceTest_PropertyFromBase()
{
var fake = Isolate.Fake.Instance<TextPageThreeCol>();
Assert.AreEqual(typeof(CWSTextpageTwoCol), fake.GetType().GetProperties().Single(p => p.Name == "Headertext").DeclaringType);
}
}
}
@@ -1,19 +0,0 @@
using System;
using System.Web;
using TypeMock.ArrangeActAssert;
using System.IO;
namespace umbraco.Linq.Core.Tests
{
internal class MockHelpers
{
public static void SetupFakeHttpContext()
{
HttpContext fakeHttpContext = Isolate.Fake.Instance<HttpContext>(Members.MustSpecifyReturnValues);
HttpServerUtility fakeServer = Isolate.Fake.Instance<HttpServerUtility>();
Isolate.WhenCalled(() => HttpContext.Current).WillReturn(fakeHttpContext);
Isolate.WhenCalled(() => fakeHttpContext.Server).WillReturn(fakeServer);
Isolate.WhenCalled(() => fakeServer.MapPath(string.Empty)).WillReturn(Path.Combine(Environment.CurrentDirectory, "umbraco.config"));
}
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,81 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for OrderingTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class OrderingTest
{
public OrderingTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void OrderingTest_Date()
{
MockHelpers.SetupFakeHttpContext();
using (var orderedContext = new MyUmbracoDataContext())
{
var asc = orderedContext.CWSTextpages.OrderBy(p => p.CreateDate);
var desc = orderedContext.CWSTextpages.OrderByDescending(p => p.CreateDate);
Assert.AreEqual(asc.Count(), desc.Count());
Assert.AreNotEqual(asc.First().Id, desc.First().Id);
Assert.AreEqual(asc.First().Id, desc.Last().Id);
}
}
}
}
@@ -1,109 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for ParentTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class ParentTest
{
public ParentTest()
{
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void ParentTest_ParentIdExists()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var p = ctx.CWSTextpages.First();
Assert.AreNotEqual(0, p.ParentNodeId);
}
}
[TestMethod, Isolated]
public void ParentTest_ParentCreated()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var page = ctx.CWSTextpages.Single(p => p.Id == 1099);
Assert.AreEqual(1098, page.ParentNodeId);
var parent = page.Parent<CWSHome>();
Assert.AreEqual(page.ParentNodeId, parent.Id);
}
}
[TestMethod, Isolated]
public void ParentTest_TopParentNull()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var hp = ctx.CWSHomes.First();
Assert.IsNull(hp.Parent<CWSHome>());
}
}
[TestMethod, Isolated, ExpectedException(typeof(DocTypeMissMatchException))]
public void ParentTest_InvalidParentType()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var p = ctx.CWSPhotos.First().Parent<CWSHome>();
}
}
}
}
@@ -1,9 +0,0 @@
using System.Reflection;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Core")]
@@ -1,179 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using umbraco.Test;
using TypeMock.ArrangeActAssert;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for SelectTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class SelectTest
{
public SelectTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void SelectTest_LoopTree_Query()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var homePages = from hp in ctx.CWSHomes
select hp;
Assert.IsNotNull(homePages);
foreach (var item in homePages)
{
Assert.IsTrue(item.BodyText.Length > 0);
}
}
}
[TestMethod, Isolated]
public void SelectTest_LoopTree_Lambda()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var homePages = ctx.CWSHomes;
Assert.IsNotNull(homePages);
foreach (CWSHome item in homePages)
{
Assert.IsTrue(item.BodyText.Length > 0);
}
}
}
[TestMethod, Isolated]
public void SelectTest_SingleProperty_Query()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var homePageText = from hp in ctx.CWSHomes
select hp.BodyText;
Assert.IsNotNull(homePageText);
foreach (var item in homePageText)
{
Assert.IsNotNull(item);
}
}
}
[TestMethod, Isolated]
public void SelectTest_SingleProperty_Lambda()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var homePageText = ctx.CWSHomes.Select(hp => hp.BodyText);
Assert.IsNotNull(homePageText);
foreach (var item in homePageText)
{
Assert.IsNotNull(item);
}
}
}
[TestMethod, Isolated]
public void SelectTest_Anonymous_Query()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var anon = from hp in ctx.CWSHomes
select new
{
hp.BodyText,
CreatedDate = hp.CreateDate
};
Assert.IsNotNull(anon);
foreach (var item in anon)
{
Assert.IsNotNull(item.BodyText);
Assert.AreNotEqual(DateTime.MinValue, item.CreatedDate);
}
}
}
[TestMethod, Isolated]
public void SelectTest_Anonymous_Lambda()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var anon = ctx.CWSHomes.Select(hp => new
{
hp.BodyText,
CreatedDate = hp.CreateDate
});
Assert.IsNotNull(anon);
foreach (var item in anon)
{
Assert.IsNotNull(item.BodyText);
Assert.AreNotEqual(DateTime.MinValue, item.CreatedDate);
}
}
}
}
}
@@ -1,130 +0,0 @@
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TypeMock.ArrangeActAssert;
using umbraco.Test;
namespace umbraco.Linq.Core.Tests
{
/// <summary>
/// Summary description for WhereTest
/// </summary>
[TestClass, DeploymentItem("umbraco.config")]
public class WhereTest
{
public WhereTest()
{
//
// TODO: Add constructor logic here
//
}
private TestContext testContextInstance;
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
// You can use the following additional attributes as you write your tests:
//
// Use ClassInitialize to run code before running the first test in the class
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// Use ClassCleanup to run code after all tests in a class have run
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// Use TestInitialize to run code before running each test
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// Use TestCleanup to run code after each test has run
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod, Isolated]
public void WhereTest_SingleParameter_Query()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var pages = from page in ctx.CWSTextpages
where page.BodyText.Length > 0
select page;
Assert.IsNotNull(pages);
Assert.IsTrue(pages.Count() > 0);
}
}
[TestMethod, Isolated]
public void WhereTest_DateTimeGreaterThan_Query()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var pages = from page in ctx.CWSTextpages
where page.CreateDate > DateTime.MinValue
select page;
Assert.IsNotNull(pages);
Assert.IsTrue(pages.Count() > 0);
}
}
[TestMethod, Isolated]
public void WhereTest_TwoParameter_Query()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var pages = from page in ctx.CWSTextpages
where page.BodyText.Length > 0
&& page.CreateDate > DateTime.MinValue
select page;
Assert.IsNotNull(pages);
Assert.IsTrue(pages.Count() > 0);
}
}
[TestMethod, Isolated]
public void WhereTest_ToAnonymous()
{
MockHelpers.SetupFakeHttpContext();
using (var ctx = new MyUmbracoDataContext())
{
var pages = from page in ctx.CWSTextpages
where page.BodyText.Length > 0
select new
{
page.Id,
page.BodyText
};
Assert.AreNotEqual(0, pages.Count());
}
}
}
}
@@ -1,29 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace umbraco.Linq.Core
{
/// <summary>
/// Represents the child items of TDocTypeBase
/// </summary>
/// <remarks>
/// This is used for creating a DataProvider specific child item collection of a DocType instance.
///
/// It allows a DocType to have strongly typed child associations, and accessors such as:
/// <example>
/// myDocType.SomeChildTypes
/// </example>
/// </remarks>
/// <typeparam name="TDocTypeBase">The type of the DocTypeBase which this association represents.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public abstract class AssociationTree<TDocTypeBase> : Tree<TDocTypeBase> where TDocTypeBase : DocTypeBase, new()
{
/// <summary>
/// Gets or sets the parent node id which this AssociationTree is for
/// </summary>
/// <value>The parent node id.</value>
public int ParentNodeId { get; protected set; }
}
}
@@ -1,85 +0,0 @@
using System;
namespace umbraco.Linq.Core
{
/// <summary>
/// Standard umbraco info
/// </summary>
[global::System.AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
public sealed class UmbracoInfoAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="UmbracoInfoAttribute"/> class.
/// </summary>
/// <param name="alias">The alias for this piece of umbraco info.</param>
public UmbracoInfoAttribute(string alias)
{
this.Alias = alias;
}
/// <summary>
/// Gets or sets the display name of the item.
/// </summary>
/// <value>The display name.</value>
public string DisplayName { get; set; }
/// <summary>
/// Gets or sets the alias.
/// </summary>
/// <value>The alias.</value>
public string Alias { get; private set; }
/// <summary>
/// Gets or sets a value indicating whether this property is mandatory.
/// </summary>
/// <value><c>true</c> if mandatory; otherwise, <c>false</c>.</value>
public bool Mandatory { get; set; }
}
/// <summary>
/// Marks a class as an umbraco DocType
/// </summary>
[global::System.AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, Inherited = true, AllowMultiple = false)]
public sealed class DocTypeAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="DocTypeAttribute"/> class.
/// </summary>
public DocTypeAttribute()
{
}
}
/// <summary>
/// Marks a property as a standard umbraco field
/// </summary>
/// <remarks>
/// Example usage:
/// - ID
/// - ParentID
/// - CreateDate
/// </remarks>
[global::System.AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class FieldAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="FieldAttribute"/> class.
/// </summary>
public FieldAttribute()
{
}
}
/// <summary>
/// Marks a property as a custom umbraco DocType property
/// </summary>
[global::System.AttributeUsage(AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class PropertyAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="PropertyAttribute"/> class.
/// </summary>
public PropertyAttribute()
{
}
}
}
@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1" GroupingSetting="Access" MembersFormat="NameAndType">
<Class Name="umbraco.Linq.Core.AssociationTree&lt;TDocTypeBase&gt;">
<Position X="1" Y="4.75" Width="2.25" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAA=</HashCode>
<FileName>AssociationTree.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="umbraco.Linq.Core.DocTypeBase" BaseTypeListCollapsed="true">
<Position X="8.25" Y="0.75" Width="4.5" />
<Compartments>
<Compartment Name="Internal" Collapsed="true" />
<Compartment Name="Private" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>MAASJAACAQCEAAAgAACUYAQBgACAAAAhEAIBAAEEAYI=</HashCode>
<FileName>DocTypeBase.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="umbraco.Linq.Core.Tree&lt;TDocType&gt;">
<Position X="2.5" Y="0.75" Width="3" />
<Compartments>
<Compartment Name="Private" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>AAAQAAAAAAAEABAQAAAAAAAAAAAAAAAEAAAAAAAAAAA=</HashCode>
<FileName>Tree.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="umbraco.Linq.Core.UmbracoDataContext" BaseTypeListCollapsed="true">
<Position X="13" Y="0.75" Width="3.5" />
<Compartments>
<Compartment Name="Private" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>AAAAAAAAACAEAAAAAAAAAABAAAAAAAAAAAAACACAAAA=</HashCode>
<FileName>UmbracoDataContext.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="umbraco.Linq.Core.Node.NodeAssociationTree&lt;TDocTypeBase&gt;">
<Position X="0.5" Y="6.75" Width="3.25" />
<Compartments>
<Compartment Name="Private" Collapsed="true" />
<Compartment Name="Internal" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>AAAUABAAAAAEABAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Node\NodeAssociationTree.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="umbraco.Linq.Core.Node.NodeDataProvider" BaseTypeListCollapsed="true">
<Position X="5.25" Y="12" Width="4.5" />
<Compartments>
<Compartment Name="Private" Collapsed="true" />
<Compartment Name="Internal" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>IAAAiAAAACAUAAQAAAABCKQAAAAAAAAAAAACKAiAAAA=</HashCode>
<FileName>Node\NodeDataProvider.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="umbraco.Linq.Core.Node.NodeTree&lt;TDocTypeBase&gt;">
<Position X="4.5" Y="4.75" Width="3.25" />
<Compartments>
<Compartment Name="Private" Collapsed="true" />
<Compartment Name="Internal" Collapsed="true" />
</Compartments>
<TypeIdentifier>
<HashCode>AAASABAAAAAEABAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Node\NodeTree.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="umbraco.Linq.Core.UmbracoDataProvider">
<Position X="5.25" Y="8.75" Width="4.5" />
<TypeIdentifier>
<HashCode>AAAAgAAAACAAAAQAAAABAAQAAAAAAAAAAAAAAACAAAA=</HashCode>
<FileName>UmbracoDataProvider.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Interface Name="umbraco.Linq.Core.ITree">
<Position X="5.75" Y="0.75" Width="2.25" />
<TypeIdentifier>
<HashCode>AAAQAAAAAAAEAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>ITree.cs</FileName>
</TypeIdentifier>
</Interface>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>
@@ -1,442 +0,0 @@
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using umbraco.BusinessLogic;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace umbraco.Linq.Core
{
/// <summary>
/// Provides the base framework for an umbraco item
/// </summary>
[DataContract]
public class DocTypeBase : IDocTypeBase //This class should be abstract but it can't be done AND achieve the Children property like this
{
#region Internal Storage
private int _Id;
private string _nodeName;
private string _versionId;
private int _templateId;
private int _parentId;
private int writerID;
private User _writer;
private int creatorID;
private User _creator;
private string _path;
private IEnumerable<DocTypeBase> _ancestors;
private AssociationTree<DocTypeBase> _children;
#endregion
/// <summary>
/// Initializes a new instance of the <see cref="DocTypeBase"/> class.
/// </summary>
public DocTypeBase()
{
this.IsDirty = true;
}
/// <summary>
/// Gets or sets the provider.
/// </summary>
/// <value>The provider.</value>
protected internal UmbracoDataProvider Provider { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this instance has been modified since it was first loaded
/// </summary>
/// <value><c>true</c> if this instance has been modified; otherwise, <c>false</c>.</value>
public bool IsDirty { get; protected internal set; }
#region Fields
/// <summary>
/// Gets or sets the id of the umbraco item
/// </summary>
/// <value>The id.</value>
[Field]
[UmbracoInfo("id", DisplayName = "Id", Mandatory = true), DataMember(Name = "Id")]
public virtual int Id
{
get
{
return this._Id;
}
protected internal set
{
if (this._Id != value)
{
this.RaisePropertyChanging();
this._Id = value;
this.RaisePropertyChanged("Id");
}
}
}
/// <summary>
/// Gets or sets the name (title) of the umbraco item
/// </summary>
/// <value>The name.</value>
[Field]
[UmbracoInfo("nodeName", DisplayName = "NodeName", Mandatory = true), DataMember(Name = "NodeName")]
public virtual string NodeName
{
get
{
return this._nodeName;
}
set
{
if (this._nodeName != value)
{
this.RaisePropertyChanging();
this._nodeName = value;
this.IsDirty = true;
this.RaisePropertyChanged("NodeName");
}
}
}
[Field]
[Obsolete("Name property is obsolete, use NodeName instead")] //this is because most people expect NodeName not Name as the property
public virtual string Name
{
get
{
return this.NodeName;
}
set
{
this.NodeName = value;
}
}
/// <summary>
/// Gets or sets the template ID of the umbraco item
/// </summary>
/// <value>The name.</value>
[Field]
[UmbracoInfo("template", DisplayName = "Template", Mandatory = true), DataMember(Name = "TemplateId")]
public virtual int TemplateId
{
get
{
return this._templateId;
}
set
{
if (this._templateId != value)
{
this.RaisePropertyChanging();
this._templateId = value;
this.IsDirty = true;
this.RaisePropertyChanged("Template");
}
}
}
/// <summary>
/// Gets or sets the version of the umbraco item
/// </summary>
/// <value>The version.</value>
[Field]
[UmbracoInfo("version", DisplayName = "Version", Mandatory = true), DataMember(Name = "Version")]
public virtual string Version
{
get
{
return this._versionId;
}
protected internal set
{
if (this._versionId != value)
{
this.RaisePropertyChanging();
this._versionId = value;
this.RaisePropertyChanged("Version");
}
}
}
/// <summary>
/// Gets or sets the ID of the parent node.
/// </summary>
/// <value>The parent node id.</value>
[Field]
[UmbracoInfo("parentID", DisplayName = "ParentId", Mandatory = true), DataMember(Name = "ParentId")]
public virtual int ParentNodeId
{
get
{
return this._parentId;
}
set
{
if (this._parentId != value)
{
this.RaisePropertyChanging();
this._parentId = value;
this.RaisePropertyChanged("ParentId");
}
}
}
/// <summary>
/// Gets or sets the created date.
/// </summary>
/// <value>The create date.</value>
[Field]
[UmbracoInfo("createDate", DisplayName = "CreateDate"), DataMember(Name = "CreateDate")]
public virtual DateTime CreateDate { get; set; }
/// <summary>
/// Gets or sets the sort order.
/// </summary>
/// <value>The sort order.</value>
[Field]
[UmbracoInfo("sortOrder", DisplayName = "SortOrder"), DataMember(Name = "SortOrder")]
public virtual int SortOrder { get; set; }
/// <summary>
/// Gets or sets the last updated date of the current version
/// </summary>
/// <value>The update date.</value>
[Field]
[UmbracoInfo("updateDate", DisplayName = "UpdateDate"), DataMember(Name = "UpdateDate")]
public virtual DateTime UpdateDate { get; set; }
/// <summary>
/// Gets or sets the level of this item in the content tree
/// </summary>
/// <value>The level.</value>
[Field]
[UmbracoInfo("level", DisplayName = "Level"), DataMember(Name = "Level")]
public virtual int Level { get; set; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
[Field]
[UmbracoInfo("path", DisplayName = "Path")]
[DataMember(Name = "Path")]
public virtual string Path
{
get
{
return this._path;
}
set
{
if (this._path != value)
{
this.RaisePropertyChanging();
this._path = value;
this.RaisePropertyChanged("Path");
}
}
}
#endregion
#region Parents and Children
/// <summary>
/// Gets the children of this DocType instance.
/// </summary>
/// <value>The children of this DocType instance.</value>
public AssociationTree<DocTypeBase> Children
{
get
{
if (this._children == null)
{
this._children = this.Provider.LoadAssociation(this.Id); //tell the provider to create it
}
return this._children;
}
}
/// <summary>
/// Gets the children which are of the type TDocTypeBase.
/// </summary>
/// <typeparam name="TDocTypeBase">The DocType of the children desired.</typeparam>
/// <returns>An <see cref="umbraco.Linq.Core.AssociationTree&lt;TDocTypeBase&gt;"/> of the children</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
protected AssociationTree<TDocTypeBase> ChildrenOfType<TDocTypeBase>() where TDocTypeBase : DocTypeBase, new()
{
return this.Provider.LoadAssociation<TDocTypeBase>(this.Children.Where(d => d is TDocTypeBase).Cast<TDocTypeBase>());
}
/// <summary>
/// Parent this instance.
/// </summary>
/// <typeparam name="TParent">The type of the parent.</typeparam>
/// <returns>Null when at the root level, else the parent instance</returns>
/// <exception cref="umbraco.Linq.Core.DocTypeMissMatchException">If the type of the parent does not match the provided type</exception>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public virtual TParent Parent<TParent>() where TParent : DocTypeBase, new()
{
if (this._parentId == -1)
{
return null;
}
return this.Provider.Load<TParent>(this._parentId);
}
/// <summary>
/// Retrieves the first matching ancestor of the current type
/// </summary>
/// <remarks>
/// Provides similar functionality to the XPath method
/// </remarks>
/// <returns>First ancestor matching type. Null if no match found</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public TDocType AncestorOrDefault<TDocType>() where TDocType : DocTypeBase
{
return this.AncestorOrDefault<TDocType>(t => true); //just a simple little true statement ;)
}
/// <summary>
/// Retrieves the first matching ancestor of the current type and additional boolean function
/// </summary>
/// <typeparam name="TDocType">The type of the doc type.</typeparam>
/// <param name="func">Additional boolean operation to filter on</param>
/// <returns>First ancestor matching type and function. Null if no match found</returns>
/// <exception cref="System.ArgumentNullException">Func parameter required</exception>
public TDocType AncestorOrDefault<TDocType>(Func<TDocType, bool> func) where TDocType : DocTypeBase
{
if (func == null)
{
throw new ArgumentNullException("func");
}
if (this._ancestors == null)
{
this._ancestors = this.Provider.LoadAncestors(this.Id);
}
return this._ancestors.Where(a => a is TDocType).Cast<TDocType>().FirstOrDefault(func);
}
#endregion
/// <summary>
/// Gets or sets the creator ID.
/// </summary>
/// <value>The creator ID.</value>
public int CreatorID
{
get
{
return creatorID;
}
internal set
{
this.creatorID = value;
}
}
/// <summary>
/// Gets the umbraco user who created the item
/// </summary>
/// <value>The creator.</value>
public virtual User Creator
{
get
{
if (this._creator == null)
{
this._creator = new User(this.CreatorID);
}
return this._creator;
}
}
public virtual string CreatorName { get; internal set; }
/// <summary>
/// ID of the user who last edited the item
/// </summary>
public int WriterID
{
get
{
return writerID;
}
internal set
{
this.writerID = value;
}
}
/// <summary>
/// Gets the umbraco user who last edited the instance
/// </summary>
/// <value>The writer.</value>
public virtual User Writer
{
get
{
if (this._writer == null)
{
this._writer = new User(this.WriterID);
}
return this._writer;
}
}
public virtual string WriterName { get; internal set; }
/// <summary>
/// Raises the property changing event.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")]
protected virtual void RaisePropertyChanging()
{
if (this.PropertyChanging != null)
{
this.PropertyChanging(this, new PropertyChangingEventArgs(String.Empty));
}
}
/// <summary>
/// Raises the property changed event.
/// </summary>
/// <param name="name">The name of the changed property.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1030:UseEventsWhereAppropriate")]
protected virtual void RaisePropertyChanged(string name)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
#region INotifyPropertyChanging Members
/// <summary>
/// Occurs when a property value is changing.
/// </summary>
public event PropertyChangingEventHandler PropertyChanging;
#endregion
#region INotifyPropertyChanged Members
/// <summary>
/// Occurs when a property value changes.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
#endregion
protected void ValidateProperty(string regex, string value)
{
Regex r = new Regex(regex);
if (!r.IsMatch(value))
{
throw new InvalidCastException("Value does not match validation expression from Umbraco");
}
}
}
}
@@ -1,128 +0,0 @@
using System;
namespace umbraco.Linq.Core
{
/// <summary>
/// Exception for when the provided class does not meet the expected class
/// </summary>
[global::System.Serializable]
public class DocTypeMissMatchException : ArgumentException
{
/// <summary>
/// Initializes a new instance of the <see cref="DocTypeMissMatchException"/> class.
/// </summary>
/// <param name="actual">The actual doc type alias.</param>
/// <param name="expected">The expcected doc type alias.</param>
public DocTypeMissMatchException(string actual, string expected) : this(actual, expected, string.Empty) { }
/// <summary>
/// Initializes a new instance of the <see cref="DocTypeMissMatchException"/> class.
/// </summary>
/// <param name="actual">The actual doc type alias.</param>
/// <param name="expected">The expcected doc type alias.</param>
/// <param name="message">Additional message information.</param>
public DocTypeMissMatchException(string actual, string expected, string message)
: base(string.Format("DocTypeAlias provided did not match what was expected (provided: {0}, expected: {1}){2}{3}", actual, expected, Environment.NewLine, message))
{
Expected = expected;
Actual = actual;
}
/// <summary>
/// Initializes a new instance of the <see cref="DocTypeMissMatchException"/> class.
/// </summary>
/// <param name="actual">The actual doc type alias.</param>
/// <param name="expected">The expcected doc type alias.</param>
/// <param name="message">Additional message information.</param>
/// <param name="innerException">The inner exception.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])")]
public DocTypeMissMatchException(string actual, string expected, string message, Exception innerException)
: base(string.Format("DocTypeAlias provided did not match what was expected (provided: {0}, expected: {1}){2}{3}", actual, expected, Environment.NewLine, message), innerException)
{
Expected = expected;
Actual = actual;
}
/// <summary>
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">
/// The <paramref name="info"/> parameter is null.
/// </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">
/// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
/// </exception>
protected DocTypeMissMatchException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
: base(info, context) { }
/// <summary>
/// Gets or sets the expected DocTypeAlias
/// </summary>
/// <value>The expected DocTypeAlias.</value>
public string Expected { get; set; }
/// <summary>
/// Gets or sets the actual DocTypeAlias
/// </summary>
/// <value>The actual DocTypeAlias.</value>
public string Actual { get; set; }
}
/// <summary>
/// Exception raised when a field isn't meeting its mandatory requirement
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors"), global::System.Serializable]
public class MandatoryFailureException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
/// </summary>
/// <param name="propertyName">Name of the property that failed the mandatory check.</param>
public MandatoryFailureException(string propertyName) : this(propertyName, string.Empty) { }
/// <summary>
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
/// </summary>
/// <param name="propertyName">Name of the property that failed the mandatory check.</param>
/// <param name="message">Additional message information.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)")]
public MandatoryFailureException(string propertyName, string message)
: base(string.Format("The mandatory property \"{0}\" did not have a value.{1}{2}", propertyName, Environment.NewLine, message))
{
PropertyName = propertyName;
}
/// <summary>
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
/// </summary>
/// <param name="propertyName">Name of the property that failed the mandatory check.</param>
/// <param name="message">Additional message information.</param>
/// <param name="innerException">The inner exception.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)")]
public MandatoryFailureException(string propertyName, string message, Exception innerException)
: base(string.Format("The mandatory property \"{0}\" did not have a value.{1}{2}", propertyName, Environment.NewLine, message), innerException)
{
PropertyName = propertyName;
}
/// <summary>
/// Initializes a new instance of the <see cref="MandatoryFailureException"/> class.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
/// <exception cref="T:System.ArgumentNullException">
/// The <paramref name="info"/> parameter is null.
/// </exception>
/// <exception cref="T:System.Runtime.Serialization.SerializationException">
/// The class name is null or <see cref="P:System.Exception.HResult"/> is zero (0).
/// </exception>
protected MandatoryFailureException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
: base(info, context) { }
/// <summary>
/// Gets or sets the name of the property the exception was raised for.
/// </summary>
/// <value>The name of the property.</value>
public string PropertyName { get; set; }
}
}
@@ -1,26 +0,0 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Error List, point to "Suppress Message(s)", and click
// "In Project Suppression File".
// You do not need to add suppressions to this file manually.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "namespace", Target = "umbraco.Linq.Core")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "umbraco.Linq.Core.Node")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "namespace", Target = "umbraco.Linq.Core.Node")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1032:ImplementStandardExceptionConstructors", Scope = "type", Target = "umbraco.Linq.Core.DocTypeMissMatchException")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object[])", Scope = "member", Target = "umbraco.Linq.Core.DocTypeMissMatchException.#.ctor(System.String,System.String,System.String)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "member", Target = "umbraco.Linq.Core.ReflectionAssistance.#GetumbracoInfoAttribute(System.Type)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoDataContext")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoDataProvider")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.umbracoDataProvider.#Load`1(System.Int32)")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.umbracoDataProvider.#LoadTree`1()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco", Scope = "type", Target = "umbraco.Linq.Core.umbracoInfoAttribute")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "umbraco.Linq.Core.Node.NodeAssociationTree`1")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.Node.NodeDataProvider.#LoadTree`1()")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix", Scope = "type", Target = "umbraco.Linq.Core.Node.NodeTree`1")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Scope = "member", Target = "umbraco.Linq.Core.Node.NodeDataProvider.#Load`1(System.Int32)")]
@@ -1,27 +0,0 @@
namespace umbraco.Linq.Core
{
/// <summary>
/// Base of an umbraco content tree
/// </summary>
public interface IContentTree
{
/// <summary>
/// Gets the <see cref="UmbracoDataProvider"/> Provider associated with this instance
/// </summary>
/// <value>The provider.</value>
UmbracoDataProvider Provider { get; }
/// <summary>
/// Gets a value indicating whether this instance is read only.
/// </summary>
/// <value>
/// <c>true</c> if this instance is read only; otherwise, <c>false</c>.
/// </value>
bool IsReadOnly { get; }
/// <summary>
/// Reloads the cache for the particular tree
/// </summary>
void ReloadCache();
}
}
@@ -1,116 +0,0 @@
using System;
using System.ComponentModel;
namespace umbraco.Linq.Core
{
/// <summary>
///
/// </summary>
public interface IDocTypeBase : INotifyPropertyChanging, INotifyPropertyChanged
{
/// <summary>
/// Gets the Ancestor or Default based on type
/// </summary>
/// <typeparam name="TDocType">The type of the Ancestor.</typeparam>
/// <returns></returns>
TDocType AncestorOrDefault<TDocType>() where TDocType : DocTypeBase;
/// <summary>
/// Gets the Ancestor or Default based on type
/// </summary>
/// <typeparam name="TDocType">The type of the Ancestor.</typeparam>
/// <param name="func">The func.</param>
/// <returns></returns>
TDocType AncestorOrDefault<TDocType>(Func<TDocType, bool> func) where TDocType : DocTypeBase;
/// <summary>
/// Gets the children.
/// </summary>
/// <value>The children.</value>
AssociationTree<DocTypeBase> Children { get; }
/// <summary>
/// Gets or sets the create date.
/// </summary>
/// <value>The create date.</value>
DateTime CreateDate { get; set; }
/// <summary>
/// Gets the creator user ID.
/// </summary>
/// <value>The creator ID.</value>
int CreatorID { get; }
/// <summary>
/// Gets the name of the creator.
/// </summary>
/// <value>The name of the creator.</value>
string CreatorName { get; }
/// <summary>
/// Gets the id of the item.
/// </summary>
/// <value>The id.</value>
int Id { get; }
/// <summary>
/// Gets a value indicating whether this instance is dirty.
/// </summary>
/// <value><c>true</c> if this instance is dirty; otherwise, <c>false</c>.</value>
bool IsDirty { get; }
/// <summary>
/// Gets or sets the level of the item
/// </summary>
/// <value>The level.</value>
int Level { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
string NodeName { get; set; }
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
[Obsolete("Name property is obsolete, use NodeName instead")] //this is because most people expect NodeName not Name as the property
string Name { get; set; }
/// <summary>
/// Parent if current instance
/// </summary>
/// <typeparam name="TParent">The type of the parent.</typeparam>
/// <returns></returns>
TParent Parent<TParent>() where TParent : DocTypeBase, new();
/// <summary>
/// Gets or sets the parent node id.
/// </summary>
/// <value>The parent node id.</value>
int ParentNodeId { get; set; }
/// <summary>
/// Gets or sets the sort order.
/// </summary>
/// <value>The sort order.</value>
int SortOrder { get; set; }
/// <summary>
/// Gets or sets the template id.
/// </summary>
/// <value>The template id.</value>
int TemplateId { get; set; }
/// <summary>
/// Gets or sets the update date.
/// </summary>
/// <value>The update date.</value>
DateTime UpdateDate { get; set; }
/// <summary>
/// Gets the version.
/// </summary>
/// <value>The version.</value>
string Version { get; }
/// <summary>
/// Gets the writer user ID.
/// </summary>
/// <value>The writer ID.</value>
int WriterID { get; }
/// <summary>
/// Gets the name of the writer.
/// </summary>
/// <value>The name of the writer.</value>
string WriterName { get; }
/// <summary>
/// Gets or sets the path.
/// </summary>
/// <value>The path.</value>
string Path { get; set; }
}
}
@@ -1,20 +0,0 @@
using System;
namespace umbraco.Linq.Core
{
/// <summary>
/// Abstraction of the UmbracoDataContext
/// </summary>
public interface IUmbracoDataContext : IDisposable
{
/// <summary>
/// Gets the data provider.
/// </summary>
/// <value>The data provider.</value>
UmbracoDataProvider DataProvider { get; }
/// <summary>
/// Submits the changes tracked in this data context
/// </summary>
void SubmitChanges();
}
}
@@ -1,115 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace umbraco.Linq.Core.Node
{
/// <summary>
/// Represents a collection of TDocTypeBase retrieved from the umbraco XML cache which are direct children of a node
/// </summary>
/// <typeparam name="TDocTypeBase">The type of the doc type base.</typeparam>
public sealed class NodeAssociationTree<TDocTypeBase> : AssociationTree<TDocTypeBase> where TDocTypeBase : DocTypeBase, new()
{
private object lockObject = new object();
private IEnumerable<TDocTypeBase> _nodes;
internal NodeAssociationTree(IEnumerable<TDocTypeBase> nodes)
{
this._nodes = new List<TDocTypeBase>();
this._nodes = nodes;
}
/// <summary>
/// Initializes a new instance of the <see cref="NodeAssociationTree&lt;TDocTypeBase&gt;"/> class for a particular tree section
/// </summary>
/// <param name="parentNodeId">The parent node id to start from.</param>
/// <param name="provider">The NodeDataProvider to link the tree with.</param>
public NodeAssociationTree(int parentNodeId, NodeDataProvider provider)
{
this.Provider = provider;
this.ParentNodeId = parentNodeId;
}
/// <summary>
/// Gets the enumerator for this Tree collection
/// </summary>
/// <returns></returns>
public override IEnumerator<TDocTypeBase> GetEnumerator()
{
if (this._nodes == null) //first access, otherwise it'd be cached
{
LoadNodes();
}
return this._nodes.GetEnumerator();
}
private void LoadNodes()
{
var provider = this.Provider as NodeDataProvider;
provider.CheckDisposed();
lock (lockObject)
{
var parents = provider
.Xml
.Descendants()
.Where(x => x.Attribute("id") != null && (int)x.Attribute("id") == this.ParentNodeId);
var rawNodes = parents
.Single()
.Elements()
.Where(x => x.Attribute("isDoc") != null)
;
this._nodes = provider.DynamicNodeCreation(rawNodes).Cast<TDocTypeBase>(); //drop is back to the type which was asked for
}
}
/// <summary>
/// Indicates that the NodeAssociationTree is ReadOnly
/// </summary>
/// <value>
/// <c>true</c>
/// </value>
public override bool IsReadOnly
{
get
{
return true;
}
}
/// <summary>
/// Gets or sets the DataProvider associated with this Tree
/// </summary>
/// <value>The provider.</value>
public override UmbracoDataProvider Provider { get; protected set; }
/// <summary>
/// Reloads the cache.
/// </summary>
public override void ReloadCache()
{
this.LoadNodes();
}
public override void InsertOnSubmit(TDocTypeBase item)
{
throw new NotImplementedException("The NodeAssociationTree does not support Inserting items");
}
public override void InsertAllOnSubmit(IEnumerable<TDocTypeBase> items)
{
throw new NotImplementedException("The NodeAssociationTree does not support Inserting items");
}
public override void DeleteOnSubmit(TDocTypeBase itemm)
{
throw new NotImplementedException("The NodeAssociationTree does not support Deleting items");
}
public override void DeleteAllOnSubmit(IEnumerable<TDocTypeBase> items)
{
throw new NotImplementedException("The NodeAssociationTree does not support Deleting items");
}
}
}
@@ -1,395 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Xml.Linq;
using System.Reflection;
using umbraco.presentation;
using umbraco.cms.helpers;
using umbraco.BusinessLogic.Utils;
namespace umbraco.Linq.Core.Node
{
/// <summary>
/// Data Provider for LINQ to umbraco via umbraco ndoes
/// </summary>
/// <remarks>
/// <para>This class provides a data access model for the umbraco XML cache.
/// It is responsible for the access to the XML and construction of nodes from it.</para>
/// <para>The <see cref="umbraco.Linq.Core.Node.NodeDataProvider"/> is capable of reading the XML cache from either the path provided in the umbraco settings or from a specified location on the file system.</para>
/// </remarks>
public sealed class NodeDataProvider : UmbracoDataProvider
{
private object lockObject = new object();
private string _xmlPath;
private Dictionary<UmbracoInfoAttribute, IContentTree> _trees;
private XDocument _xml;
private Dictionary<string, Type> _knownTypes;
private bool _tryMemoryCache = false;
internal XDocument Xml
{
get
{
if (this._xml == null)
{
if (this._tryMemoryCache)
{
var doc = UmbracoContext.Current.Server.ContentXml;
if (doc != null)
{
this._xml = doc;
}
else
{
this._xml = XDocument.Load(this._xmlPath);
}
}
else
{
this._xml = XDocument.Load(this._xmlPath);
}
}
return this._xml; //cache the XML in memory to increase performance and force the disposable pattern
}
}
/// <summary>
/// Initializes the NodeDataProvider, performing validation
/// </summary>
/// <param name="xmlPath">The XML path.</param>
/// <param name="newSchemaMode">if set to <c>true</c> [new schema mode].</param>
protected void Init(string xmlPath, bool newSchemaMode)
{
if (!newSchemaMode)
throw new NotSupportedException(this.Name + " only supports the new XML schema. Change the umbracoSettings.config to implement this and republish");
if (string.IsNullOrEmpty(xmlPath))
throw new ArgumentNullException("xmlPath");
if (!File.Exists(xmlPath))
throw new FileNotFoundException("The XML used by the provider must exist", xmlPath);
this._xmlPath = xmlPath;
this._trees = new Dictionary<UmbracoInfoAttribute, IContentTree>();
}
/// <summary>
/// Initializes a new instance of the <see cref="NodeDataProvider"/> class using umbraco settings as XML path
/// </summary>
public NodeDataProvider()
: this(UmbracoContext.Current.Server.MapPath(UmbracoContext.Current.Server.ContentXmlPath), UmbracoContext.Current.NewSchemaMode)
{
this._tryMemoryCache = true;
}
/// <summary>
/// Initializes a new instance of the <see cref="NodeDataProvider"/> class
/// </summary>
/// <param name="xmlPath">The path of the umbraco XML</param>
/// <param name="newSchemaMode">Indicates which Schema mode is used for the XML file</param>
/// <remarks>
/// This constructor is ideal for unit testing as it allows for the XML to be located anywhere
/// </remarks>
public NodeDataProvider(string xmlPath, bool newSchemaMode)
{
this.Init(xmlPath, newSchemaMode);
}
#region IDisposable Members
/// <summary>
/// Releases unmanaged and - optionally - managed resources
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected internal override void Dispose(bool disposing)
{
if (disposing)
{
this._xmlPath = null;
}
base.Dispose(disposing);
}
#endregion
/// <summary>
/// Gets the name of the provider
/// </summary>
/// <value>The name of the provider.</value>
public override string Name
{
get
{
return "NodeDataProvider";
}
}
/// <summary>
/// Loads the tree with the relivent DocTypes from the XML
/// </summary>
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
/// <returns><see cref="umbraco.Linq.Core.Node.NodeTree&lt;TDocType&gt;"/> representation of the content tree</returns>
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
public override Tree<TDocType> LoadTree<TDocType>()
{
CheckDisposed();
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocType));
if (!this._trees.ContainsKey(attr))
SetupNodeTree<TDocType>(attr);
return (NodeTree<TDocType>)this._trees[attr];
}
internal void SetupNodeTree<TDocType>(UmbracoInfoAttribute attr) where TDocType : DocTypeBase, new()
{
var tree = new NodeTree<TDocType>(this);
if (!this._trees.ContainsKey(attr))
{
lock (lockObject)
{
this._trees.Add(attr, tree); //cache so it's faster to get next time
}
}
else
{
this._trees[attr] = tree;
}
}
/// <summary>
/// Loads the specified id.
/// </summary>
/// <typeparam name="TDocType">The type of the doc type.</typeparam>
/// <param name="id">The id.</param>
/// <returns></returns>
/// <exception cref="umbraco.Linq.Core.DocTypeMissMatchException">If the type of the parent does not match the provided type</exception>
/// <exception cref="System.ArgumentException">No node found matching the provided ID for the parent</exception>
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
public override TDocType Load<TDocType>(int id)
{
CheckDisposed();
var parentXml = this.Xml.Descendants().SingleOrDefault(d => d.Attribute("isDoc") != null && (int)d.Attribute("id") == id);
if (!ReflectionAssistance.CompareByAlias(typeof(TDocType), parentXml))
throw new DocTypeMissMatchException(parentXml.Name.LocalName, ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocType)).Alias);
if (parentXml == null) //really shouldn't happen!
throw new ArgumentException("Parent ID \"" + id + "\" cannot be found in the loaded XML. Ensure that the umbracoDataContext is being disposed of once it is no longer needed");
var parent = new TDocType();
this.LoadFromXml(parentXml, parent);
return parent;
}
/// <summary>
/// Loads the associated (children) nodes with the relivent DocTypes
/// </summary>
/// <param name="parentNodeId">The parent node id.</param>
/// <returns></returns>
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
public override AssociationTree<DocTypeBase> LoadAssociation(int parentNodeId)
{
CheckDisposed();
NodeAssociationTree<DocTypeBase> associationTree = new NodeAssociationTree<DocTypeBase>(parentNodeId, this);
return associationTree;
}
/// <summary>
/// Loads the associated nodes with the relivent DocTypes
/// </summary>
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
/// <param name="nodes">The nodes.</param>
/// <returns></returns>
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
public override AssociationTree<TDocType> LoadAssociation<TDocType>(IEnumerable<TDocType> nodes)
{
CheckDisposed();
return new NodeAssociationTree<TDocType>(nodes);
}
/// <summary>
/// Loads the ancestors for a node
/// </summary>
/// <param name="startNodeId">The start node id.</param>
/// <returns></returns>
/// <exception cref="System.ObjectDisposedException">When the data provider has been disposed of</exception>
public override IEnumerable<DocTypeBase> LoadAncestors(int startNodeId)
{
CheckDisposed();
var startElement = this.Xml.Descendants().Single(x => x.Attribute("isDoc") != null && (int)x.Attribute("id") == startNodeId);
var ancestorElements = startElement.Ancestors();
IEnumerable<DocTypeBase> ancestors = DynamicNodeCreation(ancestorElements);
return ancestors;
}
/// <summary>
/// Creates a collection of nodes with the type specified from the XML
/// </summary>
/// <param name="elements">The elements.</param>
/// <returns>Collecton of .NET types from the XML</returns>
internal IEnumerable<DocTypeBase> DynamicNodeCreation(IEnumerable<XElement> elements)
{
// TODO: investigate this method for performance bottlenecks
// TODO: dataContext knows the types, maybe can load from there?
List<DocTypeBase> ancestors = new List<DocTypeBase>();
foreach (var ancestor in elements)
{
var alias = Casing.SafeAlias(ancestor.Name.LocalName);
var t = KnownTypes[alias];
var instaceOfT = (DocTypeBase)Activator.CreateInstance(t); //create an instance of the type and down-cast so we can use it
this.LoadFromXml(ancestor, instaceOfT);
instaceOfT.Provider = this;
ancestors.Add(instaceOfT);
yield return instaceOfT;
}
}
internal Dictionary<string, Type> KnownTypes
{
get
{
if (this._knownTypes == null)
{
this._knownTypes = new Dictionary<string, Type>();
var types = TypeFinder
.FindClassesOfType<DocTypeBase>()
.Where(t => t != typeof(DocTypeBase))
.ToDictionary(k =>
{
return ((UmbracoInfoAttribute)k.GetCustomAttributes(typeof(UmbracoInfoAttribute), true)[0]).Alias;
});
foreach (var type in types)
this._knownTypes.Add(Casing.SafeAlias(type.Key), type.Value);
}
return this._knownTypes;
}
}
/// <summary>
/// Flushes the cache for this provider
/// </summary>
public void Flush()
{
this.CheckDisposed();
this._xml = null;
this._trees.Clear();
}
/// <summary>
/// Loads from XML.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="xml">The XML.</param>
/// <param name="node">The node.</param>
public void LoadFromXml<T>(XElement xml, T node) where T : DocTypeBase
{
if (!ReflectionAssistance.CompareByAlias(node.GetType(), xml))
{
throw new DocTypeMissMatchException(xml.Name.LocalName, ReflectionAssistance.GetUmbracoInfoAttribute(node.GetType()).Alias);
}
node.Id = (int)xml.Attribute("id");
node.ParentNodeId = (int)xml.Attribute("parentID");
node.NodeName = (string)xml.Attribute("nodeName");
node.Version = (string)xml.Attribute("version");
node.CreateDate = (DateTime)xml.Attribute("createDate");
node.SortOrder = (int)xml.Attribute("sortOrder");
node.UpdateDate = (DateTime)xml.Attribute("updateDate");
node.CreatorID = (int)xml.Attribute("creatorID");
node.CreatorName = (string)xml.Attribute("creatorName");
node.WriterID = (int)xml.Attribute("writerID");
node.WriterName = (string)xml.Attribute("writerName");
node.Level = (int)xml.Attribute("level");
node.TemplateId = (int)xml.Attribute("template");
var properties = node.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => p.GetCustomAttributes(typeof(PropertyAttribute), true).Count() > 0);
foreach (var p in properties)
{
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(p);
XElement propertyXml = xml.Element(Casing.SafeAlias(attr.Alias));
string data = null;
//if the XML doesn't contain the property it means that the node hasn't been re-published with the property
//so then we'll leave the data at null, otherwise let's grab it
//Check if the propertyXml and propertyXml.FirstNode aren't null. If they are we don't need to set the value.
if (propertyXml != null && propertyXml.FirstNode != null)
{
//If the FirstNode is an XElement it means the property contains inner xml and we should return it. Otherwise just return the normal value.
if (propertyXml.FirstNode is XElement)
{
var reader = propertyXml.CreateReader();
reader.MoveToContent();
data = reader.ReadInnerXml();
}
else
{
data = propertyXml.Value;
}
}
if (p.PropertyType.IsValueType && p.PropertyType.GetGenericArguments().Length > 0 && typeof(Nullable<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition()))
{
if (string.IsNullOrEmpty(data))
{
//non-mandatory structs which have no value will be null
try
{
p.SetValue(node, null, null);
}
catch (FormatException ex)
{
throw new FormatException(
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
}
}
else
{
//non-mandatory structs which do have a value have to be cast based on the type of their Nullable<T>, found from the first (well, only) GenericArgument
try
{
p.SetValue(node, Convert.ChangeType(data, p.PropertyType.GetGenericArguments()[0]), null);
}
catch (FormatException ex)
{
throw new FormatException(
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
}
}
}
else
{
// TODO: Address how Convert.ChangeType works in globalisation
try
{
p.SetValue(node, Convert.ChangeType(data, p.PropertyType), null);
}
catch (FormatException ex)
{
throw new FormatException(
string.Format("Unable to cast '{0}' to the appropriate type ({1}) for node `{2}`. The alias of the property being parsed is {3}. Refer to inner exception for more details", data, p.PropertyType.FullName, node.Id, attr.Alias), ex);
}
}
}
}
}
}
@@ -1,119 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
namespace umbraco.Linq.Core.Node
{
/// <summary>
/// Represents a collection of TDocTypeBase retrieved from the umbraco XML cache
/// </summary>
/// <typeparam name="TDocTypeBase">The type of the doc type base.</typeparam>
public sealed class NodeTree<TDocTypeBase> : Tree<TDocTypeBase> where TDocTypeBase : DocTypeBase, new()
{
private object lockObject = new object();
private NodeDataProvider _provider;
private List<TDocTypeBase> _nodes;
internal NodeTree(NodeDataProvider provider)
{
this._provider = provider;
}
/// <summary>
/// Gets or sets the provider.
/// </summary>
/// <value>The provider.</value>
public override UmbracoDataProvider Provider
{
get
{
return this._provider;
}
protected set
{
var nodeProvider = value as NodeDataProvider;
if (nodeProvider == null)
{
throw new ArgumentException("Value must be of type NodeDataProvider");
}
this._provider = nodeProvider;
}
}
/// <summary>
/// Indicates that the NodeTree is ReadOnly
/// </summary>
/// <value>
/// <c>true</c>
/// </value>
public override bool IsReadOnly
{
get
{
return true;
}
}
/// <summary>
/// Gets the enumerator.
/// </summary>
/// <returns></returns>
public override IEnumerator<TDocTypeBase> GetEnumerator()
{
if (this._nodes == null)
{
this._nodes = new List<TDocTypeBase>();
var rawNodes = this._provider.Xml.Descendants().Where(x => ReflectionAssistance.CompareByAlias(typeof(TDocTypeBase), x));
lock (lockObject)
{
foreach (XElement n in rawNodes)
{
var dt = new TDocTypeBase();
this._provider.LoadFromXml(n, dt);
dt.IsDirty = false;
dt.Provider = this._provider;
this._nodes.Add(dt);
}
}
}
return this._nodes.GetEnumerator();
}
/// <summary>
/// Reloads the cache for the particular NodeTree
/// </summary>
public override void ReloadCache()
{
this._provider.CheckDisposed();
var attr = ReflectionAssistance.GetUmbracoInfoAttribute(typeof(TDocTypeBase));
this._provider.SetupNodeTree<TDocTypeBase>(attr);
}
public override void InsertOnSubmit(TDocTypeBase item)
{
throw new NotImplementedException("The NodeTree does not support Inserting items");
}
public override void InsertAllOnSubmit(IEnumerable<TDocTypeBase> items)
{
throw new NotImplementedException("The NodeTree does not support Inserting items");
}
public override void DeleteOnSubmit(TDocTypeBase itemm)
{
throw new NotImplementedException("The NodeTree does not support Deleting items");
}
public override void DeleteAllOnSubmit(IEnumerable<TDocTypeBase> items)
{
throw new NotImplementedException("The NodeTree does not support Deleting items");
}
}
}
@@ -1,12 +0,0 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Core")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Core")]
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("umbraco.Linq.Core.Tests")]
[assembly: ComVisible(false)]
@@ -1,55 +0,0 @@
using System;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
using umbraco.cms.helpers;
namespace umbraco.Linq.Core
{
/// <summary>
/// Class containing helpers when doing reflection against nodes
/// </summary>
public sealed class ReflectionAssistance
{
private ReflectionAssistance() { }
/// <summary>
/// Prebuilt function for getting the custom properites of the class
/// </summary>
/// <remarks>This is a Lambda function which will return all the properties of the current class which are custom DocType properties</remarks>
internal static Func<PropertyInfo, bool> CustomDocTypeProperties = p => p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false).Count() != 0 && p.GetCustomAttributes(typeof(PropertyAttribute), false).Count() != 0;
/// <summary>
/// Prebuild function for getting the mandatory properites of the class
/// </summary>
/// <remarks>This is a Lambda function which will return all the properties of the current class which are custom DocType properties and mandatory</remarks>
internal static Func<PropertyInfo, bool> MandatoryDocTypeProperties = p => p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false).Count() != 0 && ((UmbracoInfoAttribute)p.GetCustomAttributes(typeof(UmbracoInfoAttribute), false)[0]).Mandatory;
/// <summary>
/// Compares a .NET type to an Xml representation
/// </summary>
internal static Func<Type, XElement, bool> CompareByAlias = (t, x) => x.Name.LocalName == Casing.SafeAlias(ReflectionAssistance.GetUmbracoInfoAttribute(t).Alias);
/// <summary>
/// Get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for a <see cref="System.Reflection.MethodInfo"/> object
/// </summary>
/// <param name="member">The methodInfo to get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for.</param>
/// <returns></returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "umbraco")]
public static UmbracoInfoAttribute GetUmbracoInfoAttribute(MemberInfo member)
{
return member.GetCustomAttributes(typeof(UmbracoInfoAttribute), true).Cast<UmbracoInfoAttribute>().SingleOrDefault();
}
/// <summary>
/// Get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for a type
/// </summary>
/// <param name="type">The type to get the <see cref="umbraco.Linq.Core.umbracoInfoAttribute"/> for.</param>
/// <returns></returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public static UmbracoInfoAttribute GetUmbracoInfoAttribute(Type type)
{
return type.GetCustomAttributes(typeof(UmbracoInfoAttribute), true).Cast<UmbracoInfoAttribute>().SingleOrDefault();
}
}
}
@@ -1,109 +0,0 @@
using System;
namespace umbraco.Linq.Core
{
/// <summary>
/// Typed switch implementation from Bart De Smet: http://community.bartdesmet.net/blogs/bart/archive/2008/03/30/a-functional-c-type-switch.aspx
/// </summary>
public class Switch
{
/// <summary>
/// Initializes a new instance of the <see cref="Switch"/> class.
/// </summary>
/// <param name="o">The o.</param>
public Switch(object o)
{
Obj = o;
}
/// <summary>
/// Gets or sets the object being operated against
/// </summary>
/// <value>The obj.</value>
public object Obj { get; private set; }
/// <summary>
/// Case statement
/// </summary>
/// <typeparam name="T">Type of object</typeparam>
/// <param name="a">Action method to execute for case evaluation</param>
/// <returns></returns>
public Switch Case<T>(Action<T> a)
{
return Case<T>(o => true, a, false);
}
/// <summary>
/// Case statement
/// </summary>
/// <typeparam name="T">Type of object</typeparam>
/// <param name="a">Action method to execute for case evaluation</param>
/// <param name="fallThrough">if set to <c>true</c> fall through to next case statement.</param>
/// <returns></returns>
public Switch Case<T>(Action<T> a, bool fallThrough)
{
return Case<T>(o => true, a, fallThrough);
}
/// <summary>
/// Case statement
/// </summary>
/// <typeparam name="T">Type of object</typeparam>
/// <param name="c">The funcation to eveluate against to object.</param>
/// <param name="a">Action method to execute for case evaluation</param>
/// <returns></returns>
public Switch Case<T>(Func<T, bool> c, Action<T> a)
{
return Case<T>(c, a, false);
}
/// <summary>
/// Case statement
/// </summary>
/// <typeparam name="T">Type of object</typeparam>
/// <param name="c">The funcation to eveluate against to object.</param>
/// <param name="a">Action method to execute for case evaluation</param>
/// <param name="fallThrough">if set to <c>true</c> fall through to next case statement.</param>
/// <returns></returns>
public Switch Case<T>(Func<T, bool> c, Action<T> a, bool fallThrough)
{
if (this == null)
{
return null;
}
else
{
if (this.Obj is T)
{
T t = (T)this.Obj;
if (c(t))
{
a(t);
return fallThrough ? this : null;
}
}
}
return this;
}
/// <summary>
/// Defaults case
/// </summary>
/// <typeparam name="T">Type of object</typeparam>
/// <param name="a">Action to perform</param>
/// <returns></returns>
public Switch Default<T>(Action<T> a)
{
if (this == null)
{
return null;
}
else
{
a((T)this.Obj);
return this;
}
}
}
}
@@ -1,88 +0,0 @@
using System.Collections.Generic;
using System.Collections;
namespace umbraco.Linq.Core
{
/// <summary>
/// Represents a collection within DataProvider of a DocType
/// </summary>
/// <remarks>
/// Similar to the implementation of <see cref="System.Data.Linq.Table&lt;TEntity&gt;"/>,
/// providing a single collection which represents all instances of the given type within the DataProvider.
///
/// Implementers of this type will need to provide a manner of retrieving the TDocType from the DataProvider
/// </remarks>
/// <typeparam name="TDocType">The type of the DocType.</typeparam>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
public abstract class Tree<TDocType> : IContentTree, IEnumerable<TDocType>, IEnumerable
where TDocType : DocTypeBase, new()
{
#region IContentTree Members
/// <summary>
/// Gets the <see cref="umbracoDataProvider"/> Provider associated with this instance
/// </summary>
/// <value>The provider.</value>
public abstract UmbracoDataProvider Provider { get; protected set; }
/// <summary>
/// Gets a value indicating whether this instance is read only. The collection is not ReadOnly by default
/// </summary>
/// <value>
/// <c>false</c> to indicate that this collection isn't read-only
/// </value>
public virtual bool IsReadOnly
{
get
{
return false;
}
}
public abstract void ReloadCache();
#endregion
#region IEnumerable<TDocType> Members
/// <summary>
/// Returns an enumerator that iterates through the collection.
/// </summary>
/// <returns>
/// A <see cref="T:System.Collections.Generic.IEnumerator`1"/> that can be used to iterate through the collection.
/// </returns>
public abstract IEnumerator<TDocType> GetEnumerator();
#endregion
#region IEnumerable Members
IEnumerator IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
#endregion
/// <summary>
/// Insert an item on submit of the DataContext
/// </summary>
/// <param name="item">The item.</param>
public abstract void InsertOnSubmit(TDocType item);
/// <summary>
/// Insert a collection of items on submit of the DataContext
/// </summary>
/// <param name="items">The items.</param>
public abstract void InsertAllOnSubmit(IEnumerable<TDocType> items);
/// <summary>
/// Deletes an item on submit of the DataContext
/// </summary>
/// <param name="itemm">The itemm.</param>
public abstract void DeleteOnSubmit(TDocType itemm);
/// <summary>
/// Deletes a collection of items on submit of the DataContext
/// </summary>
/// <param name="items">The items.</param>
public abstract void DeleteAllOnSubmit(IEnumerable<TDocType> items);
}
}
@@ -1,114 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using umbraco.Linq.Core.Node;
namespace umbraco.Linq.Core
{
/// <summary>
/// The umbracoDataContext which handles the interaction with an <see cref="umbraco.Linq.Core.UmbracoDataProvider"/>
/// </summary>
public abstract class UmbracoDataContext : IUmbracoDataContext
{
#region Privates
private UmbracoDataProvider _dataProvider;
#endregion
/// <summary>
/// Loads the tree of umbraco items.
/// </summary>
/// <typeparam name="TDocTypeBase">The type of the DocTypeBase.</typeparam>
/// <returns>Collection of umbraco items</returns>
/// <exception cref="System.ObjectDisposedException">If the DataContext has been disposed of</exception>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
protected Tree<TDocTypeBase> LoadTree<TDocTypeBase>() where TDocTypeBase : DocTypeBase, new()
{
CheckDisposed();
return this._dataProvider.LoadTree<TDocTypeBase>();
}
/// <summary>
/// Gets the data provider.
/// </summary>
/// <value>The data provider.</value>
public UmbracoDataProvider DataProvider
{
get
{
return this._dataProvider;
}
}
/// <summary>
/// Submits the changes within the UmbracoDataContext through the <see cref="umbraco.Linq.Core.UmbracoDataProvider"/>
/// </summary>
public void SubmitChanges()
{
this.CheckDisposed();
this._dataProvider.SubmitChanges();
}
#region Constructors
/// <summary>
/// Initializes a new instance of the <see cref="umbraco.Linq.Core.UmbracoDataProvider"/> class, using a <see cref="umbraco.Linq.Core.Node.NodeDataProvider"/> data provider with the connection string from the umbraco config
/// </summary>
protected UmbracoDataContext() : this(new NodeDataProvider())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="umbraco.Linq.Core.UmbracoDataProvider"/> class.
/// </summary>
/// <param name="dataProvider">The data provider to use within the DataContext.</param>
protected UmbracoDataContext(UmbracoDataProvider dataProvider)
{
this._dataProvider = dataProvider;
}
#endregion
#region IDisposable Members
private bool _disposed;
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if (!this._disposed && disposing)
{
if (this._dataProvider != null)
{
this._dataProvider.Dispose(true);
}
this._disposed = true;
}
}
private void CheckDisposed()
{
if (this._disposed)
{
throw new ObjectDisposedException(null);
}
}
#endregion
}
}
@@ -1,106 +0,0 @@
using System;
using System.Collections.Generic;
namespace umbraco.Linq.Core
{
/// <summary>
/// Provides the methods required for a data access model within the LINQ to Umbraco project
/// </summary>
/// <remarks>
/// This base class is used when defining how a DataProvider operates against a data source (such as the umbraco.config).
///
/// It provides abstractions for all the useful operations of the DataProvider
/// </remarks>
public abstract class UmbracoDataProvider : IDisposable
{
/// <summary>
/// Indicates the disposal status of the current provider
/// </summary>
protected bool _disposed;
/// <summary>
/// Gets the name of the provider
/// </summary>
/// <value>The name of the provider.</value>
public abstract string Name { get; }
/// <summary>
/// Loads the tree with the relevant DocTypes
/// </summary>
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
/// <returns></returns>
public abstract Tree<TDocType> LoadTree<TDocType>() where TDocType : DocTypeBase, new();
/// <summary>
/// Loads the associated nodes with the relevant DocTypes
/// </summary>
/// <param name="parentNodeId">The parent node id.</param>
/// <returns></returns>
public abstract AssociationTree<DocTypeBase> LoadAssociation(int parentNodeId);
/// <summary>
/// Loads the associated nodes with the relevant DocTypes
/// </summary>
/// <typeparam name="TDocType">The type of the DocType to load.</typeparam>
/// <param name="nodes">The nodes.</param>
/// <returns></returns>
public abstract AssociationTree<TDocType> LoadAssociation<TDocType>(IEnumerable<TDocType> nodes) where TDocType : DocTypeBase, new();
/// <summary>
/// Loads the specified id.
/// </summary>
/// <typeparam name="TDocType">The type of the doc type.</typeparam>
/// <param name="id">The id.</param>
/// <returns></returns>
public abstract TDocType Load<TDocType>(int id) where TDocType : DocTypeBase, new();
/// <summary>
/// Loads the ancestors.
/// </summary>
/// <param name="startNodeId">The start node id.</param>
/// <returns></returns>
public abstract IEnumerable<DocTypeBase> LoadAncestors(int startNodeId);
#region IDisposable Members
/// <summary>
/// Checks if the provider has been disposed
/// </summary>
protected internal void CheckDisposed()
{
if (this._disposed)
throw new ObjectDisposedException(null);
}
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
/// </summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
/// <summary>
/// Releases unmanaged and - optionally - managed resources
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
protected internal virtual void Dispose(bool disposing)
{
this._disposed = true;
}
#endregion
/// <summary>
/// Submits the changes tracked by the UmbracoDataProvider
/// </summary>
/// <remarks>It is up to the implementor of the UmbracoDataProvider to decide whether or not they are supporting change submission in their provider. This will thrown an exception unless it is explicitly implemented.</remarks>
/// <exception cref="System.NotImplementedException">Thrown unless the method is implemented in a custom UmbracoDataProvider.</exception>
protected internal virtual void SubmitChanges()
{
throw new NotImplementedException("Provider \"" + this.Name + "\" does not implement a submittable pattern");
}
}
}
@@ -1,154 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{31CAEC36-0C3D-4D69-B092-84866811EA07}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>umbraco.Linq.Core</RootNamespace>
<AssemblyName>umbraco.Linq.Core</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<umbracoPresentationPath>..\..\..\..\..\umbraco\presentation\bin</umbracoPresentationPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\umbraco.Linq.Core.xml</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\umbraco.Linq.Core.XML</DocumentationFile>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Serialization">
<RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\System.Web.Abstractions.dll</HintPath>
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.XML" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\..\..\SolutionInfo.cs">
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="AssociationTree.cs" />
<Compile Include="Attributes.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="IContentTree.cs" />
<Compile Include="IDocTypeBase.cs" />
<Compile Include="IUmbracoDataContext.cs" />
<Compile Include="UmbracoDataProvider.cs" />
<Compile Include="Node\NodeAssociationTree.cs" />
<Compile Include="Node\NodeTree.cs" />
<Compile Include="Node\NodeDataProvider.cs" />
<Compile Include="Tree.cs" />
<Compile Include="UmbracoDataContext.cs" />
<Compile Include="DocTypeBase.cs" />
<Compile Include="Exceptions.cs" />
<Compile Include="ReflectionAssistance.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Switch.cs" />
</ItemGroup>
<ItemGroup>
<None Include="CoreClasses.cd" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\umbraco.businesslogic\umbraco.businesslogic.csproj">
<Project>{E469A9CE-1BEC-423F-AC44-713CD72457EA}</Project>
<Name>umbraco.businesslogic</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\umbraco.cms\umbraco.cms.csproj">
<Project>{CCD75EC3-63DB-4184-B49D-51C1DD337230}</Project>
<Name>umbraco.cms</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\..\umbraco.presentation\umbraco.presentation.csproj">
<Project>{651E1350-91B6-44B7-BD60-7207006D7003}</Project>
<Name>umbraco.presentation</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>-->
<Target Name="AfterBuild">
</Target>
<PropertyGroup>
<PostBuildEvent>XCOPY "$(TargetPath)" "$(SolutionDir)\umbraco\presentation\bin" /Y</PostBuildEvent>
</PropertyGroup>
</Project>
File diff suppressed because it is too large Load Diff
@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{4872D945-97E8-4C30-8EDC-64E424645979}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Umbraco.Linq.DTMetal.CodeBuilder.Installer</RootNamespace>
<AssemblyName>Umbraco.Linq.DTMetal.CodeBuilder.Installer</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Solution Items\umbraco-key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Solution Items\SolutionInfo.cs">
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="InstallerHandler.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="InstallerProgress.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="InstallerProgress.Designer.cs">
<DependentUpon>InstallerProgress.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="InstallerProgress.resx">
<DependentUpon>InstallerProgress.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Item packages\LINQtoUmbracoCS.zip" />
<Content Include="Item packages\LINQtoUmbracoVB.zip" />
</ItemGroup>
<ItemGroup>
<None Include="..\Solution Items\umbraco-key.snk">
<Link>Properties\umbraco-key.snk</Link>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DTMetal.CodeBuilder\DTMetal.CodeBuilder.csproj">
<Project>{461089E7-008E-4737-BA17-E1FCD1CC3D0E}</Project>
<Name>DTMetal.CodeBuilder</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -1,50 +0,0 @@
using System.ComponentModel;
using Microsoft.Win32;
using System.Windows.Forms;
using System.Globalization;
namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer
{
[RunInstaller(true)]
public class InstallerHandler : System.Configuration.Install.Installer
{
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
var vsPath = GetVsPath();
var targetPath = Context.Parameters["TargetDir"];
if (vsPath != null && targetPath != null)
{
var progress = new InstallerProgress(InstallMode.Install, vsPath, targetPath);
MessageBoxOptions options = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? MessageBoxOptions.RightAlign | MessageBoxOptions.RtlReading : 0;
if (progress.ShowDialog() != DialogResult.OK)
{
MessageBox.Show("VS 2008 Setup Failed", "LINQ to Umbraco Setup", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, options);
MessageBox.Show(progress.Error.ToString());
}
}
}
private static string GetVsPath()
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0", false);
if (key != null)
return (string)key.GetValue("InstallDir");
return null;
}
public override void Uninstall(System.Collections.IDictionary savedState)
{
base.Uninstall(savedState);
var vsPath = GetVsPath();
if (vsPath != null)
{
var progress = new InstallerProgress(InstallMode.Uninstall, vsPath, null);
progress.ShowDialog();
}
}
}
}
@@ -1,84 +0,0 @@
namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer
{
partial class InstallerProgress
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallerProgress));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.installWorker = new System.ComponentModel.BackgroundWorker();
this.SuspendLayout();
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// progressBar1
//
resources.ApplyResources(this.progressBar1, "progressBar1");
this.progressBar1.Name = "progressBar1";
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee;
//
// installWorker
//
this.installWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.installWorker_DoWork);
this.installWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.installWorker_RunWorkerCompleted);
//
// InstallerProgress
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ControlBox = false;
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "InstallerProgress";
this.Load += new System.EventHandler(this.InstallerProgress_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ProgressBar progressBar1;
private System.ComponentModel.BackgroundWorker installWorker;
}
}
@@ -1,287 +0,0 @@
using System;
using System.ComponentModel;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Globalization;
using Microsoft.Win32;
using System.Linq;
namespace Umbraco.Linq.DTMetal.CodeBuilder.Installer
{
public partial class InstallerProgress : Form
{
private const string generatorKey = "{52B316AA-1997-4c81-9969-95404C09EEB4}";
private const string dtml = ".dtml";
private const string clas = "LINQtoUmbraco.DTML.1.0";
private const string desc = "LINQ to Umbraco Entity Mapping";
private InstallMode _mode;
private string _vsPath;
private string _targetPath;
public InstallerProgress(InstallMode mode, string vsPath, string targetPath)
{
InitializeComponent();
_mode = mode;
_vsPath = vsPath;
_targetPath = targetPath;
}
#region Events
private void installWorker_DoWork(object sender, DoWorkEventArgs e)
{
switch (_mode)
{
case InstallMode.Install:
InstallVsTemplates();
SetupRegistry();
InstallDtmlXsd();
ConfigVs();
break;
case InstallMode.Uninstall:
UninstallVsTemplates();
TearDownRegistry();
UninstallDtmlXsd();
ConfigVs();
break;
default:
break;
}
}
private void installWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Error != null)
{
this.DialogResult = DialogResult.Cancel;
this.Error = e.Error;
}
else
{
this.DialogResult = DialogResult.OK;
}
}
public Exception Error { get; set; }
private void InstallerProgress_Load(object sender, EventArgs e)
{
installWorker.RunWorkerAsync();
}
#endregion
#region Uninstall
private void UninstallDtmlXsd()
{
try
{
File.Delete(GetDtmlXsdPath());
}
catch { }
}
private void TearDownRegistry()
{
if(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey) != null)
{
Registry.LocalMachine.DeleteSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey);
}
if (Registry.ClassesRoot.OpenSubKey(dtml) != null)
{
Registry.ClassesRoot.DeleteSubKeyTree(dtml);
}
if (Registry.ClassesRoot.OpenSubKey(clas) != null)
{
Registry.ClassesRoot.DeleteSubKeyTree(clas);
}
}
private void UninstallVsTemplates()
{
string csTgt = Path.Combine(_vsPath, @"ItemTemplates\CSharp\1033\LINQtoUmbracoCS.zip");
string vbTgt = Path.Combine(_vsPath, @"ItemTemplates\VisualBasic\1033\LINQtoUmbracoVB.zip");
try
{
File.Delete(csTgt);
File.Delete(vbTgt);
}
catch { }
}
#endregion
#region Install
private void InstallDtmlXsd()
{
//string assemblyName = GetCodeBuilderAssemblyName();
//Assembly assembly = Assembly.Load(assemblyName);
//it seems that it runs this before the GAC is deployed, so the above code deosn't work
//I have to embed the XSD in this assembly instead
var assembly = Assembly.GetExecutingAssembly();
// Load the XSD for DocTypeML.
string xsd;
using (Stream s = ClassGenerator.GetXsd())
{
using (StreamReader sr = new StreamReader(s))
{
xsd = sr.ReadToEnd();
}
}
// Write the XSD to the Visual Studio folder with XML schemas.
using (StreamWriter sw = File.CreateText(GetDtmlXsdPath()))
{
sw.Write(xsd);
}
}
private void SetupRegistry()
{
#region LINQtoUmbracoGenerator Key
RegistryKey genKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\VisualStudio\9.0\CLSID\" + generatorKey);
genKey.SetValue("Assembly", GetCodeBuilderAssemblyName()); //full name of the assembly which the generator is in
genKey.SetValue("Class", "Umbraco.Linq.DTMetal.CodeBuilder.LINQtoUmbracoGenerator"); //generator class
genKey.SetValue("InprocServer32", Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), @"system32\mscoree.dll"));
genKey.SetValue("ThreadingModel", "Both");
genKey.Close();
#endregion
#region HKEY_CLASSES_ROOT\.dtml
{
RegistryKey dtmlKey = Registry.ClassesRoot.CreateSubKey(dtml, RegistryKeyPermissionCheck.ReadWriteSubTree);
dtmlKey.SetValue(null, clas);
dtmlKey.Close();
}
#endregion
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0
{
RegistryKey kClas = Registry.ClassesRoot.CreateSubKey(clas, RegistryKeyPermissionCheck.ReadWriteSubTree);
kClas.SetValue(null, desc);
kClas.SetValue("AlwaysShowExt", "1");
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\DefaultIcon
{
RegistryKey kIcon = kClas.CreateSubKey("DefaultIcon");
kIcon.SetValue(null, Path.Combine(_targetPath, @"DTMetal.exe") + ",0");
kIcon.Close();
}
#endregion
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell
{
RegistryKey kShel = kClas.CreateSubKey("shell");
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open
{
RegistryKey kOpen = kShel.CreateSubKey("Open");
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\Command
{
RegistryKey kComm = kOpen.CreateSubKey("Command");
kComm.SetValue(null, "\"" + Path.Combine(_vsPath, "devenv.exe") + "\" /dde \"%1\"");
kComm.Close();
}
#endregion
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec
{
RegistryKey kDdex = kOpen.CreateSubKey("ddeexec");
kDdex.SetValue(null, "Open(\"%1\")");
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec\Application
{
RegistryKey kAppn = kDdex.CreateSubKey("Application");
kAppn.SetValue(null, "VisualStudio.9.0");
kAppn.Close();
}
#endregion
#region HKEY_CLASSES_ROOT\LINQtoUmbraco.DTML.1.0\shell\Open\ddeexec\Topic
{
RegistryKey kTopc = kDdex.CreateSubKey("Topic");
kTopc.SetValue(null, "system");
kTopc.Close();
}
#endregion
kDdex.Close();
}
#endregion
kOpen.Close();
}
#endregion
kShel.Close();
}
#endregion
kClas.Close();
}
#endregion
}
private void InstallVsTemplates()
{
string csSrc = Path.Combine(_targetPath, @"Item packages\LINQtoUmbracoCS.zip");
string vbSrc = Path.Combine(_targetPath, @"Item packages\LINQtoUmbracoVB.zip");
string csTgt = Path.Combine(_vsPath, @"ItemTemplates\CSharp\1033\LINQtoUmbracoCS.zip");
string vbTgt = Path.Combine(_vsPath, @"ItemTemplates\VisualBasic\1033\LINQtoUmbracoVB.zip");
if (!File.Exists(csTgt))
File.Copy(csSrc, csTgt);
if (!File.Exists(vbTgt))
File.Copy(vbSrc, vbTgt);
}
#endregion
private static string GetCodeBuilderAssemblyName()
{
//get the assembly version info
AssemblyName current = Assembly.GetExecutingAssembly().GetName();
StringBuilder sb = new StringBuilder();
foreach (byte b in current.GetPublicKeyToken())
sb.AppendFormat("{0:x2}", b);
string publicKeyToken = sb.ToString();
string version = current.Version.ToString();
return String.Format(CultureInfo.InvariantCulture, "Umbraco.Linq.DTMetal.CodeBuilder, Version={0}, Culture=neutral, PublicKeyToken={1}", version, publicKeyToken);
}
private string GetDtmlXsdPath()
{
string path = _vsPath; //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\
path = path.TrimEnd('\\'); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE
path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0\Common7
path = path.Substring(0, path.LastIndexOf('\\')); //%ProgramFiles%\Microsoft Visual Studio 9.0
path = Path.Combine(path, "Xml"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml
path = Path.Combine(path, "Schemas"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas
path = Path.Combine(path, "DocTypeML.xsd"); //%ProgramFiles%\Microsoft Visual Studio 9.0\Xml\Schemas\DocTypeML.xsd
return path;
}
private void ConfigVs()
{
string devenv = Path.Combine(_vsPath, "devenv.exe");
Process p = Process.Start(devenv, "/InstallVSTemplates");
p.WaitForExit();
}
}
public enum InstallMode
{
Install,
Uninstall
}
}
@@ -1,228 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>13, 13</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>246, 13</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>LINQ to Umbraco is configuring Visual Studio 2008</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 30</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>221, 13</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>This may take a few minutes, please stand by</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="progressBar1.Location" type="System.Drawing.Point, System.Drawing">
<value>16, 61</value>
</data>
<data name="progressBar1.Size" type="System.Drawing.Size, System.Drawing">
<value>243, 27</value>
</data>
<data name="progressBar1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="&gt;&gt;progressBar1.Name" xml:space="preserve">
<value>progressBar1</value>
</data>
<data name="&gt;&gt;progressBar1.Type" xml:space="preserve">
<value>System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;progressBar1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;progressBar1.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="installWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>275, 100</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>LINQ to Umbraco Installer Progress</value>
</data>
<data name="&gt;&gt;installWorker.Name" xml:space="preserve">
<value>installWorker</value>
</data>
<data name="&gt;&gt;installWorker.Type" xml:space="preserve">
<value>System.ComponentModel.BackgroundWorker, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>InstallerProgress</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
@@ -1,31 +0,0 @@
<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
<TemplateData>
<Name>LINQ to Umbraco File</Name>
<Description>An empty LINQ to Umbraco file</Description>
<Icon>umbraco.ico</Icon>
<ProjectType>CSharp</ProjectType>
<SortOrder>100</SortOrder>
<DefaultName>DataClasses.dtml</DefaultName>
<NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>
<TemplateID>Umbraco.Linq.Core.Designer</TemplateID>
<RequiredFrameworkVersion>3.5</RequiredFrameworkVersion>
</TemplateData>
<TemplateContent>
<References>
<Reference>
<Assembly>System</Assembly>
</Reference>
<Reference>
<Assembly>System.Core</Assembly>
</Reference>
<Reference>
<Assembly>Umbraco.Linq.Core</Assembly>
</Reference>
</References>
<ProjectItem TargetFileName="$fileinputname$.dtml" ReplaceParameters="true">dtml.dtml</ProjectItem>
<CustomParameters>
<CustomParameter Name="$CustomTool$" Value="LINQtoUmbracoGenerator" />
<CustomParameter Name="$Namespace$" Value="$rootnamespace$" />
</CustomParameters>
</TemplateContent>
</VSTemplate>
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<auto-generated>
This code was generated by a tool.
LINQ to Umbraco Version: $version$
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
</auto-generated>
-->
<DocumentTypes Serialization="Unidirectional" DataContextName="$fileinputname$" PluralizeCollections="true">
</DocumentTypes>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

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