public void OnNodeContent(NodeContent content, NodeContentBase parentNode) { _contentHandler.OnNodeContent(content, parentNode); _nodeExportCounter++; UpdateStatus(); }
private void BuildKachingProductAssets( NodeContentBase node, IDictionary <string, IEnumerable <ProductAsset> > productAssets, ICollection <string> entriesWithoutAssets) { var children = _contentLoader.GetChildren <CatalogContentBase>(node.ContentLink); foreach (var child in children) { switch (child) { case NodeContent childNode: BuildKachingProductAssets( childNode, productAssets, entriesWithoutAssets); break; case ProductContent childEntry: ICollection <ProductAsset> assets = _productFactory.BuildKaChingProductAssets(childEntry); if (assets == null) { entriesWithoutAssets.Add( childEntry.Code.SanitizeKey()); } else { productAssets.Add( childEntry.Code.SanitizeKey(), assets); } break; } } }
private void InsertIntoParent(EpiCategory node, NodeContentBase parentNode) { var parentCategory = _categoryMap[parentNode.ContentGuid]; var parentsChildren = parentCategory.Children; node.SortOrder = parentsChildren.Count; node.Level = parentCategory.Level + 1; parentsChildren.Add(node); }
private void AddItemsRecursive(NodeContentBase nodeContent, PromotionItems itemsOnPromotion, List <CatalogContentBase> conditionProducts) { foreach (var child in _contentLoader.GetChildren <CatalogContentBase>(nodeContent.ContentLink)) { AddIfProduct(child, conditionProducts); var childNode = child as NodeContentBase; if (childNode != null && itemsOnPromotion.Condition.IncludesSubcategories) { AddItemsRecursive(childNode, itemsOnPromotion, conditionProducts); } } }
private void ExtractNode(NodeContentBase parentNode, IExtractedContentHandler contentHandler) { if (parentNode == null) { return; } foreach (var child in BatchedChildren <NodeContent>(parentNode.ContentLink)) { contentHandler.OnNodeContent(child, parentNode); ExtractNode(child, contentHandler); ExtractProducts(child, contentHandler); } }
public void AddNode(NodeContent nodeContent, NodeContentBase parentNode) { if (NodeMapped(nodeContent)) { throw new Exception("NodeMapped(nodeContent)"); } var epiCategory = MkEpiCategory(nodeContent); if (MissingParent(parentNode)) { InsertIntoRoot(epiCategory); } else { InsertIntoParent(epiCategory, parentNode); } MapNode(epiCategory); }
public void ExportProductRecommendations(NodeContentBase node, IExportState exportState) { if (node == null) { return; } if (!_configuration.ProductRecommendationsImportUrl.IsValidProductRecommendationsImportUrl()) { return; } IEnumerable <ContentReference> descendentRefs = _contentLoader .GetDescendents(node.ContentLink); IEnumerable <ContentReference> entryRefs = _contentLoader .GetItems(descendentRefs, CultureInfo.InvariantCulture) .OfType <EntryContentBase>() .Select(c => c.ContentLink); ExportProductRecommendations(entryRefs, exportState); }
public void OnNodeContent(NodeContent content, NodeContentBase parentNode) { _categoryTreeBuilder.AddNode(content, parentNode); }
private bool MissingParent(NodeContentBase parentNode) { return(!_categoryMap.ContainsKey(parentNode.ContentGuid)); }