Пример #1
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     string url = GetUnsecureInput<string>("url");
     url = url.Replace("###", "_");
     WMContentLinks diag = new WMContentLinks(WAFRuntime.Engine.SystemSession.GetContents<UrlStatus>(AqlUrlStatus.Name == url)[0].Key.CreateCKeyNLR());
     return new NextCall(diag);
 }
Пример #2
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     _lcid = (int)GetSecureInput<object[]>()[0];
     _path = (string)GetSecureInput<object[]>()[1];
     var upload = new WMUploadFiles("Upload flag icon, format: PNG 16x11px", false);
     return new NextCall(upload, onComplete);
 }
Пример #3
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     var f = (WMUploadFiles)(invoker);
     string destination = _path + "flg" + _lcid + ".png";
     if (WAFRuntime.FileSystem.FileExists(destination)) WAFRuntime.FileSystem.FileDelete(destination);
     WAFRuntime.FileSystem.FileMove(f.GetUploadedFiles().First(), destination);
     return null;
 }
Пример #4
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     WMCreateContent d = (WMCreateContent)invoker;
        // WFContext.Edit(d.CreatedContentKey);
     WMEditContent editWM = new WMEditContent(d.CreatedContentKey, true);
     //WFContext.RefreshDesktop();
     return new NextCall(editWM);
 }
Пример #5
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     var wm = invoker as WMMergeText;
     _c.ResultXml = wm.Result;
     _c.SelectedAction = ComparisonAction.Resolved;
     WFContext.RefreshStartupWindow();
     return null;
 }
Пример #6
0
 NextCall onCompleteCreate(WorkflowMethod invoker)
 {
     WMCreateContent diag = (WMCreateContent)invoker;
     _key = diag.CreatedContentKey;
     MemDefContentClass classDef = Engine.Definition.ContentClass[_key.ClassId];
     WMEditContent ec;
     ec = new WMEditContent(_key.CreateCKeyNLR(), true, true, false, false, true, false, false, "Create", 400, 700);
     return new NextCall(ec, onCompleteEdit, onCompleteCancel);
 }
Пример #7
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     foreach (CKeyNLR key in _keys) {
         Session.DeleteNode(key.NodeId);
     }
     Session.Notify(_keys.Count + " "+ Local.Text("Web.WAF.Edit.User.UsersUsersDeleted")+ " ");
     WFContext.RefreshStartupWindow();
     return null;
 }
Пример #8
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     foreach (CKeyNLR key in _selected) {
         Session.DeleteNode(key.NodeId);
     }
     Session.Notify("Deleted " + _selected.Count + " content" + (_selected.Count > 0 ? "s" : "") + ". ");
     WFContext.RefreshStartupRequest();
     return null;
 }
Пример #9
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     foreach (CKeyNLR key in _keys) {
         Session.DeleteNode(key.NodeId);
     }
     Session.Notify(_keys.Count + " user(s) deleted. ");
     WFContext.RefreshStartupWindow();
     return null;
 }
Пример #10
0
    NextCall onComplete(WorkflowMethod invoker)
    {
        foreach (CKeyNLR key in _selected) {
            Session.DeleteNode(key.NodeId);
        }

        Session.Notify(Local.Text("Web.WAF.Dialogues.Main.FindContentInfoNotifyDeleted") + " " + _selected.Count + " " + Local.Text("Web.WAF.Dialogues.Main.FindContentInfoNotifyContent") + (_selected.Count > 0 ? "s" : "") + ". ");
        WFContext.RefreshStartupRequest();
        return null;
    }
Пример #11
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     var c = (WMContentForm)invoker;
     int lcid = int.Parse(c.Result.Get<ShortStringPropertyValue>("newLCID").Value);
     if (_lcid == lcid) throw new Exception("New LCID is same as existing LCID. ");
     ContentDefinition def = WAFContext.GetTemporaryLocalDefinition();
     if (def.Culture.ContainsKey(lcid)) throw new Exception("New LCID is already in used. ");
     SetUnsecureOutput("NewLCID", lcid);
     return null;
 }
Пример #12
0
 NextCall onComplete(WorkflowMethod invoker)
 {
     WMQuestion q = (WMQuestion)invoker;
     if (q.Answer == ExchangeResult.Ok) {
         Session.SendExchangeValue(_exchangedId, ExchangeResult.Ok, new object[] { _selected, q.AnswerCustomIndex == 1 }, true);
     } else {
         throw new WDCancelException();
     }
     return null;
 }
