This commit is contained in:
@@ -158,7 +158,6 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
private Dictionary<Guid, long> Map = new Dictionary<Guid, long>();
|
private Dictionary<Guid, long> Map = new Dictionary<Guid, long>();
|
||||||
private Dictionary<Guid, string> TagMap = new Dictionary<Guid, string>();
|
private Dictionary<Guid, string> TagMap = new Dictionary<Guid, string>();
|
||||||
private Dictionary<string, string> CustomFieldLocaleKeys = new Dictionary<string, string>();//holds custom field Raven as key and v7 custom text for that field for later export
|
|
||||||
private Dictionary<string, long> LocaleMap = new Dictionary<string, long>();
|
private Dictionary<string, long> LocaleMap = new Dictionary<string, long>();
|
||||||
|
|
||||||
private string ImportTag = "v7-import";
|
private string ImportTag = "v7-import";
|
||||||
@@ -180,7 +179,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
progress.Op("Preparing to export....");
|
progress.Op("Preparing to export....");
|
||||||
Map.Clear();
|
Map.Clear();
|
||||||
TagMap.Clear();
|
TagMap.Clear();
|
||||||
CustomFieldLocaleKeys.Clear();
|
|
||||||
LocaleMap.Clear();
|
LocaleMap.Clear();
|
||||||
|
|
||||||
|
|
||||||
@@ -193,11 +192,15 @@ namespace AyaNova.PlugIn.V8
|
|||||||
TODO:
|
TODO:
|
||||||
*
|
*
|
||||||
* locales
|
* locales
|
||||||
|
Add *customXX locale keys in RAVEN for each v7 comparable object that is custom text able so can properly do localized text
|
||||||
|
but, figure out where they are stored in v7 because the export isn't bombing so where are they going or coming from?
|
||||||
|
|
||||||
* todo locales for custom fields fixup - needs objects keys at destination first.
|
* todo locales for custom fields fixup - needs objects keys at destination first.
|
||||||
|
|
||||||
* todo: once have moved beyond what's in the v8 import stuff then need to remove all that, though maybe comment out some bits as some may be useful for import / export??
|
* todo: once have moved beyond what's in the v8 import stuff then need to remove all that, though maybe comment out some bits as some may be useful for import / export??
|
||||||
*
|
* todo: make up stub versions of all the core biz objects so can test a full wiki, attachment etc import
|
||||||
* TODO: User, fixup translationID, headofficeid, clientid vendorid, phone1, phone2, pagermaxtext
|
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: User: headofficeid, clientid vendorid, phone1, phone2, pagermaxtext
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@@ -451,8 +454,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
await util.EventLog(3, newId, creator, modifier, c.Created, c.Modified);
|
await util.EventLog(3, newId, creator, modifier, c.Created, c.Modified);
|
||||||
}
|
}
|
||||||
//todo fixup post import
|
|
||||||
progress.Append("TODO: User, fixup translationID, headofficeid, clientid vendorid, phone1, phone2, pagermaxtext");
|
|
||||||
}
|
}
|
||||||
#endregion clients
|
#endregion clients
|
||||||
|
|
||||||
@@ -528,13 +530,18 @@ namespace AyaNova.PlugIn.V8
|
|||||||
//name like this: "My custom (Espanol)" etc one for each target stock language
|
//name like this: "My custom (Espanol)" etc one for each target stock language
|
||||||
|
|
||||||
var exportName = i.Locale + " (" + RavenLocaleName + ")";
|
var exportName = i.Locale + " (" + RavenLocaleName + ")";
|
||||||
|
progress.SubOp("");
|
||||||
progress.Op("Exporting " + i.Locale + " to " + exportName);
|
progress.Op("Exporting " + i.Locale + " to " + exportName);
|
||||||
|
|
||||||
var t = new util.NameIdItem { Name = exportName, Id = x };
|
var t = new util.NameIdItem { Name = exportName, Id = x };
|
||||||
a = await util.PostAsync("Translation/Duplicate", JObject.FromObject(t).ToString());
|
a = await util.PostAsync("Translation/Duplicate", JObject.FromObject(t).ToString());
|
||||||
var targetTranslationId = util.IdFromResponse(a);
|
var targetTranslationId = util.IdFromResponse(a);
|
||||||
var ctoken = util.CTokenFromResponse(a);
|
var ctoken = util.CTokenFromResponse(a);
|
||||||
//add to maps so can set user to it on export
|
//add to maps so can set user to it on export
|
||||||
LocaleMap.Add(i.Locale, targetTranslationId);
|
//going to default to the English based one because
|
||||||
|
//that's the majority of the users
|
||||||
|
if (RavenLocaleName == "en")
|
||||||
|
LocaleMap.Add(i.Locale, targetTranslationId);
|
||||||
//Ok, have our target locale created, not we need to insert our custom translations one by one
|
//Ok, have our target locale created, not we need to insert our custom translations one by one
|
||||||
var trans = ((JArray)a.ObjectResponse["data"]["translationItems"]).ToObject<List<TranslationItem>>();
|
var trans = ((JArray)a.ObjectResponse["data"]["translationItems"]).ToObject<List<TranslationItem>>();
|
||||||
|
|
||||||
@@ -567,7 +574,7 @@ namespace AyaNova.PlugIn.V8
|
|||||||
|
|
||||||
|
|
||||||
//update it
|
//update it
|
||||||
progress.SubOp("Posting translation "+ exportName +" to server ");
|
progress.SubOp("Posting translation " + exportName + " to server ");
|
||||||
await util.PutAsync("Translation/UpdateTranslationItemsDisplayText",
|
await util.PutAsync("Translation/UpdateTranslationItemsDisplayText",
|
||||||
JArray.FromObject(exportItems).ToString());
|
JArray.FromObject(exportItems).ToString());
|
||||||
|
|
||||||
@@ -897,8 +904,8 @@ namespace AyaNova.PlugIn.V8
|
|||||||
if (f.Visible)
|
if (f.Visible)
|
||||||
{
|
{
|
||||||
int n = Convert.ToInt32(f.FieldName.Replace("Custom", "")) + 1;//raven custom fields are 1 based, v7 are zero based
|
int n = Convert.ToInt32(f.FieldName.Replace("Custom", "")) + 1;//raven custom fields are 1 based, v7 are zero based
|
||||||
CustomFieldLocaleKeys.Add(RavenCustomTranslationKeyObjectName + n.ToString(),
|
//CustomFieldLocaleKeys.Add(RavenCustomTranslationKeyObjectName + n.ToString(),
|
||||||
util.LocaleText.GetLocalizedText(v7CustomFieldObjectName + ".Label." + f.FieldName));
|
// util.LocaleText.GetLocalizedText(v7CustomFieldObjectName + ".Label." + f.FieldName));
|
||||||
|
|
||||||
dynamic dt = new JObject();
|
dynamic dt = new JObject();
|
||||||
dt.fld = RavenCustomTranslationKeyObjectName + "Custom" + n.ToString();
|
dt.fld = RavenCustomTranslationKeyObjectName + "Custom" + n.ToString();
|
||||||
|
|||||||
Reference in New Issue
Block a user