public virtual void Process( SC.Sharedsource.Pipelines.GetPresentationDataSources.GetPresentationDataSourcesArgs args) { if (args.UISearchResults != null || args.SearchResultIDs != null || args.DataSourceItems != null) { return; } this.DoProcess(args); }
public override void DoProcess( SC.Sharedsource.Pipelines.GetPresentationDataSources.GetPresentationDataSourcesArgs args) { Assert.ArgumentNotNull(args, "args"); if (!string.IsNullOrEmpty(args.RawDataSource)) { return; } args.DataSourceItems.Add(SC.Context.Item); }
private void InvokeQuery( SC.Sharedsource.Pipelines.GetPresentationDataSources.GetPresentationDataSourcesArgs args) { if (args.StoreUISearchResults) { args.UISearchResults = CS.Utilities.LinqHelper.CreateQuery( args.SearchContext, SC.Buckets.Util.UIFilterHelpers.ParseDatasourceString(args.RawDataSource)) .Filter(language => language.Language == SC.Context.Language.CultureInfo.TwoLetterISOLanguageName); } if (args.StoreSearchResultIDs) { if (args.UISearchResults != null) { args.SearchResultIDs = args.UISearchResults.Select(item => item.Id).ToArray(); } else { args.SearchResultIDs = CS.Utilities.LinqHelper.CreateQuery( args.SearchContext, SC.Buckets.Util.UIFilterHelpers.ParseDatasourceString(args.RawDataSource)) .Filter(language => language.Language == SC.Context.Language.CultureInfo.TwoLetterISOLanguageName) .Select(item => item.Id) .ToArray(); } } if (args.SearchResultIDs != null || args.UISearchResults != null) { return; } if (args.DataSourceItems == null) { args.DataSourceItems = new List <SC.Data.Items.Item>(); } args.DataSourceItems.AddRange( CS.Utilities.LinqHelper.CreateQuery( args.SearchContext, SC.Buckets.Util.UIFilterHelpers.ParseDatasourceString(args.RawDataSource)) .Filter(language => language.Language == SC.Context.Language.CultureInfo.TwoLetterISOLanguageName) .Select(item => item.GetItem())); }
/// <summary> /// Invoke the pipeline if not previously invoked /// or if forced. /// </summary> /// <param name="force">Force invocation /// even if previously invoked.</param> private void ManagePipeline(bool force) { if (this.PipelineInvoked && !force) { return; } SC.Sharedsource.Pipelines.GetPresentationDataSources.GetPresentationDataSourcesArgs args = new SC.Sharedsource.Pipelines.GetPresentationDataSources.GetPresentationDataSourcesArgs( this.RawDataSource, this.ContextItem, this.StoreUISearchResults, this.StoreSearchResultIDs, this.SearchContext); SC.Pipelines.CorePipeline.Run("getPresentationDataSources", args); this.PipelineInvoked = true; if (this.StoreSearchResultIDs) { this._searchResultIDs = args.SearchResultIDs; } if (this.StoreUISearchResults) { this._uiSearchResults = args.UISearchResults; } if (args.DataSourceItems != null && args.DataSourceItems.Count > 0) { this._items = args.DataSourceItems.ToArray(); } }
public abstract void DoProcess( SC.Sharedsource.Pipelines.GetPresentationDataSources.GetPresentationDataSourcesArgs args);