public override void DoProcess(GetPresentationDataSourcesArgs args)
        {
            if (!(args.RawDataSource.StartsWith("/") ||
                  args.RawDataSource.StartsWith("{")))
            {
                return;
            }

            foreach (string identifier in args.RawDataSource.Split('|'))
            {
                string[] parts = identifier.Split(':');
                SC.Diagnostics.Assert.IsTrue(parts.Length > 0, "parts > 0");
                SC.Diagnostics.Assert.IsTrue(parts.Length < 3, "parts < 3");
                SC.Data.Items.Item item = args.ContextItem.Database.GetItem(parts[0]);

                if (item != null)
                {
                    if (parts.Length > 1)
                    {
                        SC.Data.Fields.MultilistField field = item.Fields[parts[1]];

                        if (field == null || string.IsNullOrEmpty(field.Value))
                        {
                            continue;
                        }

                        args.DataSourceItems.AddRange(field.GetItems());
                        return;
                    }

                    args.DataSourceItems.Add(item);
                }
            }
        }
Beispiel #2
0
        public override void DoProcess(GetPresentationDataSourcesArgs args)
        {
            string query = args.RawDataSource;

            if (!(query.StartsWith("query:") || query.StartsWith(".")))
            {
                return;
            }

            if (query.StartsWith("query:"))
            {
                query = query.Substring("query:".Length);
            }

            SC.Data.Items.Item item = args.ContextItem;

            while (query.StartsWith("../"))
            {
                item  = item.Parent;
                query = query.Substring("../".Length);
            }

            if (query.StartsWith("./"))
            {
                query = query.Substring("./".Length);
            }

            if (!query.StartsWith("/"))
            {
                query = item.Paths.FullPath + "/" + query;
            }

            args.DataSourceItems.AddRange(item.Database.SelectItems(query));
        }
Beispiel #3
0
        public override void DoProcess(GetPresentationDataSourcesArgs args)
        {
            if (args.SearchContext == null)
            {
                args.SearchContext = CS.ContentSearchManager.CreateSearchContext(
                    new CS.SitecoreIndexableItem(SC.Context.Item));

                try
                {
                    this.InvokeQuery(args);
                }
                finally
                {
                    if (args.SearchContext != null && !args.StoreUISearchResults)
                    {
                        args.SearchContext.Dispose();
                        args.SearchContext = null;
                    }
                }

                return;
            }

            this.InvokeQuery(args);
        }
 override public void Process(GetPresentationDataSourcesArgs args)
 {
     SC.Diagnostics.Log.Info(this + " : Process()", this);
 }
 public override void DoProcess(GetPresentationDataSourcesArgs args)
 {
     throw new System.NotImplementedException();
 }