/// <summary>
        ///     The process request.
        /// </summary>
        /// <returns>
        ///     The <see cref="PipelineProcessorResponseValue" />.
        /// </returns>
        public override PipelineProcessorResponseValue ProcessRequest()
        {
            var url = _dialogLocator.GetDialogUrl(RequestContext.Item);

            if (!string.IsNullOrEmpty(url))
            {
                return(new PipelineProcessorResponseValue {
                    Value = url
                });
            }

            return(new PipelineProcessorResponseValue {
                AbortMessage = Translate.Text("Could not open the dialog.")
            });
        }
Example #2
0
        internal virtual void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (!_sheerResponse.CheckModified())
            {
                return;
            }

            BaseLayoutItem currentItem = DeserializeItems(args.Parameters["items"])[0];

            if (!args.IsPostBack)
            {
                var url = _dialogLocator.GetDialogUrl(currentItem);
                if (!string.IsNullOrEmpty(url))
                {
                    _sheerResponse.ShowModalDialog(url);
                    args.WaitForPostBack();
                }
                else
                {
                    _sheerResponse.Alert("Could not get the dialog URL.");
                }
            }
            else if (args.HasResult)
            {
                string message;
                if (_dialogResultProcessor.ProcessResult(currentItem, args.Result, out message))
                {
                    Refresh();
                }
                else
                {
                    _sheerResponse.Alert(string.IsNullOrEmpty(message)
                        ? "An unknown error occured while processing your selection."
                        : message);
                }
            }
        }