Exemplo n.º 1
0
        public IReadOnlyCollection <T> GetPageVersionContentDocument(ContentReference contentLink)
        {
            var content = _contentLoader.Get <IContent>(contentLink);

            if (content.ShouldIndexPage() == false)
            {
                return(Array.Empty <T>());
            }
            var document = _contentDocumentBuilder.Build(content);

            return(new[] { document });
        }
Exemplo n.º 2
0
 private async Task IndexLanguageVersions(ContentReference contentReference, IndexContentRequest indexContentRequest)
 {
     foreach (var languageVersion in _contentLoader.GetAllLanguageVersions(contentReference).Where(c => c.ShouldIndexPage()))
     {
         indexContentRequest.OnStatusChanged($"Indexing content: Name: {languageVersion.Name}, ContentLinkId: {languageVersion.ContentLink.ID}");
         var contentDocument = _documentBuilder.Build(languageVersion);
         await _azureSearchService.IndexAsync(contentDocument);
     }
 }
Exemplo n.º 3
0
        private IEnumerable <T> GetParentPagesSpecificLanguageDocuments(IContent root)
        {
            var listResult = new List <T>();

            var parents = GetBlockParentPagesInBlockLanguage(root.ContentLink)
                          .Select(contentLink => _contentRepository.Get <IContent>(contentLink))
                          .Select(content => _contentDocumentBuilder.Build(content));

            listResult.AddRange(parents);

            return(listResult);
        }