private Category LoadRuleSummaryPage(SpRulesDataSet dataSet, ListItem page, ClientContext ctx)
        {
            var cat = dataSet.CategoryByTitle(page["Title"]?.ToString());

            if (cat == null)
            {
                _log.LogWarning("failed to match rule summary item {SummaryPageTitle} to a category from the term store", page["Title"]);
                return(null);
            }

            cat.Content = page["PublishingPageContent"]?.ToString();

            cat.IntroText = page["RuleSummaryIntro"]?.ToString();
            cat.PageGuid  = page["GUID"]?.ToString();
            cat.ImageUrls.UnionWith(GetImageUrls(cat.Content));

            ExtractWebParts(cat, page, ctx);

            if (cat.Content != null)
            {
                MatchEvaluator matchEval = new MatchEvaluator(ReplaceRelativeURl);
                cat.Content = Regex.Replace(cat.Content, @"(""(\/_layouts\/15\/FIXUPREDIRECT.ASPX).*""\s)", matchEval);
            }

            return(cat);
        }
示例#2
0
        private void LoadRuleSummaryPage(SpRulesDataSet dataSet, JToken page)
        {
            var cat = dataSet.CategoryByTitle(page["Title"].NpValue <string>());

            if (cat == null)
            {
                _log.LogWarning("failed to match rule summary page {SummaryPageTitle} to a category from the term store", page["Title"].NpValue <string>());
                return;
            }
            cat.Content  = page["PublishingPageContent"].NpValue <string>();
            cat.PageGuid = page["GUID"].NpValue <string>();
        }