Exemple #1
0
 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);
 }
Exemple #2
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     ContentFormDefinition cfd = new ContentFormDefinition();
     ShortStringPropertySettings s = new ShortStringPropertySettings();
     s.ControlType = ShortStringControlType.DropDown;
     s.Items = new Dictionary<string, CsdStringSetting>();
     s.Items.Add("m1", new CsdStringSetting("1 Megapixels"));
     s.Items.Add("m2", new CsdStringSetting("2 Megapixels"));
     s.Items.Add("m3", new CsdStringSetting("3 Megapixels"));
     s.Items.Add("m4", new CsdStringSetting("4 Megapixels"));
     s.Items.Add("m6", new CsdStringSetting("6 Megapixels"));
     s.Items.Add("m8", new CsdStringSetting("8 Megapixels"));
     s.Items.Add("m10", new CsdStringSetting("10 Megapixels"));
     s.Items.Add("m15", new CsdStringSetting("15 Megapixels"));
     cfd.AddPropertyHeading(null, "<br/>Please select the maximum amount of pixels for any image:<br/><br/>", false, true, true);
     cfd.AddPropertyShortString("megapixels", "Maximum", "m4", null, s);
     return new NextCall(new WMContentForm(DialogueIcon.Question, "Rescale large images", 400, 70, cfd), onComplete);
 }
Exemple #3
0
    NextCall onSelectContentsComplete(WorkflowMethod invoker)
    {
        WMFindContent w = (WMFindContent)invoker;
        _nodeIds = w.SelectedKeys.Select(v => v.NodeId).Distinct().ToList();

        ContentFormDefinition cfd = new ContentFormDefinition();

        ShortStringPropertySettings s = new ShortStringPropertySettings();
        s.ControlType = ShortStringControlType.DropDown;
        s.Items = new Dictionary<string, CsdStringSetting>();
        foreach (var l in Session.Definitions.Culture.Values) {
            s.Items.Add(l.LCID.ToString(), new CsdStringSetting(l.Name));
        }
        cfd.AddPropertyShortString("target", "Ensure versions in", Session.LCID.ToString(), null, s);

        s = new ShortStringPropertySettings();
        s.ControlType = ShortStringControlType.DropDown;
        s.Items = new Dictionary<string, CsdStringSetting>();
        foreach (var l in Session.Definitions.Culture.Values) {
            s.Items.Add(l.LCID.ToString(), new CsdStringSetting(l.Name));
        }

        return new NextCall(new WMContentForm(DialogueIcon.Question, "Ensuring language versions", 400, 50, cfd), onSelectLanguageComplete);
    }
Exemple #4
0
 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);
 }
Exemple #5
0
 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);
 }
Exemple #6
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     if (!Session.Access.IsStored) throw new Exception(Session.Access.UserType + " user does not have editable properties. ");
     SystemUser user = Session.GetUser();
     ContentFormDefinition cfd = new ContentFormDefinition();
     cfd.AddPropertyShortString("Username", "Username", user.UserName).Focus = true;
     cfd.AddPropertyShortString("NewPassword1", "New Password", "", null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password });
     cfd.AddPropertyShortString("NewPassword2", "Confirm Password", "", null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password });
     cfd.AddPropertyShortString("OldPassword", "Old Password", "", null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password });
     cfd.AddPropertyShortString("Email", "Email", user.Email);
     cfd.AddPropertyShortString("Mobile", "Mobile", user.Mobile);
     cfd.AddPropertyShortString("Forename", "Forename", user.Forename);
     cfd.AddPropertyShortString("Surname", "Surname", user.Surname);
     cfd.AddPropertyShortString("Company", "Company", user.Company);
     cfd.AddPropertyShortString("Street", "Street address", user.Street);
     cfd.AddPropertyShortString("ProvinceState", "State or province", user.ProvinceState);
     cfd.AddPropertyShortString("PostZipCode", "Postal zip code", user.PostZipCode);
     cfd.AddPropertyShortString("City", "City", user.City);
     cfd.AddPropertyShortString("Country", "Country", user.Country);
     return new NextCall(new WMContentForm(DialogueIcon.Info, "My user details", 450, 290, cfd, new string[] { "Save" }, true), onComplete);
 }
Exemple #7
0
 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);
 }
Exemple #8
0
 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);
 }
