Skip to content

requiredForImport #32

@benloh

Description

@benloh

Add new template parameter requiredForImportExport flag to determine whether or not the data is exported and required for import, separate from hidden, which is more UI oriented.

Issues with hidden

The intent of the "hidden" field is to allow you to start with the default template, but be able to simplify the initial representation by hiding some fields initially. Once you're ready to introduce the complexity, you can unhide those fields.

The problem is that "hiding" a field has consequences for importing and exporting.
-- During "export" we only export fields that are not hidden.
-- During "import", while the app does check that any non-hidden fields (e.g. required fields) are present, the app will actually blindly import any fields defined in the header.
* So for instance, if you mark "type" as hidden, but your import file includes a "Type" header (because "Type" maps to "type"), the "Type" data will get imported. However, if you then "export" the data again, the "Type" header will NOT be exported since it was set to "hidden".

Need to verify this:

  1. Start with a db that has a field with data (e.g. 'type')
  2. hide the field
  3. import data that does NOT have the field
  4. is the existing data clobbered?

Issues to consider

  1. Should we allow arbitrary import of any field as long as it's defined in the header (and doesn't need to be defined in the template)? e.g. NetCreate will willingly import a node file with a novel field called "URL" that is not defined in the template and does not match an existing field, loading the data into node object during import. That field may show up in some instances, but for the most part it will be invisible (e.g. not shown in Node Editor or Node Table), not exported, but probably saved in the db. Should there be a warning about this? Should it be rejected?

  2. It can be a royal pain to match all the keys in an import file, if all are required. Should we just require the key fields? And just warn about non-key fields? e.g. for nodes, as long as you have a label, the file will be imported; for edges, you need a valid source and target. Or do we want strict control of import, making sure everyone has all required fields?

  3. Does it make sense to keep the hidden flag? Is it more confusing to have it there and hidden rather than removing it entirely?

  4. Do we want to add support for arbitrary fields? (We'd probably have to define field type (string vs number)? Or just treat them all as strings?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions