using System; using System.Data; using System.Web; using System.Web.UI; using CMS.GlobalHelper; using CMS.PortalControls; public partial class CMSWebParts_Syndication_AtomDataSource : CMSAbstractWebPart { #region "Properties" /// /// Gets or sets the Atom feed URL. /// public string AtomFeedUrl { get { return ValidationHelper.GetString(GetValue("AtomFeedUrl"), ""); } set { SetValue("AtomFeedUrl", value); srcXml.XmlUrl = value; } } /// /// Gets or sets the custom Atom XSD schema URL. /// public string AtomSchemaUrl { get { return ValidationHelper.GetString(GetValue("AtomSchemaUrl"), ""); } set { SetValue("AtomSchemaUrl", value); srcXml.XmlSchemaUrl = value; } } /// /// Gets or sets WHERE condition. /// public string WhereCondition { get { return ValidationHelper.GetString(GetValue("WhereCondition"), ""); } set { SetValue("WhereCondition", value); srcXml.WhereCondition = value; } } /// /// Gets or sets ORDER BY condition. /// public string OrderBy { get { return ValidationHelper.GetString(GetValue("OrderBy"), ""); } set { SetValue("OrderBy", value); srcXml.OrderBy = value; } } /// /// Gets or sets top N selected documents. /// public int TopN { get { return ValidationHelper.GetInteger(GetValue("TopN"), 0); } set { SetValue("TopN", value); srcXml.TopN = value; } } /// /// Gets or sets the source filter name. /// public string FilterName { get { return ValidationHelper.GetString(GetValue("FilterName"), ""); } set { SetValue("FilterName", value); srcXml.SourceFilterName = value; } } /// /// Gets or sets the cache item name. /// public override string CacheItemName { get { return base.CacheItemName; } set { base.CacheItemName = value; srcXml.CacheItemName = value; } } /// /// Cache dependencies, each cache dependency on a new line. /// public override string CacheDependencies { get { return ValidationHelper.GetString(base.CacheDependencies, srcXml.CacheDependencies); } set { base.CacheDependencies = value; srcXml.CacheDependencies = value; } } /// /// Gets or sets the cache minutes. /// public override int CacheMinutes { get { return base.CacheMinutes; } set { base.CacheMinutes = value; srcXml.CacheMinutes = value; } } #endregion #region "Methods" /// /// Content loaded event handler. /// public override void OnContentLoaded() { base.OnContentLoaded(); SetupControl(); } /// /// Initializes control properties. /// protected void SetupControl() { if (StopProcessing) { // Do nothing srcXml.StopProcessing = true; } else { srcXml.XmlUrl = AtomFeedUrl; srcXml.XmlSchemaUrl = AtomSchemaUrl; srcXml.WhereCondition = WhereCondition; srcXml.OrderBy = OrderBy; srcXml.TopN = TopN; srcXml.FilterName = ValidationHelper.GetString(GetValue("WebPartControlID"), ClientID); srcXml.SourceFilterName = FilterName; srcXml.CacheItemName = CacheItemName; srcXml.CacheDependencies = CacheDependencies; srcXml.CacheMinutes = CacheMinutes; srcXml.TableName = "entry"; } } /// /// Clears cache. /// public override void ClearCache() { srcXml.ClearCache(); } #endregion }