Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-81485

Extend the Dataformat API to allow importing of various file types

XMLWordPrintable

      I'm helping out with MDL-81376 which is a fairly typical export / import features. It exports some table of data using the dataformat api for free via tablelib, and then accepts an upload of a csv file.

      Technically this is a slight mismatch - in theory the site admin could turn off the csv dataformat plugin so you would be downloading in say json, and then accepting an upload in csv. I think in practice it's not a big deal, but the proper solution would:

      • Allow each dataformat plugin to declare if it supports import
      • Have a helper function which takes an arbitrary uploaded file, infers its type, hands it off to the right dataformat and gets back a format agnostic list of records
      • Possibly we could also add a custom formslib element of a 'dataformatfileupload' which handles everything and the form handler just gets nice data without knowing how it got it.
      • When exporting have an optional flag in code which filters the exports to only those which can be imported, or at least give a clear indication in the download widget that only some would be supported for import

       

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.