protected void Page_Load(object sender, EventArgs e)
        {
            if (Sitecore.Context.Item.InheritsTemplate(DefaultArticlePageItem.TemplateId))
            {
                ObjDefaultArticle = (DefaultArticlePageItem)Sitecore.Context.Item;
            }

            if (ObjDefaultArticle != null)
            {
                //Show Author details
                if (ObjDefaultArticle.AuthorName.Item != null)
                {
                    frAuthorName.Item            = ObjDefaultArticle.AuthorName.Item;
                    frAuthorImage.Item           = ObjDefaultArticle.AuthorName.Item;
                    hlAuthorImage.Visible        = true;
                    hlAuthorImage.NavigateUrl    = ObjDefaultArticle.AuthorName.Item.GetUrl();
                    hlAuthorMorePost.Text        = UnderstoodDotOrg.Common.DictionaryConstants.Articles_MorePostsbythisAuthorText;
                    hlAuthorMorePost.NavigateUrl = ObjDefaultArticle.AuthorName.Item.GetUrl();

                    AuthorItem author = (AuthorItem)ObjDefaultArticle.AuthorName.Item;

                    litBioSentence.Text = author.AuthorBioAbstract.Raw;
                }
                else
                {
                    this.Visible = false;
                }
            }
            else
            {
                this.Visible = false;
            }
        }
Exemple #2
0
        protected void rptRow_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem dataItem = (DefaultArticlePageItem)e.Item.DataItem;

                if (dataItem.InnerItem.InheritsTemplate(DefaultArticlePageItem.TemplateId))
                {
                    DefaultArticlePageItem article = (DefaultArticlePageItem)dataItem;

                    System.Web.UI.WebControls.Image imgThumbnail = e.FindControlAs <System.Web.UI.WebControls.Image>("imgThumbnail");
                    HyperLink hypArticleLink = e.FindControlAs <HyperLink>("hypArticleLink");
                    HyperLink hypThumbnail   = e.FindControlAs <HyperLink>("hypThumbnail");
                    ArticleRecommendationIcons articleRecommendationIcons = e.FindControlAs <ArticleRecommendationIcons>("articleRecommendationIcons");

                    if (imgThumbnail != null)
                    {
                        imgThumbnail.ImageUrl = article.GetArticleThumbnailUrl(230, 129);
                    }

                    if (hypArticleLink != null)
                    {
                        hypArticleLink.NavigateUrl = hypThumbnail.NavigateUrl = article.GetUrl();
                        hypArticleLink.Text        = article.ContentPage.PageTitle;
                    }

                    if (IsUserLoggedIn)
                    {
                        articleRecommendationIcons.HasMatchingParentInterest = article.HasMatchingParentInterest(CurrentMember);
                        articleRecommendationIcons.MatchingChildrenIds       = article.GetMatchingChildrenIds(CurrentMember);
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            rptDownloads.DataSource = Sitecore.Context.Item.Children;
            rptDownloads.DataBind();

            DefaultArticlePageItem context = Sitecore.Context.Item;
        }
Exemple #4
0
        protected void rptRow_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                Item dataItem = e.Item.DataItem as Item;

                if (dataItem.InheritsTemplate(DefaultArticlePageItem.TemplateId))
                {
                    DefaultArticlePageItem article = (DefaultArticlePageItem)dataItem;

                    System.Web.UI.WebControls.Image imgThumbnail = e.FindControlAs <System.Web.UI.WebControls.Image>("imgThumbnail");
                    HyperLink hypArticleLink = e.FindControlAs <HyperLink>("hypArticleLink");
                    HyperLink hypThumbnail   = e.FindControlAs <HyperLink>("hypThumbnail");

                    if (imgThumbnail != null)
                    {
                        imgThumbnail.ImageUrl = article.GetArticleThumbnailUrl(230, 129);
                    }

                    if (hypArticleLink != null)
                    {
                        hypArticleLink.NavigateUrl = hypThumbnail.NavigateUrl = article.GetUrl();
                        hypArticleLink.Text        = article.ContentPage.PageTitle;
                    }
                }
            }
        }
