Skip to content

Commit df2b7dd

Browse files
#8268: Getting rid of [Obsolete] stuff (Lombiq Technologies: ORCH-308) (#8873)
* Using Orchard.Mvc.FormValueRequiredAttribute instead of the FormValueRequiredAttribute class of the AdminController in the Orchard.Core.Contents namespace. * Removing obsoleted Spam value from the Orchard.Comments.Models.CommentStatus enum. * Removing the obsolete AddFilters method of the IFilterProvider interface in the Orchard.Mvc.Filters namespace. * Removing the obsolete LazyField<T> class from the Orchard.Core.Common.Utilities namespace. * Removing obsolete methods from OrchardLog4netLogger. * Removing obsolete Loader(Func<T, T> loader) method from LazyField.cs in the Orchard.ContentManagement.Utilities namespace. * Removing obsoleted ContentShapeResult ContentShape(IShape shape) method from ContentPartDriver. * Removing obsoleted ISessionLocator interface. * Removing obsoleted ContentFieldTemplate methods from ContentFieldDriver<TField>. * Removing obsoleted IMessagingChannel and IMessageManager interfaces, along with the migration step that updates the existing Send Email activities to use the new Message Queueing functionality. * Removing obsoleted CustomStepsStep. Don't need the CustomStepsStep RecipeBuilderStep because you can implement IRecipeBuilderStep and IRecipeExecutionStep instead of implementing custom export steps. * Removing obsoleted CustomPropertiesPart. It used to be necessary for the List feature (also obsolete) to be able to sort on custom data. * Removing the obsoleted ITaskLeaseService with its default implementation. Removing deprecated Orchard.TaskLease module because it only contains this interface with its default implementation. Use Orchard.Tasks.Locking.IDistributedLockService instead. * Removing LegacyRulesEvaluator. This condition provider was there for backwards compatibility during the deprecation period. * Removing IRuleManager with its default implementation. Use Orchard.Conditions.Services.ConditionManager instead. * Removing unused RequiresOwnership permission. * Reverting unnecessary sln file changes * Resolving IMessageChannelSelector instead of IMessageManager in editor templates * Removing commented out code from ContentPartDriverCoordinatorTests * Removing Orchard.jQuery too since its quite outdated and Orchard.Resources has been available since 1.9 * Readding the migration step that updates the existing Send Email activities --------- Co-authored-by: Benedek Farkas <benedek.farkas@lombiq.com>
1 parent 9bc5e7f commit df2b7dd

File tree

484 files changed

+48
-87572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+48
-87572
lines changed

src/Orchard.Tests.Modules/DatabaseEnabledTestsBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
using Orchard.Environment.Configuration;
1414
using Orchard.Services;
1515
using Orchard.Tests.ContentManagement;
16-
using Orchard.Tests.Data;
1716
using Orchard.Tests.Stubs;
1817

1918
namespace Orchard.Tests.Modules
@@ -54,7 +53,6 @@ public virtual void Init()
5453
var builder = new ContainerBuilder();
5554
//builder.RegisterModule(new ImplicitCollectionSupportModule());
5655
builder.RegisterType<InfosetHandler>().As<IContentHandler>();
57-
builder.RegisterInstance(new StubLocator(_session)).As<ISessionLocator>();
5856
builder.RegisterInstance(_clock).As<IClock>();
5957
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
6058
builder.RegisterInstance(new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });
@@ -84,4 +82,4 @@ protected void ClearSession()
8482
Trace.WriteLine("Flushed and cleared session");
8583
}
8684
}
87-
}
85+
}

src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@
312312
<Project>{5D0F00F0-26C9-4785-AD61-B85710C60EB0}</Project>
313313
<Name>Orchard.Tags</Name>
314314
</ProjectReference>
315-
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.TaskLease\Orchard.TaskLease.csproj">
316-
<Project>{3f72a4e9-7b72-4260-b010-c16ec54f9baf}</Project>
317-
<Name>Orchard.TaskLease</Name>
318-
</ProjectReference>
319315
<ProjectReference Include="..\Orchard.Web\Modules\Orchard.Themes\Orchard.Themes.csproj">
320316
<Project>{CDE24A24-01D3-403C-84B9-37722E18DFB7}</Project>
321317
<Name>Orchard.Themes</Name>

