Refactored the traversal, ishelper, etc... methods to be extension methods on IPublishedContent so now all of these methods are available on the Typed object not just the dynamic object which makes a whole lot more sense... and you can have intellisense.
Updated DynamicPublishedContent's methods to just proxy calls to the new extension methods so that all of the logic is contained in one place. Added new GetRootDocuments to the IPublishedContentStore since we need this in order to get the root list of documents for many of these methods. Fixed an issue with the DynamicNode to IPublishedContent converter. Fixed many of the failing unit tests.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Examine.LuceneEngine.SearchCriteria;
|
||||
using Umbraco.Core.Dynamics;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Web
|
||||
{
|
||||
@@ -8,7 +9,7 @@ namespace Umbraco.Web
|
||||
/// </summary>
|
||||
public static class DynamicPublishedContentSearchExtensions
|
||||
{
|
||||
public static DynamicPublishedContentList Search(this DynamicPublishedContent d, string term, bool useWildCards = true, string searchProvider = null)
|
||||
public static DynamicPublishedContentList Search(this DynamicPublishedContentBase d, string term, bool useWildCards = true, string searchProvider = null)
|
||||
{
|
||||
var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider;
|
||||
if (!string.IsNullOrEmpty(searchProvider))
|
||||
@@ -24,12 +25,12 @@ namespace Umbraco.Web
|
||||
return d.Search(crit, searcher);
|
||||
}
|
||||
|
||||
public static DynamicPublishedContentList SearchDescendants(this DynamicPublishedContent d, string term, bool useWildCards = true, string searchProvider = null)
|
||||
public static DynamicPublishedContentList SearchDescendants(this DynamicPublishedContentBase d, string term, bool useWildCards = true, string searchProvider = null)
|
||||
{
|
||||
return d.Search(term, useWildCards, searchProvider);
|
||||
}
|
||||
|
||||
public static DynamicPublishedContentList SearchChildren(this DynamicPublishedContent d, string term, bool useWildCards = true, string searchProvider = null)
|
||||
public static DynamicPublishedContentList SearchChildren(this DynamicPublishedContentBase d, string term, bool useWildCards = true, string searchProvider = null)
|
||||
{
|
||||
var searcher = Examine.ExamineManager.Instance.DefaultSearchProvider;
|
||||
if (!string.IsNullOrEmpty(searchProvider))
|
||||
@@ -45,7 +46,7 @@ namespace Umbraco.Web
|
||||
return d.Search(crit, searcher);
|
||||
}
|
||||
|
||||
public static DynamicPublishedContentList Search(this DynamicPublishedContent d, Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null)
|
||||
public static DynamicPublishedContentList Search(this DynamicPublishedContentBase d, Examine.SearchCriteria.ISearchCriteria criteria, Examine.Providers.BaseSearchProvider searchProvider = null)
|
||||
{
|
||||
var s = Examine.ExamineManager.Instance.DefaultSearchProvider;
|
||||
if (searchProvider != null)
|
||||
|
||||
Reference in New Issue
Block a user