diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index 602548d78..9ba1a9c85 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -16,29 +16,56 @@ jobs: shell: pwsh runs-on: windows-latest steps: - - name: Clone repository + - name: Clone Repository uses: actions/checkout@v4.1.1 - - name: Restore NuGet packages + - name: Restore NuGet Packages run: nuget restore src/Orchard.sln - - name: Add msbuild to PATH + - name: Add MSBuild to PATH uses: microsoft/setup-msbuild@v2 - name: Compile - run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError + run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /p:MvcBuildViews=true - name: Test run: msbuild Orchard.proj /m /v:minimal /t:Test + - name: Test Setup with SpecFlow + run: | + $nunitConsole = (Get-ChildItem -Path 'src/packages' -Recurse -Filter 'nunit-console.exe' | Select-Object -Last 1).FullName + & $nunitConsole 'build/Compile/Orchard.Specs.dll' /xml='build/Orchard.Specs.xml' /run=Orchard.Specs.SetupFeature.RootAndSetupFolderShowsSetupScreenAndFormValuesAreValidated + + - name: Run Orchard Setup with Orchard.exe + run: | + $commandFile = 'src/Orchard.Web/bin/setup-commands.txt' + New-Item -Path $commandFile -ItemType File -Force + Set-Content -Path $commandFile -Value 'setup /SiteName:Orchard /AdminUsername:admin /AdminPassword:Password1! /DatabaseProvider:SqlCe /Recipe:Default' + & 'src/Orchard.Web/bin/Orchard.exe' @$commandFile + + - name: Run Code Generation + run: | + $commandFile = 'src/Orchard.Web/bin/codegen-commands.txt' + New-Item -Path $commandFile -ItemType File -Force + Set-Content -Path $commandFile -Value @' + feature enable Orchard.CodeGeneration + codegen module Orchard.CodeGeneration.TestModule + codegen theme Orchard.CodeGeneration.TestTheme /CreateProject:true + codegen moduletests Orchard.CodeGeneration.TestModule + '@ + & 'src/Orchard.Web/bin/Orchard.exe' @$commandFile + + - name: Compile Again with Generated Projects + run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /NoWarn:CS2008 + compile-node: - name: Compile client-side assets + name: Compile Client-side Assets defaults: run: shell: pwsh runs-on: windows-latest steps: - - name: Clone repository + - name: Clone Repository uses: actions/checkout@v4.1.1 - name: Setup NodeJS @@ -46,7 +73,7 @@ jobs: with: node-version: '7' - - name: Setup NPM packages + - name: Setup NPM Packages working-directory: ./src run: | npm install --loglevel warn @@ -55,7 +82,7 @@ jobs: $gulpVersion = (Get-Content Package.json -Raw | ConvertFrom-Json).devDependencies.gulp Start-Process npm -NoNewWindow -Wait -ArgumentList "install gulp@$gulpVersion -g --loglevel warn" - - name: Rebuild client-side assets + - name: Rebuild Client-side Assets working-directory: ./src run: | gulp rebuild diff --git a/CREDITS.txt b/CREDITS.txt index f45a44093..35b9411f1 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -52,12 +52,6 @@ Website: http://dlr.codeplex.com Copyright: Copyright (c) Microsoft Corporation License: Apache Software Foundation License 2.0 -DotNetZip ------ -Website: http://dotnetzip.codeplex.com/ -Copyright: -License: MS-PL - Eric Meyer's Reset CSS ----- Website: http://meyerweb.com/eric/tools/css/reset/ diff --git a/README.md b/README.md index 5a7073d25..19d04cb9e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,14 @@ # Orchard -Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. +Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. You are looking at Orchard 1, the older, .NET Framework-based version that has been in development since 2009. -[![Join the chat at https://gitter.im/OrchardCMS/Orchard](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +If you're starting a new project (or maintaining a project built on Orchard 1), you should check out [Orchard Core](https://github.com/OrchardCMS/OrchardCore), the new generation of Orchard built on ASP.NET Core. You can also try it for free on [DotNest.com](https://dotnest.com)! -You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button. - -[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS) +Join the community discussion on [Discord](https://orchardcore.net/discord), where we also have a [channel dedicated to Orchard 1](https://discord.com/channels/551136772243980291/551137194689953848). ## About The Orchard Project -#### Please visit our website at https://orchardproject.net for the most current information about this project. +#### Please visit our website at https://orchardcore.net for the most current information about this project. Orchard is a free, open source, community-focused **Content Management System** built on the ASP.NET MVC platform. @@ -24,12 +22,12 @@ Our mission is to empower our users and foster a dedicated and diverse community Orchard is currently in version **[1.10.3](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.3)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*). -We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach. +We invite participation by the developer community in shaping the project's direction, so that we can publicly validate our designs and development approach. All our releases are available on our [Releases](https://github.com/OrchardCMS/Orchard/releases) page, and we encourage interested developers to check out the source code on the Orchard GitHub site and get involved with the project. * [Download the latest release](https://github.com/OrchardCMS/Orchard/releases) -* [Feature roadmap](https://docs.orchardproject.net/en/latest/Documentation/Feature-roadmap/) -* [Docs and designs/specs](https://docs.orchardproject.net) +* [Feature roadmap](https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Feature-roadmap/) +* [Docs and designs/specs](https://docs.orchardcore.net/projects/O1/en/latest/) ## How To Get Involved @@ -42,11 +40,7 @@ There are many ways you can contribute to Orchard: * [Find and file a bug](https://github.com/OrchardCMS/Orchard/issues) * [Propose a feature idea](https://github.com/OrchardCMS/Orchard/issues/new) * [Ask and answer questions on Stack Overflow](https://stackoverflow.com/questions/tagged/orchardcms) -* [Participate in our gitter.im chatroom](https://gitter.im/OrchardCMS/Orchard) -* [Submit a pull request](https://docs.orchardproject.net/en/latest/Documentation/Contributing-patches/) +* [Join us on Discord](https://orchardcore.net/discord) +* [Submit a pull request](https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Contributing-patches/) * [Translate Orchard](https://crowdin.com/project/orchard-cms) -* [Contribute modules and themes to our gallery](https://gallery.orchardproject.net/) - -## The Future Of Orchard CMS: Orchard Core - -As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard Core is the next generation of Orchard releases that is based on [ASP.NET Core](https://www.asp.net/core). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/OrchardCore). Orchard Core (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions (1.x) of Orchard. +* [Contribute modules and themes to our gallery](https://gallery.orchardproject.net) diff --git a/src/Orchard.Core.Tests/App.config b/src/Orchard.Core.Tests/App.config index 9493cfeea..1f3ed444a 100644 --- a/src/Orchard.Core.Tests/App.config +++ b/src/Orchard.Core.Tests/App.config @@ -16,7 +16,7 @@ - + @@ -26,6 +26,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/App.Config b/src/Orchard.Specs/App.Config index ac77472da..5ce21ccba 100644 --- a/src/Orchard.Specs/App.Config +++ b/src/Orchard.Specs/App.Config @@ -24,7 +24,7 @@ - + @@ -38,6 +38,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config index 593d2ac20..0c84ea8c4 100644 --- a/src/Orchard.Specs/Hosting/Orchard.Web/Web.config +++ b/src/Orchard.Specs/Hosting/Orchard.Web/Web.config @@ -151,7 +151,7 @@ - + diff --git a/src/Orchard.Tests.Modules/App.config b/src/Orchard.Tests.Modules/App.config index a5baeb2d4..867a6f55b 100644 --- a/src/Orchard.Tests.Modules/App.config +++ b/src/Orchard.Tests.Modules/App.config @@ -24,7 +24,7 @@ - + @@ -42,6 +42,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs b/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs index 018772b6f..e349829dd 100644 --- a/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs +++ b/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; -using Ionic.Zip; using NUnit.Framework; using Orchard.Environment.Configuration; using Orchard.FileSystems.Media; @@ -53,10 +53,10 @@ namespace Orchard.Tests.Modules.Media.Services { [Test] public void GetMediaFoldersTest() { StorageProvider.ListFoldersPredicate = path => { - return string.IsNullOrEmpty(path) ? new[] {new StubStorageFolder(FolderName1)} - : string.Equals(path, FolderName1) ? new[] {new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3)} + return string.IsNullOrEmpty(path) ? new[] { new StubStorageFolder(FolderName1) } + : string.Equals(path, FolderName1) ? new[] { new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3) } : new StubStorageFolder[] { }; - }; + }; IEnumerable mediaFolders = MediaService.GetMediaFolders(null); Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Root path only has 1 sub directory"); @@ -94,7 +94,7 @@ namespace Orchard.Tests.Modules.Media.Services { Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed"); - + Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3)); } @@ -160,29 +160,30 @@ namespace Orchard.Tests.Modules.Media.Services { } private MemoryStream CreateZipMemoryStream() { + var entries = new List { + TextFileName, WebconfigFileName, DllFileName, ZipFileName, NoExtensionFileName, PaddedWebconfigFileName, + FinalDottedWebconfigFileName, PaddedTextFileName, FinalDottedTextFileName + }; + // Setup memory stream with zip archive for more complex scenarios MemoryStream memoryStream = new MemoryStream(); - using (ZipFile zipOut = new ZipFile()) { - - zipOut.AddEntry(TextFileName, new byte[] { 0x01 }); - zipOut.AddEntry(WebconfigFileName, new byte[] { 0x02 }); - zipOut.AddEntry(DllFileName, new byte[] { 0x03 }); - zipOut.AddEntry(ZipFileName, new byte[] { 0x04 }); - zipOut.AddEntry(NoExtensionFileName, new byte[] { 0x05 }); - zipOut.AddEntry(PaddedWebconfigFileName, new byte[] { 0x06 }); - zipOut.AddEntry(FinalDottedWebconfigFileName, new byte[] { 0x07 }); - zipOut.AddEntry(PaddedTextFileName, new byte[] { 0x08 }); - zipOut.AddEntry(FinalDottedTextFileName, new byte[] { 0x09 }); - - zipOut.Save(memoryStream); + using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, leaveOpen: true)) { + var content = new byte[] { 0x01 }; + foreach (var entry in entries) { + var zipEntry = archive.CreateEntry(entry); + using (var zipStream = zipEntry.Open()) { + zipStream.Write(content, 0, 1); + } + ++content[0]; + } } - + return new MemoryStream(memoryStream.ToArray()); } private class MediaServiceAccessor : MediaService { public MediaServiceAccessor(IStorageProvider storageProvider, IOrchardServices orchardServices) - : base (storageProvider, orchardServices) {} + : base(storageProvider, orchardServices) { } public void UnzipMediaFileArchiveAccessor(string targetFolder, Stream zipStream) { UnzipMediaFileArchive(targetFolder, zipStream); diff --git a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj index 0667d1d7c..f02dacad9 100644 --- a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj +++ b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj @@ -64,9 +64,6 @@ ..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll - - ..\packages\DotNetZip.1.12.0\lib\net20\DotNetZip.dll - ..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll @@ -107,8 +104,8 @@ ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -134,6 +131,7 @@ ..\..\lib\sqlce\System.Data.SqlServerCe.dll True + 3.5 diff --git a/src/Orchard.Tests.Modules/packages.config b/src/Orchard.Tests.Modules/packages.config index 7ee686fd9..8aa1a29ec 100644 --- a/src/Orchard.Tests.Modules/packages.config +++ b/src/Orchard.Tests.Modules/packages.config @@ -2,7 +2,6 @@ - @@ -12,7 +11,7 @@ - + diff --git a/src/Orchard.Tests/App.config b/src/Orchard.Tests/App.config index a5baeb2d4..4a4387430 100644 --- a/src/Orchard.Tests/App.config +++ b/src/Orchard.Tests/App.config @@ -24,7 +24,7 @@ - + diff --git a/src/Orchard.Tests/Orchard.Framework.Tests.csproj b/src/Orchard.Tests/Orchard.Framework.Tests.csproj index a4cb85c8a..dbf74d029 100644 --- a/src/Orchard.Tests/Orchard.Framework.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Framework.Tests.csproj @@ -104,8 +104,8 @@ ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard.Tests/packages.config b/src/Orchard.Tests/packages.config index 56276c608..f6113f41e 100644 --- a/src/Orchard.Tests/packages.config +++ b/src/Orchard.Tests/packages.config @@ -14,7 +14,7 @@ - + diff --git a/src/Orchard.Web.Tests/app.config b/src/Orchard.Web.Tests/app.config index 35fa94aea..edbdd0906 100644 --- a/src/Orchard.Web.Tests/app.config +++ b/src/Orchard.Web.Tests/app.config @@ -16,7 +16,7 @@ - + @@ -30,6 +30,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Core/Containers/AdminMenu.cs b/src/Orchard.Web/Core/Containers/AdminMenu.cs new file mode 100644 index 000000000..cc5fd9b52 --- /dev/null +++ b/src/Orchard.Web/Core/Containers/AdminMenu.cs @@ -0,0 +1,93 @@ +using System.Linq; +using Orchard.ContentManagement; +using Orchard.Core.Containers.Models; +using Orchard.Core.Containers.Services; +using Orchard.Localization; +using Orchard.Security; +using Orchard.UI.Navigation; +using Orchard.Utility.Extensions; + +namespace Orchard.Core.Containers { + public class AdminMenu : INavigationProvider { + private readonly IContainerService _containerService; + private readonly IContentManager _contentManager; + private readonly IAuthorizationService _authorizationService; + private readonly IWorkContextAccessor _workContextAccessor; + + public AdminMenu( + IContainerService containerService, + IContentManager contentManager, + IAuthorizationService authorizationService, + IWorkContextAccessor workContextAccessor) { + _containerService = containerService; + _contentManager = contentManager; + _authorizationService = authorizationService; + _workContextAccessor = workContextAccessor; + } + + public Localizer T { get; set; } + public string MenuName { get { return "admin"; } } + + public void GetNavigation(NavigationBuilder builder) { + builder.AddImageSet("container"); + + var containers = _containerService + .GetContainersQuery(VersionOptions.Latest) + .Where(x => x.ShowOnAdminMenu) + .List() + .Where(content => _authorizationService.TryCheckAccess( + Contents.Permissions.EditContent, + _workContextAccessor.GetContext().CurrentUser, + content)) + .ToList(); + + foreach (var container in containers) { + var closureContainer = container; + + if (!string.IsNullOrWhiteSpace(container.AdminMenuImageSet)) { + builder.AddImageSet(container.AdminMenuImageSet.Trim()); + } + + builder.Add(T(container.AdminMenuText), container.AdminMenuPosition, item => { + var containedItems = _containerService.GetContentItems(closureContainer.Id, VersionOptions.Latest).ToList(); + var actualContainer = closureContainer; + var position = 0; + + // If the list has just a single item that happens to be a container itself, + // we will treat that one as the actual container to provide a nice & quick way to manage that list. + if (containedItems.Count == 1) { + var containedItem = containedItems.First().As(); + + if (containedItem != null) { + actualContainer = containedItem; + foreach (var itemContentType in containedItem.ItemContentTypes) { + var closureItemContentType = itemContentType; + item.Add(T("New {0}", itemContentType.DisplayName), string.Format("1.{0}", position++), subItem => subItem + .Action("Create", "Admin", new { + id = closureItemContentType.Name, + containerid = containedItem.Id, + area = "Contents" + })); + } + } + } + + item.Action(_contentManager.GetItemMetadata(actualContainer).AdminRouteValues) + .AddClass("section-container") + .AddClass(closureContainer.AdminMenuText.HtmlClassify()) + .LinkToFirstChild(false); + + foreach (var itemContentType in closureContainer.ItemContentTypes) { + var closureItemContentType = itemContentType; + item.Add(T("New {0}", itemContentType.DisplayName), string.Format("1.{0}", position++), subItem => subItem + .Action("Create", "Admin", new { + id = closureItemContentType.Name, + containerid = container.Id, + area = "Contents" + })); + } + }); + } + } + } +} diff --git a/src/Orchard.Web/Core/Containers/Styles/Web.config b/src/Orchard.Web/Core/Containers/Styles/Web.config new file mode 100644 index 000000000..93eab9a73 --- /dev/null +++ b/src/Orchard.Web/Core/Containers/Styles/Web.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Styles/images/menu.list.png b/src/Orchard.Web/Core/Containers/Styles/images/menu.container.png similarity index 100% rename from src/Orchard.Web/Modules/Orchard.Lists/Styles/images/menu.list.png rename to src/Orchard.Web/Core/Containers/Styles/images/menu.container.png diff --git a/src/Orchard.Web/Core/Containers/Styles/menu.container-admin.css b/src/Orchard.Web/Core/Containers/Styles/menu.container-admin.css new file mode 100644 index 000000000..a795a07ce --- /dev/null +++ b/src/Orchard.Web/Core/Containers/Styles/menu.container-admin.css @@ -0,0 +1,7 @@ +.menu-admin > .section-container > h3 > a { + background-image: url(images/menu.container.png) !important; +} + +.menu-admin > .section-container > h3 > a:hover { + background-position: 0 -30px !important; +} diff --git a/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs b/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs index bbd1f6218..2337598da 100644 --- a/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs @@ -1,74 +1,75 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Web.Mvc; +using System.Web.Routing; using Orchard.ContentManagement; +using Orchard.ContentManagement.Aspects; +using Orchard.ContentManagement.Handlers; +using Orchard.Core.Contents.Settings; using Orchard.Core.Navigation.Models; using Orchard.Core.Navigation.Services; using Orchard.Core.Navigation.ViewModels; -using Orchard.Localization; -using Orchard.Mvc.Extensions; -using Orchard.UI; -using Orchard.UI.Notify; -using Orchard.UI.Navigation; -using Orchard.Utility; -using System; -using Orchard.ContentManagement.Handlers; -using Orchard.Logging; -using Orchard.Exceptions; -using Orchard.ContentManagement.Aspects; -using Orchard.Utility.Extensions; -using Orchard.Mvc.Html; -using Orchard.Core.Contents.Settings; using Orchard.Data; -using System.Web.Routing; +using Orchard.Exceptions; +using Orchard.Localization; +using Orchard.Logging; +using Orchard.Mvc.Extensions; +using Orchard.Mvc.Html; +using Orchard.Security; +using Orchard.UI; +using Orchard.UI.Navigation; +using Orchard.UI.Notify; +using Orchard.Utility; +using Orchard.Utility.Extensions; namespace Orchard.Core.Navigation.Controllers { [ValidateInput(false)] public class AdminController : Controller, IUpdateModel { + private readonly IContentManager _contentManager; + private readonly ITransactionManager _transactionManager; + private readonly IAuthorizer _authorizer; + private readonly INotifier _notifier; private readonly IMenuService _menuService; private readonly INavigationManager _navigationManager; private readonly IEnumerable _handlers; private readonly IMenuManager _menuManager; - private readonly IContentManager _contentManager; - private readonly ITransactionManager _transactionManager; public AdminController( IOrchardServices orchardServices, - IContentManager contentManager, - ITransactionManager transactionManager, IMenuService menuService, IMenuManager menuManager, INavigationManager navigationManager, IEnumerable handlers) { - _contentManager = contentManager; - _transactionManager = transactionManager; + _contentManager = orchardServices.ContentManager; + _transactionManager = orchardServices.TransactionManager; + _authorizer = orchardServices.Authorizer; + _notifier = orchardServices.Notifier; _menuService = menuService; _menuManager = menuManager; _navigationManager = navigationManager; _handlers = handlers; - Services = orchardServices; T = NullLocalizer.Instance; Logger = NullLogger.Instance; } public Localizer T { get; set; } public ILogger Logger { get; set; } - public IOrchardServices Services { get; set; } public ActionResult Index(NavigationManagementViewModel model, int? menuId) { - var menus = Services.ContentManager.Query("Menu").List().ToList() + var menus = _contentManager.Query("Menu").List().ToList() .OrderBy(x => x.ContentManager.GetItemMetadata(x).DisplayText); if (!menus.Any()) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) { + if (!_authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) { return new HttpUnauthorizedResult(); } return RedirectToAction("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl }); } - var allowedMenus = menus.Where(menu => Services.Authorizer.Authorize(Permissions.ManageMenus, menu)).ToList(); + var allowedMenus = menus.Where(menu => _authorizer.Authorize(Permissions.ManageMenus, menu)).ToList(); if (!allowedMenus.Any()) { return new HttpUnauthorizedResult(); @@ -87,7 +88,11 @@ namespace Orchard.Core.Navigation.Controllers { } if (model.MenuItemEntries == null || !model.MenuItemEntries.Any()) { - model.MenuItemEntries = _menuService.GetMenuParts(currentMenu.Id).Select(CreateMenuItemEntries).OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()).ToList(); + model.MenuItemEntries = _menuService + .GetMenuParts(currentMenu.Id) + .Select(CreateMenuItemEntries) + .OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()) + .ToList(); } model.MenuItemDescriptors = _menuManager.GetMenuItemTypes(); @@ -100,7 +105,10 @@ namespace Orchard.Core.Navigation.Controllers { [HttpPost, ActionName("Index")] public ActionResult IndexPOST(IList menuItemEntries, int? menuId) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, (menuId.HasValue) ? _menuService.GetMenu(menuId.Value) : null, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize( + Permissions.ManageMenus, + menuId.HasValue ? _menuService.GetMenu(menuId.Value) : null, + T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); // See https://github.com/OrchardCMS/Orchard/issues/948 @@ -123,25 +131,15 @@ namespace Orchard.Core.Navigation.Controllers { return RedirectToAction("Index", new { menuId }); } - private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { - return new MenuItemEntry { - MenuItemId = menuPart.Id, - IsMenuItem = menuPart.Is(), - Text = menuPart.MenuText, - Position = menuPart.MenuPosition, - Url = menuPart.Is() - ? menuPart.As().Url - : _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), - ContentItem = menuPart.ContentItem, - }; - } - [HttpPost] public ActionResult Delete(int id) { MenuPart menuPart = _menuService.Get(id); int? menuId = null; - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, (menuPart != null) ? _menuService.GetMenu(menuPart.Menu.Id) : null, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize( + Permissions.ManageMenus, + menuPart == null ? null : _menuService.GetMenu(menuPart.Menu.Id), + T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); if (menuPart != null) { @@ -155,7 +153,8 @@ namespace Orchard.Core.Navigation.Controllers { foreach (var menuItem in menuItems.Concat(new[] { menuPart })) { // if the menu item is a concrete content item, don't delete it, just unreference the menu - if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { + if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") + || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { menuPart.Menu = null; } else { @@ -168,26 +167,18 @@ namespace Orchard.Core.Navigation.Controllers { return RedirectToAction("Index", new { menuId }); } - bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { - return TryUpdateModel(model, prefix, includeProperties, excludeProperties); - } - - void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { - ModelState.AddModelError(key, errorMessage.ToString()); - } - public ActionResult CreateMenuItem(string id, int menuId, string returnUrl) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); // create a new temporary menu item - var menuPart = Services.ContentManager.New(id); + var menuPart = _contentManager.New(id); if (menuPart == null) return HttpNotFound(); // load the menu - var menu = Services.ContentManager.Get(menuId); + var menu = _contentManager.Get(menuId); if (menu == null) return HttpNotFound(); @@ -196,7 +187,7 @@ namespace Orchard.Core.Navigation.Controllers { // filter the content items for this specific menu menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); menuPart.Menu = menu; - var model = Services.ContentManager.BuildEditor(menuPart); + var model = _contentManager.BuildEditor(menuPart); return View(model); } @@ -206,32 +197,32 @@ namespace Orchard.Core.Navigation.Controllers { } Logger.Error(T("Creating menu item failed: {0}", exception.Message).Text); - Services.Notifier.Error(T("Creating menu item failed: {0}", exception.Message)); + _notifier.Error(T("Creating menu item failed: {0}", exception.Message)); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); } } [HttpPost, ActionName("CreateMenuItem")] public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); - var menuPart = Services.ContentManager.New(id); + var menuPart = _contentManager.New(id); if (menuPart == null) return HttpNotFound(); // load the menu - var menu = Services.ContentManager.Get(menuId); + var menu = _contentManager.Get(menuId); if (menu == null) return HttpNotFound(); menuPart.Menu = menu; - var model = Services.ContentManager.UpdateEditor(menuPart, this); + var model = _contentManager.UpdateEditor(menuPart, this); menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); - Services.ContentManager.Create(menuPart); + _contentManager.Create(menuPart); if (!ModelState.IsValid) { - Services.TransactionManager.Cancel(); + _transactionManager.Cancel(); return View(model); } - Services.Notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); + _notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); } @@ -241,7 +232,7 @@ namespace Orchard.Core.Navigation.Controllers { if (contentItem == null) return HttpNotFound(); - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); var model = _contentManager.BuildEditor(contentItem); @@ -252,19 +243,81 @@ namespace Orchard.Core.Navigation.Controllers { [Mvc.FormValueRequired("submit.Save")] public ActionResult EditPOST(int id, string returnUrl) { return EditPOST(id, returnUrl, contentItem => { - if (!contentItem.Has() && !contentItem.TypeDefinition.Settings.GetModel().Draftable) + if (!contentItem.Has() + && !contentItem.TypeDefinition.Settings.GetModel().Draftable + && contentItem.IsPublished()) _contentManager.Publish(contentItem); }); } - private ActionResult EditPOST(int id, string returnUrl, Action conditionallyPublish) { - var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired); - if (contentItem == null) + [HttpPost] + // Copy of Contents/AdminController/Publish, but with different permission check and redirect. + public ActionResult Publish(int id) { + var menuPart = _contentManager.GetLatest(id); + if (menuPart == null) return HttpNotFound(); - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); + _contentManager.Publish(menuPart.ContentItem); + + _notifier.Information( + string.IsNullOrWhiteSpace(menuPart.MenuText) + ? string.IsNullOrWhiteSpace(menuPart.TypeDefinition.DisplayName) + ? T("Your content has been published.") + : T("Your {0} has been published.", menuPart.TypeDefinition.DisplayName) + : T("'{0}' has been published.", menuPart.MenuText)); + + return RedirectToAction("Index", new { menuId = menuPart.Menu.Id }); + } + + [HttpPost] + // Copy of Contents/AdminController/Unpublish, but with different permission check and redirect. + public ActionResult Unpublish(int id) { + var menuPart = _contentManager.GetLatest(id); + if (menuPart == null) + return HttpNotFound(); + + if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu"))) + return new HttpUnauthorizedResult(); + + _contentManager.Unpublish(menuPart.ContentItem); + + _notifier.Information( + string.IsNullOrWhiteSpace(menuPart.MenuText) + ? string.IsNullOrWhiteSpace(menuPart.TypeDefinition.DisplayName) + ? T("Your content has been unpublished.") + : T("Your {0} has been unpublished.", menuPart.TypeDefinition.DisplayName) + : T("'{0}' has been unpublished.", menuPart.MenuText)); + + return RedirectToAction("Index", new { menuId = menuPart.Menu.Id }); + } + + private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { + return new MenuItemEntry { + MenuItemId = menuPart.Id, + IsMenuItem = menuPart.Is(), + Text = menuPart.MenuText, + Position = menuPart.MenuPosition, + Url = menuPart.Is() + ? menuPart.As().Url + : _navigationManager.GetUrl(null, _contentManager.GetItemMetadata(menuPart).DisplayRouteValues), + ContentItem = menuPart.ContentItem, + }; + } + + private ActionResult EditPOST(int id, string returnUrl, Action conditionallyPublish) { + var menuPart = _contentManager.GetDraftRequired(id); + + if (menuPart == null) + return HttpNotFound(); + + if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu"))) + return new HttpUnauthorizedResult(); + + var contentItem = menuPart.ContentItem; + string previousRoute = null; if (contentItem.Has() && !string.IsNullOrWhiteSpace(returnUrl) @@ -289,11 +342,22 @@ namespace Orchard.Core.Navigation.Controllers { returnUrl = Url.ItemDisplayUrl(contentItem); } - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) - ? T("Your content has been saved.") - : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName)); + _notifier.Information( + string.IsNullOrWhiteSpace(menuPart.MenuText) + ? string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) + ? T("Your content has been saved.") + : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName) + : T("'{0}' has been saved.", menuPart.MenuText)); - return this.RedirectLocal(returnUrl, () => RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } })); + return RedirectToAction("Index", new { menuId = menuPart.Menu.Id }); + } + + bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { + return TryUpdateModel(model, prefix, includeProperties, excludeProperties); + } + + void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { + ModelState.AddModelError(key, errorMessage.ToString()); } } } diff --git a/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs b/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs index ea3f94b2f..682df695d 100644 --- a/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs +++ b/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs @@ -19,8 +19,8 @@ namespace Orchard.Core.Navigation.Services { public IEnumerable GetMenuParts(int menuId) { return _contentManager - .Query() - .Where( x => x.MenuId == menuId) + .Query(VersionOptions.Latest) + .Where(x => x.MenuId == menuId) .List(); } diff --git a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml index bcae792ed..7acaa2e2d 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml @@ -1,4 +1,6 @@ @model NavigationManagementViewModel + +@using Orchard.ContentManagement; @using Orchard.Core.Navigation.ViewModels; @using Orchard.Utility.Extensions; @@ -115,8 +117,21 @@ - @Html.ItemEditLink(T("Edit").Text, menuPartEntry.ContentItem, new { returnUrl = Request.RawUrl })@T(" | ") - @Html.Link(T("Delete").Text, Url.ItemRemoveUrl(menuPartEntry.ContentItem,null), new { itemprop = "RemoveUrl UnsafeUrl" }) + @{ + var menuItemHasPublished = menuPartEntry.ContentItem.HasPublished(); + } + + @Html.Link( + menuItemHasPublished ? T("Unpublish").Text : T("Publish").Text, + Url.Action( + menuItemHasPublished ? "Unpublish": "Publish", + "Admin", + new { area = "Navigation", id = menuPartEntry.ContentItem.Id }), + new { itemprop = "UnsafeUrl" }) + @T(" | ") + @Html.ItemEditLink(T("Edit").Text, menuPartEntry.ContentItem, new { returnUrl = Request.RawUrl }) + @T(" | ") + @Html.Link(T("Delete").Text, Url.ItemRemoveUrl(menuPartEntry.ContentItem, null), new { itemprop = "RemoveUrl UnsafeUrl" }) diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index 77d33482c..4bbad852e 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -119,6 +119,7 @@ + @@ -318,6 +319,8 @@ + + @@ -611,10 +614,15 @@ - + + + + Designer + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Orchard.Web/Core/Web.config b/src/Orchard.Web/Core/Web.config index b4eb81357..29f42ce2e 100644 --- a/src/Orchard.Web/Core/Web.config +++ b/src/Orchard.Web/Core/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Lucene/Web.config b/src/Orchard.Web/Modules/Lucene/Web.config index 5d7a337e5..d7b3d6256 100644 --- a/src/Orchard.Web/Modules/Lucene/Web.config +++ b/src/Orchard.Web/Modules/Lucene/Web.config @@ -53,7 +53,7 @@ - + diff --git a/src/Orchard.Web/Modules/Markdown/Markdown.csproj b/src/Orchard.Web/Modules/Markdown/Markdown.csproj index 21462fb86..d5a4305cc 100644 --- a/src/Orchard.Web/Modules/Markdown/Markdown.csproj +++ b/src/Orchard.Web/Modules/Markdown/Markdown.csproj @@ -62,20 +62,20 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + ..\..\..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll - - ..\..\..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + ..\..\..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll - - ..\..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + ..\..\..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll - - ..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + ..\..\..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll @@ -231,4 +231,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Markdown/Web.config b/src/Orchard.Web/Modules/Markdown/Web.config index 836843e00..5a55c6247 100644 --- a/src/Orchard.Web/Modules/Markdown/Web.config +++ b/src/Orchard.Web/Modules/Markdown/Web.config @@ -54,7 +54,7 @@ - + @@ -68,6 +68,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Markdown/packages.config b/src/Orchard.Web/Modules/Markdown/packages.config index e11111c39..1c515e289 100644 --- a/src/Orchard.Web/Modules/Markdown/packages.config +++ b/src/Orchard.Web/Modules/Markdown/packages.config @@ -6,8 +6,8 @@ - - - - - + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Alias/Web.config b/src/Orchard.Web/Modules/Orchard.Alias/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Alias/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Alias/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj b/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj index 19ce10a60..56a43eda4 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj @@ -59,8 +59,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -250,4 +250,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config b/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config b/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config index 3a05f90ac..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ArchiveLater/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj index 21115cd73..e0098aa0e 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj @@ -61,8 +61,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config index bdc46ecc9..30fb3794f 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Web.config @@ -56,7 +56,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config index a8752aa1c..e19361cb1 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config @@ -6,7 +6,7 @@ - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config b/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config index 7c4a9d858..dd91d87a6 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Web.config @@ -53,7 +53,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj index 7099a743e..822f95b4f 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj @@ -76,14 +76,14 @@ ..\..\..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll - - ..\..\..\packages\Microsoft.IdentityModel.JsonWebTokens.5.2.4\lib\net451\Microsoft.IdentityModel.JsonWebTokens.dll + + ..\..\..\packages\Microsoft.IdentityModel.JsonWebTokens.5.7.0\lib\net461\Microsoft.IdentityModel.JsonWebTokens.dll - - ..\..\..\packages\Microsoft.IdentityModel.Logging.5.2.4\lib\net451\Microsoft.IdentityModel.Logging.dll + + ..\..\..\packages\Microsoft.IdentityModel.Logging.5.7.0\lib\net461\Microsoft.IdentityModel.Logging.dll - - ..\..\..\packages\Microsoft.IdentityModel.Tokens.5.2.4\lib\net451\Microsoft.IdentityModel.Tokens.dll + + ..\..\..\packages\Microsoft.IdentityModel.Tokens.5.7.0\lib\net461\Microsoft.IdentityModel.Tokens.dll ..\..\..\packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4\Microsoft.Practices.TransientFaultHandling.Core.dll @@ -109,8 +109,8 @@ ..\..\..\packages\WindowsAzure.Storage.5.0.2\lib\net40\Microsoft.WindowsAzure.Storage.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -121,8 +121,8 @@ 3.5 - - ..\..\..\packages\System.IdentityModel.Tokens.Jwt.5.2.4\lib\net451\System.IdentityModel.Tokens.Jwt.dll + + ..\..\..\packages\System.IdentityModel.Tokens.Jwt.5.7.0\lib\net461\System.IdentityModel.Tokens.Jwt.dll diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config index 999404c7c..c459044f1 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Web.config @@ -51,7 +51,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config index 0b1ef3eba..09787dc07 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config @@ -11,15 +11,15 @@ - - - + + + - + - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj b/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj index d0b71207f..ed3b9bcf0 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj +++ b/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj @@ -100,8 +100,8 @@ ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.WindowsFabric.Data.Common.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -218,4 +218,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Azure/Web.config b/src/Orchard.Web/Modules/Orchard.Azure/Web.config index 6a4fb0f7e..de8a44fc6 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Azure/Web.config @@ -63,7 +63,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure/packages.config b/src/Orchard.Web/Modules/Orchard.Azure/packages.config index 1caf16749..3ca59d4ee 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Azure/packages.config @@ -12,9 +12,9 @@ - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Web.config b/src/Orchard.Web/Modules/Orchard.Blogs/Web.config index 836843e00..5a55c6247 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Web.config @@ -54,7 +54,7 @@ - + @@ -68,6 +68,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Caching/Web.config b/src/Orchard.Web/Modules/Orchard.Caching/Web.config index 9b5d042d1..d3d43517f 100644 --- a/src/Orchard.Web/Modules/Orchard.Caching/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Caching/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt index 50753e181..a00ea74ab 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleRootWebConfig.txt @@ -47,7 +47,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt index 8bd755adb..889b3c7fa 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt @@ -21,7 +21,7 @@ DEBUG;TRACE prompt 4 - ..\..\..\OrchardBasicCorrectness.ruleset + ..\..\..\..\OrchardBasicCorrectness.ruleset false @@ -35,16 +35,16 @@ false - + ..\..\..\..\packages\Autofac.3.5.2\lib\net40\Autofac.dll ..\..\..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - ..\..\..\..\packages\NHibernate.4.0.1.4000\lib\net40\NHibernate.dll + + ..\..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll - + ..\..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsPackagesConfig.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsPackagesConfig.txt new file mode 100644 index 000000000..6b79f20b1 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsPackagesConfig.txt @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs index 7f3523094..398617a25 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs @@ -161,6 +161,8 @@ namespace Orchard.CodeGeneration.Commands { templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString()); File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText); content.Add(propertiesPath + "\\AssemblyInfo.cs"); + File.WriteAllText(testsPath + "packages.config", File.ReadAllText(_codeGenTemplatePath + "ModuleTestsPackagesConfig.txt")); + content.Add(testsPath + "packages.config"); var itemGroup = CreateProjectItemGroup(testsPath, content, folders); @@ -168,7 +170,7 @@ namespace Orchard.CodeGeneration.Commands { csprojText = csprojText.Replace("$$ProjectName$$", projectName); csprojText = csprojText.Replace("$$TestsProjectGuid$$", projectGuid); csprojText = csprojText.Replace("$$FileIncludes$$", itemGroup ?? ""); - csprojText = csprojText.Replace("$$OrchardReferences$$", GetOrchardReferences()); + csprojText = csprojText.Replace("$$OrchardReferences$$", GetOrchardReferences(modulesFolderRelativeDepth: 3)); File.WriteAllText(testsPath + projectName + ".csproj", csprojText); @@ -327,15 +329,17 @@ namespace Orchard.CodeGeneration.Commands { return text; } - private static string GetOrchardReferences() { + private static string GetOrchardReferences(int modulesFolderRelativeDepth = 2) { + var frameworkRelativeDepth = string.Join("\\", Enumerable.Repeat("..", modulesFolderRelativeDepth + 1)); + var coreRelativeDepth = string.Join("\\", Enumerable.Repeat("..", modulesFolderRelativeDepth)); return IsSourceEnlistment() ? -@" - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} +$@" + {{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}} Orchard.Framework $(MvcBuildViews) - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + + {{9916839C-39FC-4CEB-A5AF-89CA7E87119F}} Orchard.Core $(MvcBuildViews) " : diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj index 05eb8c41b..6565c15f6 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj @@ -88,6 +88,7 @@ + @@ -158,4 +159,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config index 9b5d042d1..d3d43517f 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Comments/Web.config b/src/Orchard.Web/Modules/Orchard.Comments/Web.config index fbf55500e..2e75b2e7c 100644 --- a/src/Orchard.Web/Modules/Orchard.Comments/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Comments/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Conditions/Web.config b/src/Orchard.Web/Modules/Orchard.Conditions/Web.config index 326a39614..b49058725 100644 --- a/src/Orchard.Web/Modules/Orchard.Conditions/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Conditions/Web.config @@ -52,7 +52,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config b/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPermissions/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config b/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPicker/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config b/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config b/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config +++ b/src/Orchard.Web/Modules/Orchard.CustomForms/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config b/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config index 3b5d12341..1ca5a1a65 100644 --- a/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Dashboards/Web.config @@ -55,7 +55,7 @@ - + @@ -69,6 +69,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config index 3ab218f54..e218dbb69 100644 --- a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config @@ -55,7 +55,7 @@ - + @@ -69,6 +69,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj b/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj index 1b17c9c07..df2c9dd01 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj @@ -65,8 +65,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config b/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config index 83edfe666..7b0b8d162 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Web.config @@ -57,7 +57,7 @@ - + @@ -71,6 +71,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config b/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config index 44b10a9b4..4fae832de 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config @@ -7,5 +7,5 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj index d5dcfd97d..7c9775b1e 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj +++ b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj @@ -55,8 +55,11 @@ ..\..\..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll - - ..\..\..\packages\MailKit.3.1.1\lib\net48\MailKit.dll + + ..\..\..\packages\BouncyCastle.Cryptography.2.5.0\lib\net461\BouncyCastle.Cryptography.dll + + + ..\..\..\packages\MailKit.4.9.0\lib\net48\MailKit.dll ..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\lib\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -65,23 +68,42 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\MimeKit.3.1.1\lib\net48\MimeKit.dll + + ..\..\..\packages\MimeKit.4.9.0\lib\net48\MimeKit.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - ..\..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + ..\..\..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll False + + ..\..\..\packages\System.Formats.Asn1.8.0.1\lib\net462\System.Formats.Asn1.dll + + + ..\..\..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + + + ..\..\..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + + ..\..\..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\..\..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + + ..\..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + diff --git a/src/Orchard.Web/Modules/Orchard.Email/Web.config b/src/Orchard.Web/Modules/Orchard.Email/Web.config index 1149fd7ed..dc1b9f756 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Email/Web.config @@ -55,7 +55,7 @@ - + @@ -69,6 +69,18 @@ + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Email/packages.config b/src/Orchard.Web/Modules/Orchard.Email/packages.config index f172c28e1..0589304a6 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Email/packages.config @@ -1,13 +1,20 @@  - + + - - + + - + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs b/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs index 3f314311c..48dbf43ca 100644 --- a/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs @@ -6,6 +6,7 @@ using Orchard.Fields.Settings; using Orchard.Localization; using System; using System.Collections.Generic; +using System.Security.Policy; namespace Orchard.Fields.Drivers { public class LinkFieldDriver : ContentFieldDriver { @@ -57,11 +58,33 @@ namespace Orchard.Fields.Drivers { if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) { updater.AddModelError(GetPrefix(field, part), T("Url is required for {0}", T(field.DisplayName))); } - else if (!String.IsNullOrWhiteSpace(field.Value) && !Uri.IsWellFormedUriString(field.Value, UriKind.RelativeOrAbsolute)) { - updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value)); - } else if (settings.LinkTextMode == LinkTextMode.Required && String.IsNullOrWhiteSpace(field.Text)) { updater.AddModelError(GetPrefix(field, part), T("Text is required for {0}.", T(field.DisplayName))); + } else if (!String.IsNullOrWhiteSpace(field.Value)) { + // Check if it's a valid uri, considering that there may be the link to an anchor only + // e.g.: field.Value = "#divId" + // Take everything before the first "#" character and check if it's a valid uri. + // If there is no character before the first "#", consider the value as a valid one (because it is a reference to a div inside the same page) + if (field.Value.StartsWith("#")) { + // The field value is a tag id reference + // For html 5, a tag id is valid as long as it doesn't contain white spaces + if (field.Value.IndexOf(' ') >= 0) { + updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value)); + } + } else { + var urlAndRef = field.Value.Split(new char[] { '#' }, 2); + + // Since field value is a proper url and not a tag id only, assume the first part of the array is the actual url to link to + if (!String.IsNullOrWhiteSpace(urlAndRef[0]) && !Uri.IsWellFormedUriString(urlAndRef[0], UriKind.RelativeOrAbsolute)) { + updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value)); + } else if (urlAndRef.Length > 1) { + // The second part of the url is the id reference + // For html 5, a tag id is valid as long as it doesn't contain white spaces + if (urlAndRef[1].IndexOf(' ') >= 0) { + updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value)); + } + } + } } } diff --git a/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml index 89bcbfdbf..c35df6491 100644 --- a/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml @@ -25,7 +25,7 @@
@(settings.Required ? Html.TextBoxFor(m => m.Value, new { @class = "text large", required = "required" }) : Html.TextBoxFor(m => m.Value, new { @class = "text large" })) - @T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, ...") + @T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, #some_id, ...")
@if (settings.LinkTextMode == LinkTextMode.Optional || settings.LinkTextMode == LinkTextMode.Required) {
diff --git a/src/Orchard.Web/Modules/Orchard.Fields/Web.config b/src/Orchard.Web/Modules/Orchard.Fields/Web.config index 8fae9643f..a5c193197 100644 --- a/src/Orchard.Web/Modules/Orchard.Fields/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Fields/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj b/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj index 621b2818a..17d3fa58b 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj +++ b/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj @@ -54,8 +54,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -172,4 +172,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Forms/Web.config b/src/Orchard.Web/Modules/Orchard.Forms/Web.config index 68cba4a35..df4c6983f 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Forms/Web.config @@ -51,7 +51,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Forms/packages.config b/src/Orchard.Web/Modules/Orchard.Forms/packages.config index 96de43e4a..423014ad0 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Forms/packages.config @@ -4,5 +4,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config b/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config index 510d562fe..434d94d1a 100644 --- a/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ImageEditor/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config b/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config +++ b/src/Orchard.Web/Modules/Orchard.ImportExport/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Indexing/Web.config b/src/Orchard.Web/Modules/Orchard.Indexing/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Indexing/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Indexing/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj b/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj index 323423ca7..7d665223d 100644 --- a/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj +++ b/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj @@ -60,8 +60,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -196,4 +196,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config b/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config index 1149fd7ed..975f0c223 100644 --- a/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config +++ b/src/Orchard.Web/Modules/Orchard.JobsQueue/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config b/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config index 3a05f90ac..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config +++ b/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj index 1c544f1c0..aeaf2d938 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj @@ -58,8 +58,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Web.config b/src/Orchard.Web/Modules/Orchard.Layouts/Web.config index 0908d535f..390cce3a8 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Web.config @@ -43,7 +43,7 @@ - + @@ -69,6 +69,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/packages.config b/src/Orchard.Web/Modules/Orchard.Layouts/packages.config index d391928d1..9504b7d9d 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Layouts/packages.config @@ -7,6 +7,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Lists/AdminMenu.cs b/src/Orchard.Web/Modules/Orchard.Lists/AdminMenu.cs index fbb99bd8d..eb2ad4627 100644 --- a/src/Orchard.Web/Modules/Orchard.Lists/AdminMenu.cs +++ b/src/Orchard.Web/Modules/Orchard.Lists/AdminMenu.cs @@ -1,98 +1,15 @@ -using System; -using System.Linq; -using Orchard.ContentManagement; -using Orchard.Core.Containers.Models; -using Orchard.Core.Containers.Services; -using Orchard.Localization; -using Orchard.Security; +using Orchard.Localization; using Orchard.UI.Navigation; -using Orchard.Utility.Extensions; namespace Orchard.Lists { public class AdminMenu : INavigationProvider { - private readonly IContainerService _containerService; - private readonly IContentManager _contentManager; - private readonly IAuthorizationService _authorizationService; - private readonly IWorkContextAccessor _workContextAccessor; - - public AdminMenu( - IContainerService containerService, - IContentManager contentManager, - IAuthorizationService authorizationService, - IWorkContextAccessor workContextAccessor - ) { - _containerService = containerService; - _contentManager = contentManager; - _authorizationService = authorizationService; - _workContextAccessor = workContextAccessor; - } - public Localizer T { get; set; } public string MenuName { get { return "admin"; } } - public void GetNavigation(NavigationBuilder builder) { - builder.AddImageSet("list"); - - CreateListManagementMenuItem(builder); - CreateListMenuItems(builder); - } - - private void CreateListManagementMenuItem(NavigationBuilder builder) { - builder.Add(T("Lists"), "11", item => item - .Action("Index", "Admin", new {area = "Orchard.Lists"}).Permission(Permissions.ManageLists) - ); - } - - private void CreateListMenuItems(NavigationBuilder builder) { - var containers = _containerService - .GetContainersQuery(VersionOptions.Latest) - .Where(x => x.ShowOnAdminMenu) - .List() - .Where(x => _authorizationService.TryCheckAccess(Orchard.Core.Contents.Permissions.EditContent, _workContextAccessor.GetContext().CurrentUser, x)) - .ToList(); - - foreach (var container in containers) { - var closureContainer = container; - - if (!String.IsNullOrWhiteSpace(container.AdminMenuImageSet)) { - builder.AddImageSet(container.AdminMenuImageSet.Trim()); - } - - builder.Add(T(container.AdminMenuText), container.AdminMenuPosition, item => { - var containedItems = _containerService.GetContentItems(closureContainer.Id, VersionOptions.Latest).ToList(); - var actualContainer = closureContainer; - var position = 0; - - // If the list has just a single item that happens to be a container itself, - // we will treat that one as the actual container to provide a nice & quick way to manage that list. - if (containedItems.Count == 1) { - var containedItem = containedItems.First().As(); - - if (containedItem != null) { - actualContainer = containedItem; - foreach (var itemContentType in containedItem.ItemContentTypes) { - var closureItemContentType = itemContentType; - item.Add(T("New {0}", itemContentType.DisplayName), String.Format("1.{0}", position++), subItem => subItem - .Action("Create", "Admin", new { id = closureItemContentType.Name, containerid = containedItem.Id, area = "Contents" })); - } - } - } - - var containerMetadata = _contentManager.GetItemMetadata(actualContainer); - item.Action(containerMetadata.AdminRouteValues); - - item.Action(containerMetadata.AdminRouteValues); - item.AddClass("nav-list"); - item.AddClass(closureContainer.AdminMenuText.HtmlClassify()); - item.LinkToFirstChild(false); - - foreach (var itemContentType in closureContainer.ItemContentTypes) { - var closureItemContentType = itemContentType; - item.Add(T("New {0}", itemContentType.DisplayName), String.Format("1.{0}", position++), subItem => subItem - .Action("Create", "Admin", new { id = closureItemContentType.Name, containerid = container.Id, area = "Contents" })); - } - }); - } - } + public void GetNavigation(NavigationBuilder builder) => + builder + .AddImageSet("lists") + .Add(T("Lists"), "11", item => item + .Action("Index", "Admin", new { area = "Orchard.Lists" }).Permission(Permissions.ManageLists)); } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Orchard.Lists.csproj b/src/Orchard.Web/Modules/Orchard.Lists/Orchard.Lists.csproj index 2826072e4..f8b3eb32f 100644 --- a/src/Orchard.Web/Modules/Orchard.Lists/Orchard.Lists.csproj +++ b/src/Orchard.Web/Modules/Orchard.Lists/Orchard.Lists.csproj @@ -115,6 +115,7 @@ + @@ -143,16 +144,14 @@ orchard-lists-admin.js - + - list-admin.css - @@ -272,4 +271,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Styles/images/menu.list-definition.png b/src/Orchard.Web/Modules/Orchard.Lists/Styles/images/menu.lists.png similarity index 100% rename from src/Orchard.Web/Modules/Orchard.Lists/Styles/images/menu.list-definition.png rename to src/Orchard.Web/Modules/Orchard.Lists/Styles/images/menu.lists.png diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Styles/menu.list-admin.css b/src/Orchard.Web/Modules/Orchard.Lists/Styles/menu.list-admin.css deleted file mode 100644 index 9d43ff049..000000000 --- a/src/Orchard.Web/Modules/Orchard.Lists/Styles/menu.list-admin.css +++ /dev/null @@ -1,22 +0,0 @@ -.navicon-list, -.navicon-lists, -.section-new .subnavicon-list, -.nav-list > h3 > a, -.nav-list-definition > h3 > a { - background-image:url(images/menu.list.png) !important; -} - -.navicon-list:hover, -.navicon-lists:hover, -.nav-list > h3 > a:hover, -.nav-list-definition > h3 > a:hover { - background-position:0 -30px !important; -} - -.navicon-lists { - background-image:url(images/menu.list.png) !important; -} - -.navicon-lists:hover { - background-position:0 -30px !important; -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Styles/menu.lists-admin.css b/src/Orchard.Web/Modules/Orchard.Lists/Styles/menu.lists-admin.css new file mode 100644 index 000000000..2199b6ee8 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.Lists/Styles/menu.lists-admin.css @@ -0,0 +1,7 @@ +.navicon-lists { + background-image: url(images/menu.lists.png) !important; +} + +.navicon-lists:hover { + background-position: 0 -30px !important; +} diff --git a/src/Orchard.Web/Modules/Orchard.Lists/Web.config b/src/Orchard.Web/Modules/Orchard.Lists/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Lists/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Lists/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Localization/Web.config b/src/Orchard.Web/Modules/Orchard.Localization/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Localization/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Localization/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj index b01ce63de..c4a391378 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj +++ b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj @@ -52,9 +52,6 @@ false - - ..\..\..\packages\DotNetZip.1.12.0\lib\net20\DotNetZip.dll - ..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\lib\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -64,6 +61,7 @@ + @@ -204,4 +202,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs b/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs index f11190b7c..3084bd871 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; using System.Web; -using Ionic.Zip; using Orchard.ContentManagement; using Orchard.FileSystems.Media; using Orchard.Localization; @@ -194,7 +194,7 @@ namespace Orchard.Media.Services { /// The array of bytes with the file's contents. /// Boolean value indicating weather zip files should be extracted. /// The path to the uploaded file. - public string UploadMediaFile(string folderPath, string fileName, byte [] bytes, bool extractZip) { + public string UploadMediaFile(string folderPath, string fileName, byte[] bytes, bool extractZip) { Argument.ThrowIfNullOrEmpty(folderPath, "folderPath"); Argument.ThrowIfNullOrEmpty(fileName, "fileName"); Argument.ThrowIfNull(bytes, "bytes"); @@ -274,16 +274,16 @@ namespace Orchard.Media.Services { // must be in the whitelist MediaSettingsPart mediaSettings = currentSite.As(); - + if (mediaSettings == null) { return false; - } - - if(String.IsNullOrWhiteSpace(mediaSettings.UploadAllowedFileTypeWhitelist)) { - return true; - } + } - if(!mediaSettings.UploadAllowedFileTypeWhitelist.ToUpperInvariant().Split(' ').Contains(extension.ToUpperInvariant())) { + if (String.IsNullOrWhiteSpace(mediaSettings.UploadAllowedFileTypeWhitelist)) { + return true; + } + + if (!mediaSettings.UploadAllowedFileTypeWhitelist.ToUpperInvariant().Split(' ').Contains(extension.ToUpperInvariant())) { return false; } } @@ -305,28 +305,26 @@ namespace Orchard.Media.Services { Argument.ThrowIfNullOrEmpty(targetFolder, "targetFolder"); Argument.ThrowIfNull(zipStream, "zipStream"); - using (var fileInflater = ZipFile.Read(zipStream)) { + using (var fileInflater = new ZipArchive(zipStream)) { // We want to preserve whatever directory structure the zip file contained instead // of flattening it. // The API below doesn't necessarily return the entries in the zip file in any order. // That means the files in subdirectories can be returned as entries from the stream // before the directories that contain them, so we create directories as soon as first // file below their path is encountered. - foreach (ZipEntry entry in fileInflater) { + foreach (var entry in fileInflater.Entries) { if (entry == null) { continue; } - if (!entry.IsDirectory && !string.IsNullOrEmpty(entry.FileName)) { - + if (!string.IsNullOrEmpty(entry.Name)) { // skip disallowed files - if (FileAllowed(entry.FileName, false)) { - string fullFileName = _storageProvider.Combine(targetFolder, entry.FileName); + if (FileAllowed(entry.Name, false)) { + string fullFileName = _storageProvider.Combine(targetFolder, entry.FullName); - using (var stream = entry.OpenReader()) { + using (var stream = entry.Open()) { // the call will return false if the file already exists if (!_storageProvider.TrySaveStream(fullFileName, stream)) { - // try to delete the file and save again try { _storageProvider.DeleteFile(fullFileName); diff --git a/src/Orchard.Web/Modules/Orchard.Media/Web.config b/src/Orchard.Web/Modules/Orchard.Media/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Media/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Media/packages.config b/src/Orchard.Web/Modules/Orchard.Media/packages.config index 5de97f737..1c55d6960 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Media/packages.config @@ -1,6 +1,5 @@  - diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj index 11f70f309..c896c8e71 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj @@ -58,8 +58,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -451,4 +451,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config index 3ab218f54..6467d9f0d 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config b/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config index 3a05f90ac..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config b/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaPicker/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config b/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config index 9b5d042d1..d3d43517f 100644 --- a/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MessageBus/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Migrations/Web.config b/src/Orchard.Web/Modules/Orchard.Migrations/Web.config index 9b5d042d1..d3d43517f 100644 --- a/src/Orchard.Web/Modules/Orchard.Migrations/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Migrations/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Modules/Web.config b/src/Orchard.Web/Modules/Orchard.Modules/Web.config index 5d7a337e5..d7b3d6256 100644 --- a/src/Orchard.Web/Modules/Orchard.Modules/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Modules/Web.config @@ -53,7 +53,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config index 5d7a337e5..d7b3d6256 100644 --- a/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config +++ b/src/Orchard.Web/Modules/Orchard.MultiTenancy/Web.config @@ -53,7 +53,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config b/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config index 64b9971e8..d85ea246e 100644 --- a/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config +++ b/src/Orchard.Web/Modules/Orchard.OutputCache/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Packaging/Web.config b/src/Orchard.Web/Modules/Orchard.Packaging/Web.config index 5706c1b4b..9d27699e2 100644 --- a/src/Orchard.Web/Modules/Orchard.Packaging/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Packaging/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Web.config b/src/Orchard.Web/Modules/Orchard.Pages/Web.config index 55653b53f..6295ffe08 100644 --- a/src/Orchard.Web/Modules/Orchard.Pages/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Pages/Web.config @@ -51,7 +51,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs b/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs index 01b79f29d..eb9dfc794 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Controllers/AdminController.cs @@ -1,9 +1,13 @@ +using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using System.Web.Routing; +using Orchard.ContentManagement; using Orchard.Core.Title.Models; +using Orchard.DisplayManagement; using Orchard.Forms.Services; +using Orchard.Localization; using Orchard.Mvc; using Orchard.Projections.Descriptors.Filter; using Orchard.Projections.Descriptors.Layout; @@ -11,13 +15,9 @@ using Orchard.Projections.Descriptors.SortCriterion; using Orchard.Projections.Models; using Orchard.Projections.Services; using Orchard.Projections.ViewModels; -using Orchard.ContentManagement; -using Orchard.DisplayManagement; -using Orchard.Localization; -using Orchard.UI.Notify; -using System; using Orchard.Settings; using Orchard.UI.Navigation; +using Orchard.UI.Notify; namespace Orchard.Projections.Controllers { [ValidateInput(false)] @@ -84,7 +84,7 @@ namespace Orchard.Projections.Controllers { var model = new AdminIndexViewModel { Queries = results.Select(x => new QueryEntry { - Query = x.As().Record, + Query = x.As().Record, QueryId = x.Id, Name = x.As().Name }).ToList(), @@ -158,16 +158,21 @@ namespace Orchard.Projections.Controllers { Category = f.Category, Type = f.Type, FilterRecordId = filter.Id, - DisplayText = String.IsNullOrWhiteSpace(filter.Description) ? f.Display(new FilterContext {State = FormParametersHelper.ToDynamic(filter.State)}).Text : filter.Description + DisplayText = String.IsNullOrWhiteSpace(filter.Description) ? f.Display(new FilterContext { State = FormParametersHelper.ToDynamic(filter.State) }).Text : filter.Description }); } } - filterGroupEntries.Add( new FilterGroupEntry { Id = group.Id, Filters = filterEntries } ); + filterGroupEntries.Add(new FilterGroupEntry { Id = group.Id, Filters = filterEntries }); } viewModel.FilterGroups = filterGroupEntries; + if (viewModel.FilterGroups.Any(group => group.Filters.Count() == 0)) { + _services.Notifier.Warning( + T("This Query has at least one empty filter group, which will cause all content items to be returned, unless the Projection using this Query limits the number of content items displayed.")); + } + #endregion #region Load Sort criterias @@ -185,7 +190,7 @@ namespace Orchard.Projections.Controllers { Category = f.Category, Type = f.Type, SortCriterionRecordId = sortCriterion.Id, - DisplayText = String.IsNullOrWhiteSpace(sortCriterion.Description) ? f.Display(new SortCriterionContext { State = FormParametersHelper.ToDynamic(sortCriterion.State) }).Text : sortCriterion.Description + DisplayText = String.IsNullOrWhiteSpace(sortCriterion.Description) ? f.Display(new SortCriterionContext { State = FormParametersHelper.ToDynamic(sortCriterion.State) }).Text : sortCriterion.Description }); } } diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs index 352368fe6..7230ac7c3 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/ProjectionPartDriver.cs @@ -20,10 +20,12 @@ using Orchard.Projections.Settings; using Orchard.Projections.ViewModels; using Orchard.Tokens; using Orchard.UI.Navigation; +using Orchard.UI.Notify; using Orchard.Utility.Extensions; namespace Orchard.Projections.Drivers { public class ProjectionPartDriver : ContentPartDriver { + private readonly IOrchardServices _orchardServices; private readonly IRepository _queryRepository; private readonly IProjectionManagerExtension _projectionManager; private readonly IFeedManager _feedManager; @@ -33,25 +35,25 @@ namespace Orchard.Projections.Drivers { private const string TemplateName = "Parts/ProjectionPart"; public ProjectionPartDriver( - IOrchardServices services, + IOrchardServices orchardServices, IRepository queryRepository, IProjectionManagerExtension projectionManager, IFeedManager feedManager, ITokenizer tokenizer, IDisplayHelperFactory displayHelperFactory, IWorkContextAccessor workContextAccessor) { + _orchardServices = orchardServices; _queryRepository = queryRepository; _projectionManager = projectionManager; _feedManager = feedManager; _tokenizer = tokenizer; _displayHelperFactory = displayHelperFactory; _workContextAccessor = workContextAccessor; + T = NullLocalizer.Instance; - Services = services; } public Localizer T { get; set; } - public IOrchardServices Services { get; set; } protected override string Prefix { get { return "ProjectionPart"; } } @@ -59,7 +61,7 @@ namespace Orchard.Projections.Drivers { var query = part.Record.QueryPartRecord; // retrieving paging parameters - var queryString = Services.WorkContext.HttpContext.Request.QueryString; + var queryString = _orchardServices.WorkContext.HttpContext.Request.QueryString; var pageKey = String.IsNullOrWhiteSpace(part.Record.PagerSuffix) ? "page" : "page-" + part.Record.PagerSuffix; var page = 0; @@ -81,16 +83,14 @@ namespace Orchard.Projections.Drivers { var pageSizeKey = "pageSize" + part.Record.PagerSuffix; if (queryString.AllKeys.Contains(pageSizeKey)) { - int qsPageSize; - - if (Int32.TryParse(queryString[pageSizeKey], out qsPageSize)) { + if (Int32.TryParse(queryString[pageSizeKey], out int qsPageSize)) { if (part.Record.MaxItems == 0 || qsPageSize <= part.Record.MaxItems) { pageSize = qsPageSize; } } } - var pager = new Pager(Services.WorkContext.CurrentSite, page, pageSize); + var pager = new Pager(_orchardServices.WorkContext.CurrentSite, page, pageSize); var pagerShape = shapeHelper.Pager(pager) .ContentPart(part) @@ -107,7 +107,7 @@ namespace Orchard.Projections.Drivers { ContentShape("Parts_ProjectionPart_List", shape => { // generates a link to the RSS feed for this term - var metaData = Services.ContentManager.GetItemMetadata(part.ContentItem); + var metaData = _orchardServices.ContentManager.GetItemMetadata(part.ContentItem); _feedManager.Register(metaData.DisplayText, "rss", new RouteValueDictionary { { "projection", part.Id } }); // execute the query @@ -130,8 +130,8 @@ namespace Orchard.Projections.Drivers { // renders in a standard List shape if no specific layout could be found if (layoutDescriptor == null) { - var list = Services.New.List(); - var contentShapes = contentItems.Select(item => Services.ContentManager.BuildDisplay(item, "Summary")); + var list = _orchardServices.New.List(); + var contentShapes = contentItems.Select(item => _orchardServices.ContentManager.BuildDisplay(item, "Summary")); list.AddRange(contentShapes); return list; @@ -143,7 +143,7 @@ namespace Orchard.Projections.Drivers { var layoutComponents = contentItems.Select( contentItem => { - var contentItemMetadata = Services.ContentManager.GetItemMetadata(contentItem); + var contentItemMetadata = _orchardServices.ContentManager.GetItemMetadata(contentItem); var propertyDescriptors = fieldDescriptors.Select( d => { @@ -156,9 +156,9 @@ namespace Orchard.Projections.Drivers { }); // apply all settings to the field content, wrapping it in a FieldWrapper shape - var properties = Services.New.Properties( + var properties = _orchardServices.New.Properties( Items: propertyDescriptors.Select( - pd => Services.New.PropertyWrapper( + pd => _orchardServices.New.PropertyWrapper( Item: pd.Shape, Property: pd.Property, ContentItem: contentItem, @@ -199,14 +199,14 @@ namespace Orchard.Projections.Drivers { return key; }).Select(x => new { Key = x.Key, Components = x }); - var list = Services.New.List(); + var list = _orchardServices.New.List(); foreach (var group in groups) { var localResult = layoutDescriptor.Render(renderLayoutContext, group.Components); // add the Context to the shape localResult.Context(renderLayoutContext); - list.Add(Services.New.LayoutGroup(Key: new MvcHtmlString(group.Key), List: localResult)); + list.Add(_orchardServices.New.LayoutGroup(Key: new MvcHtmlString(group.Key), List: localResult)); } return list; @@ -223,81 +223,80 @@ namespace Orchard.Projections.Drivers { } protected override DriverResult Editor(ProjectionPart part, dynamic shapeHelper) { - return ContentShape("Parts_ProjectionPart_Edit", - () => { - var model = new ProjectionPartEditViewModel(); + return ContentShape("Parts_ProjectionPart_Edit", () => { + var model = new ProjectionPartEditViewModel(); - // for create read the setting values - var settings = part.TypePartDefinition.Settings.GetModel(); - if (part.Id == 0) { - model = new ProjectionPartEditViewModel { - DisplayPager = settings.DisplayPager, - Items = settings.Items, - Skip = settings.Skip, - PagerSuffix = settings.PagerSuffix, - MaxItems = settings.MaxItems, - QueryLayoutRecordId = settings.QueryLayoutRecordId - }; - } - else { - model = new ProjectionPartEditViewModel { - DisplayPager = part.Record.DisplayPager, - Items = part.Record.Items, - ItemsPerPage = part.Record.ItemsPerPage, - Skip = part.Record.Skip, - PagerSuffix = part.Record.PagerSuffix, - MaxItems = part.Record.MaxItems, - QueryLayoutRecordId = "-1" - }; - // concatenated Query and Layout ids for the view - if (part.Record.QueryPartRecord != null) { - model.QueryLayoutRecordId = part.Record.QueryPartRecord.Id + ";"; - } + // for create read the setting values + var settings = part.TypePartDefinition.Settings.GetModel(); + if (part.Id == 0) { + model = new ProjectionPartEditViewModel { + DisplayPager = settings.DisplayPager, + Items = settings.Items, + Skip = settings.Skip, + PagerSuffix = settings.PagerSuffix, + MaxItems = settings.MaxItems, + QueryLayoutRecordId = settings.QueryLayoutRecordId + }; + } + else { + model = new ProjectionPartEditViewModel { + DisplayPager = part.Record.DisplayPager, + Items = part.Record.Items, + ItemsPerPage = part.Record.ItemsPerPage, + Skip = part.Record.Skip, + PagerSuffix = part.Record.PagerSuffix, + MaxItems = part.Record.MaxItems, + QueryLayoutRecordId = "-1" + }; + // concatenated Query and Layout ids for the view + if (part.Record.QueryPartRecord != null) { + model.QueryLayoutRecordId = part.Record.QueryPartRecord.Id + ";"; + } - if (part.Record.LayoutRecord != null) { - model.QueryLayoutRecordId += part.Record.LayoutRecord.Id.ToString(); - } - else { - model.QueryLayoutRecordId += "-1"; - } - } + if (part.Record.LayoutRecord != null) { + model.QueryLayoutRecordId += part.Record.LayoutRecord.Id.ToString(); + } + else { + model.QueryLayoutRecordId += "-1"; + } + } - model.PartId = part.Id; + model.PartId = part.Id; - // lock fields - model.LockEditingItems = settings.LockEditingItems; - model.LockEditingSkip = settings.LockEditingSkip; - model.LockEditingMaxItems = settings.LockEditingMaxItems; - model.LockEditingPagerSuffix = settings.LockEditingPagerSuffix; - model.LockEditingDisplayPager = settings.LockEditingDisplayPager; + // lock fields + model.LockEditingItems = settings.LockEditingItems; + model.LockEditingSkip = settings.LockEditingSkip; + model.LockEditingMaxItems = settings.LockEditingMaxItems; + model.LockEditingPagerSuffix = settings.LockEditingPagerSuffix; + model.LockEditingDisplayPager = settings.LockEditingDisplayPager; - // populating the list of queries and layouts - var layouts = _projectionManager.DescribeLayouts().SelectMany(x => x.Descriptors).ToList(); - model.QueryRecordEntries = Services.ContentManager.Query().Join().OrderBy(x => x.Title).List() - .Select(x => new QueryRecordEntry { - Id = x.Id, - Name = x.Name, - LayoutRecordEntries = x.Layouts.Select(l => new LayoutRecordEntry { - Id = l.Id, - Description = GetLayoutDescription(layouts, l) - }) - }); + // populating the list of queries and layouts + var layouts = _projectionManager.DescribeLayouts().SelectMany(x => x.Descriptors).ToList(); + model.QueryRecordEntries = _orchardServices.ContentManager.Query().Join().OrderBy(x => x.Title).List() + .Select(x => new QueryRecordEntry { + Id = x.Id, + Name = x.Name, + LayoutRecordEntries = x.Layouts.Select(l => new LayoutRecordEntry { + Id = l.Id, + Description = GetLayoutDescription(layouts, l) + }) + }); - // if any values, use default list of the settings - if (!string.IsNullOrWhiteSpace(settings.FilterQueryRecordId)) { - var filterQueryRecordId = settings.FilterQueryRecordId.Split('&'); - model.QueryRecordIdFilterEntries = filterQueryRecordId - .Select(x => new QueryRecordFilterEntry { - Id = x.Split(';')[0], - LayoutId = x.Split(';')[1] - }); - } - else { - model.QueryRecordIdFilterEntries = new List(); - } + // if any values, use default list of the settings + if (!string.IsNullOrWhiteSpace(settings.FilterQueryRecordId)) { + var filterQueryRecordId = settings.FilterQueryRecordId.Split('&'); + model.QueryRecordIdFilterEntries = filterQueryRecordId + .Select(x => new QueryRecordFilterEntry { + Id = x.Split(';')[0], + LayoutId = x.Split(';')[1] + }); + } + else { + model.QueryRecordIdFilterEntries = new List(); + } - return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix); - }); + return shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix); + }); } private static string GetLayoutDescription(IEnumerable layouts, LayoutRecord l) { @@ -313,7 +312,7 @@ namespace Orchard.Projections.Drivers { updater.TryUpdateModel(model, Prefix, null, null); model.PartId = part.Id; - + // check the setting, if it is unlocked, assign the setting value if (settings.LockEditingDisplayPager) { part.Record.DisplayPager = settings.DisplayPager; @@ -356,6 +355,12 @@ namespace Orchard.Projections.Drivers { updater.AddModelError("PagerSuffix", T("Suffix should not contain special characters.")); } + if (model.Items == 0 + && (part.Record.QueryPartRecord?.FilterGroups.Any(group => group.Filters.Count == 0) ?? false)) { + _orchardServices.Notifier.Warning( + T("The selected Query has at least one empty filter group, which causes all content items to be returned. It is recommended to limit the number of content items queried by setting the 'Items to display' field to a non-zero value.")); + } + return Editor(part, shapeHelper); } @@ -376,12 +381,11 @@ namespace Orchard.Projections.Drivers { protected override void ImportCompleted(ProjectionPart part, ImportContentContext context) { // Assign the query only when everything is imported. var query = context.Attribute(part.PartDefinition.Name, "Query"); - if (query != null && context.GetItemFromSession(query).As()!=null) { + if (query != null && context.GetItemFromSession(query).As() != null) { part.Record.QueryPartRecord = context.GetItemFromSession(query).As().Record; var layoutIndex = context.Attribute(part.PartDefinition.Name, "LayoutIndex"); - int layoutIndexValue; if (layoutIndex != null - && Int32.TryParse(layoutIndex, out layoutIndexValue) + && Int32.TryParse(layoutIndex, out int layoutIndexValue) && layoutIndexValue >= 0 && part.Record.QueryPartRecord.Layouts.Count > layoutIndexValue) { part.Record.LayoutRecord = part.Record.QueryPartRecord.Layouts[Int32.Parse(layoutIndex)]; @@ -398,9 +402,9 @@ namespace Orchard.Projections.Drivers { context.Element(part.PartDefinition.Name).SetAttributeValue("DisplayPager", part.Record.DisplayPager); if (part.Record.QueryPartRecord != null) { - var queryPart = Services.ContentManager.Query("Query").Where(x => x.Id == part.Record.QueryPartRecord.Id).List().FirstOrDefault(); + var queryPart = _orchardServices.ContentManager.Query("Query").Where(x => x.Id == part.Record.QueryPartRecord.Id).List().FirstOrDefault(); if (queryPart != null) { - var queryIdentity = Services.ContentManager.GetItemMetadata(queryPart).Identity; + var queryIdentity = _orchardServices.ContentManager.GetItemMetadata(queryPart).Identity; context.Element(part.PartDefinition.Name).SetAttributeValue("Query", queryIdentity.ToString()); context.Element(part.PartDefinition.Name).SetAttributeValue("LayoutIndex", part.Record.QueryPartRecord.Layouts.IndexOf(part.Record.LayoutRecord)); } diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs index f737ee6cc..8024f7704 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Drivers/QueryPartDriver.cs @@ -19,14 +19,16 @@ namespace Orchard.Projections.Drivers { _projectionManager = projectionManager; _formManager = formManager; } + protected override string Prefix { get { return "Query_Part"; } } - protected override DriverResult Editor(QueryPart part, dynamic shapeHelper) { - return Editor(part, null, shapeHelper); - } + + protected override DriverResult Editor(QueryPart part, dynamic shapeHelper) => + Editor(part, null, shapeHelper); + protected override DriverResult Editor(QueryPart part, IUpdateModel updater, dynamic shapeHelper) { var model = new QueryViewModel { VersionScope = part.VersionScope }; if (updater != null) { @@ -34,10 +36,10 @@ namespace Orchard.Projections.Drivers { part.VersionScope = model.VersionScope; } } - return ContentShape("Parts_QueryPart_Edit", - () => { - return shapeHelper.EditorTemplate(TemplateName: "Parts/QueryPart_Edit", Model: model, Prefix: Prefix); - }); + + return ContentShape("Parts_QueryPart_Edit", () => { + return shapeHelper.EditorTemplate(TemplateName: "Parts/QueryPart_Edit", Model: model, Prefix: Prefix); + }); } protected override void Exporting(QueryPart part, ExportContentContext context) { @@ -60,12 +62,12 @@ namespace Orchard.Projections.Drivers { } return new XElement("Filter", - new XAttribute("Category", filter.Category ?? ""), - new XAttribute("Description", filter.Description ?? ""), - new XAttribute("Position", filter.Position), - new XAttribute("State", state ?? ""), - new XAttribute("Type", filter.Type ?? "") - ); + new XAttribute("Category", filter.Category ?? ""), + new XAttribute("Description", filter.Description ?? ""), + new XAttribute("Position", filter.Position), + new XAttribute("State", state ?? ""), + new XAttribute("Type", filter.Type ?? "") + ); }) ) ) diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs index cf0b6f57e..fbcc658ed 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs @@ -72,17 +72,7 @@ namespace Orchard.Projections { SchemaBuilder.CreateTable("FieldIndexPartRecord", table => table.ContentPartRecord()); //Adds indexes for better performances in queries - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); + AddPropertyNameAndFieldIndexPartRecordIdIndexes(); // Query @@ -287,7 +277,7 @@ namespace Orchard.Projections { Description = T("The text from the Body part").Text }); - return 6; + return 8; } public int UpdateFrom1() { @@ -343,17 +333,7 @@ namespace Orchard.Projections { .AddColumn("LatestValue")); //Adds indexes for better performances in queries - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); + AddPropertyNameAndFieldIndexPartRecordIdIndexes(); SchemaBuilder.AlterTable("QueryPartRecord", table => table .AddColumn("VersionScope", c => c.WithLength(15))); @@ -386,5 +366,47 @@ namespace Orchard.Projections { return 7; } + + public int UpdateFrom7() { + SchemaBuilder.AlterTable("StringFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + + AddPropertyNameAndFieldIndexPartRecordIdIndexes(); + + return 8; + } + + private void AddPropertyNameAndFieldIndexPartRecordIdIndexes() { + SchemaBuilder.AlterTable("StringFieldIndexRecord", table => { + table.CreateIndex("IDX_StringFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_StringFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => { + table.CreateIndex("IDX_IntegerFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_IntegerFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => { + table.CreateIndex("IDX_DoubleFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_DoubleFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => { + table.CreateIndex("IDX_DecimalFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_DecimalFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + } } -} \ No newline at end of file +} diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs b/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs index 6a1a0368e..1fe8f964b 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Services/ProjectionManager.cs @@ -108,19 +108,15 @@ namespace Orchard.Projections.Services { } public int GetCount(int queryId, ContentPart part) { - var queryRecord = _queryRepository.Get(queryId); + var queryRecord = _queryRepository.Get(queryId) ?? throw new ArgumentException("queryId"); - if (queryRecord == null) { - throw new ArgumentException("queryId"); - } - - // prepares tokens + // Prepare tokens. Dictionary tokens = new Dictionary(); if (part != null) { tokens.Add("Content", part.ContentItem); } - // aggregate the result for each group query + // Aggregate the result of each filter group. return GetContentQueries(queryRecord, Enumerable.Empty(), tokens) .Sum(contentQuery => contentQuery.Count()); } @@ -140,13 +136,13 @@ namespace Orchard.Projections.Services { var contentItems = new List(); - // prepares tokens + // Prepare tokens. Dictionary tokens = new Dictionary(); if (part != null) { tokens.Add("Content", part.ContentItem); } - // aggregate the result for each group query + // Aggregate the result of each filter group. foreach (var contentQuery in GetContentQueries(queryRecord, queryRecord.SortCriteria.OrderBy(sc => sc.Position), tokens)) { contentItems.AddRange(contentQuery.Slice(skip, count)); } @@ -155,7 +151,7 @@ namespace Orchard.Projections.Services { return contentItems; } - // re-executing the sorting with the cumulated groups + // Re-executing the sorting on the aggregated results. var ids = contentItems.Select(c => c.Id).ToArray(); if (ids.Length == 0) { @@ -164,7 +160,7 @@ namespace Orchard.Projections.Services { var groupQuery = _contentManager.HqlQuery().Where(alias => alias.Named("ci"), x => x.InG("Id", ids)); - // iterate over each sort criteria to apply the alterations to the query object + // Iterate over each sort criteria to apply the alterations to the query object. foreach (var sortCriterion in queryRecord.SortCriteria.OrderBy(s => s.Position)) { var tokenizedState = _tokenizer.Replace(sortCriterion.State, tokens); var sortCriterionContext = new SortCriterionContext { @@ -177,15 +173,17 @@ namespace Orchard.Projections.Services { string category = sortCriterion.Category; string type = sortCriterion.Type; - // look for the specific filter component - var descriptor = availableSortCriteria.SelectMany(x => x.Descriptors).FirstOrDefault(x => x.Category == category && x.Type == type); + // Find specific sort criterion. + var descriptor = availableSortCriteria + .SelectMany(x => x.Descriptors) + .FirstOrDefault(x => x.Category == category && x.Type == type); - // ignore unfound descriptors + // Skip if not found. if (descriptor == null) { continue; } - // apply alteration + // Apply alteration. descriptor.Sort(sortCriterionContext); groupQuery = sortCriterionContext.Query; @@ -194,7 +192,10 @@ namespace Orchard.Projections.Services { return groupQuery.Slice(skip, count); } - public IEnumerable GetContentQueries(QueryPartRecord queryRecord, IEnumerable sortCriteria, Dictionary tokens) { + public IEnumerable GetContentQueries( + QueryPartRecord queryRecord, + IEnumerable sortCriteria, + Dictionary tokens) { var availableFilters = DescribeFilters().ToList(); var availableSortCriteria = DescribeSortCriteria().ToList(); @@ -204,11 +205,11 @@ namespace Orchard.Projections.Services { var version = queryRecord.VersionScope.ToVersionOptions(); - // pre-executing all groups + // Iterate over each filter group and evaluate the filters. foreach (var group in queryRecord.FilterGroups) { var contentQuery = _contentManager.HqlQuery().ForVersion(version); - // iterate over each filter to apply the alterations to the query object + // Iterate over each filter to apply the alterations to the query object. foreach (var filter in group.Filters) { var tokenizedState = _tokenizer.Replace(filter.State, tokens); var filterContext = new FilterContext { @@ -221,23 +222,23 @@ namespace Orchard.Projections.Services { string category = filter.Category; string type = filter.Type; - // look for the specific filter component + // Find specific filter. var descriptor = availableFilters .SelectMany(x => x.Descriptors) .FirstOrDefault(x => x.Category == category && x.Type == type); - // ignore unfound descriptors + // Skip if not found. if (descriptor == null) { continue; } - // apply alteration + // Apply alteration. descriptor.Filter(filterContext); contentQuery = filterContext.Query; } - // iterate over each sort criteria to apply the alterations to the query object + // Iterate over each sort criteria to apply the alterations to the query object. foreach (var sortCriterion in sortCriteria.OrderBy(s => s.Position)) { var tokenizedState = _tokenizer.Replace(sortCriterion.State, tokens); var sortCriterionContext = new SortCriterionContext { @@ -250,23 +251,22 @@ namespace Orchard.Projections.Services { string category = sortCriterion.Category; string type = sortCriterion.Type; - // look for the specific filter component + // Find specific sort criterion. var descriptor = availableSortCriteria .SelectMany(x => x.Descriptors) .FirstOrDefault(x => x.Category == category && x.Type == type); - // ignore unfound descriptors + // Skip if not found. if (descriptor == null) { continue; } - // apply alteration + // Apply alteration. descriptor.Sort(sortCriterionContext); contentQuery = sortCriterionContext.Query; } - yield return contentQuery; } } diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config b/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config index 9493cfeea..6ada2cd01 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config +++ b/src/Orchard.Web/Modules/Orchard.Projections/Tests/app.config @@ -16,7 +16,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Web.config b/src/Orchard.Web/Modules/Orchard.Projections/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Projections/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config b/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config +++ b/src/Orchard.Web/Modules/Orchard.PublishLater/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Recipes/Web.config b/src/Orchard.Web/Modules/Orchard.Recipes/Web.config index f57e23503..18574b08b 100644 --- a/src/Orchard.Web/Modules/Orchard.Recipes/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Recipes/Web.config @@ -52,7 +52,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj b/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj index 39eaa9dc4..766beb457 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj +++ b/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj @@ -53,8 +53,8 @@ ..\..\..\packages\Iesi.Collections.4.0.1.4000\lib\net40\Iesi.Collections.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll @@ -161,4 +161,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Redis/Web.config b/src/Orchard.Web/Modules/Orchard.Redis/Web.config index 050c8f125..b2bd44ec1 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Redis/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Redis/packages.config b/src/Orchard.Web/Modules/Orchard.Redis/packages.config index 9e7bf972f..e967b80b0 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Redis/packages.config @@ -1,7 +1,7 @@  - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Resources/Web.config b/src/Orchard.Web/Modules/Orchard.Resources/Web.config index ae6d6621d..41c6d90cd 100644 --- a/src/Orchard.Web/Modules/Orchard.Resources/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Resources/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Web.config b/src/Orchard.Web/Modules/Orchard.Roles/Web.config index 1149fd7ed..975f0c223 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Roles/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Rules/Web.config b/src/Orchard.Web/Modules/Orchard.Rules/Web.config index 1e15feddd..c84658808 100644 --- a/src/Orchard.Web/Modules/Orchard.Rules/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Rules/Web.config @@ -57,7 +57,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config b/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Scripting.CSharp/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config b/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config index 050c8f125..b2bd44ec1 100644 --- a/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Scripting.Dlr/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Scripting/Web.config b/src/Orchard.Web/Modules/Orchard.Scripting/Web.config index 050c8f125..b2bd44ec1 100644 --- a/src/Orchard.Web/Modules/Orchard.Scripting/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Scripting/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Search/Web.config b/src/Orchard.Web/Modules/Orchard.Search/Web.config index 836843e00..5a55c6247 100644 --- a/src/Orchard.Web/Modules/Orchard.Search/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Search/Web.config @@ -54,7 +54,7 @@ - + @@ -68,6 +68,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config +++ b/src/Orchard.Web/Modules/Orchard.SecureSocketsLayer/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Web.config b/src/Orchard.Web/Modules/Orchard.Setup/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Setup/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tags/Web.config b/src/Orchard.Web/Modules/Orchard.Tags/Web.config index 836843e00..5a55c6247 100644 --- a/src/Orchard.Web/Modules/Orchard.Tags/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Tags/Web.config @@ -54,7 +54,7 @@ - + @@ -68,6 +68,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config b/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config index 050c8f125..b2bd44ec1 100644 --- a/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config +++ b/src/Orchard.Web/Modules/Orchard.TaskLease/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj b/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj index a2d6449b3..eeceab2c3 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj @@ -59,8 +59,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -288,4 +288,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config b/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config index b12ba08aa..198678287 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Web.config @@ -41,7 +41,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config b/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config index 343350b13..a8ccef4a9 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config @@ -7,5 +7,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Templates/Web.config b/src/Orchard.Web/Modules/Orchard.Templates/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Templates/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Templates/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Themes/Web.config b/src/Orchard.Web/Modules/Orchard.Themes/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Themes/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Themes/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config index cda2fe9df..ed0f1f563 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Tests/app.config @@ -16,7 +16,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Tokens/Web.config b/src/Orchard.Web/Modules/Orchard.Tokens/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Tokens/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Tokens/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Web.config b/src/Orchard.Web/Modules/Orchard.Users/Web.config index 1149fd7ed..975f0c223 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Users/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Warmup/Web.config b/src/Orchard.Web/Modules/Orchard.Warmup/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.Warmup/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Warmup/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Widgets/Web.config b/src/Orchard.Web/Modules/Orchard.Widgets/Web.config index 836843e00..5a55c6247 100644 --- a/src/Orchard.Web/Modules/Orchard.Widgets/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Widgets/Web.config @@ -54,7 +54,7 @@ - + @@ -68,6 +68,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj b/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj index 97df8d937..3e85f4f0b 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj +++ b/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj @@ -58,8 +58,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -307,4 +307,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/Web.config b/src/Orchard.Web/Modules/Orchard.Workflows/Web.config index 1149fd7ed..975f0c223 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Workflows/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/packages.config b/src/Orchard.Web/Modules/Orchard.Workflows/packages.config index 3a05f90ac..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Workflows/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.jQuery/Web.config b/src/Orchard.Web/Modules/Orchard.jQuery/Web.config index 836843e00..dbacb1007 100644 --- a/src/Orchard.Web/Modules/Orchard.jQuery/Web.config +++ b/src/Orchard.Web/Modules/Orchard.jQuery/Web.config @@ -54,7 +54,7 @@ - + diff --git a/src/Orchard.Web/Modules/SysCache/Web.config b/src/Orchard.Web/Modules/SysCache/Web.config index 050c8f125..b2bd44ec1 100644 --- a/src/Orchard.Web/Modules/SysCache/Web.config +++ b/src/Orchard.Web/Modules/SysCache/Web.config @@ -49,7 +49,7 @@ - + diff --git a/src/Orchard.Web/Modules/TinyMce/Web.config b/src/Orchard.Web/Modules/TinyMce/Web.config index 5d7a337e5..d7b3d6256 100644 --- a/src/Orchard.Web/Modules/TinyMce/Web.config +++ b/src/Orchard.Web/Modules/TinyMce/Web.config @@ -53,7 +53,7 @@ - + diff --git a/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj b/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj index 9b4d80207..002f58771 100644 --- a/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj +++ b/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj @@ -61,8 +61,8 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Upgrade/Web.config b/src/Orchard.Web/Modules/Upgrade/Web.config index 2ea1387f8..fa2449687 100644 --- a/src/Orchard.Web/Modules/Upgrade/Web.config +++ b/src/Orchard.Web/Modules/Upgrade/Web.config @@ -44,7 +44,7 @@ - + @@ -70,6 +70,18 @@ + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Upgrade/packages.config b/src/Orchard.Web/Modules/Upgrade/packages.config index c464a2ac7..44568f4f9 100644 --- a/src/Orchard.Web/Modules/Upgrade/packages.config +++ b/src/Orchard.Web/Modules/Upgrade/packages.config @@ -8,6 +8,6 @@ - + - + \ No newline at end of file diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index f793ce0b4..0707cfd68 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -72,17 +72,14 @@ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\Npgsql.2.2.3\lib\net45\Mono.Security.dll - ..\packages\MySql.Data.6.7.9\lib\net45\MySql.Data.dll - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\Npgsql.2.2.3\lib\net45\Npgsql.dll + + ..\packages\Npgsql.4.0.17\lib\net451\Npgsql.dll ..\packages\Orchard.NuGet.Core.1.1.0.0\lib\NuGet.Core.dll @@ -91,6 +88,9 @@ ..\packages\Owin.1.0\lib\net40\Owin.dll + + ..\packages\System.Buffers.4.6.0\lib\net462\System.Buffers.dll + 3.5 @@ -100,7 +100,23 @@ ..\..\lib\sqlce\System.Data.SqlServerCe.dll True + + ..\packages\System.Memory.4.6.0\lib\net462\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.6.0\lib\net462\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.1.0\lib\net462\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.6.0\lib\net462\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + diff --git a/src/Orchard.Web/Themes/Web.config b/src/Orchard.Web/Themes/Web.config index 6f22dac94..08cb067f3 100644 --- a/src/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Web/Themes/Web.config @@ -77,7 +77,7 @@ - + @@ -91,6 +91,22 @@ + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Web.config b/src/Orchard.Web/Web.config index 63a710c6c..de4c277a8 100644 --- a/src/Orchard.Web/Web.config +++ b/src/Orchard.Web/Web.config @@ -159,7 +159,7 @@ - + @@ -227,6 +227,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/packages.config b/src/Orchard.Web/packages.config index d27ff6119..5b268d7c2 100644 --- a/src/Orchard.Web/packages.config +++ b/src/Orchard.Web/packages.config @@ -10,8 +10,14 @@ - - + + + + + + + + \ No newline at end of file diff --git a/src/Orchard/Orchard.Framework.csproj b/src/Orchard/Orchard.Framework.csproj index 56e9fbc43..c74cd774f 100644 --- a/src/Orchard/Orchard.Framework.csproj +++ b/src/Orchard/Orchard.Framework.csproj @@ -83,8 +83,8 @@ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\NHibernate.4.1.2.4000\lib\net40\NHibernate.dll diff --git a/src/Orchard/app.config b/src/Orchard/app.config index 88432b48a..bc4937df3 100644 --- a/src/Orchard/app.config +++ b/src/Orchard/app.config @@ -20,7 +20,7 @@ - + diff --git a/src/Orchard/packages.config b/src/Orchard/packages.config index ae21c35d4..73bb52b83 100644 --- a/src/Orchard/packages.config +++ b/src/Orchard/packages.config @@ -14,7 +14,7 @@ - + \ No newline at end of file