This commit is contained in:
@@ -212,6 +212,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
Regions export wiki to user
|
Regions export wiki to user
|
||||||
|
|
||||||
todo: RAVEN workorder structure and then export here
|
todo: RAVEN workorder structure and then export here
|
||||||
|
todo: modify each biz object export to include progress resetting code added to top of workorder service export
|
||||||
|
reset op, subop at start of export so error doesn't show last previous item's name
|
||||||
|
|
||||||
todo: export docs, settle on "Export" and edit all references to Import to switch it around as it's probably confusing artifact from dbdump days
|
todo: export docs, settle on "Export" and edit all references to Import to switch it around as it's probably confusing artifact from dbdump days
|
||||||
|
|
||||||
@@ -424,7 +426,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
Tagit(cert.UserCertificationID, tags);
|
Tagit(cert.UserCertificationID, tags);
|
||||||
}
|
}
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
//Custom fields?
|
//Custom fields?
|
||||||
if (ShouldExportCustom)
|
if (ShouldExportCustom)
|
||||||
d.customFields = CustomFieldData(c, DateCustomFields);
|
d.customFields = CustomFieldData(c, DateCustomFields);
|
||||||
@@ -467,7 +469,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (!string.IsNullOrEmpty(NonFileUrls))
|
if (!string.IsNullOrEmpty(NonFileUrls))
|
||||||
{
|
{
|
||||||
//need to repost the user with the notes modified
|
//need to repost the user with the notes modified
|
||||||
|
|
||||||
d.login = null;
|
d.login = null;
|
||||||
d.password = null;
|
d.password = null;
|
||||||
d.notes = NonFileUrls + "\n-----------------\n" + d.notes;
|
d.notes = NonFileUrls + "\n-----------------\n" + d.notes;
|
||||||
@@ -529,7 +531,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
Tagit(c.ClientGroupID, tags);
|
Tagit(c.ClientGroupID, tags);
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
|
|
||||||
//Custom fields?
|
//Custom fields?
|
||||||
if (ShouldExportCustom)
|
if (ShouldExportCustom)
|
||||||
d.customFields = CustomFieldData(c, DateCustomFields);
|
d.customFields = CustomFieldData(c, DateCustomFields);
|
||||||
@@ -642,7 +644,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
repost = true;
|
repost = true;
|
||||||
}
|
}
|
||||||
if (repost)
|
if (repost)
|
||||||
await util.PutAsync(ObjectTypeName+"/" + RavenId.ToString(), d.ToString());
|
await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString());
|
||||||
//-----
|
//-----
|
||||||
|
|
||||||
//Event log fixup
|
//Event log fixup
|
||||||
@@ -683,7 +685,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
Tagit(c.RegionID, tags);
|
Tagit(c.RegionID, tags);
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
|
|
||||||
//Custom fields?
|
//Custom fields?
|
||||||
if (ShouldExportCustom)
|
if (ShouldExportCustom)
|
||||||
d.customFields = CustomFieldData(c, DateCustomFields);
|
d.customFields = CustomFieldData(c, DateCustomFields);
|
||||||
@@ -837,7 +839,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
|
|
||||||
//Custom fields?
|
//Custom fields?
|
||||||
if (ShouldExportCustom)
|
if (ShouldExportCustom)
|
||||||
d.customFields = CustomFieldData(c, DateCustomFields);
|
d.customFields = CustomFieldData(c, DateCustomFields);
|
||||||
@@ -1010,7 +1012,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
repost = true;
|
repost = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (repost)
|
if (repost)
|
||||||
await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString());
|
await util.PutAsync(ObjectTypeName + "/" + RavenId.ToString(), d.ToString());
|
||||||
//-----
|
//-----
|
||||||
@@ -1201,7 +1203,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
progress.Op(ObjectTypeName + " " + d.name);
|
progress.Op(ObjectTypeName + " " + d.name);
|
||||||
d.active = c.Active;
|
d.active = c.Active;
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
|
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
|
|
||||||
@@ -1274,7 +1276,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
|
Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value);
|
||||||
var ObjectTID = new TypeAndID(RootObjectTypes.WorkorderService, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.WorkorderService, c.ID);
|
||||||
//make one on the server to update
|
//make one on the server to update
|
||||||
var rMainObject = await util.PostAsync(RavenObjectName+"/Create?serial="+c.WorkorderService.ServiceNumber);
|
var rMainObject = await util.PostAsync(RavenObjectName + "/Create?serial=" + c.WorkorderService.ServiceNumber);
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Map.Add(c.ID, RavenId);
|
Map.Add(c.ID, RavenId);
|
||||||
|
|
||||||
@@ -1282,7 +1284,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
d.concurrencyToken = util.CTokenFromResponse(rMainObject);
|
||||||
progress.Op(ObjectTypeName + " " + c.WorkorderService.ServiceNumber);
|
progress.Op(ObjectTypeName + " " + c.WorkorderService.ServiceNumber);
|
||||||
d.active = true;//probably can remove this at server, just stubbed in for now
|
d.active = true;//probably can remove this at server, just stubbed in for now
|
||||||
|
|
||||||
Tagit(c.RegionID, tags);
|
Tagit(c.RegionID, tags);
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
@@ -1290,11 +1292,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//if (ShouldExportCustom)
|
//if (ShouldExportCustom)
|
||||||
// d.customFields = CustomFieldData(c, DateCustomFields);
|
// d.customFields = CustomFieldData(c, DateCustomFields);
|
||||||
|
|
||||||
// var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
// var rMainObject = await util.PostAsync(RavenObjectName, d.ToString());
|
||||||
|
|
||||||
|
|
||||||
//Attachments / FILES
|
//Attachments / FILES
|
||||||
await ExportAttachments(ObjectTID, progress);
|
await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrderItem);
|
||||||
|
|
||||||
//-----
|
//-----
|
||||||
bool repost = false;
|
bool repost = false;
|
||||||
@@ -1832,7 +1834,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
#endregion custom fields
|
#endregion custom fields
|
||||||
|
|
||||||
#region Attachments exporter
|
#region Attachments exporter
|
||||||
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress)
|
private async System.Threading.Tasks.Task ExportAttachments(TypeAndID tid, ProgressForm progress, util.AyaType specificRavenType = util.AyaType.NoType)
|
||||||
{
|
{
|
||||||
if (!WikiPage.HasWiki(tid.ID)) return;
|
if (!WikiPage.HasWiki(tid.ID)) return;
|
||||||
|
|
||||||
@@ -1873,7 +1875,12 @@ namespace AyaNova.PlugIn.V8
|
|||||||
MultipartFormDataContent formDataContent = new MultipartFormDataContent();
|
MultipartFormDataContent formDataContent = new MultipartFormDataContent();
|
||||||
|
|
||||||
//Form data like the bizobject type and id
|
//Form data like the bizobject type and id
|
||||||
formDataContent.Add(new StringContent(((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString()), name: "AttachToObjectType");
|
string RavenTypeAsString = "";
|
||||||
|
if (specificRavenType != util.AyaType.NoType)
|
||||||
|
RavenTypeAsString = ((int)specificRavenType).ToString();
|
||||||
|
else
|
||||||
|
RavenTypeAsString = ((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString();
|
||||||
|
formDataContent.Add(new StringContent(RavenTypeAsString), name: "AttachToObjectType");
|
||||||
formDataContent.Add(new StringContent(Map[tid.ID].ToString()), name: "AttachToObjectId");
|
formDataContent.Add(new StringContent(Map[tid.ID].ToString()), name: "AttachToObjectId");
|
||||||
formDataContent.Add(new StringContent(ImportTag), name: "Notes");
|
formDataContent.Add(new StringContent(ImportTag), name: "Notes");
|
||||||
formDataContent.Add(new StringContent(dFileData.ToString()), name: "FileData");
|
formDataContent.Add(new StringContent(dFileData.ToString()), name: "FileData");
|
||||||
@@ -1900,14 +1907,14 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//Map it for later processing of wiki
|
//Map it for later processing of wiki
|
||||||
//attachment upload route returns all attachments for this object in file name order
|
//attachment upload route returns all attachments for this object in file name order
|
||||||
//so need to find *our* most recent uploaded attachment so need to find the highest raven id number
|
//so need to find *our* most recent uploaded attachment so need to find the highest raven id number
|
||||||
var returnArray=((JArray)a.ObjectResponse["data"]);
|
var returnArray = ((JArray)a.ObjectResponse["data"]);
|
||||||
var ravenId = -1L;
|
var ravenId = -1L;
|
||||||
foreach (JObject o in returnArray)
|
foreach (JObject o in returnArray)
|
||||||
{
|
{
|
||||||
var oId = o["id"].Value<long>();
|
var oId = o["id"].Value<long>();
|
||||||
if (oId > ravenId) ravenId = oId;
|
if (oId > ravenId) ravenId = oId;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map.Add(af.ID, ravenId);
|
Map.Add(af.ID, ravenId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user