Exemple #5
0
        protected void rptTopicListItems_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;

                HyperLink hlTopicTitle = e.FindControlAs <HyperLink>("hlTopicTitle");
                hlTopicTitle.NavigateUrl = item.GetUrl();
                hlTopicTitle.Text        = item.ContentPage.PageTitle.Rendered;

                PlaceHolder phThumbnail = e.FindControlAs <PlaceHolder>("phThumbnail");

                var icons = e.FindControlAs <UnderstoodDotOrg.Web.Presentation.Sublayouts.Recommendation.ArticleRecommendationIcons>("ArticleRecommendationIcons");
                if (icons != null)
                {
                    icons.MatchingChildrenIds       = item.GetMatchingChildrenIds(CurrentMember);
                    icons.HasMatchingParentInterest = item.HasMatchingParentInterest(CurrentMember);
                }

                // Handle first image
                if (e.Item.ItemIndex == 0)
                {
                    Image  imgThumbnail = e.FindControlAs <Image>("imgThumbnail");
                    string source       = item.GetArticleFeaturedThumbnailUrl(190, 107);
                    imgThumbnail.ImageUrl = source;
                    phThumbnail.Visible   = !String.IsNullOrEmpty(source);
                }
                else
                {
                    phThumbnail.Visible = false;
                }
            }
        }
        void lvArticles_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                DefaultArticlePageItem article = (DefaultArticlePageItem)e.Item.DataItem;

                Sitecore.Web.UI.WebControls.Sublayout sbArticleEntry = (Sitecore.Web.UI.WebControls.Sublayout)e.Item.FindControl("sbArticleEntry");
                sbArticleEntry.DataSource = article.ID.ToString();
            }
        }
Exemple #7
0
        void rptArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;

                Sublayout sbArticleEntry = e.FindControlAs <Sublayout>("sbArticleEntry");
                sbArticleEntry.DataSource = item.ID.ToString();
            }
        }
        private void BindData(DefaultArticlePageItem page)
        {
            ActivityLog tempLog = new ActivityLog();
            //ContentId, ActivityValue
            int helpfulCount = tempLog.GetActivityCountByValue(new Guid(Sitecore.Context.Item.ID.ToString()), Constants.UserActivity_Values.FoundHelpful_True);

            lblHelpfulCount.Text = lblHelpfulCountMobile.Text = helpfulCount.ToString();

            ltlFoundThisHelpful.Text = ltlFoundThisHelpfulMobile.Text = DictionaryConstants.FoundThisHelpful;
        }
Exemple #9
0
        protected void rptArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                Article article = (Article)e.Item.DataItem;

                DefaultArticlePageItem item = article.GetItem();

                HyperLink hlTitle = e.FindControlAs <HyperLink>("hlTitle");
                hlTitle.NavigateUrl = item.GetUrl();

                Literal litTitle = e.FindControlAs <Literal>("litTitle");
                litTitle.Text = item.ContentPage.PageTitle.Rendered;

                Repeater rptArticleIssues = e.FindControlAs <Repeater>("rptArticleIssues");
                var      issues           = article.ChildIssues.Select(i => Sitecore.Context.Database.GetItem(i.Guid))
                                            .Where(i => i != null)
                                            .Select(i => new ChildIssueItem(i));
                if (issues.Any())
                {
                    rptArticleIssues.DataSource = issues;
                    rptArticleIssues.DataBind();
                }

                Repeater rptArticleGrades = e.FindControlAs <Repeater>("rptArticleGrades");
                var      grades           = article.ChildGrades.Select(i => Sitecore.Context.Database.GetItem(i.Guid))
                                            .Where(i => i != null)
                                            .Select(i => new GradeLevelItem(i));
                if (grades.Any())
                {
                    rptArticleGrades.DataSource = grades;
                    rptArticleGrades.DataBind();
                }

                Repeater rptArticleInterests = e.FindControlAs <Repeater>("rptArticleInterests");
                var      interests           = article.ParentInterests.Select(i => Sitecore.Context.Database.GetItem(i.Guid))
                                               .Where(i => i != null)
                                               .Select(i => new ParentInterestItem(i));
                if (interests.Any())
                {
                    rptArticleInterests.DataSource = interests;
                    rptArticleInterests.DataBind();
                }

                var overrides = article.OverrideTypes.Select(i => Sitecore.Context.Database.GetItem(i.Guid))
                                .Where(i => i != null);
                Repeater rptArticleOverrides = e.FindControlAs <Repeater>("rptArticleOverrides");
                if (overrides.Any())
                {
                    rptArticleOverrides.DataSource = overrides;
                    rptArticleOverrides.DataBind();
                }
            }
        }
