Merge with default

--HG--
branch : NH3
This commit is contained in:
Sebastien Ros
2012-07-13 16:29:06 -07:00
31 changed files with 189 additions and 80 deletions

View File

@@ -1,8 +1,8 @@
c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam c47525e90819321d37962a11313006a4ccfc8362 src/Orchard.Web/Modules/Orchard.AntiSpam
f41ead8138ef8eaec32e2c2826100ca175c15730 src/Orchard.Web/Modules/Orchard.Autoroute f41ead8138ef8eaec32e2c2826100ca175c15730 src/Orchard.Web/Modules/Orchard.Autoroute
a8cd78f4730747bf592935aaa605874938a9c89f src/Orchard.Web/Modules/Orchard.ContentPermissions 5eb5861244852a382332abfbfe2d28ac1b9bd419 src/Orchard.Web/Modules/Orchard.ContentPermissions
d466369118538a8ca77754d047ee841d016ea9c2 src/Orchard.Web/Modules/Orchard.ContentPicker d466369118538a8ca77754d047ee841d016ea9c2 src/Orchard.Web/Modules/Orchard.ContentPicker
3ad1bdc80b8374433d98469e8740bc48ef114be2 src/Orchard.Web/Modules/Orchard.CustomForms 8ac5b68b6ad42cfce6be53e6bd776a35ac14c6e7 src/Orchard.Web/Modules/Orchard.CustomForms
b639cb33d2ba038de6048350400b664399608996 src/Orchard.Web/Modules/Orchard.Forms b639cb33d2ba038de6048350400b664399608996 src/Orchard.Web/Modules/Orchard.Forms
b748de63e3cf8debfc3eba77f26089705147047d src/Orchard.Web/Modules/Orchard.Rules b748de63e3cf8debfc3eba77f26089705147047d src/Orchard.Web/Modules/Orchard.Rules
419399ef2e37122a000e6cc8674148d3183d7032 src/Orchard.Web/Modules/Orchard.TaskLease 419399ef2e37122a000e6cc8674148d3183d7032 src/Orchard.Web/Modules/Orchard.TaskLease

View File

@@ -1,5 +1,4 @@
using System; using JetBrains.Annotations;
using JetBrains.Annotations;
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Drivers;
using Orchard.Core.Navigation.Models; using Orchard.Core.Navigation.Models;
@@ -32,6 +31,12 @@ namespace Orchard.Core.Navigation.Drivers {
public Localizer T { get; set; } public Localizer T { get; set; }
protected override string Prefix {
get {
return "MenuPart";
}
}
protected override DriverResult Editor(MenuPart part, dynamic shapeHelper) { protected override DriverResult Editor(MenuPart part, dynamic shapeHelper) {
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part)) if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, _orchardServices.WorkContext.CurrentUser, part))
return null; return null;

View File

