This commit is contained in:
2020-04-26 21:16:52 +00:00
parent b0ce96b473
commit ad76471fcb

View File

@@ -612,9 +612,9 @@ namespace AyaNova.Plugin.Dump
WikiPage w= WikiPage.GetItem(tid);
var content= w.GetContentAsString;
var fileList = w.GetFileListContentForRI();
AyaFileList fl = AyaFileList.GetList(tid.ID);
if (string.IsNullOrWhiteSpace(content) && fileList.Count < 1) return;
if (string.IsNullOrWhiteSpace(content) && fl.Count < 1) return;
makeFolderIfNotExist(wikiOutputPath);
@@ -625,18 +625,28 @@ namespace AyaNova.Plugin.Dump
}
//files
List<string> fileNamesUsed = new List<string>();
foreach (WikiPage.WikiFileInfo i in fileList)
foreach (AyaFileList.AyaFileListInfo i in fl)
{
//WikiFileInfo fi = new WikiFileInfo();
// fi.Id = i.LT_O_AyaFile.Value.ToString();
// fi.Name = i.LT_O_AyaFile.Display;
// fi.Size = i.LT_AyaFile_Label_FileSize;
// fi.Creator = i.LT_Common_Label_Creator.Display;
// fi.Created = i.LT_Common_Label_Created.ToString();
// ret.Add(fi);
//save each file plus file info into their own folder by ayafile id this is because ayafiles can be dupe names and we need the wiki info to fixup the last created date etc
var filePath = wikiOutputPath + Path.DirectorySeparatorChar + i.Id.ToString();
makeFolderIfNotExist(filePath);//output/objectype/client.f861ec01-8bde-46e1-9849-fcee9b42f05e/files/d5461ec01-8bde-46e1-9849-fcee9b42f0ff34/
var af=AyaFile.GetItem(new Guid(i.Id));
var af = AyaFile.GetItem(i.LT_O_AyaFile.Value);
if (af == null) continue;
af.WriteToDisk(filePath, af.Name);
var fileInfo = new { name = i.Name, created=i.Created, creator=i.Creator, mimetype=af.mimeType, id=i.Id, size=i.Size,ayafiletype=af.FileType, rootobjectid=af.RootObjectID, rootobjecttype=af.RootObjectType };
var fileInfo = new { name = i.LT_O_AyaFile.Display, created = i.LT_Common_Label_Created, creator = i.LT_Common_Label_Creator.Value,
mimetype = af.mimeType, id = af.ID, size = af.FileSize, ayafiletype = af.FileType, rootobjectid = af.RootObjectID, rootobjecttype = af.RootObjectType };
JsonSerializer serializer = new JsonSerializer();
serializer.NullValueHandling = NullValueHandling.Include;
@@ -648,7 +658,7 @@ namespace AyaNova.Plugin.Dump
using (StreamWriter sw = new StreamWriter(filePath+Path.DirectorySeparatorChar+".json"))
using (StreamWriter sw = new StreamWriter(filePath+Path.DirectorySeparatorChar+"meta.json"))
using (JsonWriter writer = new JsonTextWriter(sw))
{