Exemple #10
0
        public ResultSet SearchAllArticles(string terms, string type, int page, string lang)
        {
            ResultSet results = new ResultSet();

            SetContextLanguage(lang);

            int blurbLimit         = 150; // TODO: move to constant
            SearchResultsItem item = Sitecore.Context.Database.GetItem(Constants.Pages.SearchResults);

            if (item != null && !string.IsNullOrEmpty(item.SearchResultSummaryCharacterLimit.Raw))
            {
                blurbLimit = item.SearchResultSummaryCharacterLimit.Integer;
            }

            int                  totalResults   = 0;
            List <Article>       articles       = SearchHelper.PerformArticleSearch(terms, type, page, out totalResults);
            List <SearchArticle> searchArticles = new List <SearchArticle>();

            foreach (Article article in articles)
            {
                DefaultArticlePageItem articleItem = article.GetItem();
                if (articleItem == null)
                {
                    continue;
                }

                // Handle cases such as invalid link format exception
                try
                {
                    var sa = new SearchArticle
                    {
                        Title     = Common.Helpers.TextHelper.HighlightSearchTitle(terms, HttpUtility.HtmlDecode(articleItem.ContentPage.PageTitle.Rendered)),
                        Url       = articleItem.GetUrl(),
                        Thumbnail = articleItem.GetArticleThumbnailUrl(230, 129),
                        Blurb     = articleItem.GetSearchResultBlurb(blurbLimit),
                        Type      = articleItem.GetArticleType()
                    };

                    searchArticles.Add(sa);
                }
                catch (Exception ex)
                {
                    Sitecore.Diagnostics.Log.Error("Error populating search result", ex, this);
                }
            }

            results.Articles     = searchArticles;
            results.TotalMatches = totalResults;

            results.HasMoreResults = HasMoreResults(page, Constants.SEARCH_RESULTS_ENTRIES_PER_PAGE, results.Articles.Count(), totalResults);

            return(results);
        }
        protected void rptAuthorArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem article = (DefaultArticlePageItem)e.Item.DataItem;

                if (article != null)
                {
                    HyperLink hypImageLink        = e.FindControlAs <HyperLink>("hypImageLink");
                    HyperLink hypAuthor           = e.FindControlAs <HyperLink>("hypAuthor");
                    HyperLink hypReadMore         = e.FindControlAs <HyperLink>("hypReadMore");
                    HyperLink hypArticleTitleLink = e.FindControlAs <HyperLink>("hypArticleTitleLink");
                    Literal   litCommentCount     = e.FindControlAs <Literal>("litCommentCount");
                    Literal   litArticleTitle     = e.FindControlAs <Literal>("litArticleTitle");
                    Literal   litDatePosted       = e.FindControlAs <Literal>("litDatePosted");
                    Literal   litAbstract         = e.FindControlAs <Literal>("litAbstract");
                    ArticleRecommendationIcons articleRecommendationIcons = e.FindControlAs <ArticleRecommendationIcons>("articleRecommendationIcons");

                    if (article.AuthorName.Item != null)
                    {
                        hypAuthor.Text        = article.AuthorName.Item.DisplayName;
                        hypAuthor.NavigateUrl = Sitecore.Context.Item.GetUrl();

                        hypImageLink.NavigateUrl = hypReadMore.NavigateUrl = hypArticleTitleLink.NavigateUrl = article.GetUrl();
                        hypImageLink.ImageUrl    = article.GetArticleThumbnailUrl(230, 129);

                        litArticleTitle.Text = article.DisplayName;
                        litDatePosted.Text   = article.InnerItem.Statistics.Created.ToString("MMM dd, yyyy");
                        litAbstract.Text     = UnderstoodDotOrg.Common.Helpers.TextHelper.TruncateText(
                            Sitecore.StringUtil.RemoveTags(HttpUtility.HtmlDecode(article.ContentPage.BodyContent.Raw)), 150);

                        bool hasMoreResults;
                        int  totalComments;

                        List <Comment> dataSource = TelligentService.ReadComments(
                            article.BlogId.ToString(), article.BlogPostId.ToString(), 1, Constants.ARTICLE_COMMENTS_PER_PAGE, "CreatedUtcDate", true, out totalComments, out hasMoreResults);

                        litCommentCount.Text = totalComments.ToString();

                        if (IsUserLoggedIn)
                        {
                            articleRecommendationIcons.HasMatchingParentInterest = article.HasMatchingParentInterest(CurrentMember);
                            articleRecommendationIcons.MatchingChildrenIds       = article.GetMatchingChildrenIds(CurrentMember);
                        }
                    }
                    else
                    {
                        e.Item.Visible = false;
                    }
                }
            }
        }
