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

using System;
using System.Collections;
using CommunityServer.Components;

namespace CommunityServer.Blogs.Components
{
	/// <summary>
	/// Summary description for WeblogCommentRssWriter.
	/// </summary>
	public class WeblogCommentRssWriter : BaseWeblogRssWriter
	{
		public WeblogCommentRssWriter(WeblogPost post, ArrayList posts, Weblog w, string baseUrl):base(posts,w, baseUrl)
		{
			CurrentPost = post;
		}

		protected WeblogPost CurrentPost = null;


		protected override void WriteChannel()
		{
			string desc = CurrentPost.HasExcerpt ? CurrentPost.Excerpt :  CurrentPost.RenderedBody(PostTarget.Syndication);
			desc = Formatter.RemoveHtml(desc,250);
			BuildChannel(BlogUrls.Instance().Post(CurrentPost),desc, CurrentWeblog.DefaultLanguage);
		}

		protected override string Title
		{
			get
			{
				return CurrentPost.Subject;
			}
		}

		protected override void PostComments(Post p)
		{
			
		}

		protected override string BuildLink(Post p)
		{
			return BlogUrls.Instance().Post(CurrentPost, CurrentWeblog, p as WeblogPost);
		}


	}
}
