This commit is contained in:
@@ -248,8 +248,9 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
progress.Op("Exporting objects");
|
progress.Op("Exporting objects");
|
||||||
//BIZ objects
|
//BIZ objects
|
||||||
if (progress.KeepGoing)
|
|
||||||
await ExportLocales(progress);
|
//if (progress.KeepGoing)
|
||||||
|
// await ExportLocales(progress);
|
||||||
|
|
||||||
if (progress.KeepGoing)
|
if (progress.KeepGoing)
|
||||||
await ExportUsers(progress);
|
await ExportUsers(progress);
|
||||||
@@ -304,7 +305,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region Object Export methods
|
#region BIZ OBJECT Export methods
|
||||||
|
|
||||||
#region users
|
#region users
|
||||||
private async System.Threading.Tasks.Task ExportUsers(ProgressForm progress)
|
private async System.Threading.Tasks.Task ExportUsers(ProgressForm progress)
|
||||||
@@ -324,13 +325,14 @@ namespace AyaNova.PlugIn.V8
|
|||||||
{
|
{
|
||||||
User admin = User.GetItem(User.AdministratorID);
|
User admin = User.GetItem(User.AdministratorID);
|
||||||
progress.Op("Administrator account");
|
progress.Op("Administrator account");
|
||||||
|
var adminTid=new TypeAndID(RootObjectTypes.User, User.AdministratorID);
|
||||||
//Attachments and wiki
|
//Attachments and wiki
|
||||||
string AdminWikiContent = null;
|
string AdminWikiContent = null;
|
||||||
var hasWiki = WikiPage.HasWiki(User.AdministratorID);
|
var hasWiki = WikiPage.HasWiki(User.AdministratorID);
|
||||||
if (hasWiki)
|
if (hasWiki)
|
||||||
{
|
{
|
||||||
await ExportAttachments(new TypeAndID(RootObjectTypes.User, User.AdministratorID), progress);
|
await ExportAttachments(adminTid, progress);
|
||||||
AdminWikiContent = GetWikiContent(new TypeAndID(RootObjectTypes.User, admin.ID));
|
AdminWikiContent = GetWikiContent(adminTid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -342,7 +344,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
adminCustomFields = CustomFieldData(admin, DateCustomFields);
|
adminCustomFields = CustomFieldData(admin, DateCustomFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
//check if we need to do anything with the manager account
|
//check if we need to do anything with the manager account itself
|
||||||
if (hasWiki || adminCustomFields != null)
|
if (hasWiki || adminCustomFields != null)
|
||||||
{
|
{
|
||||||
//yes, so fetch it and modify it and put it back again
|
//yes, so fetch it and modify it and put it back again
|
||||||
@@ -352,6 +354,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.customFields = CustomFieldData(admin, DateCustomFields);
|
d.customFields = CustomFieldData(admin, DateCustomFields);
|
||||||
await util.PutAsync("User/1", d.ToString());
|
await util.PutAsync("User/1", d.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion admin export
|
#endregion admin export
|
||||||
@@ -369,6 +373,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
User c = User.GetItem(i.ID);
|
User c = User.GetItem(i.ID);
|
||||||
|
|
||||||
|
var UserTID=new TypeAndID(RootObjectTypes.User, c.ID);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.name = c.FirstName + " " + c.LastName;
|
d.name = c.FirstName + " " + c.LastName;
|
||||||
progress.Op("User " + d.name);
|
progress.Op("User " + d.name);
|
||||||
@@ -414,8 +420,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var hasWiki = WikiPage.HasWiki(c.ID);
|
var hasWiki = WikiPage.HasWiki(c.ID);
|
||||||
if (hasWiki)
|
if (hasWiki)
|
||||||
{
|
{
|
||||||
await ExportAttachments(new TypeAndID(RootObjectTypes.User, c.ID), progress);
|
await ExportAttachments(UserTID, progress);
|
||||||
d.wiki = GetWikiContent(new TypeAndID(RootObjectTypes.User, c.ID));
|
d.wiki = GetWikiContent(UserTID);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Custom fields?
|
//Custom fields?
|
||||||
@@ -439,7 +445,10 @@ namespace AyaNova.PlugIn.V8
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(new TypeAndID(RootObjectTypes.User, c.ID), progress);
|
await ExportAttachments(UserTID, progress);
|
||||||
|
|
||||||
|
//docs
|
||||||
|
await ExportDocs(UserTID, c.Docs, progress);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -844,8 +853,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
//--------------------------------------------
|
//--------------------------------------------
|
||||||
#endregion object export
|
#endregion object export
|
||||||
|
|
||||||
|
|
||||||
#region Custom fields exporter
|
#region Custom fields exporter
|
||||||
|
|
||||||
|
|
||||||
@@ -1025,22 +1033,36 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
}
|
}
|
||||||
#endregion attachments
|
#endregion attachments
|
||||||
|
|
||||||
|
|
||||||
#region Assigned docs exporter
|
#region Assigned docs exporter
|
||||||
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, AssignedDocs docs, ProgressForm progress)
|
private async System.Threading.Tasks.Task<List<string>> ExportDocs(TypeAndID tid, AssignedDocs docs, ProgressForm progress)
|
||||||
{
|
{
|
||||||
if (!ExportAssignedDocs) return;
|
List<string> NonFileUrls = new List<string>();
|
||||||
|
|
||||||
if (docs.Count == 0) return;
|
if (!ExportAssignedDocs) return NonFileUrls;
|
||||||
|
|
||||||
|
if (docs.Count == 0) return NonFileUrls;
|
||||||
|
|
||||||
|
|
||||||
//iterate the files
|
//iterate the files
|
||||||
foreach (AssignedDoc doc in docs)
|
foreach (AssignedDoc doc in docs)
|
||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return NonFileUrls;
|
||||||
var af = AyaFile.GetItem(i.LT_O_AyaFile.Value);
|
|
||||||
if (af == null) continue;
|
//is it a local file?
|
||||||
|
if (!new Uri(doc.URL).IsFile)
|
||||||
|
{
|
||||||
|
NonFileUrls.Add(doc.Description + "("+ImportTag+ ")\n" + doc.URL+"\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//can we see it?
|
||||||
|
if (!File.Exists(doc.URL))
|
||||||
|
{
|
||||||
|
NonFileUrls.Add(ImportTag + " - Assigned doc. file not found:\n" + doc.Description + "\n" + doc.URL + "\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize));
|
progress.SubOp("Wikifile: \"" + af.Name + "\" " + AyaBizUtils.FileSizeDisplay((decimal)af.FileSize));
|
||||||
|
|
||||||
@@ -1085,10 +1107,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//Map it for later processing of wiki
|
//Map it for later processing of wiki
|
||||||
var ravenId = a.ObjectResponse["data"][0]["id"].Value<long>();
|
var ravenId = a.ObjectResponse["data"][0]["id"].Value<long>();
|
||||||
Map.Add(af.ID, ravenId);
|
Map.Add(af.ID, ravenId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
progress.SubOp("");
|
progress.SubOp("");
|
||||||
|
return NonFileUrls;
|
||||||
}
|
}
|
||||||
#endregion assigned docs
|
#endregion assigned docs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user