public override NextCall Invoke(WorkflowMethod invoker) { _lcid = GetSecureInput<int>(); var cfd = new ContentFormDefinition(); ShortStringPropertySettings settings = new ShortStringPropertySettings(); settings.Items = new Dictionary<string, CsdStringSetting>(); settings.ControlType = ShortStringControlType.DropDown; ContentDefinition def = WAFContext.GetTemporaryLocalDefinition(); var cultures = from c in CultureInfo.GetCultures(CultureTypes.AllCultures) orderby c.EnglishName select c; foreach (CultureInfo ci in cultures) { if (!settings.Items.ContainsKey(ci.LCID.ToString())) settings.Items.Add(ci.LCID.ToString(), new CsdStringSetting(ci.EnglishName + (_lcid == ci.LCID ? " [Current] " : def.Culture.ContainsKey(ci.LCID) ? " [Used] " : "") + " " + ci.LCID)); } cfd.AddPropertyShortString("newLCID", "New LCID", _lcid.ToString(), null, settings); string caption = "Please select the LCID you want to change to:"; var cf = new WMContentForm(DialogueIcon.Question, caption, 600, 50, cfd); return new NextCall(cf, onComplete); }
NextCall directlyViaHttp(WorkflowMethod invoker) { ContentFormDefinition cfd = new ContentFormDefinition(); if (downloadError != null) { cfd.AddPropertyHeading(null, "<br /><font color=red>" + HttpUtility.HtmlEncode(downloadError) + "</font><br /><br />", false, true, true); } else { cfd.AddPropertyHeading(null, "<br /><br />", false, true, true); } downloadError = null; cfd.AddPropertyShortString("url", "Site URL", Session.GetSetting<string>("MergeDef.Url", PersistenceScope.Application, "http://"), true); cfd.AddPropertyShortString("username", "Admin Username"); cfd.AddPropertyShortString("password", "Admin Password", null, null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password }); var diag = new WMContentForm(DialogueIcon.None, "Please provide connection details:", 400, 130, cfd); return new NextCall(diag, onDirectlyViaHttpAnswer); }
public override NextCall Invoke(WorkflowMethod invoker) { var cfd = new ContentFormDefinition(); cfd.AddPropertyHeading("Please provide a definition file", "The new ontology will be merged with the existing one, but you will be able to review all changes before they take place." + "<br/><br/>" + "IMPORTANT: Remember to do a \"Full Rebuild\" on both installations before you perform a merge. " + "<br/><br/>", false, false, true); cfd.AddPropertyCheckBox("useNames", "Do not use Guids"); WMContentForm q = new WMContentForm(DialogueIcon.Question, null, 370, 150, cfd, new string[] { "Directly via HTTP", "Upload file", "Paste XML" }, true); //WMQuestion q = new WMQuestion(DialogueIcon.Question, UIButtons.Cancel, // new string[] { "Directly via HTTP", "Upload file", "Paste XML" }, // "Please provide a definition file", // "The new ontology will be merged with the existing one, but you will be able to review all changes before they take place." // + Environment.NewLine + Environment.NewLine // + "IMPORTANT: Remember to do a \"Full Rebuild\" on both installations before you perform a merge. " // + Environment.NewLine + Environment.NewLine // ); return new NextCall(q, onAnswer); }
public override NextCall Invoke(WorkflowMethod invoker) { WFContext.Caption = "Editing definitions..."; WFContext.InBackgroundMode = true; ContentFormDefinition cfd = new ContentFormDefinition(); LongStringPropertySettings settings = new LongStringPropertySettings(); settings.Width = Unit.Percentage(100); settings.Height = Unit.Percentage(99); settings.Layout = PropertyLayout.NoTitle; settings.Enabled = false; string xmlText = File.ReadAllText(WAFContext.PathCustomDefinitions + "ContentDefinitionsNoIds.xml"); cfd.AddPropertyLongString("xmlText", null, xmlText, null, settings); WMContentForm diag = new WMContentForm(DialogueIcon.None, "Please select and copy this text:", 720, 400, cfd, new string[] { "Close" }, false); return new NextCall(diag); }
public override NextCall Invoke(WorkflowMethod invoker) { WFContext.InBackgroundMode = false; ContentFormDefinition cfd = new ContentFormDefinition(); cfd.AddPropertyCheckBox("includeDatabase", "Database", _includeDatabase); cfd.AddPropertyCheckBox("includeContentFiles", "Content files", _includeContentFiles); cfd.AddPropertyCheckBox("includeSettings", "Settings", _includeSettings); cfd.AddPropertyCheckBox("includeSearchIndex", "Search index", _includeSearchIndex); cfd.AddPropertyCheckBox("includeDefinitions", "Definitions", _includeDefinitions); cfd.AddPropertyCheckBox("includeAppCode", "Application code", _includeAppCode); cfd.AddPropertyCheckBox("includeTemplates", "Templates", _includeTemplates); cfd.AddPropertyCheckBox("includeWAF", "WAF", _includeWAF); cfd.AddPropertyCheckBox("includeOther", "All other files", _includeOther); WMContentForm cf = new WMContentForm(DialogueIcon.Question, "Please select data to include:", 200, 230, cfd); return new NextCall(cf, onSelected); }
NextCall edit(WorkflowMethod invoker) { WFContext.Caption = "Editing webfram settings..."; WFContext.InBackgroundMode = true; ContentFormDefinition cfd = new ContentFormDefinition(); try { { var settings = new ShortStringPropertySettings(); settings.Enabled = false; cfd.AddPropertyShortString("guid", "This server GUID", WAFRuntime.WebFarm.ThisServer.Guid.ToString(), null, settings); } { var settings = new ShortStringPropertySettings(); settings.Enabled = false; cfd.AddPropertyShortString("name", "This server Name", WAFRuntime.WebFarm.ThisServer.Name, null, settings); } } catch { } { var settings = new LongStringPropertySettings(); settings.Width = Unit.Percentage(100); settings.Height = Unit.Percentage(99); settings.Layout = PropertyLayout.NoTitle; cfd.AddPropertyLongString("xmlText", null, WAFRuntime.WebFarm.GetConfig(), null, settings); } WMContentForm diag = new WMContentForm(DialogueIcon.None, "Web farm settings:", 720, 400, cfd, new string[] { "Save", "Refresh", "Restart all servers", "Close" }, false); return new NextCall(diag, onComplete); }
NextCall editIds() { ContentFormDefinition cfd = new ContentFormDefinition(); StringBuilder sb = new StringBuilder(); foreach (var id in _nodeIds) { sb.Append(id); sb.Append("; "); } cfd.AddPropertyLongString("ids", "Node IDs or Guids", sb.ToString(), null, new LongStringPropertySettings() { Height = 100, Layout = PropertyLayout.TwoRows, Focus = true }); var diag = new WMContentForm(DialogueIcon.Question, "Please specify the nodes to export", 600, 120, cfd, new string[] { "Export", "Pick IDs", "Verify IDs", "Convert to Guids", "Convert to Node IDs" }, true); return new NextCall(diag, onAnswer); }
public override NextCall Invoke(WorkflowMethod invoker) { var cfd = new ContentFormDefinition(); cfd.AddPropertyShortString("node_id", "Node ID", "", true); var diag = new WMContentForm(DialogueIcon.Question, "Ensuring data integrity of one node", 400, 50, cfd); return new NextCall(diag, onAnswer); }
NextCall edit(WorkflowMethod invoker) { WFContext.Caption = "Editing definitions..."; WFContext.InBackgroundMode = true; ContentFormDefinition cfd = new ContentFormDefinition(); LongStringPropertySettings settings = new LongStringPropertySettings(); settings.Width = Unit.Percentage(100); settings.Height = Unit.Percentage(99); settings.Layout = PropertyLayout.NoTitle; cfd.AddPropertyLongString("xmlText", null, _xmlText, null, settings); WMContentForm diag = new WMContentForm(DialogueIcon.None, "The content of the temporary definition file:", 720, 400, cfd, new string[] { "Save...", "Validate hot...", "Validate full...", "Hot rebuild...", "Full rebuild...", "Close" }, false); return new NextCall(diag, onComplete); }
public override NextCall Invoke(WorkflowMethod invoker) { _find = Session.GetSetting<string>(this.GetType().FullName + "_find", PersistenceScope.UserSession, ""); _replace = Session.GetSetting<string>(this.GetType().FullName + "_replace", PersistenceScope.UserSession, ""); _where = Session.GetSetting<string>(this.GetType().FullName + "_where", PersistenceScope.UserSession, "allContent"); _caseSensitive = Session.GetSetting<bool>(this.GetType().FullName + "_caseSensitive", PersistenceScope.UserSession, false); _searchHtmlSource = Session.GetSetting<bool>(this.GetType().FullName + "_searchHtmlSource", PersistenceScope.UserSession, false); _allRevision = Session.GetSetting<bool>(this.GetType().FullName + "_allRevisions", PersistenceScope.UserSession, false); _allCultures = Session.GetSetting<bool>(this.GetType().FullName + "_allCultures", PersistenceScope.UserSession, false); _allSites = Session.GetSetting<bool>(this.GetType().FullName + "_allSites", PersistenceScope.UserSession, false); ContentFormDefinition cfd = new ContentFormDefinition(); cfd.AddPropertyShortString("find", Local.Text("Web.WAF.Edit.ContentFind"), _find); cfd.AddPropertyShortString("replace",Local.Text("Web.WAF.Edit.ContentReplace"), _replace); ShortStringPropertySettings s = new ShortStringPropertySettings(); s.ControlType = ShortStringControlType.DropDown; s.Items = new Dictionary<string, CsdStringSetting>(); s.Items.Add("allContent", new CsdStringSetting(Local.Text("Web.WAF.Edit.ContentAnyContent"))); s.Items.Add("selectedContent", new CsdStringSetting(Local.Text("Web.WAF.Edit.ContentSelectedContents"))); s.Items.Add("selectTypes", new CsdStringSetting(Local.Text("Web.WAF.Edit.ContentSelectedTypes"))); cfd.AddPropertyShortString("where",Local.Text("Web.WAF.Edit.ContentWhere"), _where, null, s); cfd.AddPropertyCheckBox("caseSensitive", Local.Text("Web.WAF.Edit.ContentMatchCase"), _caseSensitive); cfd.AddPropertyCheckBox("searchHtmlSource", Local.Text("Web.WAF.Edit.ContentHtmlSource"), _searchHtmlSource); cfd.AddPropertyCheckBox("allRevisions",Local.Text("Web.WAF.Edit.ContentAllRevisions"), _allRevision); cfd.AddPropertyCheckBox("allCultures", Local.Text("Web.WAF.Edit.ContentAllLanguages"), _allCultures); cfd.AddPropertyCheckBox("allSites",Local.Text("Web.WAF.Edit.ContentAllSites"), _allSites); cfd.AddPropertyHeading("", "<br /><font color=\"gray\">" + Local.Text("Web.WAF.Edit.ContentWarningHtml") + "</font>", false, false, true); string[] buttons = new string[] {Local.Text("Web.WAF.Edit.ContentFind...") }; WMContentForm contentFormDiag = new WMContentForm(DialogueIcon.Question, Local.Text("Web.WAF.Edit.ContentFindAndReplace"), 400, 220, cfd, buttons, true); return new NextCall(contentFormDiag, onCompleteStep1); }
public override NextCall Invoke(WorkflowMethod invoker) { if (!Session.Access.IsAdmin()) throw new AccessViolationException(); ContentFormDefinition cfd = new ContentFormDefinition(); cfd.AddPropertyShortString("FolderName", "Folder name", _newFolderName); WMContentForm cf = new WMContentForm(DialogueIcon.Info, "Create new folder:", 400, 30, cfd); return new NextCall(cf, onFormComplete); }
public override NextCall Invoke(WorkflowMethod invoker) { if (!Session.Access.IsAdmin()) throw new AccessViolationException(); ContentFormDefinition cfd = new ContentFormDefinition(); cfd.AddPropertyShortString("FolderName", Local.Text("Web.WAF.Edit.ExplorerFolderName"), _newFolderName); WMContentForm cf = new WMContentForm(DialogueIcon.Info, Local.Text("Web.WAF.Edit.ExplorerCreateNewFolder"), 400, 30, cfd); return new NextCall(cf, onFormComplete); }
NextCall edit(WorkflowMethod invoker) { WFContext.Caption = "Editing webfram settings..."; WFContext.InBackgroundMode = true; ContentFormDefinition cfd = new ContentFormDefinition(); { cfd.AddPropertyHeading("", " ", false, true, true); } { var settings = new LongStringPropertySettings(); settings.Width = Unit.Percentage(100); settings.Height = Unit.Pixel(200); settings.Enabled = true; cfd.AddPropertyLongString("config", "WebFarm.config", WAFRuntime.WebFarm.GetConfig(), null, settings); } { var settings = new ShortStringPropertySettings(); settings.Enabled = false; cfd.AddPropertyShortString("proguid", "This process GUID", WAFRuntime.WebFarm.ThisProcessGuid.ToString(), null, settings); settings = new ShortStringPropertySettings(); settings.Enabled = false; cfd.AddPropertyShortString("insguid", "This installation GUID", WAFRuntime.WebFarm.ThisInstallationGuid.ToString(), null, settings); settings = new ShortStringPropertySettings(); settings.Enabled = false; cfd.AddPropertyShortString("instname", "This installation name", WAFRuntime.WebFarm.ThisInstallationName, null, settings); } { StringBuilder sb = new StringBuilder(); sb.Append("<div> </div>"); sb.Append("<table cellpadding=\"0\" cellspacing=\"0\">"); sb.Append("<tr>"); sb.Append("<td style=\"font-size:9px; color:gray; width:220px;\">INSTALLATION</td>"); sb.Append("<td style=\"font-size:9px; color:gray; width:120px;\">CONTACT</td>"); sb.Append("<td style=\"font-size:9px; color:gray; width:130px; text-align:right;\">PAGEVIEWS / MINUTE</td>"); sb.Append("<td style=\"font-size:9px; color:gray; width:140px; text-align:right;\">REQUESTS / MINUTE</td>"); sb.Append("</tr>"); sb.Append("<tr>"); sb.Append("<td style=\"font-size:9px; \"> </td>"); sb.Append("</tr>"); var now = DateTime.Now; foreach (var p in WAFRuntime.WebFarm.Processes.OrderBy(p => p.Installation.Name)) { sb.Append("<tr>"); sb.Append("<td><span title=\"Installation ID: " + p.Installation.Guid + " Process ID: " + p.Guid + "\">" + p.Installation.Name + "</span></td>"); sb.Append("<td>" + Utils.GetTimespanString(now.Subtract(p.LastPing)) + " ago</td>"); sb.Append("<td style=\"text-align:right;\">" + p.Installation.PageViewsPerMinute.Count.ToString("### ##0") + "</td>"); sb.Append("<td style=\"text-align:right;\">" + p.Installation.RequestsPerMinute.Count.ToString("### ##0") + "</td>"); sb.Append("</tr>"); } sb.Append("</table>"); cfd.AddPropertyHeading("", sb.ToString(), false, true, true); } WMContentForm diag = new WMContentForm(DialogueIcon.None, "Web farm settings:", 720, 450, cfd, new string[] { "Refresh", "Save & Restart", "Close" }, false); return new NextCall(diag, onComplete); }
public override NextCall Invoke(WorkflowMethod invoker) { var cfd = new ContentFormDefinition(); ScheduledTask task = Session.GetContent<ScheduledTask>(_taskNodeId); //cfd.AddPropertyCheckBox("Enabled", "Enabled", task.Enabled); cfd.AddPropertyShortString("Typename", "Typename", task.TypeName, true); cfd.AddPropertyShortString("FriendlyName", "Friendly name", task.FriendlyName, false); var intervalOptions = new Dictionary<string, CsdStringSetting>(); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Continuous).ToString(), new CsdStringSetting("CONTINOUSLY, with below interval as break between each run")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Minute).ToString(), new CsdStringSetting("MINUTE, but delay each start with interval below")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Hour).ToString(), new CsdStringSetting("HOUR, but delay each start with interval below")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Day).ToString(), new CsdStringSetting("DAY, but delay each start with interval below")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Week).ToString(), new CsdStringSetting("WEEK, but delay each start with interval below")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Month).ToString(), new CsdStringSetting("MONTH, but delay each start with interval below")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Quarter).ToString(), new CsdStringSetting("QUARTER, but delay each start with interval below")); intervalOptions.Add(((int)TaskShedulerIntervalUnit.Year).ToString(), new CsdStringSetting("YEAR, but delay each start with interval below")); cfd.AddPropertyShortString("IntervalUnit", "Run every", ((int)task.IntervalUnit).ToString(), null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.DropDown, Items = intervalOptions }); int secs; string startAtUnit; if (task.StartAt == 0) { startAtUnit = "Seconds"; secs = 0; } else if (task.StartAt % (60 * 60 * 24) == 0) { startAtUnit = "Days"; secs = task.StartAt / (60 * 60 * 24); } else if (task.StartAt % (60 * 60) == 0) { startAtUnit = "Hours"; secs = task.StartAt / (60 * 60); } else if (task.StartAt % 60 == 0) { startAtUnit = "Minutes"; secs = task.StartAt / 60; } else { startAtUnit = "Seconds"; secs = task.StartAt; } cfd.AddPropertyInteger("StartAt", "Interval", secs); var startAtOptions = new Dictionary<string, CsdStringSetting>(); startAtOptions.Add("Seconds", new CsdStringSetting("Seconds")); startAtOptions.Add("Minutes", new CsdStringSetting("Minutes")); startAtOptions.Add("Hours", new CsdStringSetting("Hours")); startAtOptions.Add("Days", new CsdStringSetting("Days")); cfd.AddPropertyShortString("StartAtUnit", "Interval unit", startAtUnit, null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.DropDown, Items = startAtOptions }); if (task.FailuresBeforeDisabling > 0) cfd.AddPropertyDescription("<font color=\"gray\"><br />The task will be automatically disabled after " + task.FailuresBeforeDisabling + " exceptions. </font>", true); _showSettingsButton = false; string friendlyTypeName = null; if (task.TypeName.Length > 0) { Type t; try { t = Utils.GetType(task.TypeName); if (typeof(IWorkflowMethodTaskWithSettings).IsAssignableFrom(t)) { _showSettingsButton = true; friendlyTypeName = t.Name; } } catch { } } string[] buttons; if (_showSettingsButton) { buttons = new string[] { "Configure " + friendlyTypeName, "Check Typename", "Task details", "Save & Close" }; } else { buttons = new string[] { "Check Typename", "Task details", "Save & Close" }; } var diag = new WMContentForm(DialogueIcon.Info, "Task options", 600, 160, cfd, buttons, true); return new NextCall(diag, onCompleteSettingsFromTask); }
NextCall pasteXml() { var cfd = new ContentFormDefinition(); cfd.AddPropertyLongString("xml", "Paste the entire definition file here as XML:", null, null, new LongStringPropertySettings() { Height = 300, Focus = true, Layout = PropertyLayout.TwoRows }); var diag = new WMContentForm(DialogueIcon.None, "Import and merge new onology", 500, 320, cfd); return new NextCall(diag, onCompletePaste); }
public override NextCall Invoke(WorkflowMethod invoker) { var cfd = new ContentFormDefinition(); string name; if (Session.Access.IsStored) { name = Session.GetUser().Name; } else { name = Utils.GetFriendlyName(Session.Access.UserType.ToString()); } ShortStringPropertySettings s = new ShortStringPropertySettings(); cfd.AddPropertyShortString("from", "From", name, null, s); s.Focus = true; cfd.AddPropertyLongString("message", "Message"); var q = new WMContentForm(DialogueIcon.Question, "Please type message to send:", 400, 100, cfd); return new NextCall(q, onComplete); }
public override NextCall Invoke(WorkflowMethod invoker) { _find = Session.GetSetting<string>(this.GetType().FullName + "_find", PersistenceScope.UserSession, ""); _replace = Session.GetSetting<string>(this.GetType().FullName + "_replace", PersistenceScope.UserSession, ""); _where = Session.GetSetting<string>(this.GetType().FullName + "_where", PersistenceScope.UserSession, "allContent"); _caseSensitive = Session.GetSetting<bool>(this.GetType().FullName + "_caseSensitive", PersistenceScope.UserSession, false); _searchHtmlSource = Session.GetSetting<bool>(this.GetType().FullName + "_searchHtmlSource", PersistenceScope.UserSession, false); _allRevision = Session.GetSetting<bool>(this.GetType().FullName + "_allRevisions", PersistenceScope.UserSession, false); _allCultures = Session.GetSetting<bool>(this.GetType().FullName + "_allCultures", PersistenceScope.UserSession, false); _allSites = Session.GetSetting<bool>(this.GetType().FullName + "_allSites", PersistenceScope.UserSession, false); ContentFormDefinition cfd = new ContentFormDefinition(); cfd.AddPropertyShortString("find", "Find", _find); cfd.AddPropertyShortString("replace", "Replace", _replace); ShortStringPropertySettings s = new ShortStringPropertySettings(); s.ControlType = ShortStringControlType.DropDown; s.Items = new Dictionary<string, CsdStringSetting>(); s.Items.Add("allContent", new CsdStringSetting("Any content")); s.Items.Add("selectedContent", new CsdStringSetting("Selected contents...")); s.Items.Add("selectTypes", new CsdStringSetting("Selected types...")); cfd.AddPropertyShortString("where", "Where", _where, null, s); cfd.AddPropertyCheckBox("caseSensitive", "Match case", _caseSensitive); cfd.AddPropertyCheckBox("searchHtmlSource", "HTML source", _searchHtmlSource); cfd.AddPropertyCheckBox("allRevisions", "All revisions", _allRevision); cfd.AddPropertyCheckBox("allCultures", "All languages", _allCultures); cfd.AddPropertyCheckBox("allSites", "All sites", _allSites); cfd.AddPropertyHeading("", "<br /><font color=\"gray\">WARNING: It is not possible to undo a replace operation. </font>", false, false, true); string[] buttons = new string[] { "Find..." }; WMContentForm contentFormDiag = new WMContentForm(DialogueIcon.Question, "Find and replace text:", 400, 220, cfd, buttons, true); return new NextCall(contentFormDiag, onCompleteStep1); }
public override NextCall Invoke(WorkflowMethod invoker) { _parentFolderNodeId = this.GetSecureInput<int>(); ContentFormDefinition cfd = new ContentFormDefinition(); ShortStringPropertySettings s = new ShortStringPropertySettings(); s.Layout = PropertyLayout.NoTitle; cfd.AddPropertyShortString("name", null, "New Folder", null, s); WMContentForm cf = new WMContentForm(DialogueIcon.Question, "Please name new folder:", 400, 40, cfd); return new NextCall(cf, onComplete, onError); }