private void UpdatePageScore(HiearchyNode node) { if (node.NodeInformation.TemplateId > 0) { var analysis = _analyzeService.AnalyzeWebPage(node.NodeInformation.Id); node.FocusKeyword = analysis.FocusKeyword; node.PageScore = analysis.Score; } foreach (var childNode in node.Children) { UpdatePageScore(childNode); } }
private List <HiearchyNode> GetHierarchy(IEnumerable <IPublishedContent> nodeCollection) { var nodeHiearchyCollection = new List <HiearchyNode>(); foreach (var node in nodeCollection) { var nodeHierarchy = new HiearchyNode { NodeInformation = new NodeInformation { Id = node.Id, Name = node.Name, TemplateId = node.TemplateId }, Children = GetHierarchy(node.Children) }; nodeHiearchyCollection.Add(nodeHierarchy); } return(nodeHiearchyCollection.ToList()); }