Пример #1
0
        public void Execute()
        {
            var expiration = Sitecore.Configuration.Settings.GetIntSetting(ExpirationSetting, 20);
            var resultSig  = Guid.NewGuid().ToString();

            HttpContext.Current.Cache.Insert(resultSig, this, null,
                                             Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(expiration));

            if (!Modal)
            {
                var urlString = new UrlString();
                urlString.Add("sid", resultSig);
                var appItem = Database.GetDatabase("core").GetItem("/sitecore/content/Applications/PowerShell/PowerShellListView");
                var icon    = Icon ?? appItem.Appearance.Icon;
                Sitecore.Shell.Framework.Windows.RunApplication(appItem, icon, Title, urlString.Query);
            }
            else
            {
                var urlString = new UrlString(UIUtil.GetUri("control:PowerShellResultViewerList"));
                urlString.Add("sid", resultSig);

                var options = new ModalDialogOptions(urlString.ToString())
                {
                    Width  = Width,
                    Height = Height,
                    Header = Title
                };
                SheerResponse.ShowModalDialog(options);
            }
        }
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            string id       = args.Parameters[idParam];
            string db       = Sitecore.Context.ContentDatabase.Name;
            Item   i        = DataService.GetItemByIdValue(id, db);
            string langCode = i.Language.Name;
            string height   = args.Parameters[heightParam];
            string width    = args.Parameters[widthParam];
            string action   = (i.Paths.IsMediaItem) ? "ImageAnalysis" : "TextAnalysis";

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/CognitiveAnalysis/{action}?id={id}&language={langCode}&db={db}")
            {
                Header   = "Cognitive Analysis",
                Height   = height,
                Width    = width,
                Message  = "View the cognitive analysis of the current item",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #3
0
        protected void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            var id       = args.Parameters["id"].Replace("{", "").Replace("}", "");
            var db       = args.Parameters["database"];
            var language = Language.Parse(args.Parameters["language"]);
            var version  = args.Parameters["version"];
            var uri      = "/sitecore modules/shell/gathercontent/update/update.html";
            var path     = string.Format("{0}?id={1}&l={2}&v={3}&db={4}", uri, id, language, version, db);

#if SC72
            Context.ClientPage.ClientResponse.Broadcast(Context.ClientPage.ClientResponse.ShowModalDialog(path, "1600", "700", "Pull Updated Content from GatherContent", false), "Shell");
#else
            var options = new ModalDialogOptions(path)
            {
                Width       = "1600",
                Height      = "700",
                MinWidth    = "881",
                MinHeight   = "400",
                Maximizable = false,
                Header      = "Pull Updated Content from GatherContent"
            };

            Context.ClientPage.ClientResponse.Broadcast(Context.ClientPage.ClientResponse.ShowModalDialog(options), "Shell");
#endif
        }
Пример #4
0
        public void Execute()
        {
            var resultSig = Guid.NewGuid().ToString();

            HttpContext.Current.Cache[resultSig] = this;

            if (!Modal)
            {
                var urlString = new UrlString();
                urlString.Add("sid", resultSig);
                var appItem = Database.GetDatabase("core").GetItem("/sitecore/content/Applications/PowerShell/PowerShellListView");
                var icon    = Icon ?? appItem.Appearance.Icon;
                Sitecore.Shell.Framework.Windows.RunApplication(appItem, icon, Title, urlString.Query);
            }
            else
            {
                var urlString = new UrlString(UIUtil.GetUri("control:PowerShellResultViewerList"));
                urlString.Add("sid", resultSig);

                var options = new ModalDialogOptions(urlString.ToString())
                {
                    Width  = Width,
                    Height = Height,
                    Header = Title
                };
                SheerResponse.ShowModalDialog(options);
            }
        }
Пример #5
0
        protected void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            var id       = args.Parameters["id"].Replace("{", "").Replace("}", "");
            var language = Language.Parse(args.Parameters["language"]);
            var version  = args.Parameters["version"];
            var uri      = "/sitecore modules/shell/gathercontent/mappings/mappings.html";
            var path     = string.Format("{0}?id={1}&l={2}&v={3}", uri, id, language, version);

#if SC72
            Context.ClientPage.ClientResponse.Broadcast(Context.ClientPage.ClientResponse.ShowModalDialog(path, "1280", "500", "Manage template mappings", false), "Shell");