Пример #13
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     string selectedKeysString = GetUnsecureInput<string>("SelectedValues");
     UniqueList<CKeyNLR> selectedContents = new UniqueList<CKeyNLR>();
     foreach (string keyString in selectedKeysString.Split('|')) {
         if (keyString != null && keyString.Length > 0) selectedContents.Add(new CKeyNLR(keyString));
     }
     WMContentTreeView.SetDefaultSelectedContents(selectedContents, RelHierarchical.RelationId, Session.CompleteKeyC(Session.SiteId), false);
     WMCreateContent diag = new WMCreateContent(0, false);
     return new NextCall(diag, onComplete);
 }
Пример #14
0
 NextCall onCompleteEdit(WorkflowMethod invoker)
 {
     MessageBase mb = WFContext.Session.GetContent<MessageBase>(_key);
     mb.Status = MessageStatus.Outbox;
     mb.UpdateChanges();
     WFContext.RefreshDesktop();
     Info.InBackgroundMode = false;
     Messaging.SendMessagesInOutbox(true);
     Thread.Sleep(1000);
     return null;
 }
Пример #15
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     WFContext.Info.InBackgroundMode = false;
     string t;
     if (_selected.Count == 1) {
         t = Local.Text("Web.WAF.Dialogues.Main.FindContentInfoInBackgroundDeleteContent") + " " + Session.GetContent(_selected[0]).Name + "\"?";
     } else {
         t = Local.Text("Web.WAF.Dialogues.Main.FindContentInfoInBackgroundDeleteThese") + " " + _selected.Count + " " + Local.Text("Web.WAF.Dialogues.Main.FindContentInfoInBackgroundContens");
     }
     WMConfirmQuestion q = new WMConfirmQuestion(t);
     return new NextCall(q, onComplete);
 }
Пример #16
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     MemDefContentClass baseClassDef = WAFRuntime.Definitions.ContentClass[DiscountBase.ContentClassId];
     UniqueList<int> classesToInclude = new UniqueList<int>();
     foreach (int classId in baseClassDef.AllDescendantsIncThis) {
         if (classId != DiscountBase.ContentClassId) {
             classesToInclude.Add(classId);
         }
     }
     WMCreateContent d = new WMCreateContent(classesToInclude, false, false);
     return new NextCall(d, onComplete);
 }
Пример #17
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     WFContext.Info.InBackgroundMode = false;
     string t;
     if (_selected.Count == 1) {
         t = "Deleted the content \"" + Session.GetContent(_selected[0]).Name + "\"?";
     } else {
         t = "Deleted these " + _selected.Count + " contents?";
     }
     WMConfirmQuestion q = new WMConfirmQuestion(t);
     return new NextCall(q, onComplete);
 }
Пример #18
0
 NextCall Continue(WorkflowMethod invoker)
 {
     WFContext.InBackgroundMode = false;
     WFContext.EstimateProgress = true;
     WFContext.Caption = "Preparing for update...";
     _updateScript = new SystemUpdateScript(WAFContext.PathFromRootToAppFolder, Engine.Dao.DbProvider, true);
     _updateScript.ProgressUpdate += updateScript_ProgressUpdate;
     if (_updateScript.Update()) {
         return null; // done
     } else {
         throw new WDCancelException();
     }
 }
Пример #19
0
 NextCall onCompleteCreate(WorkflowMethod invoker)
 {
     WMCreateContent diag = (WMCreateContent)invoker;
     _key = diag.CreatedContentKey;
     MemDefContentClass classDef = Engine.Definition.ContentClass[_key.ClassId];
     WMEditContent ec;
     if (classDef.AllParentsIncThis.Contains(SMS.ContentClassId)) {
         ec = new WMEditContent(_key.CreateCKeyNLR(), true, false, false, false, true, false, false, "Send SMS", 250, 500);
     } else {
         ec = new WMEditContent(_key.CreateCKeyNLR(), true, false, false, false, true, false, false, "Send MMS", 450, 760);
     }
     return new NextCall(ec, onCompleteEdit, onCompleteCancel);
 }
Пример #20
0
 //NextCall onTypeSelected(WorkflowMethod invoker) {
 //    WMCreateContent cc = (WMCreateContent)invoker;
 //    CreatedContent = cc.CreatedContentKey;
 //    var d = new WMFindContent(ListSelectionMode.Single, null, new UniqueList<int>(SegmentDimension.ContentClassId), true, "Please select which dimension the segment belongs to:", "Select", null, false, "");
 //    return new NextCall(d, onComplete);
 //}
 NextCall onComplete(WorkflowMethod invoker)
 {
     WMCreateContent cc = (WMCreateContent)invoker;
     CreatedContent = cc.CreatedContentKey;
     VisitorSegment segment = Session.GetContent<VisitorSegment>(CreatedContent);
     List<SegmentationSettings> settings = WFContext.Session.Query<SegmentationSettings>().Where(AqlContent.SiteId == WFContext.Session.SiteId).Where(AqlSegmentationSettings.LCID == WFContext.Session.LCID).Where(AqlSegmentationSettings.IsDerived == false).Execute();
     if (settings.Count > 0) {
         SegmentationSettings root = settings[0];
         segment.SegmentSettings.Set(root.NodeId);
         segment.UpdateChanges();
     }
     WFContext.Edit(CreatedContent);
     return null;// new NextCall(editWM);
 }
