Merge pull request #2058 from OpenRefine/issue-1994-customMetadata

Fix parsing and display of custom metadata
This commit is contained in:
Antonin Delpeuch 2019-06-14 14:53:19 +01:00 committed by GitHub
commit 8390d234b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 7 deletions

View File

@ -114,7 +114,7 @@ public class ProjectMetadata {
private ArrayNode _userMetadata = ParsingUtilities.mapper.createArrayNode();
@JsonProperty("customMetadata")
private Map<String, Serializable> _customMetadata = new HashMap<String, Serializable>();
private Map<String, Object> _customMetadata = new HashMap<>();
@JsonProperty("preferences")
@JsonView(JsonViews.SaveMode.class)
private PreferenceStore _preferenceStore = new PreferenceStore();
@ -247,7 +247,7 @@ public class ProjectMetadata {
@JsonIgnore
public Serializable getCustomMetadata(String key) {
return _customMetadata.get(key);
return (Serializable)_customMetadata.get(key);
}
public void setCustomMetadata(String key, Serializable value) {

View File

@ -1 +1 @@
{"name":"numeric facet test","tags":[],"created":"2018-09-04T16:07:31Z","modified":"2018-09-04T17:02:31Z","creator":"","contributors":"","subject":"","description":"","rowCount":4,"title":"","homepage":"","image":"","license":"","version":"","customMetadata":{},"importOptionMetadata":[{"guessCellValueTypes":false,"projectTags":[""],"ignoreLines":-1,"processQuotes":true,"fileSource":"(clipboard)","encoding":"","separator":"\\t","storeBlankCellsAsNulls":true,"storeBlankRows":true,"skipDataLines":0,"includeFileSources":false,"headerLines":1,"limit":-1,"quoteCharacter":"\"","projectName":"numeric facet test"}]}
{"name":"numeric facet test","tags":[],"created":"2018-09-04T16:07:31Z","modified":"2018-09-04T17:02:31Z","creator":"","contributors":"","subject":"","description":"","rowCount":4,"title":"","homepage":"","image":"","license":"","version":"","customMetadata":{"hash":"a9f7bc0818ab566264e5b83d17eb745c"},"importOptionMetadata":[{"guessCellValueTypes":false,"projectTags":[""],"ignoreLines":-1,"processQuotes":true,"fileSource":"(clipboard)","encoding":"","separator":"\\t","storeBlankCellsAsNulls":true,"storeBlankRows":true,"skipDataLines":0,"includeFileSources":false,"headerLines":1,"limit":-1,"quoteCharacter":"\"","projectName":"numeric facet test"}]}

View File

@ -1 +1 @@
{"name":"numeric facet test","tags":[],"created":"2018-09-04T16:07:31Z","modified":"2018-09-04T17:02:31Z","creator":"","contributors":"","subject":"","description":"","rowCount":4,"title":"","homepage":"","image":"","license":"","version":"","customMetadata":{},"importOptionMetadata":[{"guessCellValueTypes":false,"projectTags":[""],"ignoreLines":-1,"processQuotes":true,"fileSource":"(clipboard)","encoding":"","separator":"\\t","storeBlankCellsAsNulls":true,"storeBlankRows":true,"skipDataLines":0,"includeFileSources":false,"headerLines":1,"limit":-1,"quoteCharacter":"\"","projectName":"numeric facet test"}],"password":"","encoding":"UTF-8","encodingConfidence":0,"preferences":{"entries":{"scripting.starred-expressions":{"class":"com.google.refine.preference.TopList","top":2147483647,"list":[]},"scripting.expressions":{"class":"com.google.refine.preference.TopList","top":100,"list":[]}}}}
{"name":"numeric facet test","tags":[],"created":"2018-09-04T16:07:31Z","modified":"2018-09-04T17:02:31Z","creator":"","contributors":"","subject":"","description":"","rowCount":4,"title":"","homepage":"","image":"","license":"","version":"","customMetadata":{"hash":"a9f7bc0818ab566264e5b83d17eb745c"},"importOptionMetadata":[{"guessCellValueTypes":false,"projectTags":[""],"ignoreLines":-1,"processQuotes":true,"fileSource":"(clipboard)","encoding":"","separator":"\\t","storeBlankCellsAsNulls":true,"storeBlankRows":true,"skipDataLines":0,"includeFileSources":false,"headerLines":1,"limit":-1,"quoteCharacter":"\"","projectName":"numeric facet test"}],"password":"","encoding":"UTF-8","encodingConfidence":0,"preferences":{"entries":{"scripting.starred-expressions":{"class":"com.google.refine.preference.TopList","top":2147483647,"list":[]},"scripting.expressions":{"class":"com.google.refine.preference.TopList","top":100,"list":[]}}}}

View File

@ -23,6 +23,11 @@
"core-index/sample-data": "sample data sets",
"core-index/change-metadata-value": "Change value of metadata key",
"core-index/name": "Project name:",
"core-index/tags": "Tags:",
"core-index/title": "Title:",
"core-index/license": "License:",
"core-index/homepage": "Homepage:",
"core-index/image": "Image:",
"core-index/created": "Create time:",
"core-index/modified": "Last modified time:",
"core-index/creator": "Creator:",
@ -31,9 +36,9 @@
"core-index/description": "Description:",
"core-index/rowCount": "Row count:",
"core-index/metaDatas": "Project metadata",
"core-index/customMetadata": "Custom metadata(JSON):",
"core-index/customMetadata": "Custom metadata (JSON):",
"core-index/id": "Project ID:",
"core-index/importOptionMetadata": "Import option metadata(JSON):",
"core-index/importOptionMetadata": "Import option metadata (JSON):",
"core-index-create/create-proj": "Create Project",
"core-index-create/starting": "Starting",
"core-index-create/done": "Done.",

View File

@ -13,7 +13,7 @@ function EditMetadataDialog(metaData, targetRowElem) {
var td0 = tr.insertCell(0);
var keyLable = $.i18n._('core-index')[key] || key;
var keyLable = $.i18n('core-index/'+key) || key;
$(td0).text(keyLable);
var td1 = tr.insertCell(1);