From 04d32746d8043af304ffe983ec0c1e2109b259d3 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Wed, 30 Jun 2010 17:20:59 +0000 Subject: [PATCH] Various recon commands in the UI were not updated to work with the refactored backend. git-svn-id: http://google-refine.googlecode.com/svn/trunk@1054 7d457c2a-affb-35e4-300a-418c747d4874 --- .../views/data-table/data-table-cell-ui.js | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/data-table-cell-ui.js b/main/webapp/modules/core/scripts/views/data-table/data-table-cell-ui.js index 44a5e8dad..c9eb32e6c 100644 --- a/main/webapp/modules/core/scripts/views/data-table/data-table-cell-ui.js +++ b/main/webapp/modules/core/scripts/views/data-table/data-table-cell-ui.js @@ -207,47 +207,55 @@ DataTableCellUI.prototype._doMatchNewTopicToOneCell = function() { }; DataTableCellUI.prototype._doMatchNewTopicToSimilarCells = function() { - this._doJudgmentForSimilarCells("new", { shareNewTopics: true }, true); + this._doJudgmentForSimilarCells("new", {}, { shareNewTopics: true }, true); }; DataTableCellUI.prototype._doMatchTopicToOneCell = function(candidate) { - this._doJudgment("matched", { - topicID : candidate.id, - topicGUID: candidate.guid, - topicName: candidate.name, + this._doJudgment("matched", {}, { + id : candidate.id, + name: candidate.name, score: candidate.score, types: candidate.types.join(",") }); }; DataTableCellUI.prototype._doMatchTopicToSimilarCells = function(candidate) { - this._doJudgmentForSimilarCells("matched", { - topicID : candidate.id, - topicGUID: candidate.guid, - topicName: candidate.name, + this._doJudgmentForSimilarCells("matched", {}, { + id : candidate.id, + name: candidate.name, score: candidate.score, types: candidate.types.join(",") }, true); }; -DataTableCellUI.prototype._doJudgment = function(judgment, params) { - params = params || {}; - params.row = this._rowIndex; - params.cell = this._cellIndex; - params.judgment = judgment; - params.identifierSpace = (this._cell.r) ? this._cell.r.identifierSpace : null; - params.schemaSpace = (this._cell.r) ? this._cell.r.schemaSpace : null; - this._postProcessOneCell("recon-judge-one-cell", params, true); +DataTableCellUI.prototype._doJudgment = function(judgment, params, bodyParams) { + this._postProcessOneCell( + "recon-judge-one-cell", + params || {}, + $.extend(bodyParams || {}, { + row: this._rowIndex, + cell: this._cellIndex, + judgment: judgment, + identifierSpace: (this._cell.r) ? this._cell.r.identifierSpace : null, + schemaSpace: (this._cell.r) ? this._cell.r.schemaSpace : null + }), + true + ); }; -DataTableCellUI.prototype._doJudgmentForSimilarCells = function(judgment, params) { - params = params || {}; - params.columnName = Gridworks.cellIndexToColumn(this._cellIndex).name; - params.similarValue = this._cell.v; - params.judgment = judgment; - params.identifierSpace = (this._cell.r) ? this._cell.r.identifierSpace : null; - params.schemaSpace = (this._cell.r) ? this._cell.r.schemaSpace : null; - this._postProcessSeveralCells("recon-judge-similar-cells", params, true); +DataTableCellUI.prototype._doJudgmentForSimilarCells = function(judgment, params, bodyParams) { + this._postProcessSeveralCells( + "recon-judge-similar-cells", + params || {}, + $.extend(bodyParams || {}, { + columnName: Gridworks.cellIndexToColumn(this._cellIndex).name, + similarValue: this._cell.v, + judgment: judgment, + identifierSpace: (this._cell.r) ? this._cell.r.identifierSpace : null, + schemaSpace: (this._cell.r) ? this._cell.r.schemaSpace : null + }), + true + ); }; DataTableCellUI.prototype._searchForMatch = function(suggestOptions) { @@ -287,12 +295,12 @@ DataTableCellUI.prototype._searchForMatch = function(suggestOptions) { params.similarValue = self._cell.v; params.columnName = Gridworks.cellIndexToColumn(self._cellIndex).name; - self._postProcessSeveralCells("recon-judge-similar-cells", params, true); + self._postProcessSeveralCells("recon-judge-similar-cells", {}, params, true); } else { params.row = self._rowIndex; params.cell = self._cellIndex; - self._postProcessOneCell("recon-judge-one-cell", params, true); + self._postProcessOneCell("recon-judge-one-cell", {}, params, true); } DialogSystem.dismissUntil(level - 1); @@ -319,13 +327,13 @@ DataTableCellUI.prototype._searchForMatch = function(suggestOptions) { .data("suggest").textchange(); }; -DataTableCellUI.prototype._postProcessOneCell = function(command, params, columnStatsChanged) { +DataTableCellUI.prototype._postProcessOneCell = function(command, params, bodyParams, columnStatsChanged) { var self = this; Gridworks.postProcess( command, params, - null, + bodyParams, { columnStatsChanged: columnStatsChanged }, { onDone: function(o) { @@ -342,11 +350,11 @@ DataTableCellUI.prototype._postProcessOneCell = function(command, params, column ); }; -DataTableCellUI.prototype._postProcessSeveralCells = function(command, params, columnStatsChanged) { +DataTableCellUI.prototype._postProcessSeveralCells = function(command, params, bodyParams, columnStatsChanged) { Gridworks.postProcess( command, params, - null, + bodyParams, { cellsChanged: true, columnStatsChanged: columnStatsChanged } ); };