using CMS.CMSHelper; using CMS.GlobalHelper; using CMS.PortalControls; public partial class CMSWebParts_Community_Groups_GroupsDataSource : CMSAbstractWebPart { #region "Properties" /// /// Gets or sets the site name. /// public string SiteName { get { return DataHelper.GetNotEmpty(GetValue("SiteName"), CMSContext.CurrentSiteName); } set { SetValue("SiteName", value); srcGroups.SiteName = value; } } /// /// Gets or sets WHERE condition. /// public string WhereCondition { get { return ValidationHelper.GetString(GetValue("WhereCondition"), ""); } set { SetValue("WhereCondition", value); srcGroups.WhereCondition = value; } } /// /// Gets or sets Select only approved. /// public bool SelectOnlyApproved { get { return ValidationHelper.GetBoolean(GetValue("SelectOnlyApproved"), true); } set { SetValue("SelectOnlyApproved", value); srcGroups.SelectOnlyApproved = value; } } /// /// Gets or sets ORDER BY condition. /// public string OrderBy { get { return ValidationHelper.GetString(GetValue("OrderBy"), ""); } set { SetValue("OrderBy", value); srcGroups.OrderBy = value; } } /// /// Gets or sets top N selected documents. /// public int SelectTopN { get { return ValidationHelper.GetInteger(GetValue("SelectTopN"), 0); } set { SetValue("SelectTopN", value); srcGroups.TopN = value; } } /// /// Gets or sets the source filter name. /// public string FilterName { get { return ValidationHelper.GetString(GetValue("FilterName"), ""); } set { SetValue("FilterName", value); srcGroups.SourceFilterName = value; } } /// /// Gest or sest the cache item name. /// public override string CacheItemName { get { return base.CacheItemName; } set { base.CacheItemName = value; srcGroups.CacheItemName = value; } } /// /// Cache dependencies, each cache dependency on a new line. /// public override string CacheDependencies { get { return ValidationHelper.GetString(base.CacheDependencies, srcGroups.CacheDependencies); } set { base.CacheDependencies = value; srcGroups.CacheDependencies = value; } } /// /// Gets or sets the cache minutes. /// public override int CacheMinutes { get { return ValidationHelper.GetInteger(GetValue("CacheMinutes"), 0); } set { SetValue("CacheMinutes", value); srcGroups.CacheMinutes = value; } } /// /// Gest or sets selected columns. /// public string Columns { get { return ValidationHelper.GetString(GetValue("Columns"), ""); } set { SetValue("Columns", value); srcGroups.SelectedColumns = value; } } #endregion #region "Methods" /// /// Content loaded event handler. /// public override void OnContentLoaded() { base.OnContentLoaded(); SetupControl(); } /// /// Initializes the control properties. /// protected void SetupControl() { if (StopProcessing) { // Do nothing } else { srcGroups.SiteName = SiteName; srcGroups.WhereCondition = WhereCondition; srcGroups.OrderBy = OrderBy; srcGroups.TopN = SelectTopN; srcGroups.FilterName = ID; srcGroups.SourceFilterName = FilterName; srcGroups.CacheItemName = CacheItemName; srcGroups.CacheDependencies = CacheDependencies; srcGroups.CacheMinutes = CacheMinutes; srcGroups.SelectOnlyApproved = SelectOnlyApproved; srcGroups.SelectedColumns = Columns; } } /// /// Clears cache. /// public override void ClearCache() { srcGroups.ClearCache(); } #endregion }