Пример #21
0
 NextCall onCompleteEdit(WorkflowMethod invoker)
 {
     MessageBase mb = WFContext.Session.GetContent<MessageBase>(_key);
     mb.Status = MessageStatus.Outbox;
     mb.UpdateChanges();
     WFContext.RefreshDesktop();
     Info.InBackgroundMode = false;
     try {
         Messaging.SendMessagesInOutbox(true);
         Thread.Sleep(1000);
     } catch(Exception err) {
         Session.Notify(DialogueIcon.Warning, "Unable to send message", err.Message);
     }
     return null;
 }
Пример #22
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     Engine.SystemSession.SetSetting("SystemUpdateCancelled", null, PersistenceScope.Application);
     if (WAFContext.Engine.NativeDefinition.Build < 1228) {
         WMQuestion q = new WMQuestion(DialogueIcon.Warning, UIButtons.ConfirmCancel,
             "Upgrade to .NET 4.0", "This update requires that you update the entire site to .NET 4.0. In IIS you will need to change the Application Pool to .NET 4.0, and in Visual Studio you must change the target framework of the website to .NET 4.0"
             + Environment.NewLine + ""
             + Environment.NewLine + "IMPORTANT: Update the .NET version AFTER this update process is complete. The update dialogue will freeze when it is complete, refresh the browser and you will get a compilation error telling you to upgrade the website to .NET 4.0"
             + Environment.NewLine + ""
             + Environment.NewLine + "Click Confirm to continue.");
         return new NextCall(q, afterConfirmation);
     } else {
         return Continue(invoker);
     }
 }
Пример #23
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);
 }
Пример #24
0
 NextCall go(WorkflowMethod invoker)
 {
     current++;
     if (WFContext.BreakExecution) return null;
     if (current >= _keys.Count) {
         Session.Notify("Translation complete", "You selected " + _keys.Count + " contents, of these " + _contentsTranslated + " were translated. ");
         WFContext.SendClientScriptToStartupWindow("location=location;");
         return null;
     }
     ContentBase to;
     CKeyNLR key = _keys[current];
     ContentBase from = null;
     foreach (var c in Session.GetContentAllVersions(key.NodeId, false)) {
         if (c.LCID != key.LCID && !c.IsDerived) {
             if (from == null || (from.Revision != 0 && c.Revision == 0) || (from.Revision < 0 && c.Revision > 0)) {
                 from = c;
             }
         }
     }
     WFContext.Description = "Translating " + (current + 1) + " of " + _keys.Count + "...";
     WFContext.SetProgress(current + 1, _keys.Count);
     try {
         if (from != null) {
             to = Session.GetContent(new CKeyNLR(key.NodeId, key.LCID, 0));
             var newKey = to.ExecuteRevisionAction(RevisionAction.AddLanguage, false);
             to = Session.GetContent(new CKeyNLR(key.NodeId, key.LCID, 0));
             var diag = new WMTranslateContent(from, to, true);
             _contentsTranslated++;
             return new NextCall(diag, go);
         } else {
             return new NextCall(go);
         }
     } catch {
         return new NextCall(go);
     }
 }
Пример #25
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     AqlQuery q = Session.CreateQuery();
     q.Where(AqlContent.IsDerived == true);
     WMFindContent diag = new WMFindContent(ListSelectionMode.Multiple, q, null, true, "Select contents to translate", "Select", "", true, "Select All");
     return new NextCall(diag, onSelected);
 }
Пример #26
0
 public override NextCall Invoke(WorkflowMethod invoker)
 {
     foreach (CKeyNLR key in Keys) {
         HierarchicalContent hContent = WFContext.Session.GetContent<HierarchicalContent>(key.NodeId);
         WFContext.InBackgroundMode = false;
         WFContext.EstimateProgress = true;
         WFContext.Caption = "Deleting " + hContent.Name;
         if (WFContext.BreakExecution) break;
         List<HierarchicalContent> children = hContent.GetAllChildren();
         if (children.Count > 0) WFContext.Caption += " and " + children.Count + " children";
         if (WFContext.BreakExecution) break;
         int n = 0;
         foreach (HierarchicalContent child in children) {
             WFContext.SetProgress(100 * n++ / children.Count);
             if (WFContext.BreakExecution) break;
             WFContext.Session.DeleteNode(child.NodeId, false);
         }
         if (WFContext.BreakExecution) break;
         WFContext.Session.DeleteNode(hContent.NodeId, false);
     }
     WFContext.RefreshStartupRequest();
     return null;
 }