#else
            var options = new ModalDialogOptions(path)
            {
                Width       = "1280",
                Height      = "530",
                MinWidth    = "1280",
                MinHeight   = "530",
                Maximizable = false,
                Resizable   = false,
                Header      = "Manage template mappings"
            };

            Context.ClientPage.ClientResponse.Broadcast(Context.ClientPage.ClientResponse.ShowModalDialog(options), "Shell");
#endif
        }
Пример #6
0
        private async Task ShowCreateStickyNote()
        {
            var options = new ModalDialogOptions
            {
                Style = "modal-base",
                BackgroundClickToClose = false
            };
            ModalDialogResult modalResult = await ModalService.ShowDialogAsync <AddStickyNote>("Create a sticky note", options);

            var result = modalResult.ReturnParameters;

            if (!modalResult.Success)
            {
                return;
            }
            var note      = result.Get <StickyNote>("StickyNoteModel");
            var userNotes = LocalStorage.GetItem <UserStickyNotes>($"{AppState.UserName}-StickyNotes");

            if (userNotes == null || userNotes?.StickyNotes?.Count == 0)
            {
                AppState.UserStickyNotes ??= new UserStickyNotes {
                    UserName = AppState.UserName
                };
                AppState.UserStickyNotes.StickyNotes ??= new List <StickyNote>();
            }
            else
            {
                AppState.UserStickyNotes = userNotes;
            }
            AppState.UserStickyNotes.StickyNotes.Add(note);
            _selectOption = "Sticky";
            LocalStorage.SetItem($"{AppState.UserName}-StickyNotes", AppState.UserStickyNotes);
            AppState.StickyNote = note;
        }
