diff --git a/main/src/com/google/refine/ProjectMetadata.java b/main/src/com/google/refine/ProjectMetadata.java index c618c30a7..b1cf896f3 100644 --- a/main/src/com/google/refine/ProjectMetadata.java +++ b/main/src/com/google/refine/ProjectMetadata.java @@ -79,7 +79,7 @@ public class ProjectMetadata implements Jsonizable { private Map _customMetadata = new HashMap(); private PreferenceStore _preferenceStore = new PreferenceStore(); - final static Logger logger = LoggerFactory.getLogger("project_metadata"); + private final static Logger logger = LoggerFactory.getLogger("project_metadata"); protected ProjectMetadata(Date date) { _created = date; diff --git a/main/src/com/google/refine/commands/project/SetProjectMetaDataCommand.java b/main/src/com/google/refine/commands/project/SetProjectMetaDataCommand.java index 6644cf389..0995f781b 100644 --- a/main/src/com/google/refine/commands/project/SetProjectMetaDataCommand.java +++ b/main/src/com/google/refine/commands/project/SetProjectMetaDataCommand.java @@ -6,10 +6,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.lang.StringUtils; import org.json.JSONException; -import org.json.JSONTokener; -import org.json.JSONWriter; import com.google.refine.ProjectManager; import com.google.refine.ProjectMetadata; @@ -35,9 +32,6 @@ public class SetProjectMetaDataCommand extends Command { try { response.setCharacterEncoding("UTF-8"); response.setHeader("Content-Type", "application/json"); - JSONWriter writer = new JSONWriter(response.getWriter()); - - Object o = StringUtils.isEmpty(valueString) ? null : new JSONTokener(valueString).nextValue(); meta.setAnyField(metaName, valueString); ProjectManager.singleton.saveMetadata(meta, project.id); diff --git a/main/src/com/google/refine/io/FileProjectManager.java b/main/src/com/google/refine/io/FileProjectManager.java index f663d143a..0afd7997b 100644 --- a/main/src/com/google/refine/io/FileProjectManager.java +++ b/main/src/com/google/refine/io/FileProjectManager.java @@ -45,7 +45,6 @@ import java.util.Properties; import java.util.zip.GZIPInputStream; import org.apache.commons.lang.exception.ExceptionUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.tools.tar.TarEntry; import org.apache.tools.tar.TarInputStream; import org.apache.tools.tar.TarOutputStream; 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 671757eb2..23a65248d 100644 --- a/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js +++ b/main/webapp/modules/core/scripts/index/edit-metadata-dialog.js @@ -37,7 +37,7 @@ function EditMetadataDialog(metaData, targetRowElem) { Refine.OpenProjectUI.refreshProject(targetRowElem, metaData); }); - } + }; this._createDialog(); } @@ -81,11 +81,11 @@ EditMetadataDialog.prototype._createDialog = function() { for (var k in flatMetaData) { var tr = metadataTable.insertRow(metadataTable.rows.length); - if (typeof flatMetaData[k] === 'string') + if (typeof flatMetaData[k] === 'string') { v = flatMetaData[k].replace(/\"/g, ""); - else + } else { v = JSON.stringify(flatMetaData[k]); - + } this._metaDataUIs.push(new this._MetaDataUI(tr, k, v, flatMetaData.id)); } diff --git a/main/webapp/modules/core/scripts/index/open-project-ui.js b/main/webapp/modules/core/scripts/index/open-project-ui.js index 46c959c42..9c62c7910 100644 --- a/main/webapp/modules/core/scripts/index/open-project-ui.js +++ b/main/webapp/modules/core/scripts/index/open-project-ui.js @@ -230,7 +230,7 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { .appendTo($(tr.insertCell(tr.cells.length)).attr('width', '10%')); var appendMetaField = function(data, width) { - var width = width || '1%'; + width = width || '1%'; $('
') .html(data) .appendTo($(tr.insertCell(tr.cells.length)).attr('width', width)); @@ -248,9 +248,6 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) { appendMetaField(data[i].value); } } - console.log('==================='); - console.log(JSON.stringify(project)); - // END TODO $(tr).mouseenter(function() { renameLink.css("visibility", "visible"); @@ -336,7 +333,7 @@ Refine.OpenProjectUI.refreshProject = function(tr, metaData) { } } -} +}; Refine.actionAreas.push({ id: "open-project",