Exemple #9
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     string errorText = null;
     if (invoker is WMContentForm) {
         _text = ((WMContentForm)invoker).Result.Get<LongStringPropertyValue>("values").Value;
         string[] rows = _text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
         try {
             int colCodeName = -1;
             int colValue = -1;
             Dictionary<int, int> colsNameByLcId = new Dictionary<int, int>();
             Dictionary<int, int> colsDescByLcId = new Dictionary<int, int>();
             var header = rows[0].Split(new char[] { '\t', ';' }, StringSplitOptions.None);
             for (int col = 0; col < header.Length; col++) {
                 string v = header[col].Trim();
                 if (v == "CODENAME") colCodeName = col;
                 else if (v == "VALUE") colValue = col;
                 else if (v.StartsWith("NAME")) colsNameByLcId.Add(col, int.Parse(v.Substring(4)));
                 else if (v.StartsWith("DESC")) colsDescByLcId.Add(col, int.Parse(v.Substring(4)));
             }
             var newValues = new Dictionary<int, MemDefEnumerationValue>();
             for (int row = 1; row < rows.Length; row++) {
                 var e = new MemDefEnumerationValue();
                 var cols = rows[row].Split(new char[] { '\t', ';' }, StringSplitOptions.None);
                 e.CodeName = cols[colCodeName].Trim();
                 e.Value = int.Parse(cols[colValue].Trim());
                 foreach (int col in colsNameByLcId.Keys) e.NameByLCID.Add(colsNameByLcId[col], cols[col].Trim());
                 foreach (int col in colsDescByLcId.Keys) e.DescriptionByLCID.Add(colsDescByLcId[col], cols[col].Trim());
                 newValues.Add(e.Value, e);
             }
             _defEnum.Values = newValues;
             WFContext.SendClientScriptToStartupRequest(_onCompleteScript);
             return null;
         } catch (Exception error) {
             errorText = "The import failed, there are formatting errors in the text. " + error.Message + " ";
         }
     }
     ContentFormDefinition cfd = new ContentFormDefinition();
     var settings = new LongStringPropertySettings();
     settings.Height = Unit.Percentage(95);
     settings.Layout = PropertyLayout.NoTitle;
     cfd.AddPropertyHeading("", "<span style=\"color:red;\">" + errorText + "</span>Each column can be separated by a TAB or SEMICOLON. Use Excel or similar to edit large datasets. Select paste \"as text\" when pasting into excel for best formatting. You must include the first header to indicate the position of each coloum. You may add or delete language specific columns. Not all language specific columns must be filled in for each row.", false, true, true, Unit.Percentage(100), Unit.Pixel(70));
     cfd.AddPropertyLongString("values", "Values", _text, null, settings);
     return new NextCall(new WMContentForm(DialogueIcon.Info, "Values of \"" + _defEnum.CodeName + "\"", 600, 300, cfd, new string[] { "Import values..." }, true), Invoke);
 }
Exemple #10
0
    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);
    }
Exemple #11
0
    public override NextCall Invoke(WorkflowMethod invoker)
    {
        if (!Session.Access.IsStored) throw new Exception(Session.Access.UserType + " user does not have editable properties. ");
        SystemUser user = Session.GetUser();
        ContentFormDefinition cfd = new ContentFormDefinition();

        cfd.AddPropertyShortString("Username", Local.Text("Web.WAF.Edit.Welcome.DefaultUsername"), user.UserName).Focus = true;
        cfd.AddPropertyShortString("NewPassword1",Local.Text("Web.WAF.Edit.Welcome.DefaultNewPassword") , "", null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password });
        cfd.AddPropertyShortString("NewPassword2", Local.Text("Web.WAF.Edit.Welcome.DefaultComfirmPassword"), "", null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password });
        cfd.AddPropertyShortString("OldPassword", Local.Text("Web.WAF.Edit.Welcome.DefaultOldPassword") , "", null, new ShortStringPropertySettings() { ControlType = ShortStringControlType.Password });
        cfd.AddPropertyShortString("Email", Local.Text("Web.WAF.Edit.Welcome.DefaultEmail"), user.Email);
        cfd.AddPropertyShortString("Mobile", Local.Text("Web.WAF.Edit.Welcome.DefaultMobile"), user.Mobile);
        cfd.AddPropertyShortString("Forename",  Local.Text("Web.WAF.Edit.Welcome.DefaultForename"), user.Forename);
        cfd.AddPropertyShortString("Surname", Local.Text("Web.WAF.Edit.Welcome.DefaultSurename"), user.Surname);
        cfd.AddPropertyShortString("Company", Local.Text("Web.WAF.Edit.Welcome.DefaultCompany"), user.Company);
        cfd.AddPropertyShortString("Street",  Local.Text("Web.WAF.Edit.Welcome.DefaultStreetAddress"), user.Street);
        cfd.AddPropertyShortString("ProvinceState", Local.Text("Web.WAF.Edit.Welcome.DefaultStatOrProvince"), user.ProvinceState);
        cfd.AddPropertyShortString("PostZipCode",Local.Text("Web.WAF.Edit.Welcome.DefaultPostalZipCode"), user.PostZipCode);
        cfd.AddPropertyShortString("City", Local.Text("Web.WAF.Edit.Welcome.DefaultCity"), user.City);
        cfd.AddPropertyShortString("Country", Local.Text("Web.WAF.Edit.Welcome.DefaultCountry"), user.Country);
        return new NextCall(new WMContentForm(DialogueIcon.Info, Local.Text("Web.WAF.Edit.Welcome.DefaultMyUserDetails"), 450, 290, cfd, new string[] { Local.Text("Web.WAF.Edit.Welcome.DefaultSave") }, true), onComplete);
    }
Exemple #12
0
        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);
        }
Exemple #13
0
    NextCall edit(WorkflowMethod invoker)
    {
        WFContext.Caption = "Editing webfram settings...";
        WFContext.InBackgroundMode = true;
        ContentFormDefinition cfd = new ContentFormDefinition();
        {
            cfd.AddPropertyHeading("", "&nbsp;", 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>&nbsp;</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; \">&nbsp;</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);
    }
Exemple #14
0
    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);
    }
Exemple #15
0
    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);
    }
Exemple #16
0
 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);
 }
Exemple #17
0
 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);
 }
Exemple #18
0
 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);
 }
Exemple #19
0
 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);
 }
Exemple #20
0
 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);
 }
Exemple #21
0
 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);
 }
Exemple #22
0
 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);
 }