From fe44061e63243f00e71cbb8d562fd0a46cb7394d Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 1 Sep 2021 18:41:44 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 47 +++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index e2a9fd7..beed5d3 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -522,6 +522,7 @@ namespace AyaNova.PlugIn.V8 await ExportClientServiceRequests(progress); await SynchronizeInventory(progress); await ExportGlobalSettings(progress); + await ExportGlobalRegionalWiki(progress); if (progress.KeepGoing) { @@ -4848,6 +4849,50 @@ namespace AyaNova.PlugIn.V8 + #region Global / Regional WIKIPAGES + private async System.Threading.Tasks.Task ExportGlobalRegionalWiki(ProgressForm progress) + { + ResetUniqueNames(); + if (!progress.KeepGoing) return; + progress.Op("Start Global / Regional WIKI page export"); + progress.SubOp("Global WIKI check"); + if (WikiPage.HasWiki(Address.GlobalAddressID)) + { + progress.SubOp("Global WIKI exists, migrating to special User account"); + dynamic d = new JObject(); + d.name = "zV8Migrate GLOBAL_WIKI_REPOSITORY"; + d.wiki = await GetWikiContent(new TypeAndID(RootObjectTypes.Global,Address.GlobalAddressID)); + d.active = false; + d.userType = 2; + d.roles = 0; + d.login = util.RandomString(); + d.password = util.RandomString(); + d.notes = "This record created by V8Migrate utility to contain the AyaNova 7 Global WIKI which has no corresponding place in v8"; + await util.PostAsync("user", d); + } + RegionList l = RegionList.GetList(string.Empty); + progress.SubOp("Regional WIKI checks"); + foreach (RegionList.RegionListInfo i in l) + { + if (WikiPage.HasWiki(i.LT_Region_Label_Name.Value)) + { + progress.SubOp("Region "+i.LT_Region_Label_Name.Display+" WIKI exists, migrating to special User account"); + dynamic d = new JObject(); + d.name = "zV8Migrate REGION_WIKI_REPOSITORY_"+i.LT_Region_Label_Name.Display; + d.wiki = await GetWikiContent(new TypeAndID(RootObjectTypes.Region, i.LT_Region_Label_Name.Value)); + d.active = false; + d.userType = 2; + d.roles = 0; + d.login = util.RandomString(); + d.password = util.RandomString(); + d.notes = "This record created by V8Migrate utility to contain the AyaNova 7 Regional WIKI which has no corresponding place in v8"; + await util.PostAsync("user", d); + } + } + } + #endregion global regional wiki pages + + @@ -5859,7 +5904,7 @@ namespace AyaNova.PlugIn.V8 { //this is image links to file attachments //if there is no match then chuck it, it's not critically important and already was missing in v7 anyway - var RavenId = await Getv7v8IdMapNullOk(new Guid(m.Groups["guid"].Value), tid.RootObjectType, false);//Map[new Guid(m.Groups["guid"].Value)]; + var RavenId = await Getv7v8IdMapNullOk(new Guid(m.Groups["guid"].Value), tid.RootObjectType, false,true);//Map[new Guid(m.Groups["guid"].Value)]; if (RavenId != null) content = content.Replace(m.Value, ""); else