From 8bf7995b6f1fd4207243c9c72cbf5f50aa27065a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 1 Sep 2021 19:36:30 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 29 +++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index beed5d3..46278aa 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -485,6 +485,7 @@ namespace AyaNova.PlugIn.V8 V7UseInventory = AyaBizUtils.GlobalSettings.UseInventory; //BIZ objects + await ExportLocales(progress); await ExportStaffUsers(progress); await ExportRates(progress); @@ -4852,7 +4853,7 @@ namespace AyaNova.PlugIn.V8 #region Global / Regional WIKIPAGES private async System.Threading.Tasks.Task ExportGlobalRegionalWiki(ProgressForm progress) { - ResetUniqueNames(); + progress.Append("Export Global / Regional WIKI"); if (!progress.KeepGoing) return; progress.Op("Start Global / Regional WIKI page export"); progress.SubOp("Global WIKI check"); @@ -4860,15 +4861,22 @@ namespace AyaNova.PlugIn.V8 { 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.name = "zV8Migrate GLOBAL_WIKI_REPOSITORY"; 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); + var r= await util.PostAsync("user", d); + long RavenId = util.IdFromResponse(r); + Addv7v8IdMap(Address.GlobalAddressID, RavenId); + //FILES / ATTACHMENTS FOR WIKI + var tid = new TypeAndID(RootObjectTypes.Global, Address.GlobalAddressID); + await ExportAttachments(tid, progress, util.AyaType.User); + d = r.ObjectResponse["data"]; + d.wiki = await GetWikiContent(tid); + await util.PutAsync("user", d); } RegionList l = RegionList.GetList(string.Empty); progress.SubOp("Regional WIKI checks"); @@ -4878,15 +4886,22 @@ namespace AyaNova.PlugIn.V8 { 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.name = "zV8Migrate REGION_WIKI_REPOSITORY_"+i.LT_Region_Label_Name.Display; 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); + var r = await util.PostAsync("user", d); + long RavenId = util.IdFromResponse(r); + Addv7v8IdMap(i.LT_Region_Label_Name.Value, RavenId); + //FILES / ATTACHMENTS FOR WIKI + var tid=new TypeAndID(RootObjectTypes.Region, i.LT_Region_Label_Name.Value); + await ExportAttachments(tid, progress, util.AyaType.User); + d = r.ObjectResponse["data"]; + d.wiki = await GetWikiContent(tid); + await util.PutAsync("user", d); } } }