@@ -1,8 +1,12 @@
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Drivers;
using Orchard.Core.Navigation.Models; using Orchard.Core.Navigation.Models;
using Orchard.Core.Navigation.Services;
using Orchard.Core.Navigation.ViewModels; using Orchard.Core.Navigation.ViewModels;
using Orchard.Localization;
using Orchard.Security; using Orchard.Security;
using Orchard.UI.Navigation;
using Orchard.Utility;
namespace Orchard.Core.Navigation.Drivers { namespace Orchard.Core.Navigation.Drivers {
@@ -10,14 +14,30 @@ namespace Orchard.Core.Navigation.Drivers {
private readonly IAuthorizationService _authorizationService; private readonly IAuthorizationService _authorizationService;
private readonly IWorkContextAccessor _workContextAccessor; private readonly IWorkContextAccessor _workContextAccessor;
private readonly IContentManager _contentManager; private readonly IContentManager _contentManager;
private readonly IMenuService _menuService;
private readonly INavigationManager _navigationManager;
public NavigationPartDriver( public NavigationPartDriver(
IAuthorizationService authorizationService, IAuthorizationService authorizationService,
IWorkContextAccessor workContextAccessor, IWorkContextAccessor workContextAccessor,
IContentManager contentManager) { IContentManager contentManager,
IMenuService menuService,
INavigationManager navigationManager) {
_authorizationService = authorizationService; _authorizationService = authorizationService;
_workContextAccessor = workContextAccessor; _workContextAccessor = workContextAccessor;
_contentManager = contentManager; _contentManager = contentManager;
_menuService = menuService;
_navigationManager = navigationManager;
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
protected override string Prefix {
get {
return "NavigationPart";
}
} }
protected override DriverResult Editor(NavigationPart part, dynamic shapeHelper) { protected override DriverResult Editor(NavigationPart part, dynamic shapeHelper) {
@@ -28,14 +48,48 @@ namespace Orchard.Core.Navigation.Drivers {
return ContentShape("Parts_Navigation_Edit", return ContentShape("Parts_Navigation_Edit",
() => { () => {
// loads all menu part of type ContentMenuItem linking to the current content item // loads all menu part of type ContentMenuItem linking to the current content item
var model = new NavigationPartViewModel() { var model = new NavigationPartViewModel {
Part = part, Part = part,
ContentMenuItems = _contentManager.Query<MenuPart>() ContentMenuItems = _contentManager
.Join<ContentMenuItemPartRecord>().Where(x => x.ContentMenuItemRecord == part.ContentItem.Record).List() .Query<MenuPart>()
.Join<ContentMenuItemPartRecord>()
.Where(x => x.ContentMenuItemRecord == part.ContentItem.Record)
.List(),
Menus = _menuService.GetMenus(),
}; };
return shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.Edit", Model: model, Prefix: Prefix); return shapeHelper.EditorTemplate(TemplateName: "Parts.Navigation.Edit", Model: model, Prefix: Prefix);
}); });
} }
protected override DriverResult Editor(NavigationPart part, IUpdateModel updater, dynamic shapeHelper) {
var currentUser = _workContextAccessor.GetContext().CurrentUser;
if (!_authorizationService.TryCheckAccess(Permissions.ManageMainMenu, currentUser, part))
return null;
var model = new NavigationPartViewModel();
if (updater.TryUpdateModel(model, Prefix, null, null)) {
if(model.AddMenuItem) {
if (string.IsNullOrEmpty(model.MenuText)) {
updater.AddModelError("MenuText", T("The MenuText field is required"));
}
else {
var menu = _contentManager.Get(model.CurrentMenuId);
if(menu != null) {
var menuItem = _contentManager.Create<ContentMenuItemPart>("ContentMenuItem");
menuItem.Content = part.ContentItem;
menuItem.As<MenuPart>().MenuText = model.MenuText;
menuItem.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
menuItem.As<MenuPart>().Menu = menu;
}
}
}
}
return Editor(part, shapeHelper);
}
} }
} }

View File

@@ -25,16 +25,21 @@ namespace Orchard.Core.Navigation.Handlers {
OnActivated<MenuPart>(PropertySetHandlers); OnActivated<MenuPart>(PropertySetHandlers);
} }
protected static void PropertySetHandlers(ActivatedContentContext context, MenuPart menuPart) { protected void PropertySetHandlers(ActivatedContentContext context, MenuPart menuPart) {
menuPart.MenuField.Setter(menu => { menuPart.MenuField.Setter(menu => {
if(menu == null || menu.ContentItem == null) {
menuPart.Record.MenuId = 0;
}
else {
menuPart.Record.MenuId = menu.ContentItem.Id; menuPart.Record.MenuId = menu.ContentItem.Id;
return menu;
});
} }
protected void LazyLoadHandlers(MenuPart menuPart) { return menu;
});
menuPart.MenuField.Loader(ctx => menuPart.MenuField.Loader(ctx =>
_contentManager.Get(menuPart.Record.MenuId, menuPart.IsPublished() ? VersionOptions.Published : VersionOptions.Latest)); _contentManager.Get(menuPart.Record.MenuId, menuPart.IsPublished() ? VersionOptions.Published : VersionOptions.Latest)
);
} }
protected override void GetItemMetadata(GetContentItemMetadataContext context) { protected override void GetItemMetadata(GetContentItemMetadataContext context) {

View File

@@ -14,7 +14,7 @@ namespace Orchard.Core.Navigation {
public int Create() { public int Create() {
ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder.Attachable()); ContentDefinitionManager.AlterPartDefinition("MenuPart", builder => builder.Attachable());
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable()); ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable());
ContentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg.WithPart("MenuPart")); ContentDefinitionManager.AlterTypeDefinition("Page", cfg => cfg.WithPart("NavigationPart"));
SchemaBuilder.CreateTable("MenuItemPartRecord", SchemaBuilder.CreateTable("MenuItemPartRecord",
table => table table => table
@@ -165,14 +165,29 @@ namespace Orchard.Core.Navigation {
ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable()); ContentDefinitionManager.AlterPartDefinition("NavigationPart", builder => builder.Attachable());
SchemaBuilder.CreateTable("ContentMenuItemPartRecord",
table => table
.ContentPartRecord()
.Column<int>("ContentMenuItemRecord_id")
);
ContentDefinitionManager.AlterTypeDefinition("ContentMenuItem", cfg => cfg
.WithPart("MenuPart")
.WithPart("CommonPart")
.WithPart("IdentityPart")
.WithPart("ContentMenuItemPart")
.DisplayedAs("Content Menu Item")
.WithSetting("Description", "Adds a Content Item to the menu.")
.WithSetting("Stereotype", "MenuItem")
);
// create a Main Menu // create a Main Menu
var mainMenu = _menuService.Create("Main Menu"); var mainMenu = _menuService.Create("Main Menu");
// assign the Main Menu to all current menu items // assign the Main Menu to all current menu items
foreach (var menuItem in _menuService.Get()) { foreach (var menuItem in _menuService.Get()) {
// if they don't have a position, then they are not displayed // if they don't have a position or a text, then they are not displayed
if(string.IsNullOrWhiteSpace(menuItem.MenuPosition)) { if(string.IsNullOrWhiteSpace(menuItem.MenuPosition) || string.IsNullOrEmpty(menuItem.MenuText)) {
continue; continue;
} }
menuItem.Menu = mainMenu.ContentItem; menuItem.Menu = mainMenu.ContentItem;

View File

@@ -25,7 +25,7 @@ namespace Orchard.Core.Navigation.Services {
if (menuPart != null) { if (menuPart != null) {
var part = menuPart; var part = menuPart;
builder.Add(new LocalizedString(HttpUtility.HtmlEncode(part.AdminMenuText)), builder.Add(new LocalizedString(part.AdminMenuText),
part.AdminMenuPosition, part.AdminMenuPosition,
item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).AdminRouteValues)); item => item.Action(_contentManager.GetItemMetadata(part.ContentItem).AdminRouteValues));
// todo: somehow determine if they will ultimately have rights to the destination and hide if not. possibly would need to add a Permission to metadata. // todo: somehow determine if they will ultimately have rights to the destination and hide if not. possibly would need to add a Permission to metadata.

View File

@@ -1,9 +1,14 @@
using System.Collections.Generic; using System.Collections.Generic;
using Orchard.ContentManagement;
using Orchard.Core.Navigation.Models; using Orchard.Core.Navigation.Models;
namespace Orchard.Core.Navigation.ViewModels { namespace Orchard.Core.Navigation.ViewModels {
public class NavigationPartViewModel { public class NavigationPartViewModel {
public IEnumerable<MenuPart> ContentMenuItems { get; set; } public IEnumerable<MenuPart> ContentMenuItems { get; set; }
public NavigationPart Part { get; set; } public NavigationPart Part { get; set; }
public IEnumerable<ContentItem> Menus { get; set; }
public string MenuText { get; set; }
public bool AddMenuItem { get; set; }
public int CurrentMenuId { get; set; }
} }
} }

View File

@@ -22,5 +22,22 @@
@T("Not displayed in any menu.") @T("Not displayed in any menu.")
} }
</fieldset>
<fieldset>
@Html.EditorFor(m => m.AddMenuItem)
<label for="@Html.FieldIdFor(m => m.AddMenuItem)" class="forcheckbox">@T("Add on a menu")</label>
<div data-controllerid="@Html.FieldIdFor(m => m.AddMenuItem)">
<select id="@Html.FieldIdFor(m => m.CurrentMenuId)" name="@Html.FieldNameFor(m => m.CurrentMenuId)">
@foreach (ContentItem menu in Model.Menus) {
@Html.SelectOption(Model.CurrentMenuId, menu.Id, Html.ItemDisplayText(menu).ToString())
}
</select>
<span class="hint">@T("Select which menu you want the content item to be added on.")</span>
<label for="MenuText">@T("Menu text")</label>
@Html.TextBoxFor(m => m.MenuText, new { @class = "text-box single-line" })
<span class="hint">@T("The text that should appear in the menu.")</span>
</div>
</fieldset> </fieldset>

View File

@@ -91,9 +91,11 @@ namespace Orchard.Blogs.Commands {
var menu = _menuService.GetMenu(MenuName); var menu = _menuService.GetMenu(MenuName);
if (menu != null) { if (menu != null) {
blog.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); var menuItem = _contentManager.Create<ContentMenuItemPart>("ContentMenuItem");
blog.As<MenuPart>().MenuText = MenuText; menuItem.Content = blog;
blog.As<MenuPart>().Menu = menu.ContentItem; menuItem.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
menuItem.As<MenuPart>().MenuText = MenuText;
menuItem.As<MenuPart>().Menu = menu;
} }
} }

View File

@@ -154,7 +154,7 @@ namespace Orchard.Blogs.Controllers {
list.AddRange(_blogService.Get(VersionOptions.Latest) list.AddRange(_blogService.Get(VersionOptions.Latest)
.Select(b => { .Select(b => {
var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin"); var blog = Services.ContentManager.BuildDisplay(b, "SummaryAdmin");
blog.TotalPostCount = _blogPostService.Get(b, VersionOptions.Latest).Count(); blog.TotalPostCount = _blogPostService.PostCount(b, VersionOptions.Latest);
return blog; return blog;
})); }));

View File

@@ -32,7 +32,7 @@ namespace Orchard.Blogs.Handlers {
var posts = blogPostService.Get(blogPostPart.BlogPart, VersionOptions.Published); var posts = blogPostService.Get(blogPostPart.BlogPart, VersionOptions.Published);
// create a dictionary of all the year/month combinations and their count of posts that are published in this blog // create a dictionary of all the year/month combinations and their count of posts that are published in this blog
var inMemoryBlogArchives = new Dictionary<DateTime, int>(posts.Count()); var inMemoryBlogArchives = new Dictionary<DateTime, int>();
foreach (var post in posts) { foreach (var post in posts) {
if (!post.Has<CommonPart>()) if (!post.Has<CommonPart>())
continue; continue;

View File

@@ -43,7 +43,7 @@ namespace Orchard.Blogs.Handlers {
// Ensure the "right" set of published posts for the blog is obtained // Ensure the "right" set of published posts for the blog is obtained
blogPart.ContentItem.ContentManager.Flush(); blogPart.ContentItem.ContentManager.Flush();
blogPart.PostCount = _blogPostService.Get(blogPart, VersionOptions.Published).Count(); blogPart.PostCount = _blogPostService.PostCount(blogPart);
} }
} }

View File

@@ -49,26 +49,26 @@ namespace Orchard.Comments.Controllers {
options = new CommentIndexOptions(); options = new CommentIndexOptions();
// Filtering // Filtering
IContentQuery<CommentPart, CommentPartRecord> comments; IContentQuery<CommentPart, CommentPartRecord> commentsQuery;
switch (options.Filter) { switch (options.Filter) {
case CommentIndexFilter.All: case CommentIndexFilter.All:
comments = _commentService.GetComments(); commentsQuery = _commentService.GetComments();
break; break;
case CommentIndexFilter.Approved: case CommentIndexFilter.Approved:
comments = _commentService.GetComments(CommentStatus.Approved); commentsQuery = _commentService.GetComments(CommentStatus.Approved);
break; break;
case CommentIndexFilter.Pending: case CommentIndexFilter.Pending:
comments = _commentService.GetComments(CommentStatus.Pending); commentsQuery = _commentService.GetComments(CommentStatus.Pending);
break; break;
case CommentIndexFilter.Spam: case CommentIndexFilter.Spam:
comments = _commentService.GetComments(CommentStatus.Spam); commentsQuery = _commentService.GetComments(CommentStatus.Spam);
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
var pagerShape = Shape.Pager(pager).TotalItemCount(comments.Count()); var pagerShape = Shape.Pager(pager).TotalItemCount(commentsQuery.Count());
var entries = comments var entries = commentsQuery
.OrderByDescending<CommentPartRecord>(cpr => cpr.CommentDateUtc) .OrderByDescending<CommentPartRecord>(cpr => cpr.CommentDateUtc)
.Slice(pager.GetStartIndex(), pager.PageSize) .Slice(pager.GetStartIndex(), pager.PageSize)
.ToList() .ToList()

View File

@@ -80,9 +80,11 @@ namespace Orchard.Pages.Commands {
var menu = _menuService.GetMenu(MenuName); var menu = _menuService.GetMenu(MenuName);
if (menu != null) { if (menu != null) {
page.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); var menuItem = _contentManager.Create<ContentMenuItemPart>("ContentMenuItem");
page.As<MenuPart>().MenuText = MenuText; menuItem.Content = page;
page.As<MenuPart>().Menu = menu.ContentItem; menuItem.As<MenuPart>().MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu));
menuItem.As<MenuPart>().MenuText = MenuText;
menuItem.As<MenuPart>().Menu = menu;
} }
} }

View File

@@ -142,7 +142,10 @@ namespace Orchard.Tags.Services {
} }
public int GetTaggedContentItemCount(int tagId, VersionOptions options) { public int GetTaggedContentItemCount(int tagId, VersionOptions options) {
return GetTaggedContentItems(tagId, options).Count(); return _orchardServices.ContentManager
.Query<TagsPart, TagsPartRecord>()
.Where(tpr => tpr.Tags.Any(tr => tr.TagRecord.Id == tagId))
.Count();
} }
private void TagContentItem(TagsPartRecord tagsPartRecord, string tagName) { private void TagContentItem(TagsPartRecord tagsPartRecord, string tagName) {

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Web.Mvc; using System.Web.Mvc;
using System.Linq; using System.Linq;
using Orchard.ContentManagement; using Orchard.ContentManagement;
@@ -116,9 +117,9 @@ namespace Orchard.Widgets.Controllers {
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
IEnumerable<LayerPart> layers = _widgetsService.GetLayers(); IEnumerable<LayerPart> layers = _widgetsService.GetLayers().ToList();
if (layers.Count() == 0) { if (!layers.Any()) {
Services.Notifier.Error(T("Layer not found: {0}", layerId)); Services.Notifier.Error(T("Layer not found: {0}", layerId));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@@ -147,8 +148,8 @@ namespace Orchard.Widgets.Controllers {
if (widgetPart == null) if (widgetPart == null)
return HttpNotFound(); return HttpNotFound();
try { try {
int widgetPosition = _widgetsService.GetWidgets().Where(widget => widget.Zone == widgetPart.Zone).Count() + 1; int widgetPosition = _widgetsService.GetWidgets().Count(widget => widget.Zone == widgetPart.Zone) + 1;
widgetPart.Position = widgetPosition.ToString(); widgetPart.Position = widgetPosition.ToString(CultureInfo.InvariantCulture);
widgetPart.Zone = zone; widgetPart.Zone = zone;
widgetPart.LayerPart = _widgetsService.GetLayer(layerId); widgetPart.LayerPart = _widgetsService.GetLayer(layerId);
dynamic model = Services.ContentManager.BuildEditor(widgetPart); dynamic model = Services.ContentManager.BuildEditor(widgetPart);

View File

@@ -78,6 +78,10 @@ namespace Orchard.Widgets.Services {
} }
public IEnumerable<string> GetZones(ExtensionDescriptor theme) { public IEnumerable<string> GetZones(ExtensionDescriptor theme) {
if(theme == null) {
return Enumerable.Empty<string>();
}
IEnumerable<string> zones = new List<string>(); IEnumerable<string> zones = new List<string>();
// get the zones for this theme // get the zones for this theme

View File

@@ -2,7 +2,7 @@
using Orchard.Security; using Orchard.Security;
using Orchard.UI.Navigation; using Orchard.UI.Navigation;
namespace UpgradeTo14 { namespace UpgradeTo15 {
public class AdminMenu : INavigationProvider { public class AdminMenu : INavigationProvider {
public Localizer T { get; set; } public Localizer T { get; set; }
@@ -12,9 +12,9 @@ namespace UpgradeTo14 {
public void GetNavigation(NavigationBuilder builder) { public void GetNavigation(NavigationBuilder builder) {
builder builder
.Add(T("Migrate to 1.4"), "0", menu => menu.Action("Index", "Route", new { area = "UpgradeTo14" }) .Add(T("Migrate to 1.5"), "0", menu => menu.Action("Index", "Route", new { area = "UpgradeTo15" })
.Add(T("Migrate Routes"), "0", item => item.Action("Index", "Route", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner)) .Add(T("Migrate Routes"), "0", item => item.Action("Index", "Route", new { area = "UpgradeTo15" }).LocalNav().Permission(StandardPermissions.SiteOwner))
.Add(T("Migrate Fields"), "0", item => item.Action("Index", "Field", new { area = "UpgradeTo14" }).LocalNav().Permission(StandardPermissions.SiteOwner)) .Add(T("Migrate Fields"), "0", item => item.Action("Index", "Field", new { area = "UpgradeTo15" }).LocalNav().Permission(StandardPermissions.SiteOwner))
); );
} }
} }

View File

@@ -4,15 +4,14 @@ using System.Web.Mvc;
using Orchard; using Orchard;
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.MetaData;
using Orchard.Data;
using Orchard.Environment.Features; using Orchard.Environment.Features;
using Orchard.Localization; using Orchard.Localization;
using Orchard.Security; using Orchard.Security;
using Orchard.UI.Admin; using Orchard.UI.Admin;
using Orchard.UI.Notify; using Orchard.UI.Notify;
using UpgradeTo14.ViewModels; using UpgradeTo15.ViewModels;
namespace UpgradeTo14.Controllers { namespace UpgradeTo15.Controllers {
[Admin] [Admin]
public class FieldController : Controller { public class FieldController : Controller {
private readonly IContentDefinitionManager _contentDefinitionManager; private readonly IContentDefinitionManager _contentDefinitionManager;

View File

@@ -18,9 +18,9 @@ using Orchard.Reports.Services;
using Orchard.Security; using Orchard.Security;
using Orchard.UI.Admin; using Orchard.UI.Admin;
using Orchard.UI.Notify; using Orchard.UI.Notify;
using UpgradeTo14.ViewModels; using UpgradeTo15.ViewModels;
namespace UpgradeTo14.Controllers { namespace UpgradeTo15.Controllers {
[Admin] [Admin]
public class RouteController : Controller { public class RouteController : Controller {
private readonly IContentDefinitionManager _contentDefinitionManager; private readonly IContentDefinitionManager _contentDefinitionManager;
@@ -73,7 +73,7 @@ namespace UpgradeTo14.Controllers {
if(TryUpdateModel(viewModel)) { if(TryUpdateModel(viewModel)) {
// creating report // creating report
_reportsCoordinator.Register("Migration", "UpgradeTo14", "Migrating " + string.Join(" ,", viewModel.ContentTypes.Where(x => x.IsChecked).Select(x => x.ContentTypeName).ToArray())); _reportsCoordinator.Register("Migration", "UpgradeTo15", "Migrating " + string.Join(" ,", viewModel.ContentTypes.Where(x => x.IsChecked).Select(x => x.ContentTypeName).ToArray()));
var contentTypesToMigrate = viewModel.ContentTypes.Where(c => c.IsChecked).Select(c => c.ContentTypeName); var contentTypesToMigrate = viewModel.ContentTypes.Where(c => c.IsChecked).Select(c => c.ContentTypeName);

View File

@@ -1,11 +1,11 @@
Name: UpgradeTo14 Name: UpgradeTo15
AntiForgery: enabled AntiForgery: enabled
Author: The Orchard Team Author: The Orchard Team
Website: http://orchardproject.net Website: http://orchardproject.net
Version: 1.5 Version: 1.5
OrchardVersion: 1.4 OrchardVersion: 1.5
Description: Description for the module Description: Description for the module
Features: Features:
UpgradeTo14: UpgradeTo15:
Description: Description for feature UpgradeTo14. Description: Description for feature UpgradeTo15.
Dependencies: Orchard.Autoroute, Title Dependencies: Orchard.Autoroute, Title

View File

@@ -6,7 +6,7 @@ using System.Security;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("UpgradeTo14")] [assembly: AssemblyTitle("UpgradeTo15")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")] [assembly: AssemblyProduct("Orchard")]

View File

@@ -9,8 +9,8 @@
<ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> <ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UpgradeTo14</RootNamespace> <RootNamespace>UpgradeTo15</RootNamespace>
<AssemblyName>UpgradeTo14</AssemblyName> <AssemblyName>UpgradeTo15</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews> <MvcBuildViews>false</MvcBuildViews>
<FileUpgradeFlags> <FileUpgradeFlags>
@@ -40,9 +40,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL"> <Reference Include="NHibernate">
<SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\..\lib\fluentnhibernate\NHibernate.dll</HintPath>
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />

View File

@@ -1,6 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
namespace UpgradeTo14.ViewModels { namespace UpgradeTo15.ViewModels {
public class MigrateViewModel { public class MigrateViewModel {
public IList<ContentTypeEntry> ContentTypes { get; set; } public IList<ContentTypeEntry> ContentTypes { get; set; }
} }

View File

@@ -136,8 +136,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Alias", "Orchard.We
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute", "Orchard.Web\Modules\Orchard.Autoroute\Orchard.Autoroute.csproj", "{66FCCD76-2761-47E3-8D11-B45D0001DDAA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute", "Orchard.Web\Modules\Orchard.Autoroute\Orchard.Autoroute.csproj", "{66FCCD76-2761-47E3-8D11-B45D0001DDAA}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpgradeTo14", "Orchard.Web\Modules\UpgradeTo14\UpgradeTo14.csproj", "{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute.Specs", "Orchard.Web\Modules\Orchard.Autoroute\Specs\Orchard.Autoroute.Specs.csproj", "{AC4402A1-61C4-4229-B840-FB1777DAE10C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Autoroute.Specs", "Orchard.Web\Modules\Orchard.Autoroute\Specs\Orchard.Autoroute.Specs.csproj", "{AC4402A1-61C4-4229-B840-FB1777DAE10C}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AntiSpam", "Orchard.Web\Modules\Orchard.AntiSpam\Orchard.AntiSpam.csproj", "{91BC2E7F-DA04-421C-98EF-76D37CEC130C}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.AntiSpam", "Orchard.Web\Modules\Orchard.AntiSpam\Orchard.AntiSpam.csproj", "{91BC2E7F-DA04-421C-98EF-76D37CEC130C}"
@@ -754,16 +752,6 @@ Global
{66FCCD76-2761-47E3-8D11-B45D0001DDAA}.FxCop|Any CPU.Build.0 = Release|Any CPU {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.FxCop|Any CPU.Build.0 = Release|Any CPU
{66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.Build.0 = Release|Any CPU {66FCCD76-2761-47E3-8D11-B45D0001DDAA}.Release|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU
{AC4402A1-61C4-4229-B840-FB1777DAE10C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU {AC4402A1-61C4-4229-B840-FB1777DAE10C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{AC4402A1-61C4-4229-B840-FB1777DAE10C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU {AC4402A1-61C4-4229-B840-FB1777DAE10C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{AC4402A1-61C4-4229-B840-FB1777DAE10C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU {AC4402A1-61C4-4229-B840-FB1777DAE10C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
@@ -811,6 +799,16 @@ Global
{E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.FxCop|Any CPU.Build.0 = Release|Any CPU {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.FxCop|Any CPU.Build.0 = Release|Any CPU
{E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.Build.0 = Release|Any CPU {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3}.Release|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Coverage|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.FxCop|Any CPU.Build.0 = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@@ -859,11 +857,11 @@ Global
{3787DDE5-E5C8-4841-BDA7-DCB325388064} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {3787DDE5-E5C8-4841-BDA7-DCB325388064} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{475B6C45-B27C-438B-8966-908B9D6D1077} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {475B6C45-B27C-438B-8966-908B9D6D1077} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{66FCCD76-2761-47E3-8D11-B45D0001DDAA} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {66FCCD76-2761-47E3-8D11-B45D0001DDAA} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{91BC2E7F-DA04-421C-98EF-76D37CEC130C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {91BC2E7F-DA04-421C-98EF-76D37CEC130C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{2CF067CA-064B-43C6-8B88-5E3B99A65F1D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {2CF067CA-064B-43C6-8B88-5E3B99A65F1D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{F301EF7D-F19C-4D83-AA94-CB64F29C037D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {F301EF7D-F19C-4D83-AA94-CB64F29C037D} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{E826F796-8CE3-4B5B-8423-5AA5F81D2FC3} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} {E826F796-8CE3-4B5B-8423-5AA5F81D2FC3} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{8A9FDB57-342D-49C2-BAFC-D885AAE5CC7C} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
{ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {ABC826D4-2FA1-4F2F-87DE-E6095F653810} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {F112851D-B023-4746-B6B1-8D2E5AD8F7AA} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
{6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA} {6CB3EB30-F725-45C0-9742-42599BA8E8D2} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}