This commit is contained in:
2022-03-27 18:43:59 +00:00
parent cebaa3548a
commit 9f3f2f9284
4 changed files with 26 additions and 9 deletions

2
.vscode/launch.json vendored
View File

@@ -48,7 +48,7 @@
"AYANOVA_DATA_PATH": "c:\\temp\\ravendata",
"AYANOVA_USE_URLS": "http://*:7575;",
//"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",
"AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE": "true",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-8",
//"AYANOVA_REPORT_RENDERING_TIMEOUT":"1",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",

View File

@@ -22,7 +22,6 @@ Import / update
Back end import must handle each item one by one and decide if update or add and act accordingly working with the convention
TODO:
OUTSTANDING:
front end translations and final text (as schema update)
docs incomplete for import form section showing UI fields and menu options (awaiting trans keys)
replicate customerbiz import code to all the other supported objects
test each object

View File

@@ -52,7 +52,7 @@ You can easily remove the tag later if desired by using the [bulk tagger extensi
Checkmarking "Update existing records" indicates you want to **update** matched records in AyaNova.
AyaNova will attempt to match the records in the import file to existing records in the AyaNova database by comparing the "key" field (identified in each objects import specifications).
AyaNova will attempt to match the records in the import file to existing records in the AyaNova database by comparing the "key" field (identified in each objects [import specifications](#import-specifications)).
Usually the key field will be the `Name` field but in some cases it may be another field that is the primary unique identifier for that record type.
@@ -88,9 +88,11 @@ Internally AyaNova only imports .json data; a .csv file is converted to json for
### Import file format
Each supported object type that can be imported has it's import specification and examples documented individually, click through the objects listed below to see the import file specifications for each type.
Each supported object type that can be imported has it's [import specification](#import-specifications) and examples documented individually, click through the objects listed below to see the import file specifications for each type.
Field names in .json or header row names in .csv files _must_ match exactly in case and spelling the field names in each object type's specification document. Any other fields included will be removed by AyaNova before sending to the server for import.
Field names in .json or header row names in .csv files _must_ match exactly in case and spelling the field names in each object type's [import specification](#import-specifications) document.
Any other fields included will be removed by AyaNova before sending to the server for import.
CSV files must have a header row as the first row containing the specified field names. It's ok to omit any non-required fields.
@@ -128,7 +130,7 @@ As a rough guideline we recommend keeping the import file under 300kb in size to
## Can I import an AyaNova export file?
JSON export files created with the [Export extension](ay-ex-export.md) can be imported into AyaNova however not all fields exported are importable, any fields not found in the import specification will be ignored.
JSON export files created with the [Export extension](ay-ex-export.md) can be imported into AyaNova however not all fields exported are importable, any fields not found in the [import specifications](#import-specifications) will be ignored.
The export extension exports many more object types and includes more fields than the import process supports.
@@ -142,10 +144,22 @@ The following listed types of AyaNova objects can currently be imported / update
Types not listed may be added in future; for needs beyond what is provided with the import feature, you can always import **any** data now into AyaNova via software written using the [AyaNova developers API](api-intro.md).
Each item below links to a page showing the specific format required for the import file and special notes about importing that specific object:
Each object type listed below links to a page showing the specific format required for the import file and special notes about importing that specific object:
- [Customer specifications](adm-import-customer.md)
- [Customers](adm-import-customer.md)
## Import form
#### Type
AyaNova object types that can currently be imported / updated.
Here you select the desired destination object type to be imported or updated.
If a type of object is not on this list it is not importable through this import form however any object that can be created or edited in AyaNova can be imported via the [AyaNova developers API](api-intro.md).
Other controls on this form are hidden until a type is selected.
####
### Menu options

View File

@@ -1291,18 +1291,22 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ImportNewRecords', 'Import new records' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'UpdateExistingRecords', 'Update existing records' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AdminImportUpdateWarning', 'Warning: you are about to permanently change multiple objects.\r\nAre you sure?' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'FileToImport', 'File to import' FROM atranslation t where t.baselanguage = 'en'");
//spanish translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ImportNewRecords', 'Importar nuevos registros' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'UpdateExistingRecords', 'Actualizar registros existentes' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AdminImportUpdateWarning', 'Advertencia: está a punto de cambiar varios objetos de forma permanente.\r\n¿Está seguro?' FROM atranslation t where t.baselanguage = 'es'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'FileToImport', 'Archivo a importar' FROM atranslation t where t.baselanguage = 'es'");
//french translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ImportNewRecords', 'Importer de nouveaux enregistrements' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'UpdateExistingRecords', 'Mettre à jour les enregistrements existants' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AdminImportUpdateWarning', 'Avertissement: vous êtes sur le point de modifier définitivement plusieurs objets.\r\nÊtes-vous sûr?' FROM atranslation t where t.baselanguage = 'fr'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'FileToImport', 'Fichier à importer' FROM atranslation t where t.baselanguage = 'fr'");
//german translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ImportNewRecords', 'Importieren Sie neue Datensätze' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'UpdateExistingRecords', 'Aktualisieren Sie vorhandene Datensätze' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AdminImportUpdateWarning', 'Warnung: Sie sind dabei, mehrere Objekte dauerhaft zu ändern.\r\nSind Sie sicher?' FROM atranslation t where t.baselanguage = 'de'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'FileToImport', 'Zu importierende Datei' FROM atranslation t where t.baselanguage = 'de'");
await SetSchemaLevelAsync(++currentSchema);
}