//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System.Collections;

using CommunityServer.Components;

namespace CommunityServer.Blogs.Components
{
    /// <summary>
    /// Generates an XML feed by a specific category
    /// </summary>
    public class WeblogCategoryRssWriter : WeblogRssWriter
    {
        public WeblogCategoryRssWriter(ArrayList posts, Weblog w, string baseUrl, PostCategory category):base(posts,w, baseUrl)
        {
            Category = category;
        }

        /// <summary>
        /// Appends the CategoryName to Title element
        /// </summary>
        protected override string Title
        {
            get
            {
                return base.Title + " : " + Category.Name;
            }
        }


        protected PostCategory Category = null;

        protected override bool AllowComments
        {
            get
            {
                return base.AllowComments && CurrentWeblog.EnableCommentsDefault;
            }
        }

        protected override void WriteChannel()
        {
            BuildChannel(BlogUrls.Instance().IndividualCategoryPage(CurrentSection.ApplicationKey,Category.CategoryID),Category.Description, CurrentWeblog.DefaultLanguage);
        }


        


    }
}
