This commit is contained in:
2020-04-26 20:06:38 +00:00
parent c8ec020046
commit 2d79390b4c

View File

@@ -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