src/Orchard.Tests/ContentManagement/Handlers/Coordinators/ContentPartDriverCoordinatorTests.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,9 @@ protected override DriverResult Display(StubPart part, string displayType, dynam
8787
var stub = shapeHelper.Stub(Foo: string.Join(",", part.Foo));
8888
if (!string.IsNullOrWhiteSpace(displayType))
8989
stub.Metadata.Type = string.Format("{0}.{1}", stub.Metadata.Type, displayType);
90-
return ContentShape(stub).Location("TopMeta");
91-
92-
//var viewModel = new StubViewModel { Foo = string.Join(",", part.Foo) };
93-
//if (displayType.StartsWith("Summary"))
94-
// return ContentPartTemplate(viewModel, "StubViewModelTerse").Location("TopMeta");
95-
96-
//return ContentPartTemplate(viewModel).Location("TopMeta");
90+
return ContentShape("Parts_Stub", () => {
91+
return string.Empty;
92+
}).Location("TopMeta");
9793
}
9894

9995
protected override DriverResult Editor(StubPart part, dynamic shapeHelper)

src/Orchard.Tests/Data/StubLocator.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Orchard.Tests/DatabaseEnabledTestsBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Orchard.Environment.Configuration;
1313
using Orchard.Services;
1414
using Orchard.Tests.ContentManagement;
15-
using Orchard.Tests.Data;
1615
using Orchard.Tests.Stubs;
1716

1817
namespace Orchard.Tests
@@ -50,7 +49,6 @@ public virtual void Init()
5049
var builder = new ContainerBuilder();
5150
//builder.RegisterModule(new ImplicitCollectionSupportModule());
5251
builder.RegisterType<InfosetHandler>().As<IContentHandler>();
53-
builder.RegisterInstance(new StubLocator(_session)).As<ISessionLocator>();
5452
builder.RegisterInstance(_clock).As<IClock>();
5553
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>)).InstancePerLifetimeScope();
5654
builder.RegisterInstance(_shellSettings = new ShellSettings { Name = ShellSettings.DefaultName, DataProvider = "SqlCe" });
@@ -80,4 +78,4 @@ protected void ClearSession()
8078
Trace.WriteLine("Flushed and cleared session");
8179
}
8280
}
83-
}
81+
}

src/Orchard.Tests/Orchard.Framework.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@
268268
<Compile Include="Data\RepositoryTests.cs" />
269269
<Compile Include="Data\ProvidersTests.cs" />
270270
<Compile Include="Data\Bags\SettingsTests.cs" />
271-
<Compile Include="Data\StubLocator.cs" />
272271
<Compile Include="DisplayManagement\ArgsUtility.cs" />
273272
<Compile Include="DisplayManagement\CompositeTests.cs" />
274273
<Compile Include="DisplayManagement\Descriptors\LocationParserTests.cs" />

src/Orchard.Web/Core/Common/Utilities/LazyField.cs

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/Orchard.Web/Core/Containers/Drivers/CustomPropertiesDriver.cs

Lines changed: 0 additions & 68 deletions
This file was deleted.

src/Orchard.Web/Core/Containers/Extensions/ContentQueryExtensions.cs

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,12 @@
22
using System.Collections.Generic;
33
using Orchard.ContentManagement;
44
using Orchard.Core.Common.Models;
5-
using Orchard.Core.Containers.Models;
65
using Orchard.Core.Title.Models;
76

