Forgot a console.log() call.

Allow reconciling against no particular type.

git-svn-id: http://google-refine.googlecode.com/svn/trunk@1043 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
David Huynh 2010-06-27 04:20:35 +00:00
parent 7439be4ce1
commit 0e4781cb58
4 changed files with 40 additions and 24 deletions

View File

@ -66,14 +66,14 @@ public class StandardReconConfig extends ReconConfig {
columnDetails = new ArrayList<ColumnDetail>();
}
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
);
@ -126,10 +126,14 @@ public class StandardReconConfig extends ReconConfig {
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();
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;
}
}
}
}

View File

@ -15,7 +15,13 @@
</tr>
<tr>
<td><input type="radio" name="type-choice" value="">
Or enter a specific type: <input size="20" bind="typeInput" /></td>
Reconcile against type: <input size="20" bind="typeInput" /></td>
<td>
</td>
</tr>
<tr>
<td><input type="radio" name="type-choice" value="-">
Reconcile against no particular type</td>
<td>
</td>
</tr>

View File

@ -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
})

View File

@ -183,7 +183,7 @@ DataTableCellUI.prototype._render = function() {
if (addSuggest) {
$('<a href="javascript:{}"></a>')
.addClass("data-table-recon-search")
.click(function(evt) {console.log(suggestOptions);
.click(function(evt) {
self._searchForMatch(suggestOptions);
return false;
})