Exemple #12
0
        private void BindContent()
        {
            if (DataSource != null)
            {
                DefaultArticlePageItem article = DataSource;

                frPageTitle.Item        = article;
                imgThumbnail.ImageUrl   = article.GetArticleThumbnailUrl(190, 107);
                hlThumbnail.NavigateUrl = hlTitle.NavigateUrl = article.GetUrl();

                articleRecommendationIcons.HasMatchingParentInterest = article.HasMatchingParentInterest(CurrentMember);
                articleRecommendationIcons.MatchingChildrenIds       = article.GetMatchingChildrenIds(CurrentMember);
            }
        }
        protected void rptTopicCarousel_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem item = e.Item.DataItem as DefaultArticlePageItem;

                System.Web.UI.WebControls.Image imgFeatured = e.FindControlAs <System.Web.UI.WebControls.Image>("imgFeatured");
                imgFeatured.ImageUrl = item.GetArticleFeaturedThumbnailUrl(630, 354);

                Literal litNavigationTitle = e.FindControlAs <Literal>("litNavigationTitle");
                litNavigationTitle.Text = item.ContentPage.BasePageNEW.NavigationTitle.Rendered;

                HyperLink hlImageLink = e.FindControlAs <HyperLink>("hlImageLink");
                hlImageLink.NavigateUrl = item.GetUrl();
            }
        }
Exemple #14
0
        void rptArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;

                HyperLink hlArticleDetail = e.FindControlAs <HyperLink>("hlArticleDetail");
                hlArticleDetail.NavigateUrl = item.GetUrl();

                System.Web.UI.WebControls.Image imgThumbnail = e.FindControlAs <System.Web.UI.WebControls.Image>("imgThumbnail");
                imgThumbnail.ImageUrl = item.GetArticleThumbnailUrl(230, 129);

                FieldRenderer frPageTitle = e.FindControlAs <FieldRenderer>("frPageTitle");
                frPageTitle.Item = item;
            }
        }
Exemple #15
0
        protected void rptFeaturedArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem article = e.Item.DataItem as DefaultArticlePageItem;

                HyperLink hypArticleLink = e.FindControlAs <HyperLink>("hypArticleLink");
                Literal   ltArticleText  = e.FindControlAs <Literal>("ltArticleText");
                System.Web.UI.WebControls.Image imgThumbnail = e.FindControlAs <System.Web.UI.WebControls.Image>("imgThumbnail");

                hypArticleLink.NavigateUrl = article.GetUrl();
                // TODO: verify this truncation is allowed
                ltArticleText.Text    = article.ContentPage.BasePageNEW.NavigationTitle.Raw.Truncate(50, true, true);
                imgThumbnail.ImageUrl = article.GetArticleFeaturedThumbnailUrl(230, 129);
            }
        }
