diff --git a/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs b/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs index 67fd4ac54..d613c7411 100644 --- a/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs +++ b/src/Orchard.Core.Tests/Common/Services/RoutableServiceTests.cs @@ -40,7 +40,7 @@ namespace Orchard.Core.Tests.Common.Services { builder.RegisterType().As(); builder.RegisterInstance(new UrlHelper(new RequestContext(new StubHttpContext("~/"), new RouteData()))).As(); - builder.RegisterType().As(); + builder.RegisterType().As(); } @@ -51,11 +51,11 @@ namespace Orchard.Core.Tests.Common.Services { var contentManager = _container.Resolve(); var thing = contentManager.Create(ThingDriver.ContentType.Name, t => { - t.As().Record = new RoutableRecord(); + t.As().Record = new RoutePartRecord(); t.Title = "Please do not use any of the following characters in your slugs: \":\", \"/\", \"?\", \"#\", \"[\", \"]\", \"@\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\""; }); - _routableService.FillSlug(thing.As()); + _routableService.FillSlug(thing.As()); Assert.That(thing.Slug, Is.EqualTo("please-do-not-use-any-of-the-following-characters-in-your-slugs-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"-\"")); } @@ -87,11 +87,11 @@ namespace Orchard.Core.Tests.Common.Services { veryVeryLongTitle += "aaaaaaaaaa"; var thing = contentManager.Create(ThingDriver.ContentType.Name, t => { - t.As().Record = new RoutableRecord(); + t.As().Record = new RoutePartRecord(); t.Title = veryVeryLongTitle; }); - _routableService.FillSlug(thing.As()); + _routableService.FillSlug(thing.As()); Assert.That(veryVeryLongTitle.Length, Is.AtLeast(1001)); Assert.That(thing.Slug.Length, Is.EqualTo(1000)); @@ -138,11 +138,11 @@ namespace Orchard.Core.Tests.Common.Services { var contentManager = _container.Resolve(); var thing = contentManager.Create(ThingDriver.ContentType.Name, t => { - t.As().Record = new RoutableRecord(); + t.As().Record = new RoutePartRecord(); t.Title = "This Is Some Interesting Title"; }); - _routableService.FillSlug(thing.As()); + _routableService.FillSlug(thing.As()); Assert.That(thing.Slug, Is.EqualTo("this-is-some-interesting-title")); } @@ -152,12 +152,12 @@ namespace Orchard.Core.Tests.Common.Services { var contentManager = _container.Resolve(); var thing1 = contentManager.Create(ThingDriver.ContentType.Name, t => { - t.As().Record = new RoutableRecord(); + t.As().Record = new RoutePartRecord(); t.Title = "This Is Some Interesting Title"; }); var thing2 = contentManager.Create(ThingDriver.ContentType.Name, t => { - t.As().Record = new RoutableRecord(); + t.As().Record = new RoutePartRecord(); t.Title = "This Is Some Interesting Title"; }); @@ -169,12 +169,12 @@ namespace Orchard.Core.Tests.Common.Services { var contentManager = _container.Resolve(); var thing = contentManager.Create(ThingDriver.ContentType.Name, t => { - t.As().Record = new RoutableRecord(); + t.As().Record = new RoutePartRecord(); t.Title = "This Is Some Interesting Title"; }); var stuff = contentManager.Create(StuffDriver.ContentType.Name, s => { - s.As().Record = new RoutableRecord(); + s.As().Record = new RoutePartRecord(); s.Title = "This Is Some Interesting Title"; }); @@ -185,7 +185,7 @@ namespace Orchard.Core.Tests.Common.Services { protected override IEnumerable DatabaseTypes { get { return new[] { - typeof(RoutableRecord), + typeof(RoutePartRecord), typeof(ContentTypeRecord), typeof(ContentItemRecord), typeof(ContentItemVersionRecord), @@ -201,7 +201,7 @@ namespace Orchard.Core.Tests.Common.Services { Filters.Add(new ActivatingFilter(ThingDriver.ContentType.Name)); Filters.Add(new ActivatingFilter>(ThingDriver.ContentType.Name)); Filters.Add(new ActivatingFilter(ThingDriver.ContentType.Name)); - Filters.Add(new ActivatingFilter(ThingDriver.ContentType.Name)); + Filters.Add(new ActivatingFilter(ThingDriver.ContentType.Name)); } } @@ -209,13 +209,13 @@ namespace Orchard.Core.Tests.Common.Services { public int Id { get { return ContentItem.Id; } } public string Title { - get { return this.As().Title; } - set { this.As().Title = value; } + get { return this.As().Title; } + set { this.As().Title = value; } } public string Slug { - get { return this.As().Slug; } - set { this.As().Slug = value; } + get { return this.As().Slug; } + set { this.As().Slug = value; } } } @@ -232,7 +232,7 @@ namespace Orchard.Core.Tests.Common.Services { Filters.Add(new ActivatingFilter(StuffDriver.ContentType.Name)); Filters.Add(new ActivatingFilter>(StuffDriver.ContentType.Name)); Filters.Add(new ActivatingFilter(StuffDriver.ContentType.Name)); - Filters.Add(new ActivatingFilter(StuffDriver.ContentType.Name)); + Filters.Add(new ActivatingFilter(StuffDriver.ContentType.Name)); } } @@ -240,13 +240,13 @@ namespace Orchard.Core.Tests.Common.Services { public int Id { get { return ContentItem.Id; } } public string Title { - get { return this.As().Title; } - set { this.As().Title = value; } + get { return this.As().Title; } + set { this.As().Title = value; } } public string Slug { - get { return this.As().Slug; } - set { this.As().Slug = value; } + get { return this.As().Slug; } + set { this.As().Slug = value; } } } diff --git a/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs b/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs index 2fa48aee2..fe8f18d21 100644 --- a/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs +++ b/src/Orchard.Core.Tests/Feeds/Controllers/FeedControllerTests.cs @@ -149,16 +149,16 @@ namespace Orchard.Core.Tests.Feeds.Controllers { var clock = new StubClock(); var hello = new ContentItemBuilder(new ContentTypeDefinitionBuilder().Named("hello").Build()) .Weld() - .Weld() + .Weld() .Weld() .Build(); hello.As().Record = new CommonPartRecord(); - hello.As().Record = new RoutableRecord(); + hello.As().Record = new RoutePartRecord(); hello.As().Record = new BodyPartRecord(); hello.As().PublishedUtc = clock.UtcNow; - hello.As().Title = "alpha"; - hello.As().Slug = "beta"; + hello.As().Title = "alpha"; + hello.As().Slug = "beta"; hello.As().Text = "gamma"; var query = new StubQuery(new[] { diff --git a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs index d4dd21cb2..bc49bf5e6 100644 --- a/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs +++ b/src/Orchard.Web/Core/Common/Drivers/BodyPartDriver.cs @@ -93,7 +93,7 @@ namespace Orchard.Core.Common.Drivers { if (common == null) return this; - var routable = common.Container.As(); + var routable = common.Container.As(); if (routable == null) return this; @@ -102,7 +102,7 @@ namespace Orchard.Core.Common.Drivers { } public PathBuilder AddSlug() { - var routable = _content.As(); + var routable = _content.As(); if (routable == null) return this; diff --git a/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs b/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs index 4f24fb55f..fa4965a2a 100644 --- a/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs +++ b/src/Orchard.Web/Core/Feeds/StandardBuilders/ItemInspector.cs @@ -10,14 +10,14 @@ namespace Orchard.Core.Feeds.StandardBuilders { private readonly IContent _item; private readonly ContentItemMetadata _metadata; private readonly ICommonPart _common; - private readonly IsRoutable _routable; + private readonly RoutePart _routable; private readonly BodyPart _body; public ItemInspector(IContent item, ContentItemMetadata metadata) { _item = item; _metadata = metadata; _common = item.Get(); - _routable = item.Get(); + _routable = item.Get(); _body = item.Get(); } diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index f3a28c17c..31beffcea 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -114,10 +114,10 @@ - - + + - + @@ -176,7 +176,7 @@ - + @@ -297,7 +297,7 @@ - + diff --git a/src/Orchard.Web/Core/Routable/Controllers/ItemController.cs b/src/Orchard.Web/Core/Routable/Controllers/ItemController.cs index e0a074e4b..5b9b29a4a 100644 --- a/src/Orchard.Web/Core/Routable/Controllers/ItemController.cs +++ b/src/Orchard.Web/Core/Routable/Controllers/ItemController.cs @@ -30,7 +30,7 @@ namespace Orchard.Core.Routable.Controllers { } var hits = _contentManager - .Query(VersionOptions.Published) + .Query(VersionOptions.Published) .Where(r => r.Path == matchedPath) .Slice(0, 2); if (hits.Count() == 0) { diff --git a/src/Orchard.Web/Core/Routable/DataMigrations/RoutableDataMigration.cs b/src/Orchard.Web/Core/Routable/DataMigrations/RoutableDataMigration.cs index e46164c1a..9ef4501d0 100644 --- a/src/Orchard.Web/Core/Routable/DataMigrations/RoutableDataMigration.cs +++ b/src/Orchard.Web/Core/Routable/DataMigrations/RoutableDataMigration.cs @@ -10,7 +10,7 @@ namespace Orchard.Core.Routable.DataMigrations { public int Create() { //CREATE TABLE Routable_RoutableRecord (Id INTEGER not null, Title TEXT, Slug TEXT, Path TEXT, ContentItemRecord_id INTEGER, primary key (Id)); - SchemaBuilder.CreateTable("RoutableRecord", table => table + SchemaBuilder.CreateTable("RoutePartRecord", table => table .ContentPartVersionRecord() .Column("Title", column => column.WithLength(1024)) .Column("Slug") @@ -21,7 +21,7 @@ namespace Orchard.Core.Routable.DataMigrations { } public int UpdateFrom1() { - ContentDefinitionManager.AlterPartDefinition(typeof(IsRoutable).Name, cfg => cfg + ContentDefinitionManager.AlterPartDefinition(typeof(RoutePart).Name, cfg => cfg .WithLocation(new Dictionary { {"Editor", new ContentLocation { Zone = "primary", Position = "before.5" }} } )); diff --git a/src/Orchard.Web/Core/Routable/Drivers/RoutableDriver.cs b/src/Orchard.Web/Core/Routable/Drivers/RoutePartDriver.cs similarity index 88% rename from src/Orchard.Web/Core/Routable/Drivers/RoutableDriver.cs rename to src/Orchard.Web/Core/Routable/Drivers/RoutePartDriver.cs index 1a7201d73..8019265d5 100644 --- a/src/Orchard.Web/Core/Routable/Drivers/RoutableDriver.cs +++ b/src/Orchard.Web/Core/Routable/Drivers/RoutePartDriver.cs @@ -9,17 +9,17 @@ using Orchard.Localization; using Orchard.UI.Notify; namespace Orchard.Core.Routable.Drivers { - public class RoutableDriver : ContentPartDriver { + public class RoutePartDriver : ContentPartDriver { private readonly IOrchardServices _services; private readonly IRoutableService _routableService; - public RoutableDriver(IOrchardServices services, IRoutableService routableService) { + public RoutePartDriver(IOrchardServices services, IRoutableService routableService) { _services = services; _routableService = routableService; T = NullLocalizer.Instance; } - private const string TemplateName = "Parts/Routable.IsRoutable"; + private const string TemplateName = "Parts/Routable.RoutePart"; public Localizer T { get; set; } @@ -46,7 +46,7 @@ namespace Orchard.Core.Routable.Drivers { return null; } - protected override DriverResult Editor(IsRoutable part) { + protected override DriverResult Editor(RoutePart part) { var model = new RoutableEditorViewModel { ContentType = part.ContentItem.ContentType, Id = part.ContentItem.Id, @@ -71,7 +71,7 @@ namespace Orchard.Core.Routable.Drivers { return ContentPartTemplate(model, TemplateName, Prefix).Location(location); } - protected override DriverResult Editor(IsRoutable part, IUpdateModel updater) { + protected override DriverResult Editor(RoutePart part, IUpdateModel updater) { var model = new RoutableEditorViewModel(); updater.TryUpdateModel(model, Prefix, null, null); diff --git a/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs b/src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs similarity index 71% rename from src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs rename to src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs index 7ea971dd4..2fc80356f 100644 --- a/src/Orchard.Web/Core/Routable/Handlers/RoutableHandler.cs +++ b/src/Orchard.Web/Core/Routable/Handlers/RoutePartHandler.cs @@ -5,22 +5,22 @@ using Orchard.Core.Routable.Models; using Orchard.Data; namespace Orchard.Core.Routable.Handlers { - public class RoutableHandler : ContentHandler { + public class RoutePartHandler : ContentHandler { private readonly IRoutablePathConstraint _routablePathConstraint; - public RoutableHandler(IRepository repository, IRoutablePathConstraint routablePathConstraint) { + public RoutePartHandler(IRepository repository, IRoutablePathConstraint routablePathConstraint) { _routablePathConstraint = routablePathConstraint; Filters.Add(StorageFilter.For(repository)); - OnPublished((context, routable) => { + OnPublished((context, routable) => { if (!string.IsNullOrEmpty(routable.Path)) _routablePathConstraint.AddPath(routable.Path); }); } } - public class IsRoutableHandler : ContentHandlerBase { + public class RoutePartHandlerBase : ContentHandlerBase { public override void GetContentItemMetadata(GetContentItemMetadataContext context) { - var routable = context.ContentItem.As(); + var routable = context.ContentItem.As(); if (routable != null) { context.Metadata.DisplayRouteValues = new RouteValueDictionary { {"Area", "Routable"}, diff --git a/src/Orchard.Web/Core/Routable/Models/IsRoutable.cs b/src/Orchard.Web/Core/Routable/Models/RoutePart.cs similarity index 85% rename from src/Orchard.Web/Core/Routable/Models/IsRoutable.cs rename to src/Orchard.Web/Core/Routable/Models/RoutePart.cs index 6dd92fd05..8896ff02b 100644 --- a/src/Orchard.Web/Core/Routable/Models/IsRoutable.cs +++ b/src/Orchard.Web/Core/Routable/Models/RoutePart.cs @@ -2,7 +2,7 @@ using Orchard.ContentManagement.Aspects; namespace Orchard.Core.Routable.Models { - public class IsRoutable : ContentPart, IRoutableAspect { + public class RoutePart : ContentPart, IRoutableAspect { public string Title { get { return Record.Title; } set { Record.Title = value; } diff --git a/src/Orchard.Web/Core/Routable/Models/RoutableRecord.cs b/src/Orchard.Web/Core/Routable/Models/RoutePartRecord.cs similarity index 82% rename from src/Orchard.Web/Core/Routable/Models/RoutableRecord.cs rename to src/Orchard.Web/Core/Routable/Models/RoutePartRecord.cs index 6b6c9030d..b4680d63a 100644 --- a/src/Orchard.Web/Core/Routable/Models/RoutableRecord.cs +++ b/src/Orchard.Web/Core/Routable/Models/RoutePartRecord.cs @@ -2,7 +2,7 @@ using Orchard.ContentManagement.Records; namespace Orchard.Core.Routable.Models { - public class RoutableRecord : ContentPartVersionRecord { + public class RoutePartRecord : ContentPartVersionRecord { [StringLength(1024)] public virtual string Title { get; set; } diff --git a/src/Orchard.Web/Core/Routable/Services/IRoutableService.cs b/src/Orchard.Web/Core/Routable/Services/IRoutableService.cs index 4daa265b6..101fce3c4 100644 --- a/src/Orchard.Web/Core/Routable/Services/IRoutableService.cs +++ b/src/Orchard.Web/Core/Routable/Services/IRoutableService.cs @@ -4,14 +4,14 @@ using Orchard.Core.Routable.Models; namespace Orchard.Core.Routable.Services { public interface IRoutableService : IDependency { - void FillSlug(TModel model) where TModel : IsRoutable; - void FillSlug(TModel model, Func generateSlug) where TModel : IsRoutable; + void FillSlug(TModel model) where TModel : RoutePart; + void FillSlug(TModel model, Func generateSlug) where TModel : RoutePart; string GenerateUniqueSlug(string slugCandidate, IEnumerable existingSlugs); /// /// Returns any content item of the specified content type with similar slugs /// - IEnumerable GetSimilarSlugs(string contentType, string slug); + IEnumerable GetSimilarSlugs(string contentType, string slug); /// /// Validates the given slug @@ -22,7 +22,7 @@ namespace Orchard.Core.Routable.Services { /// Defines the slug of a RoutableAspect and validate its unicity /// /// True if the slug has been created, False if a conflict occured - bool ProcessSlug(IsRoutable part); + bool ProcessSlug(RoutePart part); } } \ No newline at end of file diff --git a/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs b/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs index 4aa54973b..cf4f69b83 100644 --- a/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs +++ b/src/Orchard.Web/Core/Routable/Services/RoutableHomePageProvider.cs @@ -28,11 +28,11 @@ namespace Orchard.Core.Routable.Services { public ActionResult GetHomePage(int itemId) { var contentItem = _contentManager.Get(itemId, VersionOptions.Published); - if (contentItem == null || !contentItem.Is()) + if (contentItem == null || !contentItem.Is()) return new NotFoundResult(); var model = new RoutableDisplayViewModel { - Routable = _contentManager.BuildDisplayModel(contentItem.As(), "Detail") + Routable = _contentManager.BuildDisplayModel(contentItem.As(), "Detail") }; return new ViewResult { diff --git a/src/Orchard.Web/Core/Routable/Services/RoutablePathConstraintUpdator.cs b/src/Orchard.Web/Core/Routable/Services/RoutablePathConstraintUpdator.cs index e9fcab916..1716c88ec 100644 --- a/src/Orchard.Web/Core/Routable/Services/RoutablePathConstraintUpdator.cs +++ b/src/Orchard.Web/Core/Routable/Services/RoutablePathConstraintUpdator.cs @@ -9,9 +9,9 @@ namespace Orchard.Core.Routable.Services { [UsedImplicitly] public class RoutablePathConstraintUpdator : IOrchardShellEvents, IBackgroundTask { private readonly IRoutablePathConstraint _pageSlugConstraint; - private readonly IRepository _repository; + private readonly IRepository _repository; - public RoutablePathConstraintUpdator(IRoutablePathConstraint pageSlugConstraint, IRepository repository) { + public RoutablePathConstraintUpdator(IRoutablePathConstraint pageSlugConstraint, IRepository repository) { _pageSlugConstraint = pageSlugConstraint; _repository = repository; } diff --git a/src/Orchard.Web/Core/Routable/Services/RoutableService.cs b/src/Orchard.Web/Core/Routable/Services/RoutableService.cs index 6ddaf2d02..20bd4e8c6 100644 --- a/src/Orchard.Web/Core/Routable/Services/RoutableService.cs +++ b/src/Orchard.Web/Core/Routable/Services/RoutableService.cs @@ -14,7 +14,7 @@ namespace Orchard.Core.Routable.Services { _contentManager = contentManager; } - public void FillSlug(TModel model) where TModel : IsRoutable { + public void FillSlug(TModel model) where TModel : RoutePart { if (!string.IsNullOrEmpty(model.Slug) || string.IsNullOrEmpty(model.Title)) return; @@ -30,7 +30,7 @@ namespace Orchard.Core.Routable.Services { model.Slug = slug.ToLowerInvariant(); } - public void FillSlug(TModel model, Func generateSlug) where TModel : IsRoutable { + public void FillSlug(TModel model, Func generateSlug) where TModel : RoutePart { if (!string.IsNullOrEmpty(model.Slug) || string.IsNullOrEmpty(model.Title)) return; @@ -60,12 +60,12 @@ namespace Orchard.Core.Routable.Services { : null; } - public IEnumerable GetSimilarSlugs(string contentType, string slug) + public IEnumerable GetSimilarSlugs(string contentType, string slug) { return - _contentManager.Query().Join() + _contentManager.Query().Join() .List() - .Select(i => i.As()) + .Select(i => i.As()) .Where(routable => routable.Path != null && routable.Path.Equals(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith .ToArray(); } @@ -75,7 +75,7 @@ namespace Orchard.Core.Routable.Services { return slug == null || String.IsNullOrEmpty(slug.Trim()) || Regex.IsMatch(slug, @"^[^/:?#\[\]@!$&'()*+,;=\s]+$"); } - public bool ProcessSlug(IsRoutable part) + public bool ProcessSlug(RoutePart part) { FillSlug(part); diff --git a/src/Orchard.Web/Core/Routable/Views/EditorTemplates/Parts/Routable.IsRoutable.ascx b/src/Orchard.Web/Core/Routable/Views/EditorTemplates/Parts/Routable.RoutePart.ascx similarity index 100% rename from src/Orchard.Web/Core/Routable/Views/EditorTemplates/Parts/Routable.IsRoutable.ascx rename to src/Orchard.Web/Core/Routable/Views/EditorTemplates/Parts/Routable.RoutePart.ascx diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs index 750a59e76..dd7efff6b 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs @@ -54,8 +54,8 @@ namespace Orchard.Blogs.Commands { var blog = _contentManager.New("Blog"); blog.As().Owner = admin; - blog.As().Slug = Slug; - blog.As().Title = Title; + blog.As().Slug = Slug; + blog.As().Title = Title; if ( !String.IsNullOrWhiteSpace(MenuText) ) { blog.As().OnMainMenu = true; blog.As().MenuPosition = _menuService.Get().Select(menuPart => menuPart.MenuPosition).Max() + 1 + ".0"; @@ -97,8 +97,8 @@ namespace Orchard.Blogs.Commands { var post = _contentManager.New("BlogPost"); post.As().Owner = admin; post.As().Container = blog; - post.As().Slug = Slugify(postName); - post.As().Title = postName; + post.As().Slug = Slugify(postName); + post.As().Title = postName; post.As().Text = item.Element("description").Value; _contentManager.Create(post); } diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/DataMigrations/BlogsDataMigration.cs b/src/Orchard.Web/Modules/Orchard.Blogs/DataMigrations/BlogsDataMigration.cs index f04f74f38..7662e34db 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/DataMigrations/BlogsDataMigration.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/DataMigrations/BlogsDataMigration.cs @@ -33,7 +33,7 @@ namespace Orchard.Blogs.DataMigrations { cfg => cfg .WithPart("BlogPart") .WithPart("CommonPart") - .WithPart("IsRoutable") + .WithPart("RoutePart") ); ContentDefinitionManager.AlterTypeDefinition("BlogPost", @@ -41,7 +41,7 @@ namespace Orchard.Blogs.DataMigrations { .WithPart("BlogPostPart") .WithPart("CommonPart") .WithPart("PublishLaterPart") - .WithPart("IsRoutable") + .WithPart("RoutePart") .WithPart("BodyPart") ); diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs index 47efb2290..484f8ba8a 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPart.cs @@ -8,14 +8,14 @@ namespace Orchard.Blogs.Models { public int Id { get { return ContentItem.Id; } } public string Name { - get { return this.As().Title; } - set { this.As().Title = value; } + get { return this.As().Title; } + set { this.As().Title = value; } } //TODO: (erikpo) Need a data type for slug public string Slug { - get { return this.As().Slug; } - set { this.As().Slug = value; } + get { return this.As().Slug; } + set { this.As().Slug = value; } } public string Description { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPostPart.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPostPart.cs index 9235abe0c..8e7678190 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPostPart.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Models/BlogPostPart.cs @@ -14,13 +14,13 @@ namespace Orchard.Blogs.Models { } public string Title { - get { return this.As().Title; } - set { this.As().Title = value; } + get { return this.As().Title; } + set { this.As().Title = value; } } public string Slug { - get { return this.As().Slug; } - set { this.As().Slug = value; } + get { return this.As().Slug; } + set { this.As().Slug = value; } } public string Text { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogPostService.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogPostService.cs index 212520dfc..7f86dd82e 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogPostService.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogPostService.cs @@ -29,7 +29,7 @@ namespace Orchard.Blogs.Services { public BlogPostPart Get(BlogPart blogPart, string slug, VersionOptions versionOptions) { return - _contentManager.Query(versionOptions, BlogPostPartDriver.ContentType.Name).Join().Where(rr => rr.Slug == slug). + _contentManager.Query(versionOptions, BlogPostPartDriver.ContentType.Name).Join().Where(rr => rr.Slug == slug). Join().Where(cr => cr.Container == blogPart.Record.ContentItemRecord).List(). SingleOrDefault().As(); } diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs index b3095eb7c..49acea0b2 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Services/BlogService.cs @@ -20,13 +20,13 @@ namespace Orchard.Blogs.Services { public BlogPart Get(string slug) { return _contentManager.Query() - .Join().Where(rr => rr.Slug == slug) + .Join().Where(rr => rr.Slug == slug) .List().FirstOrDefault(); } public IEnumerable Get() { return _contentManager.Query() - .Join() + .Join() .OrderBy(br => br.Title) .List(); } diff --git a/src/Orchard.Web/Modules/Orchard.DevTools/Commands/ProfilingCommands.cs b/src/Orchard.Web/Modules/Orchard.DevTools/Commands/ProfilingCommands.cs index 837126c3f..a3b215c76 100644 --- a/src/Orchard.Web/Modules/Orchard.DevTools/Commands/ProfilingCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.DevTools/Commands/ProfilingCommands.cs @@ -27,9 +27,9 @@ namespace Orchard.DevTools.Commands { var pageName = "page" + index; var page = _contentManager.Create("Page", VersionOptions.Draft); page.As().Owner = admin; - page.As().Slug = pageName; - page.As().Path = pageName; - page.As().Title = pageName; + page.As().Slug = pageName; + page.As().Path = pageName; + page.As().Title = pageName; page.As().Text = pageName; page.As().OnMainMenu = true; page.As().MenuPosition = "5." + index; @@ -39,9 +39,9 @@ namespace Orchard.DevTools.Commands { var blogName = "blog" + index; var blog = _contentManager.New("Blog"); blog.As().Owner = admin; - blog.As().Slug = blogName; - blog.As().Path = blogName; - blog.As().Title = blogName; + blog.As().Slug = blogName; + blog.As().Path = blogName; + blog.As().Title = blogName; blog.As().OnMainMenu = true; blog.As().MenuPosition = "6." + index; blog.As().MenuText = blogName; diff --git a/src/Orchard.Web/Modules/Orchard.Pages/DataMigrations/PageDataMigration.cs b/src/Orchard.Web/Modules/Orchard.Pages/DataMigrations/PageDataMigration.cs index 132134559..bf027d0ba 100644 --- a/src/Orchard.Web/Modules/Orchard.Pages/DataMigrations/PageDataMigration.cs +++ b/src/Orchard.Web/Modules/Orchard.Pages/DataMigrations/PageDataMigration.cs @@ -10,7 +10,7 @@ namespace Orchard.Pages.DataMigrations { cfg => cfg .WithPart("Page") .WithPart("CommonPart") - .WithPart("IsRoutable") + .WithPart("RoutePart") .WithPart("BodyPart") ); diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs b/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs index 8df5c9587..0f5a45546 100644 --- a/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs +++ b/src/Orchard.Web/Modules/Orchard.Pages/Models/Page.cs @@ -12,12 +12,12 @@ namespace Orchard.Pages.Models { public int Id { get { return ContentItem.Id; } } public string Title { - get { return this.As().Title; } + get { return this.As().Title; } } public string Slug { - get { return this.As().Slug; } - set { this.As().Slug = value; } + get { return this.As().Slug; } + set { this.As().Slug = value; } } public IUser Creator { diff --git a/src/Orchard.Web/Modules/Orchard.Pages/Services/PageService.cs b/src/Orchard.Web/Modules/Orchard.Pages/Services/PageService.cs index 84ae3f4c9..dd724e20f 100644 --- a/src/Orchard.Web/Modules/Orchard.Pages/Services/PageService.cs +++ b/src/Orchard.Web/Modules/Orchard.Pages/Services/PageService.cs @@ -35,11 +35,11 @@ namespace Orchard.Pages.Services { public IEnumerable Get(PageStatus status) { switch (status) { case PageStatus.All: - return _contentManager.Query(PageDriver.ContentType.Name).Join().ForVersion(VersionOptions.Latest).List().AsPart(); + return _contentManager.Query(PageDriver.ContentType.Name).Join().ForVersion(VersionOptions.Latest).List().AsPart(); case PageStatus.Published: - return _contentManager.Query(PageDriver.ContentType.Name).Join().ForVersion(VersionOptions.Published).List().AsPart(); + return _contentManager.Query(PageDriver.ContentType.Name).Join().ForVersion(VersionOptions.Published).List().AsPart(); case PageStatus.Offline: - return _contentManager.Query(PageDriver.ContentType.Name).Join().ForVersion(VersionOptions.Latest).Where(ci => !ci.ContentItemVersionRecord.Published).List().AsPart(); + return _contentManager.Query(PageDriver.ContentType.Name).Join().ForVersion(VersionOptions.Latest).Where(ci => !ci.ContentItemVersionRecord.Published).List().AsPart(); default: return Enumerable.Empty(); } @@ -51,7 +51,7 @@ namespace Orchard.Pages.Services { public Page Get(string slug) { return - _contentManager.Query(PageDriver.ContentType.Name).Join().Where(rr => rr.Slug == slug).List().FirstOrDefault + _contentManager.Query(PageDriver.ContentType.Name).Join().Where(rr => rr.Slug == slug).List().FirstOrDefault ().As(); } @@ -61,7 +61,7 @@ namespace Orchard.Pages.Services { public Page GetLatest(string slug) { return - _contentManager.Query(VersionOptions.Latest, PageDriver.ContentType.Name).Join().Where(rr => rr.Slug == slug) + _contentManager.Query(VersionOptions.Latest, PageDriver.ContentType.Name).Join().Where(rr => rr.Slug == slug) .Slice(0, 1).FirstOrDefault().As(); } diff --git a/src/Orchard.Web/Modules/Orchard.Sandbox/DataMigrations/SandBoxDataMigration.cs b/src/Orchard.Web/Modules/Orchard.Sandbox/DataMigrations/SandBoxDataMigration.cs index 0775551df..b0331b555 100644 --- a/src/Orchard.Web/Modules/Orchard.Sandbox/DataMigrations/SandBoxDataMigration.cs +++ b/src/Orchard.Web/Modules/Orchard.Sandbox/DataMigrations/SandBoxDataMigration.cs @@ -24,7 +24,7 @@ namespace Orchard.Sandbox.DataMigrations { cfg => cfg .WithPart("SandboxPagePart") .WithPart("CommonPart") - .WithPart("IsRoutable") + .WithPart("RoutePart") .WithPart("BodyPart") ); diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs b/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs index 6e72e844a..6f07e7412 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Services/SetupService.cs @@ -202,7 +202,7 @@ namespace Orchard.Setup.Services { .DisplayedAs("Page") .WithPart("CommonPart") .WithPart("PublishLaterPart") - .WithPart("IsRoutable") + .WithPart("RoutePart") .WithPart("BodyPart") .WithPart("CommentsPart") .WithPart("TagsPart") @@ -215,9 +215,9 @@ namespace Orchard.Setup.Services { // create home page as a CMS page var page = contentManager.Create("Page", VersionOptions.Draft); page.As().Text = "

Welcome to Orchard!

Congratulations, you've successfully set-up your Orchard site.

This is the home page of your new site. We've taken the liberty to write here about a few things you could look at next in order to get familiar with the application. Once you feel confident you don't need this anymore, just click Edit to go into edit mode and replace this with whatever you want on your home page to make it your own.

One thing you could do (but you don't have to) is go into Manage Settings (follow the Admin link and then look for it under \"Settings\" in the menu on the left) and check that everything is configured the way you want.

You probably want to make the site your own. One of the ways you can do that is by clicking Manage Themes in the admin menu. A theme is a packaged look and feel that affects the whole site.

Next, you can start playing with the content types that we installed. For example, go ahead and click Add New Page in the admin menu and create an \"about\" page. Then, add it to the navigation menu by going to Manage Menu. You can also click Add New Blog and start posting by clicking \"Add New Post\".

Finally, Orchard has been designed to be extended. It comes with a few built-in modules such as pages and blogs or themes. You can install new themes by going to Manage Themes and clicking Install a new Theme. Like for themes, modules are created by other users of Orchard just like you so if you feel up to it, please consider participating.

--The Orchard Crew

"; - page.As().Slug = "home"; - page.As().Path = "home"; - page.As().Title = T("Home").ToString(); + page.As().Slug = "home"; + page.As().Path = "home"; + page.As().Title = T("Home").ToString(); page.As().Owner = user; if (page.Has()) { page.As().CommentsShown = false;