87
namespace Orchard.Core.Containers.Extensions
98
{
10-
[Obsolete]
119
public static class ContentQueryExtensions
1210
{
13-
public static IContentQuery<T> OrderBy<T>(this IContentQuery<T> query, string partAndProperty, bool descendingOrder) where T : IContent
14-
{
15-
//todo: (heskew) order by custom part properties
16-
switch (partAndProperty)
17-
{
18-
case "ContainablePart.Weight":
19-
query = descendingOrder
20-
? query.OrderByDescending<ContainablePartRecord>(record => record.Position)
21-
: query.OrderBy<ContainablePartRecord>(record => record.Position);
22-
break;
23-
case "TitlePart.Title":
24-
query = descendingOrder
25-
? query.OrderByDescending<TitlePartRecord>(record => record.Title)
26-
: query.OrderBy<TitlePartRecord>(record => record.Title);
27-
break;
28-
case "CustomPropertiesPart.CustomOne":
29-
query = descendingOrder
30-
? query.OrderByDescending<CustomPropertiesPartRecord>(record => record.CustomOne)
31-
: query.OrderBy<CustomPropertiesPartRecord>(record => record.CustomOne);
32-
break;
33-
case "CustomPropertiesPart.CustomTwo":
34-
query = descendingOrder
35-
? query.OrderByDescending<CustomPropertiesPartRecord>(record => record.CustomTwo)
36-
: query.OrderBy<CustomPropertiesPartRecord>(record => record.CustomTwo);
37-
break;
38-
case "CustomPropertiesPart.CustomThree":
39-
query = descendingOrder
40-
? query.OrderByDescending<CustomPropertiesPartRecord>(record => record.CustomThree)
41-
: query.OrderBy<CustomPropertiesPartRecord>(record => record.CustomThree);
42-
break;
43-
case "CommonPart.CreatedUtc":
44-
query = descendingOrder
45-
? query.OrderByDescending<CommonPartRecord>(record => record.CreatedUtc)
46-
: query.OrderBy<CommonPartRecord>(record => record.CreatedUtc);
47-
break;
48-
default: // "CommonPart.PublishedUtc"
49-
query = descendingOrder
50-
? query.OrderByDescending<CommonPartRecord>(record => record.PublishedUtc)
51-
: query.OrderBy<CommonPartRecord>(record => record.PublishedUtc);
52-
break;
53-
}
54-
55-
return query;
56-
}
57-
5811
public static IContentQuery<ContentItem> Where(this IContentQuery<ContentItem> query, string partAndProperty, string comparisonOperator, string comparisonValue)
5912
{
6013
var filterKey = string.Format("{0}|{1}", partAndProperty, comparisonOperator);
@@ -74,19 +27,6 @@ public static IContentQuery<ContentItem> Where(this IContentQuery<ContentItem> q
7427
{"CommonPart.PublishedUtc|>", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CommonPartRecord>(r => r.PublishedUtc > DateTime.Parse(s)))},
7528
{"CommonPart.PublishedUtc|=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CommonPartRecord>(r => r.PublishedUtc == DateTime.Parse(s)))}, // todo: (heskew) not practical as is. needs some sense of precision....
7629
{"CommonPart.PublishedUtc|^=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CommonPartRecord>(r => true /* can't modified PublishedUtc for partial comparisons */))},
77-
// todo: (hesekw) this could benefit from a better filter implementation as this is currently very limited in functionality and I have no idea how the custom parts will be used by folks
78-
{"CustomPropertiesPart.CustomOne|<", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => true /* CompareTo is not implemented - r.CustomOne.CompareTo(s) == -1*/))},
79-
{"CustomPropertiesPart.CustomOne|>", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => true /* CompareTo is not implemented - r.CustomOne.CompareTo(s) == 1*/))},
80-
{"CustomPropertiesPart.CustomOne|=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => r.CustomOne.Equals(s, StringComparison.OrdinalIgnoreCase)))},
81-
{"CustomPropertiesPart.CustomOne|^=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => r.CustomOne.StartsWith(s, StringComparison.OrdinalIgnoreCase)))},
82-
{"CustomPropertiesPart.CustomTwo|<", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => true /* CompareTo is not implemented - r.CustomTwo.CompareTo(s) == -1*/))},
83-
{"CustomPropertiesPart.CustomTwo|>", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => true /* CompareTo is not implemented - r.CustomTwo.CompareTo(s) == 1*/))},
84-
{"CustomPropertiesPart.CustomTwo|=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => r.CustomTwo.Equals(s, StringComparison.OrdinalIgnoreCase)))},
85-
{"CustomPropertiesPart.CustomTwo|^=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => r.CustomTwo.StartsWith(s, StringComparison.OrdinalIgnoreCase)))},
86-
{"CustomPropertiesPart.CustomThree|<", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => true /* CompareTo is not implemented - r.CustomThree.CompareTo(s) == -1*/))},
87-
{"CustomPropertiesPart.CustomThree|>", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => true /* CompareTo is not implemented - r.CustomThree.CompareTo(s) == 1*/))},
88-
{"CustomPropertiesPart.CustomThree|=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => r.CustomThree.Equals(s, StringComparison.OrdinalIgnoreCase)))},
89-
{"CustomPropertiesPart.CustomThree|^=", new Func<IContentQuery<ContentItem>, string, IContentQuery<ContentItem>>((q, s) => q.Where<CustomPropertiesPartRecord>(r => r.CustomThree.StartsWith(s, StringComparison.OrdinalIgnoreCase)))},
9030
};
9131
}
92-
}
32+
}

src/Orchard.Web/Core/Containers/Models/CustomPropertiesPart.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)