diff --git a/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java b/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java index abf006c5e..98407d4d8 100644 --- a/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java +++ b/main/src/com/metaweb/gridworks/model/recon/StandardReconConfig.java @@ -66,14 +66,14 @@ public class StandardReconConfig extends ReconConfig { columnDetails = new ArrayList(); } - JSONObject t = obj.getJSONObject("type"); + JSONObject t = obj.has("type") && !obj.isNull("type") ? obj.getJSONObject("type") : null; return new StandardReconConfig( obj.getString("service"), obj.has("identifierSpace") ? obj.getString("identifierSpace") : null, obj.has("schemaSpace") ? obj.getString("schemaSpace") : null, - t.getString("id"), - t.getString("name"), + t == null ? null : t.getString("id"), + t == null ? null : (t.has("name") ? t.getString("name") : null), obj.getBoolean("autoMatch"), columnDetails ); @@ -125,11 +125,15 @@ public class StandardReconConfig extends ReconConfig { writer.key("service"); writer.value(service); writer.key("identifierSpace"); writer.value(identifierSpace); writer.key("schemaSpace"); writer.value(schemaSpace); - writer.key("type"); - writer.object(); - writer.key("id"); writer.value(typeID); - writer.key("name"); writer.value(typeName); - writer.endObject(); + writer.key("type"); + if (typeID == null) { + writer.value(null); + } else { + writer.object(); + writer.key("id"); writer.value(typeID); + writer.key("name"); writer.value(typeName); + writer.endObject(); + } writer.key("autoMatch"); writer.value(autoMatch); writer.key("columnDetails"); writer.array(); @@ -165,7 +169,10 @@ public class StandardReconConfig extends ReconConfig { jsonWriter.object(); jsonWriter.key("query"); jsonWriter.value(cell.value.toString()); - jsonWriter.key("type"); jsonWriter.value(typeID); + if (typeID != null) { + jsonWriter.key("type"); jsonWriter.value(typeID); + } + if (columnDetails.size() > 0) { jsonWriter.key("properties"); jsonWriter.array(); @@ -349,10 +356,12 @@ public class StandardReconConfig extends ReconConfig { recon.setFeature(Recon.Feature_nameWordDistance, wordDistance(text, candidate.name)); recon.setFeature(Recon.Feature_typeMatch, false); - for (String typeID : candidate.types) { - if (this.typeID.equals(typeID)) { - recon.setFeature(Recon.Feature_typeMatch, true); - break; + if (this.typeID != null) { + for (String typeID : candidate.types) { + if (this.typeID.equals(typeID)) { + recon.setFeature(Recon.Feature_typeMatch, true); + break; + } } } } diff --git a/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.html b/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.html index fd267b759..3647877ad 100644 --- a/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.html +++ b/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.html @@ -15,7 +15,13 @@ - Or enter a specific type: + Reconcile against type: + + + + + + Reconcile against no particular type diff --git a/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.js b/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.js index 9dea64d66..e0a9a80ab 100644 --- a/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.js +++ b/main/webapp/modules/core/scripts/reconciliation/standard-service-panel.js @@ -230,11 +230,15 @@ ReconStandardServicePanel.prototype.start = function() { }; var choices = this._panel.find('input[name="type-choice"]:checked'); - if (choices !== null && choices.length > 0 && choices[0].value != "") { - type = { - id: choices[0].value, - name: choices.attr("typeName") - }; + if (choices !== null && choices.length > 0) { + if (choices[0].value == '-') { + type = null; + } else if (choices[0].value != "") { + type = { + id: choices[0].value, + name: choices.attr("typeName") + }; + } } var columnDetails = []; @@ -275,10 +279,7 @@ ReconStandardServicePanel.prototype.start = function() { service: this._service.url, identifierSpace: this._service.identifierSpace, schemaSpace: this._service.schemaSpace, - type: { - id: type.id, - name: type.name - }, + type: (type) ? { id: type.id, name: type.name } : null, autoMatch: this._elmts.automatchCheck[0].checked, columnDetails: columnDetails }) 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 9a94a16cf..44a5e8dad 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 @@ -183,7 +183,7 @@ DataTableCellUI.prototype._render = function() { if (addSuggest) { $('') .addClass("data-table-recon-search") - .click(function(evt) {console.log(suggestOptions); + .click(function(evt) { self._searchForMatch(suggestOptions); return false; })