From 2d79390b4cb9700a40de811762f771f1a4280611 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 26 Apr 2020 20:06:38 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.Dump/Dump.cs | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.Dump/Dump.cs b/source/Plugins/AyaNova.Plugin.Dump/Dump.cs index eedc4da..c7a739d 100644 --- a/source/Plugins/AyaNova.Plugin.Dump/Dump.cs +++ b/source/Plugins/AyaNova.Plugin.Dump/Dump.cs @@ -542,6 +542,7 @@ namespace AyaNova.Plugin.Dump makeFolderIfNotExist(dumpFolder); var outputFileName = dumpFolder + Path.DirectorySeparatorChar + objectFileName + ".json"; + var wikiOutputPath = dumpFolder + Path.DirectorySeparatorChar + objectFileName + Path.DirectorySeparatorChar + "files"; JsonSerializer serializer = new JsonSerializer(); serializer.NullValueHandling = NullValueHandling.Include; @@ -573,12 +574,11 @@ namespace AyaNova.Plugin.Dump } //WIKI / ATTACHMENTS - DumpWikiPageAndAttachments(tid); + DumpWikiPageAndAttachments(tid, wikiOutputPath); } //WIKI - #region Wikiable objects reference /* Find all "Util.OpenWikiPage", Whole word, Subfolders, Keep modified files open, Find Results 1, Entire Solution, "" @@ -604,11 +604,29 @@ namespace AyaNova.Plugin.Dump */ #endregion - private void DumpWikiPageAndAttachments(TypeAndID tid) + private void DumpWikiPageAndAttachments(TypeAndID tid, string wikiOutputPath) { //may not exist if (!WikiPage.HasWiki(tid.ID)) return; + WikiPage w= WikiPage.GetItem(tid.ID); + var content= w.GetContentAsString; + var fileList = w.GetFileListContentForRI(); + + if (string.IsNullOrWhiteSpace(content) && fileList.Count < 1) return; + + makeFolderIfNotExist(wikiOutputPath); + + if (!string.IsNullOrWhiteSpace(content)) + { + //write out the html wiki page + File.WriteAllText(wikiOutputPath + Path.DirectorySeparatorChar + "w.html", content); + } + foreach (WikiPage.WikiFileInfo i in fileList) + { + //save out each file to that path with a uniquification prepended + + } } #endregion dump