zotero/scaffold — pull request #16 by aurimasv (2014-06-27 07:47:19+00:00)
Title: Tweaks to test display and saving

This accomplishes two things:

When running `doWeb` or `doImport` in Scaffold, it will display which item fields will be removed/renamed when the item is actually imported into Zotero. The display is similar to what we see when running tests.

When saving tests, Scaffold will now save the item fields in a deterministic (sorted) way. This means that we should no longer see fields randomly moving around in diffs when updating tests. It will also sort tags, which sometimes tend to jump around. Most of the fields are sorted alphabetically, but I decided that itemType, title, creators, and date (the most important metadata) should always be at the top. I also moved stuff that's rarely used/takes up a lot of space, to the bottom of the list (i.e. tags, seeAlso, attachments, notes).

Thoughts? (I think @adam3smith should like these changes. I'm certainly enjoying them)

Here's an example:
Before
```
{
"type": "web",
"url": "http://lhclz.gbv.de/DB=1/XMLPRS=N/PPN?PPN=08727342X",
"items": [
{
"itemType": "book",
"creators": [
{
"firstName": "Bettina",
"lastName": "Reckter",
"creatorType": "editor"
},
{
"firstName": "Rolf H.",
"lastName": "Simen",
"creatorType": "editor"
},
{
"firstName": "Karl-Heinz",
"lastName": "Preuß",
"creatorType": "editor"
}
],
"notes": [
{
"note": "

Institutsbestand, deshalb nähere Informationen im Inst. f. Wirtschaftswissenschaft (IfW13)

"
}
],
"tags": [
"Umweltschaden",
"Aufsatzsammlung / Umweltschutz",
"Aufsatzsammlung",
"Ökomonie",
"Umweltschutz",
"Gleichgewicht",
"Waldsterben",
"Tiere",
"Lebensräume",
"Vogelarten",
"Umweltgifte",
"Bienen",
"Schmetterlinge",
"Perlmuscheln",
"Gewässerverschmutzung",
"Süßwasserfische",
"Saurer Regen",
"Umweltsignale",
"Trinkwasser",
"Algenpest",
"Sonnenenergie",
"Mülldeponie"
],
"seeAlso": [],
"attachments": [
{
"title": "Link to Library Catalog Entry",
"mimeType": "text/html",
"snapshot": false
},
{
"title": "Library Catalog Entry Snapshot",
"mimeType": "text/html",
"snapshot": true
}
],
"title": "Geschichten, die die Forschung schreibt: ein Umweltlesebuch des Deutschen Forschungsdienstes",
"ISBN": "3-923120-26-5",
"date": "1990",
"pages": "319",
"place": "Bonn - Bad Godesberg",
"publisher": "Verlag Deutscher Forschungsdienst",
"libraryCatalog": "Library Catalog - lhclz.gbv.de",
"numPages": "319",
"callNumber": "CL 13 : IfW13 40 W 2",
"shortTitle": "Geschichten, die die Forschung schreibt"
}
]
}
```
After
```
{
"type": "web",
"url": "http://lhclz.gbv.de/DB=1/XMLPRS=N/PPN?PPN=08727342X",
"items": [
{
"itemType": "book",
"title": "Geschichten, die die Forschung schreibt: ein Umweltlesebuch des Deutschen Forschungsdienstes",
"creators": [
{
"firstName": "Bettina",
"lastName": "Reckter",
"creatorType": "editor"
},
{
"firstName": "Rolf H.",
"lastName": "Simen",
"creatorType": "editor"
},
{
"firstName": "Karl-Heinz",
"lastName": "Preuß",
"creatorType": "editor"
}
],
"date": "1990",
"ISBN": "3-923120-26-5",
"callNumber": "CL 13 : IfW13 40 W 2",
"libraryCatalog": "Library Catalog - lhclz.gbv.de",
"numPages": "319",
"pages": "319",
"place": "Bonn - Bad Godesberg",
"publisher": "Verlag Deutscher Forschungsdienst",
"shortTitle": "Geschichten, die die Forschung schreibt",
"attachments": [
{
"title": "Link to Library Catalog Entry",
"mimeType": "text/html",
"snapshot": false
},
{
"title": "Library Catalog Entry Snapshot",
"mimeType": "text/html",
"snapshot": true
}
],
"tags": [
"Algenpest",
"Aufsatzsammlung",
"Aufsatzsammlung / Umweltschutz",
"Bienen",
"Gewässerverschmutzung",
"Gleichgewicht",
"Lebensräume",
"Mülldeponie",
"Perlmuscheln",
"Saurer Regen",
"Schmetterlinge",
"Sonnenenergie",
"Süßwasserfische",
"Tiere",
"Trinkwasser",
"Umweltgifte",
"Umweltschaden",
"Umweltschutz",
"Umweltsignale",
"Vogelarten",
"Waldsterben",
"Ökomonie"
],
"notes": [
{
"note": "

Institutsbestand, deshalb nähere Informationen im Inst. f. Wirtschaftswissenschaft (IfW13)

"
}
],
"seeAlso": []
}
]
}
```