From e5a20f0c1be78042a151e83149f63854c34eca0b Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 18 Jan 2013 13:20:08 -0100 Subject: [PATCH] Web.Routing - rename things --- .../Routing/FinderByAliasTests.cs | 2 +- src/Umbraco.Tests/Routing/FinderByIdTests.cs | 2 +- .../FinderByNiceUrlAndTemplateTests.cs | 2 +- .../Routing/FinderByNiceUrlTests.cs | 4 ++-- .../FinderByNiceUrlWithDomainsTests.cs | 4 ++-- .../Routing/FinderByPageIdQueryTests.cs | 2 +- .../Routing/UrlsWithNestedDomains.cs | 2 +- .../Routing/uQueryGetNodeIdByUrlTests.cs | 4 ++-- .../Stubs/FakeLastChanceFinder.cs | 2 +- .../TestHelpers/BaseRoutingTest.cs | 2 +- ...erByIdPath.cs => ContentFinderByIdPath.cs} | 10 +++++----- ...ByNiceUrl.cs => ContentFinderByNiceUrl.cs} | 16 +++++++-------- ...s => ContentFinderByNiceUrlAndTemplate.cs} | 10 +++++----- ...Query.cs => ContentFinderByPageIdQuery.cs} | 2 +- ...ByProfile.cs => ContentFinderByProfile.cs} | 10 +++++----- ...rByAlias.cs => ContentFinderByUrlAlias.cs} | 6 +++--- ...ceFinder.cs => ContentLastChanceFinder.cs} | 16 +++++++-------- ...shedContentFinder.cs => IContentFinder.cs} | 2 +- ...rResolver.cs => IContentFinderResolver.cs} | 8 ++++---- ...cs => IContentLastChanceFinderResolver.cs} | 10 +++++----- src/Umbraco.Web/Routing/RoutingContext.cs | 8 ++++---- src/Umbraco.Web/Umbraco.Web.csproj | 20 +++++++++---------- src/Umbraco.Web/UmbracoModule.cs | 4 ++-- src/Umbraco.Web/WebBootManager.cs | 16 +++++++-------- 24 files changed, 82 insertions(+), 82 deletions(-) rename src/Umbraco.Web/Routing/{FinderByIdPath.cs => ContentFinderByIdPath.cs} (78%) rename src/Umbraco.Web/Routing/{FinderByNiceUrl.cs => ContentFinderByNiceUrl.cs} (81%) rename src/Umbraco.Web/Routing/{FinderByNiceUrlAndTemplate.cs => ContentFinderByNiceUrlAndTemplate.cs} (79%) rename src/Umbraco.Web/Routing/{FinderByPageIdQuery.cs => ContentFinderByPageIdQuery.cs} (89%) rename src/Umbraco.Web/Routing/{FinderByProfile.cs => ContentFinderByProfile.cs} (81%) rename src/Umbraco.Web/Routing/{FinderByAlias.cs => ContentFinderByUrlAlias.cs} (79%) rename src/Umbraco.Web/Routing/{DefaultLastChanceFinder.cs => ContentLastChanceFinder.cs} (90%) rename src/Umbraco.Web/Routing/{IPublishedContentFinder.cs => IContentFinder.cs} (91%) rename src/Umbraco.Web/Routing/{IPublishedContentFinderResolver.cs => IContentFinderResolver.cs} (59%) rename src/Umbraco.Web/Routing/{IPublishedContentLastChanceFinderResolver.cs => IContentLastChanceFinderResolver.cs} (58%) diff --git a/src/Umbraco.Tests/Routing/FinderByAliasTests.cs b/src/Umbraco.Tests/Routing/FinderByAliasTests.cs index 0a9822cfda..8c72a9ddf4 100644 --- a/src/Umbraco.Tests/Routing/FinderByAliasTests.cs +++ b/src/Umbraco.Tests/Routing/FinderByAliasTests.cs @@ -32,7 +32,7 @@ namespace Umbraco.Tests.Routing var routingContext = GetRoutingContext(urlAsString); var url = routingContext.UmbracoContext.CleanedUmbracoUrl; //very important to use the cleaned up umbraco url var docRequest = new PublishedContentRequest(url, routingContext); - var lookup = new FinderByAlias(); + var lookup = new ContentFinderByUrlAlias(); var result = lookup.TryFindDocument(docRequest); diff --git a/src/Umbraco.Tests/Routing/FinderByIdTests.cs b/src/Umbraco.Tests/Routing/FinderByIdTests.cs index 94925599a8..91c8e9d249 100644 --- a/src/Umbraco.Tests/Routing/FinderByIdTests.cs +++ b/src/Umbraco.Tests/Routing/FinderByIdTests.cs @@ -24,7 +24,7 @@ namespace Umbraco.Tests.Routing var routingContext = GetRoutingContext(urlAsString); var url = routingContext.UmbracoContext.CleanedUmbracoUrl; //very important to use the cleaned up umbraco url var docRequest = new PublishedContentRequest(url, routingContext); - var lookup = new FinderByIdPath(); + var lookup = new ContentFinderByIdPath(); var result = lookup.TryFindDocument(docRequest); diff --git a/src/Umbraco.Tests/Routing/FinderByNiceUrlAndTemplateTests.cs b/src/Umbraco.Tests/Routing/FinderByNiceUrlAndTemplateTests.cs index 3c7b3538a5..6b00c2dddc 100644 --- a/src/Umbraco.Tests/Routing/FinderByNiceUrlAndTemplateTests.cs +++ b/src/Umbraco.Tests/Routing/FinderByNiceUrlAndTemplateTests.cs @@ -27,7 +27,7 @@ namespace Umbraco.Tests.Routing var routingContext = GetRoutingContext(urlAsString, template); var url = routingContext.UmbracoContext.CleanedUmbracoUrl; //very important to use the cleaned up umbraco url var docRequest = new PublishedContentRequest(url, routingContext); - var lookup = new FinderByNiceUrlAndTemplate(); + var lookup = new ContentFinderByNiceUrlAndTemplate(); var result = lookup.TryFindDocument(docRequest); diff --git a/src/Umbraco.Tests/Routing/FinderByNiceUrlTests.cs b/src/Umbraco.Tests/Routing/FinderByNiceUrlTests.cs index 638d8a2de7..4fb0817f07 100644 --- a/src/Umbraco.Tests/Routing/FinderByNiceUrlTests.cs +++ b/src/Umbraco.Tests/Routing/FinderByNiceUrlTests.cs @@ -40,7 +40,7 @@ namespace Umbraco.Tests.Routing var routingContext = GetRoutingContext(urlString); var url = routingContext.UmbracoContext.CleanedUmbracoUrl; //very important to use the cleaned up umbraco url var docreq = new PublishedContentRequest(url, routingContext); - var lookup = new FinderByNiceUrl(); + var lookup = new ContentFinderByNiceUrl(); ConfigurationManager.AppSettings.Set("umbracoHideTopLevelNodeFromPath", "true"); var result = lookup.TryFindDocument(docreq); @@ -67,7 +67,7 @@ namespace Umbraco.Tests.Routing var routingContext = GetRoutingContext(urlString); var url = routingContext.UmbracoContext.CleanedUmbracoUrl; //very important to use the cleaned up umbraco url var docreq = new PublishedContentRequest(url, routingContext); - var lookup = new FinderByNiceUrl(); + var lookup = new ContentFinderByNiceUrl(); var result = lookup.TryFindDocument(docreq); diff --git a/src/Umbraco.Tests/Routing/FinderByNiceUrlWithDomainsTests.cs b/src/Umbraco.Tests/Routing/FinderByNiceUrlWithDomainsTests.cs index 6ea32d75f1..0e7cdf88f3 100644 --- a/src/Umbraco.Tests/Routing/FinderByNiceUrlWithDomainsTests.cs +++ b/src/Umbraco.Tests/Routing/FinderByNiceUrlWithDomainsTests.cs @@ -163,7 +163,7 @@ namespace Umbraco.Tests.Routing // must lookup domain else lookup by url fails pcr.Engine.FindDomain(); - var lookup = new FinderByNiceUrl(); + var lookup = new ContentFinderByNiceUrl(); var result = lookup.TryFindDocument(pcr); Assert.IsTrue(result); Assert.AreEqual(expectedId, pcr.PublishedContentId); @@ -202,7 +202,7 @@ namespace Umbraco.Tests.Routing pcr.Engine.FindDomain(); Assert.AreEqual(expectedCulture, pcr.Culture.Name); - var lookup = new FinderByNiceUrl(); + var lookup = new ContentFinderByNiceUrl(); var result = lookup.TryFindDocument(pcr); Assert.IsTrue(result); Assert.AreEqual(expectedId, pcr.PublishedContentId); diff --git a/src/Umbraco.Tests/Routing/FinderByPageIdQueryTests.cs b/src/Umbraco.Tests/Routing/FinderByPageIdQueryTests.cs index f7820ef2f1..6a8e3c8e9c 100644 --- a/src/Umbraco.Tests/Routing/FinderByPageIdQueryTests.cs +++ b/src/Umbraco.Tests/Routing/FinderByPageIdQueryTests.cs @@ -28,7 +28,7 @@ namespace Umbraco.Tests.Routing var routingContext = GetRoutingContext(urlAsString); var url = routingContext.UmbracoContext.CleanedUmbracoUrl; //very important to use the cleaned up umbraco url var docRequest = new PublishedContentRequest(url, routingContext); - var lookup = new FinderByPageIdQuery(); + var lookup = new ContentFinderByPageIdQuery(); //we need to manually stub the return output of HttpContext.Request["umbPageId"] routingContext.UmbracoContext.HttpContext.Request.Stub(x => x["umbPageID"]) diff --git a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs index f6414ee62b..2f0c4a04c4 100644 --- a/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs +++ b/src/Umbraco.Tests/Routing/UrlsWithNestedDomains.cs @@ -48,7 +48,7 @@ namespace Umbraco.Tests.Routing Assert.IsTrue(pcr.HasDomain); // check that it's been routed - var lookup = new FinderByNiceUrl(); + var lookup = new ContentFinderByNiceUrl(); var result = lookup.TryFindDocument(pcr); Assert.IsTrue(result); Assert.AreEqual(100111, pcr.PublishedContentId); diff --git a/src/Umbraco.Tests/Routing/uQueryGetNodeIdByUrlTests.cs b/src/Umbraco.Tests/Routing/uQueryGetNodeIdByUrlTests.cs index 348548f259..d6d77ac5c6 100644 --- a/src/Umbraco.Tests/Routing/uQueryGetNodeIdByUrlTests.cs +++ b/src/Umbraco.Tests/Routing/uQueryGetNodeIdByUrlTests.cs @@ -35,8 +35,8 @@ namespace Umbraco.Tests.Routing var url = "/test"; - var lookup = new Umbraco.Web.Routing.FinderByNiceUrl(); - var lookups = new Umbraco.Web.Routing.IPublishedContentFinder[] { lookup }; + var lookup = new Umbraco.Web.Routing.ContentFinderByNiceUrl(); + var lookups = new Umbraco.Web.Routing.IContentFinder[] { lookup }; var t = Template.MakeNew("test", new User(0)); diff --git a/src/Umbraco.Tests/Stubs/FakeLastChanceFinder.cs b/src/Umbraco.Tests/Stubs/FakeLastChanceFinder.cs index 4508756781..bf8991586a 100644 --- a/src/Umbraco.Tests/Stubs/FakeLastChanceFinder.cs +++ b/src/Umbraco.Tests/Stubs/FakeLastChanceFinder.cs @@ -2,7 +2,7 @@ using Umbraco.Web.Routing; namespace Umbraco.Tests.Stubs { - internal class FakeLastChanceFinder : IPublishedContentFinder + internal class FakeLastChanceFinder : IContentFinder { public bool TryFindDocument(PublishedContentRequest docRequest) { diff --git a/src/Umbraco.Tests/TestHelpers/BaseRoutingTest.cs b/src/Umbraco.Tests/TestHelpers/BaseRoutingTest.cs index 1b768d3fbe..786c695353 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseRoutingTest.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseRoutingTest.cs @@ -42,7 +42,7 @@ namespace Umbraco.Tests.TestHelpers var niceUrls = new NiceUrlProvider(contentStore, umbracoContext); var routingContext = new RoutingContext( umbracoContext, - Enumerable.Empty(), + Enumerable.Empty(), new FakeLastChanceFinder(), contentStore, niceUrls); diff --git a/src/Umbraco.Web/Routing/FinderByIdPath.cs b/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs similarity index 78% rename from src/Umbraco.Web/Routing/FinderByIdPath.cs rename to src/Umbraco.Web/Routing/ContentFinderByIdPath.cs index f3d88b35cb..7442bfd2e7 100644 --- a/src/Umbraco.Web/Routing/FinderByIdPath.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByIdPath.cs @@ -9,12 +9,12 @@ using Umbraco.Core; namespace Umbraco.Web.Routing { /// - /// Provides an implementation of that handles page identifiers. + /// Provides an implementation of that handles page identifiers. /// /// /// Handles /1234 where 1234 is the identified of a document. /// - internal class FinderByIdPath : IPublishedContentFinder + internal class ContentFinderByIdPath : IContentFinder { /// /// Tries to find and assign an Umbraco document to a PublishedContentRequest. @@ -36,7 +36,7 @@ namespace Umbraco.Web.Routing if (nodeId > 0) { - LogHelper.Debug("Id={0}", () => nodeId); + LogHelper.Debug("Id={0}", () => nodeId); node = docRequest.RoutingContext.PublishedContentStore.GetDocumentById( docRequest.RoutingContext.UmbracoContext, nodeId); @@ -44,7 +44,7 @@ namespace Umbraco.Web.Routing if (node != null) { docRequest.PublishedContent = node; - LogHelper.Debug("Found node with id={0}", () => docRequest.PublishedContentId); + LogHelper.Debug("Found node with id={0}", () => docRequest.PublishedContentId); } else { @@ -54,7 +54,7 @@ namespace Umbraco.Web.Routing } if (nodeId == -1) - LogHelper.Debug("Not a node id"); + LogHelper.Debug("Not a node id"); return node != null; } diff --git a/src/Umbraco.Web/Routing/FinderByNiceUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs similarity index 81% rename from src/Umbraco.Web/Routing/FinderByNiceUrl.cs rename to src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs index e084171716..06b016de03 100644 --- a/src/Umbraco.Web/Routing/FinderByNiceUrl.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByNiceUrl.cs @@ -8,12 +8,12 @@ using Umbraco.Core; namespace Umbraco.Web.Routing { /// - /// Provides an implementation of that handles page nice urls. + /// Provides an implementation of that handles page nice urls. /// /// /// Handles /foo/bar where /foo/bar is the nice url of a document. /// - internal class FinderByNiceUrl : IPublishedContentFinder + internal class ContentFinderByNiceUrl : IContentFinder { /// /// Tries to find and assign an Umbraco document to a PublishedContentRequest. @@ -40,7 +40,7 @@ namespace Umbraco.Web.Routing /// The document node, or null. protected IPublishedContent LookupDocumentNode(PublishedContentRequest docreq, string route) { - LogHelper.Debug("Test route \"{0}\"", () => route); + LogHelper.Debug("Test route \"{0}\"", () => route); // first ask the cache for a node // return '0' if in preview mode @@ -60,7 +60,7 @@ namespace Umbraco.Web.Routing if (node != null) { docreq.PublishedContent = node; - LogHelper.Debug("Cache hit, id={0}", () => nodeId); + LogHelper.Debug("Cache hit, id={0}", () => nodeId); } else { @@ -71,7 +71,7 @@ namespace Umbraco.Web.Routing // if we still have no node, get it by route if (node == null) { - LogHelper.Debug("Cache miss, query"); + LogHelper.Debug("Cache miss, query"); node = docreq.RoutingContext.PublishedContentStore.GetDocumentByRoute( docreq.RoutingContext.UmbracoContext, route); @@ -79,11 +79,11 @@ namespace Umbraco.Web.Routing if (node != null) { docreq.PublishedContent = node; - LogHelper.Debug("Query matches, id={0}", () => docreq.PublishedContentId); + LogHelper.Debug("Query matches, id={0}", () => docreq.PublishedContentId); var iscanon = !DomainHelper.ExistsDomainInPath(docreq.Domain, node.Path); if (!iscanon) - LogHelper.Debug("Non canonical url"); + LogHelper.Debug("Non canonical url"); // do not store if previewing or if non-canonical if (!docreq.RoutingContext.UmbracoContext.InPreviewMode && iscanon) @@ -92,7 +92,7 @@ namespace Umbraco.Web.Routing } else { - LogHelper.Debug("Query does not match"); + LogHelper.Debug("Query does not match"); } } diff --git a/src/Umbraco.Web/Routing/FinderByNiceUrlAndTemplate.cs b/src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs similarity index 79% rename from src/Umbraco.Web/Routing/FinderByNiceUrlAndTemplate.cs rename to src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs index cbd0238cce..2be18f9563 100644 --- a/src/Umbraco.Web/Routing/FinderByNiceUrlAndTemplate.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByNiceUrlAndTemplate.cs @@ -9,13 +9,13 @@ using Template = umbraco.cms.businesslogic.template.Template; namespace Umbraco.Web.Routing { /// - /// Provides an implementation of that handles page nice urls and a template. + /// Provides an implementation of that handles page nice urls and a template. /// /// /// Handles /foo/bar/template where /foo/bar is the nice url of a document, and template a template alias. /// If successful, then the template of the document request is also assigned. /// - internal class FinderByNiceUrlAndTemplate : FinderByNiceUrl, IPublishedContentFinder + internal class ContentFinderByNiceUrlAndTemplate : ContentFinderByNiceUrl, IContentFinder { /// /// Tries to find and assign an Umbraco document to a PublishedContentRequest. @@ -44,7 +44,7 @@ namespace Umbraco.Web.Routing var template = Template.GetByAlias(templateAlias); if (template != null) { - LogHelper.Debug("Valid template: \"{0}\"", () => templateAlias); + LogHelper.Debug("Valid template: \"{0}\"", () => templateAlias); var route = docRequest.HasDomain ? (docRequest.Domain.RootNodeId.ToString() + path) : path; node = LookupDocumentNode(docRequest, route); @@ -54,12 +54,12 @@ namespace Umbraco.Web.Routing } else { - LogHelper.Debug("Not a valid template: \"{0}\"", () => templateAlias); + LogHelper.Debug("Not a valid template: \"{0}\"", () => templateAlias); } } else { - LogHelper.Debug("No template in path \"/\""); + LogHelper.Debug("No template in path \"/\""); } return node != null; diff --git a/src/Umbraco.Web/Routing/FinderByPageIdQuery.cs b/src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs similarity index 89% rename from src/Umbraco.Web/Routing/FinderByPageIdQuery.cs rename to src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs index f971601fd7..51f9b16a31 100644 --- a/src/Umbraco.Web/Routing/FinderByPageIdQuery.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByPageIdQuery.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Routing /// This is used by library.RenderTemplate and also some of the macro rendering functionality like in /// insertMacro.aspx and macroResultWrapper.aspx /// - internal class FinderByPageIdQuery : IPublishedContentFinder + internal class ContentFinderByPageIdQuery : IContentFinder { public bool TryFindDocument(PublishedContentRequest docRequest) { diff --git a/src/Umbraco.Web/Routing/FinderByProfile.cs b/src/Umbraco.Web/Routing/ContentFinderByProfile.cs similarity index 81% rename from src/Umbraco.Web/Routing/FinderByProfile.cs rename to src/Umbraco.Web/Routing/ContentFinderByProfile.cs index c17389ba14..3722e9005e 100644 --- a/src/Umbraco.Web/Routing/FinderByProfile.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByProfile.cs @@ -8,7 +8,7 @@ using Umbraco.Core; namespace Umbraco.Web.Routing { /// - /// Provides an implementation of that handles profiles. + /// Provides an implementation of that handles profiles. /// /// /// Handles /profile/login where /profile is the profile page nice url and login the login of a member. @@ -16,7 +16,7 @@ namespace Umbraco.Web.Routing /// We keep it for backward compatility reasons. /// //[ResolutionWeight(40)] - internal class FinderByProfile : FinderByNiceUrl + internal class ContentFinderByProfile : ContentFinderByNiceUrl { /// /// Tries to find and assign an Umbraco document to a PublishedContentRequest. @@ -38,7 +38,7 @@ namespace Umbraco.Web.Routing if (path == GlobalSettings.ProfileUrl) { isProfile = true; - LogHelper.Debug("Path \"{0}\" is the profile path", () => path); + LogHelper.Debug("Path \"{0}\" is the profile path", () => path); var route = docRequest.HasDomain ? (docRequest.Domain.RootNodeId.ToString() + path) : path; node = LookupDocumentNode(docRequest, route); @@ -50,14 +50,14 @@ namespace Umbraco.Web.Routing } else { - LogHelper.Debug("No document matching profile path?"); + LogHelper.Debug("No document matching profile path?"); } } } if (!isProfile) { - LogHelper.Debug("Not the profile path"); + LogHelper.Debug("Not the profile path"); } return node != null; diff --git a/src/Umbraco.Web/Routing/FinderByAlias.cs b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs similarity index 79% rename from src/Umbraco.Web/Routing/FinderByAlias.cs rename to src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs index 6dcc507835..baa1fa809c 100644 --- a/src/Umbraco.Web/Routing/FinderByAlias.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs @@ -8,13 +8,13 @@ using Umbraco.Core; namespace Umbraco.Web.Routing { /// - /// Provides an implementation of that handles page aliases. + /// Provides an implementation of that handles page aliases. /// /// /// Handles /just/about/anything where /just/about/anything is contained in the umbracoUrlAlias property of a document. /// The alias is the full path to the document. There can be more than one alias, separated by commas. /// - internal class FinderByAlias : IPublishedContentFinder + internal class ContentFinderByUrlAlias : IContentFinder { /// /// Tries to find and assign an Umbraco document to a PublishedContentRequest. @@ -36,7 +36,7 @@ namespace Umbraco.Web.Routing if (node != null) { docRequest.PublishedContent = node; - LogHelper.Debug("Path \"{0}\" is an alias for id={1}", () => docRequest.Uri.AbsolutePath, () => docRequest.PublishedContentId); + LogHelper.Debug("Path \"{0}\" is an alias for id={1}", () => docRequest.Uri.AbsolutePath, () => docRequest.PublishedContentId); } } diff --git a/src/Umbraco.Web/Routing/DefaultLastChanceFinder.cs b/src/Umbraco.Web/Routing/ContentLastChanceFinder.cs similarity index 90% rename from src/Umbraco.Web/Routing/DefaultLastChanceFinder.cs rename to src/Umbraco.Web/Routing/ContentLastChanceFinder.cs index aabe0968ee..9294c772e2 100644 --- a/src/Umbraco.Web/Routing/DefaultLastChanceFinder.cs +++ b/src/Umbraco.Web/Routing/ContentLastChanceFinder.cs @@ -12,10 +12,10 @@ using umbraco.interfaces; namespace Umbraco.Web.Routing { /// - /// Provides an implementation of to be used as a last chance finder, + /// Provides an implementation of to be used as a last chance finder, /// that handles backward compatilibty with legacy INotFoundHandler. /// - internal class DefaultLastChanceFinder : IPublishedContentFinder + internal class ContentLastChanceFinder : IContentFinder { // notes // @@ -98,7 +98,7 @@ namespace Umbraco.Web.Routing IPublishedContent HandlePageNotFound(PublishedContentRequest docRequest) { - LogHelper.Debug("Running for url='{0}'.", () => docRequest.Uri.AbsolutePath); + LogHelper.Debug("Running for url='{0}'.", () => docRequest.Uri.AbsolutePath); //XmlNode currentPage = null; IPublishedContent currentPage = null; @@ -115,7 +115,7 @@ namespace Umbraco.Web.Routing // FIXME - could it be null? - LogHelper.Debug("Handler '{0}' found node with id={1}.", () => handler.GetType().FullName, () => handler.redirectID); + LogHelper.Debug("Handler '{0}' found node with id={1}.", () => handler.GetType().FullName, () => handler.redirectID); //// check for caching //if (handler.CacheUrl) @@ -146,7 +146,7 @@ namespace Umbraco.Web.Routing // initialize handlers // create the definition cache - LogHelper.Debug("Registering custom handlers."); + LogHelper.Debug("Registering custom handlers."); var customHandlerTypes = new List(); @@ -171,7 +171,7 @@ namespace Umbraco.Web.Routing continue; } - LogHelper.Debug("Registering '{0}.{1},{2}'.", () => ns, () => typeName, () => assemblyName); + LogHelper.Debug("Registering '{0}.{1},{2}'.", () => ns, () => typeName, () => assemblyName); Type type = null; try @@ -184,7 +184,7 @@ namespace Umbraco.Web.Routing } catch (Exception e) { - LogHelper.Error("Error registering handler, ignoring.", e); + LogHelper.Error("Error registering handler, ignoring.", e); } if (type != null) @@ -217,7 +217,7 @@ namespace Umbraco.Web.Routing } catch (Exception e) { - LogHelper.Error(string.Format("Error instanciating handler {0}, ignoring.", type.FullName), e); + LogHelper.Error(string.Format("Error instanciating handler {0}, ignoring.", type.FullName), e); } } diff --git a/src/Umbraco.Web/Routing/IPublishedContentFinder.cs b/src/Umbraco.Web/Routing/IContentFinder.cs similarity index 91% rename from src/Umbraco.Web/Routing/IPublishedContentFinder.cs rename to src/Umbraco.Web/Routing/IContentFinder.cs index 6985d748f5..34d5c959d9 100644 --- a/src/Umbraco.Web/Routing/IPublishedContentFinder.cs +++ b/src/Umbraco.Web/Routing/IContentFinder.cs @@ -3,7 +3,7 @@ namespace Umbraco.Web.Routing /// /// Provides a method to try to find and assign an Umbraco document to a PublishedContentRequest. /// - internal interface IPublishedContentFinder + internal interface IContentFinder { /// /// Tries to find and assign an Umbraco document to a PublishedContentRequest. diff --git a/src/Umbraco.Web/Routing/IPublishedContentFinderResolver.cs b/src/Umbraco.Web/Routing/IContentFinderResolver.cs similarity index 59% rename from src/Umbraco.Web/Routing/IPublishedContentFinderResolver.cs rename to src/Umbraco.Web/Routing/IContentFinderResolver.cs index ef91829433..140da0e536 100644 --- a/src/Umbraco.Web/Routing/IPublishedContentFinderResolver.cs +++ b/src/Umbraco.Web/Routing/IContentFinderResolver.cs @@ -12,21 +12,21 @@ namespace Umbraco.Web.Routing /// /// Resolver for IPublishedContentFinder objects. /// - internal sealed class IPublishedContentFinderResolver : ManyObjectsResolverBase + internal sealed class IContentFinderResolver : ManyObjectsResolverBase { /// - /// Initializes a new instance of the class with an initial list of finder types. + /// Initializes a new instance of the class with an initial list of finder types. /// /// The list of finder types /// The resolver is created by the WebBootManager and thus the constructor remains internal. - internal IPublishedContentFinderResolver(IEnumerable finders) + internal IContentFinderResolver(IEnumerable finders) : base(finders) { } /// /// Gets the finders. /// - public IEnumerable Finders + public IEnumerable Finders { get { return Values; } } diff --git a/src/Umbraco.Web/Routing/IPublishedContentLastChanceFinderResolver.cs b/src/Umbraco.Web/Routing/IContentLastChanceFinderResolver.cs similarity index 58% rename from src/Umbraco.Web/Routing/IPublishedContentLastChanceFinderResolver.cs rename to src/Umbraco.Web/Routing/IContentLastChanceFinderResolver.cs index 14bf0d405e..7dfa147a95 100644 --- a/src/Umbraco.Web/Routing/IPublishedContentLastChanceFinderResolver.cs +++ b/src/Umbraco.Web/Routing/IContentLastChanceFinderResolver.cs @@ -6,14 +6,14 @@ namespace Umbraco.Web.Routing /// /// Resolver for the last chance IPublishedContentFinder object. /// - internal sealed class IPublishedContentLastChanceFinderResolver : SingleObjectResolverBase + internal sealed class IContentLastChanceFinderResolver : SingleObjectResolverBase { /// - /// Initializes a new instance of the class with an instance of a finder. + /// Initializes a new instance of the class with an instance of a finder. /// /// A instance of a finder. /// The resolver is created by the WebBootManager and thus the constructor remains internal. - internal IPublishedContentLastChanceFinderResolver(IPublishedContentFinder finder) + internal IContentLastChanceFinderResolver(IContentFinder finder) : base(finder) { } @@ -22,7 +22,7 @@ namespace Umbraco.Web.Routing /// /// The finder. /// For developers, at application startup. - public void SetFinder(IPublishedContentFinder finder) + public void SetFinder(IContentFinder finder) { Value = finder; } @@ -30,7 +30,7 @@ namespace Umbraco.Web.Routing /// /// Gets the last chance finder. /// - public IPublishedContentFinder Finder + public IContentFinder Finder { get { return Value; } } diff --git a/src/Umbraco.Web/Routing/RoutingContext.cs b/src/Umbraco.Web/Routing/RoutingContext.cs index e7e0a39fb9..7790df7a06 100644 --- a/src/Umbraco.Web/Routing/RoutingContext.cs +++ b/src/Umbraco.Web/Routing/RoutingContext.cs @@ -19,8 +19,8 @@ namespace Umbraco.Web.Routing /// The nice urls resolver. internal RoutingContext( UmbracoContext umbracoContext, - IEnumerable contentFinders, - IPublishedContentFinder contentLastChanceFinder, + IEnumerable contentFinders, + IContentFinder contentLastChanceFinder, IPublishedContentStore publishedContentStore, NiceUrlProvider niceUrlResolver) { @@ -39,12 +39,12 @@ namespace Umbraco.Web.Routing /// /// Gets the published content finders. /// - internal IEnumerable PublishedContentFinders { get; private set; } + internal IEnumerable PublishedContentFinders { get; private set; } /// /// Gets the published content last chance finder. /// - internal IPublishedContentFinder PublishedContentLastChanceFinder { get; private set; } + internal IContentFinder PublishedContentLastChanceFinder { get; private set; } /// /// Gets the content store. diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 4e3f0162d5..89aa20aafc 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -325,7 +325,7 @@ - + @@ -426,25 +426,25 @@ - - - + + + - - - - + + + + - + - + diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index 2201ab176b..7a13b31a01 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -62,8 +62,8 @@ namespace Umbraco.Web // create the RoutingContext, and assign var routingContext = new RoutingContext( umbracoContext, - IPublishedContentFinderResolver.Current.Finders, - IPublishedContentLastChanceFinderResolver.Current.Finder, + IContentFinderResolver.Current.Finders, + IContentLastChanceFinderResolver.Current.Finder, PublishedContentStoreResolver.Current.PublishedContentStore, niceUrls); umbracoContext.RoutingContext = routingContext; diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index c65daaac5a..422bef2dbc 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -193,19 +193,19 @@ namespace Umbraco.Web typeof (RenderControllerFactory) }); - IPublishedContentLastChanceFinderResolver.Current = new IPublishedContentLastChanceFinderResolver(new DefaultLastChanceFinder()); + IContentLastChanceFinderResolver.Current = new IContentLastChanceFinderResolver(new ContentLastChanceFinder()); - IPublishedContentFinderResolver.Current = new IPublishedContentFinderResolver( + IContentFinderResolver.Current = new IContentFinderResolver( //add all known resolvers in the correct order, devs can then modify this list on application startup either by binding to events //or in their own global.asax new[] { - typeof (FinderByPageIdQuery), - typeof (FinderByNiceUrl), - typeof (FinderByIdPath), - typeof (FinderByNiceUrlAndTemplate), - typeof (FinderByProfile), - typeof (FinderByAlias) + typeof (ContentFinderByPageIdQuery), + typeof (ContentFinderByNiceUrl), + typeof (ContentFinderByIdPath), + typeof (ContentFinderByNiceUrlAndTemplate), + typeof (ContentFinderByProfile), + typeof (ContentFinderByUrlAlias) }); RoutesCacheResolver.Current = new RoutesCacheResolver(new DefaultRoutesCache(_isForTesting == false));