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)
 {
     _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);
 }
Exemple #3
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 #4
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 #5
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 #6
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 #7
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 #8
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);
    }
 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);
 }