project-open-data / catalog-generator

A multi-format tool to generate and maintain agency.gov/data catalog files.
http://project-open-data.github.com/catalog-generator/
21 stars 18 forks source link

Importing a CSV file yields no data and returns me to home page #22

Open JDLH opened 10 years ago

JDLH commented 10 years ago

I am trying to import a CSV file with fields describing 150+ datasets, and generate a data catalogue in JSON format. This is not working for me in my present environment. I have reproduced the failure with a simple test case.

How to reproduce:

  1. Go to main page of hosted catalog generator, http://project-open-data.github.io/catalog-generator/# . Two sets of empty fields appear, with buttons "Add new dataset", "Export", "Import" at the bottom.
  2. Click the "Import" button at the bottom. The "Catalog Generator / Import" page appears.
  3. Click the "Browse" button. A standard file open dialog appears.
  4. Select the test file, Simple data catalogue.csv (contents below). Click OK. A field list appears. It has the message, "Map each field to the proper schema attribute. Non-mapped fields will be ignored.", and the field names from the CSV file: "Title Field", "Homepage field", "Format field", "Download field". There are two buttons "Import" and "Back" at the bottom.
  5. Map the CSV fields to catalog fields in any sensible way. I used: "Title Field": "Title", "Homepage field": "Homepage URL", "Format field": "Format", "Download field": "Download URL"
  6. Press the "Import" button.

Observed behaviour: The main page appears. There are no values in the catalog fields. They have the same light-grey placeholder text as they did when starting the test. Clicking the "Export" button causes an Export page to appear. It has JSON catalog data with null contents:

[{"title":null,"description":null,"keyword":null,"modified":null,"publisher":null,
"contactPoint":null,"mbox":null,"identifier":null,"accessLevel":null,
"accessLevelComment":null,"bureauCode":null,"programCode":null,"accessURL":null,
"webService":null,"format":null,"license":null,"spatial":null,"temporal":null},
{"title":null,"description":null,"keyword":null,"modified":null,"publisher":null,
"contactPoint":null,"mbox":null,"identifier":null,"accessLevel":null,
"accessLevelComment":null,"bureauCode":null,"programCode":null,"accessURL":null,
"webService":null,"format":null,"license":null,"spatial":null,"temporal":null}]

Expected behaviour: On returning to the main page, there is one set of fields for every row of the CSV import file. The values of the fields are taken from the contents of the fields in the CSV file, as determined by the field mapping.

Test File Here is my simple test file, Simple data catalogue.csv .

"Title Field","Homepage field","Format field","Download field"
"Test title","http://example.com/","csv","http://example.com/test.csv"

Other Information I am using FireFox 16.0.2 on Mac OS X 10.5.8.