Exemple #1
0
 public void Process(GetLookupSourceItemsArgs args)
 {
     Assert.ArgumentNotNull(args, "args");
     if (IsScripted(args.Source))
     {
         var items  = new ItemList();
         var source = GetScriptedQueries(args.Source, args.Item, items);
         args.Result.AddRange(items.ToArray());
         if (string.IsNullOrEmpty(source))
         {
             args.AbortPipeline();
         }
     }
 }
        /// <summary>
        /// Process Method
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        public void Process(GetLookupSourceItemsArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (args.Source.StartsWith("code:"))
            {
                var itemArray = RunEnumeration(args.Source, args.Item);
                if (itemArray.IsNotNull() && (itemArray.Length > 0))
                {
                    args.Result.AddRange(itemArray);
                }

                args.AbortPipeline();
            }
        }
        /// <summary>
        /// Process Method
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        public void Process(GetLookupSourceItemsArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (args.Source.StartsWith("lucene:"))
            {
                var itemArray = RunEnumeration(args.Source, args.Item);
                if (itemArray.IsNotNull() && (itemArray.Length > 0))
                {
                    args.Result.AddRange(itemArray);
                }

                args.AbortPipeline();
            }
        }
 public void Process(GetLookupSourceItemsArgs args)
 {
     Assert.ArgumentNotNull(args, "args");
     if (IsScripted(args.Source))
     {
         var items = new ItemList();
         string source = GetScriptedQueries(args.Source, args.Item, items);
         args.Result.AddRange(items.ToArray());
         if (string.IsNullOrEmpty(source))
         {
             args.AbortPipeline();
         }
     }
 }
Exemple #5
0
        public void Process(GetLookupSourceItemsArgs args)
        {
            //should we care?
            if (HasLookup(args.Source))
            {
                var url = WebUtil.GetQueryString();

                if (string.IsNullOrWhiteSpace(url))
                {
                    return;
                }

                var fieldEditorOptions = FieldEditorOptions.Parse(new UrlString(url));
                var parameters         = fieldEditorOptions.Parameters;

                var currentItemId = parameters[Constants.FieldEditor.RenderingParameters.ContentItem];

                if (string.IsNullOrEmpty(currentItemId))
                {
                    return;
                }

                // get the context item.
                var contentItemUri = new ItemUri(currentItemId);

                var contextItem = Database.GetItem(contentItemUri);


                // get all item fields, filter out standard fields and order. maybe group by section in future?
                contextItem.Fields.ReadAll();
                var itemFields = contextItem.Fields.Where(f => !f.Name.StartsWith("__")).OrderBy(f => f.DisplayName);

                foreach (Field field in itemFields)
                {
                    // check if we support the field type
                    if (IsSupportedField(field))
                    {
                        args.Result.Add(field.InnerItem);
                    }
                }


                // if no other queries to be served, no need to continue pipeline
                args.AbortPipeline();
            }
        }
        public void Process(GetLookupSourceItemsArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (args.Source.StartsWith("code:"))
            {

                Item[] itemArray;
                string query = args.Source;

                itemArray = RunEnumeration(query, args.Item);

                if ((itemArray != null) && (itemArray.Length > 0))
                {
                    args.Result.AddRange(itemArray);
                }
                args.AbortPipeline();
            }
        }