Exemple #16
0
        private void BindContent()
        {
            DefaultArticlePageItem item = Sitecore.Context.Item;

            if (!item.InnerItem.InheritsTemplate(DefaultArticlePageItem.TemplateId) ||
                item.HideMoreLikeThisModule.Checked)
            {
                this.Visible = false;
                return;
            }

            var articles = item.GetMoreLikeThisArticles();

            if (articles.Any())
            {
                rptArticles.DataSource = articles;
                rptArticles.DataBind();
            }
        }
        protected void rptTryMoreQuizzes_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem context = (DefaultArticlePageItem)e.Item.DataItem;

                System.Web.UI.WebControls.Image imgImage = e.FindControlAs <System.Web.UI.WebControls.Image>("imgImage");
                FieldRenderer frQuizName  = e.FindControlAs <FieldRenderer>("frQuizName");
                HyperLink     hypMoreLink = e.FindControlAs <HyperLink>("hypMoreLink");

                if (context != null)
                {
                    imgImage.ImageUrl = context.GetArticleThumbnailUrl(230, 129);;
                    frQuizName.Item   = context.InnerItem;

                    hypMoreLink.NavigateUrl = context.GetUrl();
                }
            }
        }
Exemple #18
0
        private void PopulateArticleInfo()
        {
            phAuthorInfo.Visible = false;

            if (_currentItem.InheritsTemplate(DefaultArticlePageItem.TemplateId))
            {
                DefaultArticlePageItem article = _currentItem;

                if (article.AuthorName.Item != null)
                {
                    frAuthorName.Item        = article.AuthorName.Item;
                    hlAuthorName.NavigateUrl = article.AuthorName.Item.GetUrl();
                    hlAuthorName.Text        = article.AuthorName.Item.Name;
                    phAuthorInfo.Visible     = true;
                }
            }

            //UNAO-434 - refactored to recursively go up the tree until it finds something to navigate back to
            this.SetBreadcrumb(Sitecore.Context.Item.Parent);
        }
Exemple #19
0
        public Dictionary <string, string> GetArticleFilters()
        {
            var filters = new Dictionary <string, string>();

            filters.Add(string.Empty, DictionaryConstants.Featured);

            // Popular
            var log = new ActivityLog();

            if (log.HasPopularArticlesBySubtopic(InnerItem))
            {
                filters.Add(Guid.Empty.ToString(), DictionaryConstants.PopularLabel);
            }

            // Article type filter
            var articles = this.InnerItem
                           .Children
                           .FilterByContextLanguageVersion();

            if (articles.Any())
            {
                // Grab unique article template ids for this subtopic
                var templates = articles.Select(x => x.TemplateID)
                                .Distinct();

                foreach (Sitecore.Data.ID templateId in templates)
                {
                    string label = DefaultArticlePageItem.GetArticleType(templateId);
                    if (!string.IsNullOrEmpty(label))
                    {
                        filters.Add(templateId.ToString(), label);
                    }
                    else
                    {
                        Sitecore.Diagnostics.Log.Info(String.Format("No article type found for template: {0}", templateId), this);
                    }
                }
            }

            return(filters);
        }
