diff --git a/main/src/com/google/refine/ProjectMetadata.java b/main/src/com/google/refine/ProjectMetadata.java index 8b9c42306..98fba08e0 100644 --- a/main/src/com/google/refine/ProjectMetadata.java +++ b/main/src/com/google/refine/ProjectMetadata.java @@ -114,7 +114,7 @@ public class ProjectMetadata { private ArrayNode _userMetadata = ParsingUtilities.mapper.createArrayNode(); @JsonProperty("customMetadata") - private Map _customMetadata = new HashMap(); + private Map _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) { diff --git a/main/tests/data/example_project_metadata.json b/main/tests/data/example_project_metadata.json index a9507fe8b..b604ed843 100644 --- a/main/tests/data/example_project_metadata.json +++ b/main/tests/data/example_project_metadata.json @@ -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"}]} diff --git a/main/tests/data/example_project_metadata_save_mode.json b/main/tests/data/example_project_metadata_save_mode.json index 84d4e0490..4a33b9e66 100644 --- a/main/tests/data/example_project_metadata_save_mode.json +++ b/main/tests/data/example_project_metadata_save_mode.json @@ -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":[]}}}} \ No newline at end of file +{"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":[]}}}} diff --git a/main/webapp/modules/core/langs/translation-en.json b/main/webapp/modules/core/langs/translation-en.json index 2b88eb0b1..365b4d5d5 100644 --- a/main/webapp/modules/core/langs/translation-en.json +++ b/main/webapp/modules/core/langs/translation-en.json @@ -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.", diff --git a/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js b/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js index 96d2e1eb1..6fb7ea275 100644 --- a/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js +++ b/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js @@ -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);