Пример #7
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            string id       = args.Parameters[idParam];
            string db       = Sitecore.Context.ContentDatabase.Name;
            Item   i        = DataWrapper.GetItemByIdValue(id, db);
            string langCode = i.Language.Name;
            string height   = args.Parameters[heightParam];
            string width    = args.Parameters[widthParam];

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/CognitiveBot/OleChat?id={id}&language={langCode}&db={db}")
            {
                Header   = "Chat with Ole",
                Height   = height,
                Width    = width,
                Message  = "Chat with Ole, Sitecore's internal AI",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #8
0
 private async Task ShowMenu()
 {
     var option = new ModalDialogOptions
     {
         Style = "modal-dialog-appMenu",
     };
     var result = await ModalService.ShowDialogAsync <AppMenu>("Action Menu", option);
 }
 private static void ShowDatasourceSettingsDialog()
 {
   var urlString = new UrlString(Context.Site.XmlControlPage)
                   {
                     ["xmlcontrol"] = "DatasourceSettings"
                   };
   var dialogOptions = new ModalDialogOptions(urlString.ToString())
                       {
                         Response = true
                       };
   SheerResponse.ShowModalDialog(dialogOptions);
 }
 public void ShowImmediateWindow(UrlString url)
 {
     var options = new ModalDialogOptions(url.ToString())
     {
         Header = "Immediate Window",
         Resizable = true,
         Width = "800",
         Height = "600",
         Response = true
     };
     SheerResponse.ShowModalDialog(options);
 }
Пример #11
0
        private static void ShowDatasourceSettingsDialog()
        {
            var urlString = new UrlString(Context.Site.XmlControlPage)
            {
                ["xmlcontrol"] = "DatasourceSettings"
            };
            var dialogOptions = new ModalDialogOptions(urlString.ToString())
            {
                Response = true
            };

            SheerResponse.ShowModalDialog(dialogOptions);
        }
Пример #12
0
        public void ShowImmediateWindow(UrlString url)
        {
            var options = new ModalDialogOptions(url.ToString())
            {
                Header    = "Immediate Window",
                Resizable = true,
                Width     = "800",
                Height    = "600",
                Response  = true
            };

            SheerResponse.ShowModalDialog(options);
        }
Пример #13
0
        protected async Task <string> UpdateFromPublicRepo()
        {
            var option = new ModalDialogOptions
            {
                Style = "modal-dialog-githubform"
            };
            var result = await ModalService.ShowDialogAsync <GitHubForm>("Get code from a public Github Repo", option);

            if (!result.Success)
            {
                return(null);
            }
            string code = result.ReturnParameters.Get <string>("FileCode");

            return(code);
        }
        public void ShowSessionElevationWindow(UrlString url)
        {
            var options = new ModalDialogOptions(url.ToString())
            {
                Header      = string.Empty,
                Resizable   = false,
                Width       = "450",
                Height      = "400",
                Response    = true,
                Maximizable = false,
                Closable    = false,
                Message     = string.Empty
            };

            SheerResponse.ShowModalDialog(options);
        }
        protected void Run(ClientPipelineArgs args)
        {
            string text = args.Parameters["apiUrl"];

            Assert.IsNotNull((object)text, "apiUrl parameter cannot be empty");
            UrlString val = new UrlString(HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + text);

            Assert.IsNotNull((object)val, "Url string cannot be null");
            var options = new ModalDialogOptions(val.ToString())
            {
                Header = "Content Management " + args.Parameters["title"],
                Height = "450px",
                Width  = "800px"
            };

            Context.ClientPage.ClientResponse.ShowModalDialog(options);
        }
Пример #16
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentTagging/LearnType?id={Id}&language={Language}&db={Db}")
            {
                Header   = "Learn Type",
                Height   = "500",
                Width    = "810",
                Message  = "",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #17
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentMedia/ImageAnalysis?id={Id}&language={Language}&db={Db}")
            {
                Header   = "Cognitive Analysis",
                Height   = "550",
                Width    = "1100",
                Message  = "View the cognitive analysis of the current item",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #18
0
        /// <summary>
        /// Runs the pipeline.
        /// </summary>
        /// <param name="args">The arguments.</param>
        protected void Run(ClientPipelineArgs args)
        {
            string id       = args.Parameters["id"];
            string language = args.Parameters["language"];
            string version  = args.Parameters["version"];

            Item item = Context.ContentDatabase.Items[id, Language.Parse(language), Sitecore.Data.Version.Parse(version)];

            Error.AssertItemFound(item);

            if (!SheerResponse.CheckModified())
            {
                return;
            }

            if (args.IsPostBack)
            {
                if (args.Result != "undefined")
                {
                    Sitecore.Web.UI.Sheer.SheerResponse.Download(args.Result);
                }
            }

            else
            {
                UrlString urlString = new UrlString(UIUtil.GetUri("control:QuickPackage"));

                urlString.Add("id", item.ID.ToString());
                urlString.Add("la", item.Language.ToString());
                urlString.Add("vs", item.Version.ToString());

                ModalDialogOptions options = new ModalDialogOptions(urlString.ToString())
                {
                    MinWidth  = "550px",
                    Height    = "250px",
                    MinHeight = "250px",
                    Response  = true
                };

                SheerResponse.ShowModalDialog(options);
                args.WaitForPostBack();
            }
        }
        protected async void UpdateFromPublicRepo()
        {
            var option = new ModalDialogOptions
            {
                Style = "modal-dialog-githubform"
            };
            var result = await ModalService.ShowDialogAsync <GitHubForm>("Get code from a public Github Repo", option);

            if (result.Success)
            {
                string code = result.ReturnParameters.Get <string>("FileCode");
                CodeSnippet = code;
                CodeEditorService.CodeSnippet = code;
                //CodeEditorService.UpdateSnippet(code);
                isSelectSnippet = true;
            }

            await InvokeAsync(StateHasChanged);
        }
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentMedia/Analyze?id={Id}&language={Language}&db={Db}&overwrite=true")
            {
                Header   = "Cognitive Analysis",
                Height   = DataWrapper.GetFieldDimension(ContextItem, "height", 500, 56),
                Width    = DataWrapper.GetFieldDimension(ContextItem, "width", 810, 20),
                Message  = "View the cognitive analysis of the current item",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #21
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentMedia/AddFace?id={Id}&language={Language}&db={Db}")
            {
                Header   = "Add Face",
                Height   = "400",
                Width    = "650",
                Message  = "Add an image to a person for face training",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #22
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentMedia/ViewImageDescription?id={Id}&language={Language}&db={Db}")
            {
                Header   = "Set Alt Tag",
                Height   = "350",
                Width    = "475",
                Message  = "",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #23
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentMedia/IdentifyAllGroups?id={Id}&language={Language}&db={Db}")
            {
                Header   = "Identify All Group",
                Height   = "200",
                Width    = "400",
                Message  = "",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/Sitecore/Admin/XConnectDashboard.aspx")
            {
                Header   = "XConnect Rocks dashboard",
                Height   = "500",
                Width    = "810",
                Message  = "- for todays",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/OleChat/RestoreOle?id={Id}&language={Language}&db={Db}")
            {
                Header   = "Restore Ole",
                Height   = "200",
                Width    = "410",
                Message  = "Restore Ole",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #26
0
        public virtual void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            var groupId = ContextItem.Fields[Settings.FaceEntityIdFieldId]?.Value;

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/IntelligentMedia/TrainGroup?groupId={groupId}&id={Id}&db={Db}")
            {
                Header   = "Train Group",
                Height   = "200",
                Width    = "400",
                Message  = "",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #27
0
        protected void Run(ClientPipelineArgs args)
        {
            if (args.IsPostBack)
            {
                return;
            }

            string height = args.Parameters[heightParam];
            string width  = args.Parameters[widthParam];

            ModalDialogOptions mdo = new ModalDialogOptions($"/SolrAnalyzer/Query/QueryAnalysis")
            {
                Header   = "Query Analyzer Analysis",
                Height   = height,
                Width    = width,
                Message  = "Solr Query Analysis",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
        private async Task ShowChatContent()
        {
            isNewChat = false;
            var parameters = new ModalDialogParameters
            {
                { "ChatContent", ChatContent }
            };
            var options = new ModalDialogOptions
            {
                Position = ModalDialogPositionOptions.TopRight,
                BackgroundClickToClose = false
            };
            bool isClear = false;
            var  result  = await ModalService.ShowDialogAsync <ChatDisplay>("Chat Messages", options, parameters);

            if (result.Success)
            {
                isClear = result.ReturnParameters.Get <bool>("IsClear");
            }

            ChatContent = isClear ? string.Empty : ChatContent;
        }
Пример #29
0
 protected void OpenDevicePipeline(ClientPipelineArgs args)
 {
     Assert.ArgumentNotNull(args, "args");
     if (args.IsPostBack)
     {
         if (!string.IsNullOrEmpty(args.Result) && (args.Result != "undefined"))
         {
             XmlDocument doc = XmlUtil.LoadXml(WebUtil.GetSessionString("SC_DEVICEEDITOR"));
             WebUtil.SetSessionValue("SC_DEVICEEDITOR", null);
             if (doc != null)
             {
                 this.SetActiveLayout(GetLayoutValue(doc));
             }
             else
             {
                 this.SetActiveLayout(string.Empty);
             }
             this.Refresh();
         }
     }
     else
     {
         XmlDocument document2 = this.GetDoc();
         WebUtil.SetSessionValue("SC_DEVICEEDITOR", document2.OuterXml);
         UrlString str = new UrlString(UIUtil.GetUri("control:DeviceEditor"));
         str.Append("de", StringUtil.GetString(new string[] { args.Parameters["deviceid"] }));
         str.Append("id", WebUtil.GetQueryString("id"));
         str.Append("vs", WebUtil.GetQueryString("vs"));
         str.Append("la", WebUtil.GetQueryString("la"));
         ModalDialogOptions options = new ModalDialogOptions(str.ToString())
         {
             Response = true,
             Width    = "700"
         };
         Context.ClientPage.ClientResponse.ShowModalDialog(options);
         args.WaitForPostBack();
     }
 }
        protected void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (!SheerResponse.CheckModified())
            {
                return;
            }

            //var testConnectionManager = new TestConnectionManager();
            //bool testConnection = testConnectionManager.TestConnection();

            //don't want to add a bunch of references and IoC-related code here, lets test whole controller :-/
            string          testUrl    = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Authority + "/api/sitecore/mappings/try";
            HttpWebRequest  webrequest = WebRequest.Create(testUrl) as HttpWebRequest;
            HttpWebResponse response   = webrequest.GetResponse() as HttpWebResponse;
            bool            success    = response.StatusCode == HttpStatusCode.OK;

            var uri = "/sitecore modules/shell/gathercontent/testconnection/testconnection.html";

            var path = string.Format("{0}?success={1}", uri, success);

#if SC72
            Context.ClientPage.ClientResponse.Broadcast(Context.ClientPage.ClientResponse.ShowModalDialog(path, "250", "100", "Test Connection", false), "Shell");
#else
            var options = new ModalDialogOptions(path)
            {
                Width       = "250",
                Height      = "100",
                MinWidth    = "250",
                MinHeight   = "100",
                Maximizable = false,
                Header      = "Test Connection"
            };

            Context.ClientPage.ClientResponse.Broadcast(Context.ClientPage.ClientResponse.ShowModalDialog(options), "Shell");
#endif
        }
Пример #31
0
        private async Task SaveUserSnippet(string snippet)
        {
            if (!AppState.HasUser)
            {
                var result = await ModalService.ShowDialogAsync <LoginProvider>("Sign-in to Save");

                if (!result.Success)
                {
                    return;
                }
            }
            var    inputForm    = new ModalDataInputForm("Save User Snippet", "what should we call this code snippet?");
            var    snippetField = inputForm.AddStringField("Name", "Snippet Name", "");
            string snippetName  = "";
            var    options      = new ModalDialogOptions()
            {
                Style = "small-modal"
            };

            if (await inputForm.ShowAsync(ModalService, options))
            {
                snippetName = snippetField.Value;
            }
            var newSnippet = new UserSnippet
            {
                Name    = snippetName,
                Snippet = snippet
            };
            var userData = AppState.UserAppData;

            userData.Snippets.Add(newSnippet);
            AppState.UpdateUserAppData(userData);
            var requestResult = await PublicClient.AddUserSnippet(AppState.UserName, newSnippet);

            isSnippetSaving = false;
            message         = requestResult ? $"Successfully saved snippet: {snippetName}" : "Save snippet failed";
            StateHasChanged();
        }
        protected static void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (args.IsPostBack)
            {
                return;
            }

            var itemId   = ID.Parse(args.Parameters["itemid"]);
            var language = Language.Parse(args.Parameters["language"]);
            var version  = Sitecore.Data.Version.Parse(args.Parameters["version"]);
            var fieldId  = ID.Parse(args.Parameters["fieldId"]);

            Database database = Context.ContentDatabase ?? Context.Database;

            Assert.IsNotNull(database, "database");

            Item       ctxItem = database.GetItem(itemId, language, version);
            ImageField field   = ctxItem?.Fields[fieldId];

            if (field?.MediaItem == null)
            {
                return;
            }

            ModalDialogOptions mdo = new ModalDialogOptions($"/SitecoreCognitiveServices/CognitiveImageSearch/ImageAnalysis?id={field.MediaItem.ID}&language={language.Name}&db={database.Name}")
            {
                Header   = "Cognitive Analysis",
                Height   = DataWrapper.GetFieldDimension(field.MediaItem, "height", 500, 60),
                Width    = DataWrapper.GetFieldDimension(field.MediaItem, "width", 810, 41),
                Message  = "View the cognitive analysis of the current item",
                Response = true
            };

            SheerResponse.ShowModalDialog(mdo);
            args.WaitForPostBack();
        }
Пример #33
0
 public void ImmediateWindowPipeline(ClientPipelineArgs args)
 {
     if (!args.IsPostBack)
     {
         var session = ScriptSessionManager.GetSession(Monitor.SessionID);
         UrlString url = new UrlString(UIUtil.GetUri("control:PowerShellConsole"));
         url.Parameters["id"] = session.Key;
         var options = new ModalDialogOptions(url.ToString())
         {
             Header = "Immediate Window",
             Resizable = true,
             Width = "800",
             Height = "600",
             Response = true
         };
         Monitor.Active = false;
         SheerResponse.ShowModalDialog(options);
         args.WaitForPostBack(true);
     }
     else
     {
         Monitor.Active = true;
     }
 }
        /// <summary>
        /// Runs the pipeline.
        /// </summary>
        /// <param name="args">The arguments.</param>
        protected void Run(ClientPipelineArgs args)
        {
            string id = args.Parameters["id"];
            string language = args.Parameters["language"];
            string version = args.Parameters["version"];

            Item item = Context.ContentDatabase.Items[id, Language.Parse(language), Sitecore.Data.Version.Parse(version)];
            Error.AssertItemFound(item);

            if (!SheerResponse.CheckModified())
            {
                return;
            }

            if (args.IsPostBack)
            {
                if (args.Result != "undefined")
                {
                    Sitecore.Web.UI.Sheer.SheerResponse.Download(args.Result);
                }
            }

            else
            {
                UrlString urlString = new UrlString(UIUtil.GetUri("control:QuickPackage"));

                urlString.Add("id", item.ID.ToString());
                urlString.Add("la", item.Language.ToString());
                urlString.Add("vs", item.Version.ToString());

                ModalDialogOptions options = new ModalDialogOptions(urlString.ToString())
                {
                    MinWidth = "550px",
                    Height = "250px",
                    MinHeight = "250px",
                    Response = true
                };

                SheerResponse.ShowModalDialog(options);
                args.WaitForPostBack();
            }
        }