azerbini / eamena_dev

Arches is a web-based, geospatial information system for cultural heritage inventory and management.
GNU Affero General Public License v3.0
1 stars 2 forks source link

EAMENA_ID upload #115

Closed TeriForey closed 5 years ago

TeriForey commented 5 years ago

Description of Change

EAMENA_IDs can now be successfully exported and then imported via arches, bulk upload and json files. Validation checks have been added to bulk upload, arches and json imports so that if EAMENA_IDs with those values already exist nothing will be imported/uploaded. Also fixed errors in arches upload that meant not all branches were merged in at the correct location.

Note, the creation of an EAMENA_ID does depend on the settings.EAMENA_RESOURCES dictionary, so if uploading something with an EAMENA_ID called 'FISH_3' and it's a heritage place, the ID that will be searched for within the database would be 'EAMENA_0000003'. There aren't any checks that the EAMENA_ID should look sensible - but these could be added if you wanted.

Issues Solved

98

Types of changes

Checklist

Further comments

mradamcox commented 5 years ago

@TeriForey I may be missing something, but this isn't working for me. To test, I started with a working E27 upload file for North Africa, then added a column in the NOT sheet called EAMENA_ID.E42 and populated it with EAMENA-50 through EAMENA-59. When I try to bulk upload this file, I do see the unique id validation pass correctly. In the resulting .arches file I see lines like this for each resource

0|HERITAGE_PLACE.E27|EAMENA_ID.E42|EAMENA-50|0

When I load the resources they load well, no errors and looks like everything loads, but EAMENA ids are set back to starting at 000001; the existing ids are not imported.

I also tried with JSON export: I exported the single 000003 resource after it's creation as described above, and then removed all resources and imported it through the command line. A single new resource was created, but it's id was 000001.

I'll attach the files here too. Any thoughts on what I'm doing wrong? north-africa-test-EAMENA_ID-import.zip

TeriForey commented 5 years ago

Thanks @mradamcox, that was totally my bad! I got so caught up in the different scenarios I missed the crucial part! Should be working now, it'll also do the same for heritage component IDs. Note, when you upload something with an eamena ID of 50, all new resources will be numbered 51 upwards (even if there's nothing between 1 and 50).

mradamcox commented 5 years ago

I've been testing this out as I work on v1 - v2 migration, and it seems to work perfectly. Thanks @TeriForey !