Exemple #20
0
        private void BindData(Item thePage)
        {
            string BlogId     = "";
            string BlogPostId = "";

            if (thePage.InheritsTemplate(DefaultArticlePageItem.TemplateId))
            {
                BlogId     = new DefaultArticlePageItem(thePage).BlogId.Raw;
                BlogPostId = new DefaultArticlePageItem(thePage).BlogPostId.Raw;
            }
            else if (thePage.InheritsTemplate(BehaviorToolsAdvicePageItem.TemplateId))
            {
                BlogId     = new BehaviorAdvicePageItem(thePage).BlogId.Raw;
                BlogPostId = new BehaviorAdvicePageItem(thePage).BlogPostId.Raw;
            }

            ActivityLog tempLog = new ActivityLog();
            //ContentId, ActivityValue
            int helpfulCount = tempLog.GetActivityCountByValue(new Guid(Sitecore.Context.Item.ID.ToString()), Constants.UserActivity_Values.FoundHelpful_True);
            int commentCount = 0;

            if (!string.IsNullOrEmpty(BlogId) && !string.IsNullOrEmpty(BlogPostId))
            {
                commentCount = CommunityHelper.GetTotalComments(BlogId, BlogPostId);
            }

            lblHelpfulCount.Text = lblHelpfulCountMobile.Text = helpfulCount.ToString();
            lblCommentCount.Text = lblCommentCountMobile.Text = commentCount.ToString();

            ltlFoundThisHelpful.Text = ltlFoundThisHelpfulMobile.Text = DictionaryConstants.FoundThisHelpful;

            string commentLabel = DictionaryConstants.PluralCommentLabel;

            if (commentCount == 1)
            {
                commentLabel = DictionaryConstants.SingleCommentLabel;
            }

            ltlComments.Text = ltlCommentsMobile.Text = commentLabel;
        }
Exemple #21
0
        protected void rptFeaturedArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem dataItem = (DefaultArticlePageItem)e.Item.DataItem;
                Repeater rptRow = e.FindControlAs <Repeater>("rptRow");

                if (TempList.Count < 2)
                {
                    TempList.Add(dataItem);
                    if (TempList.Count == 2)
                    {
                        rptRow.DataSource = TempList;
                        rptRow.DataBind();
                        TempList.Clear();
                    }
                    else if (e.Item.ItemIndex + 1 == ListTotal)
                    {
                        rptRow.DataSource = TempList;
                        rptRow.DataBind();
                    }
                }
            }
        }
 public AudioArticlePageItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
Exemple #23
0
 public AssessmentQuizArticlePageEndItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
Exemple #24
0
 public DeepDiveArticlePageItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
 public SlideshowArticlePageItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
