Project

General

Profile

Feature #1386

Ability to import into KV lookups

Added by Luke Murphey over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
05/21/2017
Due date:
% Done:

100%


Description

Add the ability to import a CSV into a KV store lookup.

Test.csv View (1.01 MB) Luke Murphey, 05/20/2017 06:05 AM


Subtasks

Task #1870: Add detection of import errors; show in progress dialogClosedLuke Murphey

Task #1871: Ensure that input file has at least some fieldsClosedLuke Murphey

History

#1 Updated by Luke Murphey over 8 years ago

  1. Will need to ensure that the fields of the CSV match that of the KV store
    1. If the input includes a _key field, should it be:
      1. ignored: just make a new entry
      2. used to overwrite: potentially overwriting existing entries to update them
      3. used if no conflict: only imported if a row doesn't exist with that _key (preferred)
      4. make new entries: just make more rows
    2. If the CSV includes extra fields (more than the ones that the KV store includes), should they be:
      1. ignored: not imported (preferred)
      2. imported: imported but won't be shown since not a declared field (preferred, if the KV store import will still accept them)
      3. cancelled: stopping importation
    3. If the CSV includes fewer fields, should they be:
      1. ignored: missing fields will be empty
      2. cancelled: import stopped (preferred)
      3. use default: use some field value that the user defines

#2 Updated by Luke Murphey over 7 years ago

  • Target version changed from Plus_1 to 2.7.0

#3 Updated by Luke Murphey over 7 years ago

Sub-tasks:

1) Show import options
2) Validate schema of incoming file
3) Load file into editor
4) Do saves of rows
5) Ignore existing rows with the same _key

#4 Updated by Luke Murphey over 7 years ago

This is a bit difficult with KV store lookups since calling renderLookup() loses the header on KV lookups.

A couple of ways to do this:
  1. iteratively add each row
  2. pull in all of the rows and then have it save

#5 Updated by Luke Murphey over 7 years ago

A couple of other options:
  • Have importer just import each row
  • Have Python do the import and reload the lookup when done
  • Have JS do the import in the background and reload the lookup when done

#6 Updated by Luke Murphey over 7 years ago

#8 Updated by Luke Murphey over 7 years ago

Things still to be done:

  1. [Done] Save lookups with owner
  2. [Done] Show a progress dialog

#9 Updated by Luke Murphey over 7 years ago

Here is a primer on the behavior:

  1. Files can only be imported if they include all of the fields of the lookup.
    1. Extra columns will cause import to fail.
    2. _key values in the import will be ignored.
    3. Missing columns will be silently ignored.
    4. An error is generated if no columns match
  2. A progress dialog is displayed during import
    1. The progress dialog will be shown when a file is dragged unto the editor or when a file is selected.
  3. The import can be cancelled clicking cancel or by closing the dialog with the "X" button.

#10 Updated by Luke Murphey over 7 years ago

  • Status changed from New to Closed

Also available in: Atom PDF