Пример #27
0
 NextCall searchStart(WorkflowMethod invoker)
 {
     WFContext.InBackgroundMode = false;
     WFContext.Caption = "Searching contents...";
     WFContext.EstimateProgress = true;
     _hits = new Dictionary<CKeyNLRC, int>();
     return searchNext(invoker);
 }
Пример #28
0
 NextCall searchNext(WorkflowMethod invoker)
 {
     if (WFContext.BreakExecution) { Session.StartWorkflowMethod(this); return null; }
     if (_currentIndex + _pageSize > _selectedContents.Count) _pageSize = _selectedContents.Count - _currentIndex;
     List<ContentBase> contents = Session.GetContents<ContentBase>(_selectedContents.GetRange(_currentIndex, _pageSize));
     foreach (ContentBase c in contents) {
         _currentIndex++;
         WFContext.SetProgress(_currentIndex, _selectedContents.Count);
         WFContext.Description = "Searching " + _currentIndex + " of " + _selectedContents.Count + ". " + _hits.Count + " matches so far. ";
         if (WFContext.BreakExecution) { Session.StartWorkflowMethod(this); return null; }
         int count = countOccurencesOfText(c, _find, _caseSensitive, _searchHtmlSource);
         if (count > 0) {
             _hitCount += count;
             _hits.Add(c.Key, count);
         }
     }
     if (_currentIndex < _selectedContents.Count) {
         return new NextCall(searchNext);
     } else {
         return new NextCall(confirmReplace);
     }
 }
Пример #29
0
 NextCall replaceNext(WorkflowMethod invoker)
 {
     if (WFContext.BreakExecution) { Session.StartWorkflowMethod(this); return null; }
     if (_currentIndex + _pageSize > _contentMatches.Count) _pageSize = _contentMatches.Count - _currentIndex;
     List<ContentBase> contents = Session.GetContents<ContentBase>(_contentMatches.GetRange(_currentIndex, _pageSize));
     foreach (ContentBase c in contents) {
         _currentIndex++;
         WFContext.SetProgress(_currentIndex, _contentMatches.Count);
         WFContext.Description = "Replacing matches in " + _currentIndex + " of " + _contentMatches.Count + " contents... ";
         if (WFContext.BreakExecution) { Session.StartWorkflowMethod(this); return null; }
         _hitCount += replaceOccurencesOfText(c, _find, _replace, _caseSensitive, _searchHtmlSource);
         c.UpdateChanges();
     }
     if (_currentIndex < _contentMatches.Count) {
         return new NextCall(replaceNext);
     } else {
         Session.Notify(DialogueIcon.Info, "Replace completed", "Replaced " + _hitCount + " match" + (_hitCount > 0 ? "es" : "") + " in " + _contentMatches.Count + " content" + (_contentMatches.Count > 0 ? "s" : "") + ". ");
         WFContext.RefreshStartupRequest();
         return null;
     }
 }
Пример #30
0
 NextCall replace(WorkflowMethod invoker)
 {
     WFContext.InBackgroundMode = false;
     WorkflowMethodDialogue diag = (WorkflowMethodDialogue)invoker;
     if (diag.DialogueResult == ExchangeResult.Ok) {
         object result = diag.DialogueResultValue;
         if (result is string) {  // replace all
             _contentMatches = new List<CKeyNLR>();
             foreach (CKeyNLRC key in _hits.Keys) _contentMatches.Add(key.CreateCKeyNLR());
         } else if (result is List<CKeyNLR>) { // replace selected
             _contentMatches = (List<CKeyNLR>)result;
         } else if (result == null) { // new search
             Session.StartWorkflowMethod(this);
             return null;
         }
         _currentIndex = 0;
         _hitCount = 0;
         WFContext.InBackgroundMode = false;
         WFContext.Caption = "Replacing text...";
         WFContext.EstimateProgress = true;
         return new NextCall(replaceNext);
     } else {
         return null;
     }
 }
Пример #31
0
        public override NextCall Invoke(WorkflowMethod invoker)
        {
            WFContext.Session.SendEmail(false, "Quick brown fox jumps over the lay dog", "*****@*****.**", "*****@*****.**", "Test email");

            return(null);
        }