Exemple #26
0
        protected void rptChildRelatedArticles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.IsItem())
            {
                DefaultArticlePageItem item = (DefaultArticlePageItem)e.Item.DataItem;
                {
                    HyperLink hlArticleImage = e.FindControlAs <HyperLink>("hlArticleImage");
                    HyperLink hlArticleTitle = e.FindControlAs <HyperLink>("hlArticleTitle");

                    hlArticleImage.NavigateUrl = hlArticleTitle.NavigateUrl = item.InnerItem.GetUrl();

                    Image imgThumbnail = e.FindControlAs <Image>("imgThumbnail");
                    imgThumbnail.ImageUrl = item.GetArticleThumbnailUrl(150, 85);

                    // DEBUG - START
                    Literal litDebugTag = e.FindControlAs <Literal>("litDebugTag");

                    StringBuilder sb = new StringBuilder();
                    sb.AppendLine("");
                    sb.AppendLine("Sitecore web db tagging:");
                    sb.AppendLine("Grades:");

                    foreach (var grade in item.ChildGrades.ListItems)
                    {
                        GradeLevelItem gli = grade;
                        sb.AppendLine(HttpUtility.HtmlDecode(gli.Name.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Issues:");

                    foreach (var issue in item.ChildIssues.ListItems)
                    {
                        ChildIssueItem cii = issue;
                        sb.AppendLine(HttpUtility.HtmlDecode(cii.IssueName.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Child Diagnoses:");

                    foreach (var diagnosis in item.ChildDiagnoses.ListItems)
                    {
                        ChildDiagnosisItem cdi = diagnosis;
                        sb.AppendLine(HttpUtility.HtmlDecode(cdi.DiagnosisName.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Interests:");

                    foreach (var interest in item.ApplicableInterests.ListItems)
                    {
                        ParentInterestItem pii = interest;
                        sb.AppendLine(HttpUtility.HtmlDecode(pii.InterestName.Raw));
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Evaluations:");

                    foreach (var itemEval in item.OtherApplicableEvaluations.ListItems)
                    {
                        sb.AppendLine(itemEval.Name);
                    }

                    sb.AppendLine("");

                    sb.AppendLine("Diagnosed:");

                    foreach (var diag in item.DiagnosedCondition.ListItems)
                    {
                        sb.AppendLine(diag.Name);
                    }

                    sb.AppendLine("");

                    bool excluded = item.OverrideType.ListItems
                                    .Where(x => x.ID == Sitecore.Data.ID.Parse(Constants.ArticleTags.ExcludeFromPersonalization))
                                    .FirstOrDefault() != null;

                    sb.AppendLine(String.Format("Exclude from Personalization: {0}", excluded.ToString().ToLower()));

                    bool mustRead = item.ImportanceLevel.ListItems
                                    .Where(x => x.ID == Sitecore.Data.ID.Parse(Constants.ArticleTags.MustRead))
                                    .FirstOrDefault() != null;

                    sb.AppendLine(String.Format("Must read: {0}", mustRead.ToString().ToLower()));

                    sb.AppendLine(String.Format("Timely: {0}", IsTimely(item.DateStart.DateTime, item.DateEnd.DateTime).ToString()));

                    sb.AppendLine("");



                    Article article = SearchHelper.GetArticle(item.ID);
                    if (article != null)
                    {
                        sb.AppendLine("Solr index:");
                        sb.AppendLine("Grades:");

                        foreach (var grade in article.ChildGrades)
                        {
                            GradeLevelItem gli = Sitecore.Context.Database.GetItem(grade.Guid);
                            if (gli != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(gli.Name.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Issues:");

                        foreach (var issue in article.ChildIssues)
                        {
                            ChildIssueItem cii = Sitecore.Context.Database.GetItem(issue.Guid);
                            if (cii != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(cii.IssueName.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Child Diagnoses:");

                        foreach (var diagnosis in article.ChildDiagnoses)
                        {
                            ChildDiagnosisItem cdi = Sitecore.Context.Database.GetItem(diagnosis.Guid);
                            if (cdi != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(cdi.DiagnosisName.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Interests:");

                        foreach (var interest in article.ParentInterests)
                        {
                            ParentInterestItem pii = Sitecore.Context.Database.GetItem(interest.Guid);
                            if (pii != null)
                            {
                                sb.AppendLine(HttpUtility.HtmlDecode(pii.InterestName.Raw));
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Evaluations:");

                        foreach (var itemEval in article.ApplicableEvaluations)
                        {
                            Item i = Sitecore.Context.Database.GetItem(itemEval);
                            if (i != null)
                            {
                                sb.AppendLine(i.Name);
                            }
                        }

                        sb.AppendLine("");

                        sb.AppendLine("Diagnosed:");

                        foreach (var diag in article.DiagnosedConditions)
                        {
                            Item i = Sitecore.Context.Database.GetItem(diag);
                            if (i != null)
                            {
                                sb.AppendLine(i.Name);
                            }
                        }

                        sb.AppendLine("");

                        bool excludedTag = article.OverrideTypes.Contains(Sitecore.Data.ID.Parse(Constants.ArticleTags.ExcludeFromPersonalization));

                        sb.AppendLine(String.Format("Exclude from Personalization: {0}", excludedTag.ToString().ToLower()));

                        bool mustReadTag = article.ImportanceLevels.Contains(Sitecore.Data.ID.Parse(Constants.ArticleTags.MustRead));
                        sb.AppendLine(String.Format("Must read: {0}", mustReadTag.ToString().ToLower()));

                        sb.AppendLine(String.Format("Timely: {0}", IsTimely(article.TimelyStart, article.TimelyEnd)));
                    }

                    litDebugTag.Text = String.Format("<!--{0}-->", sb.ToString());
                    // DEBUG - END
                }
            }
        }
 public SimpleExpertArticleItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
 public KnowledgeQuizQuestionArticlePageItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
Exemple #29
0
 public ActionStyleListPageItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }
 public KnowledgeQuizResultsArticlePageItem(Item innerItem) : base(innerItem)
 {
     _DefaultArticlePageItem = new DefaultArticlePageItem(innerItem);
 }