This commit is contained in:
2020-07-06 21:22:34 +00:00
parent c1a064d14a
commit e84b5b6bd5
2 changed files with 91 additions and 96 deletions

View File

@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("AyaNova.PlugIn.V8")] [assembly: AssemblyTitle("AyaNova.PlugIn.V8")]
[assembly: AssemblyDescription("V8 export plugin for AyaNova")] [assembly: AssemblyDescription("V8 migrate plugin for AyaNova")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ground Zero Tech-Works Inc.")] [assembly: AssemblyCompany("Ground Zero Tech-Works Inc.")]
[assembly: AssemblyProduct("AyaNova.PlugIn.V8")] [assembly: AssemblyProduct("AyaNova.PlugIn.V8")]

View File

@@ -16,10 +16,10 @@ namespace AyaNova.PlugIn.V8
{ {
class util class util
{ {
public static string PRE_RELEASE_VERSION_STRING {get;set;} public static string PRE_RELEASE_VERSION_STRING { get; set; }
public static GZTW.AyaNova.BLL.LocalizedTextTable LocaleText = null; public static GZTW.AyaNova.BLL.LocalizedTextTable LocaleText = null;
const string TEST_ROUTE = "ServerInfo"; const string TEST_ROUTE = "notify/hello";
const string API_BASE_ROUTE = "api/v8/"; const string API_BASE_ROUTE = "api/v8/";
static HttpClient client = new HttpClient(); static HttpClient client = new HttpClient();
//url once known to be good //url once known to be good
@@ -77,13 +77,8 @@ namespace AyaNova.PlugIn.V8
HttpResponseMessage response = await client.GetAsync(serverUrl + TEST_ROUTE); HttpResponseMessage response = await client.GetAsync(serverUrl + TEST_ROUTE);
if (response.IsSuccessStatusCode) if (response.IsSuccessStatusCode)
{ {
var ret = await response.Content.ReadAsStringAsync(); ApiBaseUrl = serverUrl;
if (ret.Contains("AyaNova")) return "OK";
{
ApiBaseUrl = serverUrl;
return "OK";
}
} }
else else
{ {
@@ -93,7 +88,7 @@ namespace AyaNova.PlugIn.V8
catch { return "Failed"; } catch { return "Failed"; }
return "failed"; // return "failed";
} }
@@ -278,7 +273,7 @@ namespace AyaNova.PlugIn.V8
//deadman switch //deadman switch
if (appendValue > int.MaxValue) if (appendValue > int.MaxValue)
{ {
throw new System.OverflowException("UniqueNameBuilder: Unique name could not be generated for item \""+oldName+"\" after "+int.MaxValue.ToString()+" attempts"); throw new System.OverflowException("UniqueNameBuilder: Unique name could not be generated for item \"" + oldName + "\" after " + int.MaxValue.ToString() + " attempts");
} }
var appendString = "-" + appendValue.ToString(); var appendString = "-" + appendValue.ToString();
string ret = oldName + appendString; string ret = oldName + appendString;
@@ -417,89 +412,89 @@ namespace AyaNova.PlugIn.V8
//***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key //***IMPORTANT: Also need to add translations for any new biz objects added that don't match exactly the name here in the key
//because enumlist gets it that way, i.e. "Global" would be the expected key //because enumlist gets it that way, i.e. "Global" would be the expected key
NoType = 0, NoType = 0,
Global = 1, Global = 1,
// //
Widget = 2,//attachable, wikiable, reviewable Widget = 2,//attachable, wikiable, reviewable
// //
User = 3,//attachable, wikiable, reviewable User = 3,//attachable, wikiable, reviewable
ServerState = 4, ServerState = 4,
License = 5, License = 5,
LogFile = 6, LogFile = 6,
PickListTemplate = 7, PickListTemplate = 7,
// //
Customer = 8, Customer = 8,
ServerJob = 9, ServerJob = 9,
// //
Contract = 10, Contract = 10,
TrialSeeder = 11, TrialSeeder = 11,
Metrics = 12, Metrics = 12,
Translation = 13, Translation = 13,
UserOptions = 14, UserOptions = 14,
// //
HeadOffice = 15, HeadOffice = 15,
// //
LoanUnit = 16, LoanUnit = 16,
FileAttachment = 17, FileAttachment = 17,
DataListView = 18, DataListView = 18,
FormCustom = 19, FormCustom = 19,
// //
Part = 20, Part = 20,
// //
PM = 21, PM = 21,
// //
PMItem = 22, PMItem = 22,
// //
PMTemplate = 23, PMTemplate = 23,
// //
PMTemplateItem = 24, PMTemplateItem = 24,
// //
Project = 25, Project = 25,
// //
PurchaseOrder = 26, PurchaseOrder = 26,
// //
Quote = 27, Quote = 27,
// //
QuoteItem = 28, QuoteItem = 28,
// //
QuoteTemplate = 29, QuoteTemplate = 29,
// //
QuoteTemplateItem = 30, QuoteTemplateItem = 30,
// //
Unit = 31, Unit = 31,
// //
UnitModel = 32, UnitModel = 32,
// //
Vendor = 33, Vendor = 33,
//--- WorkOrder //--- WorkOrder
// //
WorkOrder = 34, WorkOrder = 34,
// //
WorkOrderItem = 35, WorkOrderItem = 35,
// //
WorkOrderItemExpense = 36, WorkOrderItemExpense = 36,
// //
WorkOrderItemLabor = 37, WorkOrderItemLabor = 37,
// //
WorkOrderItemLoan = 38, WorkOrderItemLoan = 38,
// //
WorkOrderItemPart = 39, WorkOrderItemPart = 39,
// //
WorkOrderItemPartRequest = 40, WorkOrderItemPartRequest = 40,
// //
WorkOrderItemScheduledUser = 41, WorkOrderItemScheduledUser = 41,
// //
WorkOrderItemTask = 42, WorkOrderItemTask = 42,
// //
WorkOrderItemTravel = 43, WorkOrderItemTravel = 43,
// //
WorkOrderItemUnit = 44, WorkOrderItemUnit = 44,
//--- //---
// //
WorkOrderTemplate = 45, WorkOrderTemplate = 45,
// //
WorkOrderTemplateItem = 46 WorkOrderTemplateItem = 46
//NOTE: New objects added here need to also be added to the following classes: //NOTE: New objects added here need to also be added to the following classes:
@@ -565,7 +560,7 @@ Locale Français is customized [signature: 804154061] exporting
allStrings.Add(entry.Value); allStrings.Add(entry.Value);
} }
int CurrentLocaleHash = GetOrderIndependentHashCode<string>(allStrings); int CurrentLocaleHash = GetOrderIndependentHashCode<string>(allStrings);
if (StockLocaleHashes.Contains(CurrentLocaleHash)) return false; if (StockLocaleHashes.Contains(CurrentLocaleHash)) return false;
progress.Append("Locale " + localeName + " is customized [signature: " + CurrentLocaleHash.ToString() + "] exporting"); progress.Append("Locale " + localeName + " is customized [signature: " + CurrentLocaleHash.ToString() + "] exporting");