public ReadPageServiceBuildUrl ( IPageUrlBuilder <TItem> pageUrlBuilder, IReadPageService <TItem> next ) { _pageUrlBuilder = pageUrlBuilder ?? throw new ArgumentNullException(nameof(pageUrlBuilder)); _next = next ?? throw new ArgumentNullException(nameof(next)); }
public UrlBuilder(IConfigurationService configurationService, IAdminUrlBuilder admin, IPostUrlBuilder post, IPageUrlBuilder page, ICategoryUrlBuilder categoryUrlBuilder, IServiceUrlBuilder serviceUrlBuilder, IFeedUrlBuilder feedUrlBuilder) : base(configurationService) { this.Admin = admin; this.Post = post; this.Page = page; this.Category = categoryUrlBuilder; this.Service = serviceUrlBuilder; this.Feed = feedUrlBuilder; }
public AdminPageUrlBuilder(IConfigurationService configurationService, IPageUrlBuilder pageUrlBuilder) : base(configurationService) { this.pageUrlBuilder = pageUrlBuilder; }
private static void BuildFolderPaths(SitemapBuildingData pagesData, IEnumerable<XElement> elements, IDictionary<string, Guid> urlToIdLookup, IPageUrlBuilder builder) { foreach (XElement element in elements) { Guid pageId = new Guid(element.Attribute(AttributeNames.Id).Value); IPage page = pagesData.PageById[pageId]; IPageStructure pageStructure = pagesData.StructureById[pageId]; if (pageStructure == null) { continue; } Guid parentId = pageStructure.ParentId; PageUrlSet pageUrls = builder.BuildUrlSet(page, parentId); if(pageUrls == null) { continue; } element.Add(new XAttribute(AttributeNames.URL, pageUrls.PublicUrl)); string lookupUrl = pageUrls.PublicUrl; if(pageUrls.FriendlyUrl != null) { element.Add(new XAttribute(AttributeNames.FriendlyUrl, pageUrls.FriendlyUrl)); } //// FolderPath isn't used any more //element.Add(new XAttribute("FolderPath", builder.FolderPaths[pageId])); element.Add(new XAttribute(AttributeNames.Depth, 1 + element.Ancestors(PageElementName).Count())); // NOTE: urlToIdLookup is obsolete, but old API needs it if (urlToIdLookup.ContainsKey(lookupUrl)) { Log.LogError(LogTitle, "Multiple pages share the same path '{0}', page ID: '{1}'. Duplicates are ignored.".FormatWith(pageUrls.PublicUrl, pageId)); continue; } urlToIdLookup.Add(lookupUrl, pageId); BuildFolderPaths(pagesData, element.Elements(), urlToIdLookup, builder); } }
private static void BuildFolderPaths(SitemapBuildingData pagesData, IEnumerable<XElement> roots, IPageUrlBuilder pageUrlBuilder, IDictionary<string, Guid> urlToIdLookup) { BuildFolderPaths(pagesData, roots, urlToIdLookup, pageUrlBuilder); }