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:
parent
7439be4ce1
commit
0e4781cb58
@ -66,14 +66,14 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
columnDetails = new ArrayList<ColumnDetail>();
|
columnDetails = new ArrayList<ColumnDetail>();
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject t = obj.getJSONObject("type");
|
JSONObject t = obj.has("type") && !obj.isNull("type") ? obj.getJSONObject("type") : null;
|
||||||
|
|
||||||
return new StandardReconConfig(
|
return new StandardReconConfig(
|
||||||
obj.getString("service"),
|
obj.getString("service"),
|
||||||
obj.has("identifierSpace") ? obj.getString("identifierSpace") : null,
|
obj.has("identifierSpace") ? obj.getString("identifierSpace") : null,
|
||||||
obj.has("schemaSpace") ? obj.getString("schemaSpace") : null,
|
obj.has("schemaSpace") ? obj.getString("schemaSpace") : null,
|
||||||
t.getString("id"),
|
t == null ? null : t.getString("id"),
|
||||||
t.getString("name"),
|
t == null ? null : (t.has("name") ? t.getString("name") : null),
|
||||||
obj.getBoolean("autoMatch"),
|
obj.getBoolean("autoMatch"),
|
||||||
columnDetails
|
columnDetails
|
||||||
);
|
);
|
||||||
@ -125,11 +125,15 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
writer.key("service"); writer.value(service);
|
writer.key("service"); writer.value(service);
|
||||||
writer.key("identifierSpace"); writer.value(identifierSpace);
|
writer.key("identifierSpace"); writer.value(identifierSpace);
|
||||||
writer.key("schemaSpace"); writer.value(schemaSpace);
|
writer.key("schemaSpace"); writer.value(schemaSpace);
|
||||||
writer.key("type");
|
writer.key("type");
|
||||||
writer.object();
|
if (typeID == null) {
|
||||||
writer.key("id"); writer.value(typeID);
|
writer.value(null);
|
||||||
writer.key("name"); writer.value(typeName);
|
} else {
|
||||||
writer.endObject();
|
writer.object();
|
||||||
|
writer.key("id"); writer.value(typeID);
|
||||||
|
writer.key("name"); writer.value(typeName);
|
||||||
|
writer.endObject();
|
||||||
|
}
|
||||||
writer.key("autoMatch"); writer.value(autoMatch);
|
writer.key("autoMatch"); writer.value(autoMatch);
|
||||||
writer.key("columnDetails");
|
writer.key("columnDetails");
|
||||||
writer.array();
|
writer.array();
|
||||||
@ -165,7 +169,10 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
|
|
||||||
jsonWriter.object();
|
jsonWriter.object();
|
||||||
jsonWriter.key("query"); jsonWriter.value(cell.value.toString());
|
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) {
|
if (columnDetails.size() > 0) {
|
||||||
jsonWriter.key("properties");
|
jsonWriter.key("properties");
|
||||||
jsonWriter.array();
|
jsonWriter.array();
|
||||||
@ -349,10 +356,12 @@ public class StandardReconConfig extends ReconConfig {
|
|||||||
recon.setFeature(Recon.Feature_nameWordDistance, wordDistance(text, candidate.name));
|
recon.setFeature(Recon.Feature_nameWordDistance, wordDistance(text, candidate.name));
|
||||||
|
|
||||||
recon.setFeature(Recon.Feature_typeMatch, false);
|
recon.setFeature(Recon.Feature_typeMatch, false);
|
||||||
for (String typeID : candidate.types) {
|
if (this.typeID != null) {
|
||||||
if (this.typeID.equals(typeID)) {
|
for (String typeID : candidate.types) {
|
||||||
recon.setFeature(Recon.Feature_typeMatch, true);
|
if (this.typeID.equals(typeID)) {
|
||||||
break;
|
recon.setFeature(Recon.Feature_typeMatch, true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="radio" name="type-choice" value="">
|
<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>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -230,11 +230,15 @@ ReconStandardServicePanel.prototype.start = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var choices = this._panel.find('input[name="type-choice"]:checked');
|
var choices = this._panel.find('input[name="type-choice"]:checked');
|
||||||
if (choices !== null && choices.length > 0 && choices[0].value != "") {
|
if (choices !== null && choices.length > 0) {
|
||||||
type = {
|
if (choices[0].value == '-') {
|
||||||
id: choices[0].value,
|
type = null;
|
||||||
name: choices.attr("typeName")
|
} else if (choices[0].value != "") {
|
||||||
};
|
type = {
|
||||||
|
id: choices[0].value,
|
||||||
|
name: choices.attr("typeName")
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var columnDetails = [];
|
var columnDetails = [];
|
||||||
@ -275,10 +279,7 @@ ReconStandardServicePanel.prototype.start = function() {
|
|||||||
service: this._service.url,
|
service: this._service.url,
|
||||||
identifierSpace: this._service.identifierSpace,
|
identifierSpace: this._service.identifierSpace,
|
||||||
schemaSpace: this._service.schemaSpace,
|
schemaSpace: this._service.schemaSpace,
|
||||||
type: {
|
type: (type) ? { id: type.id, name: type.name } : null,
|
||||||
id: type.id,
|
|
||||||
name: type.name
|
|
||||||
},
|
|
||||||
autoMatch: this._elmts.automatchCheck[0].checked,
|
autoMatch: this._elmts.automatchCheck[0].checked,
|
||||||
columnDetails: columnDetails
|
columnDetails: columnDetails
|
||||||
})
|
})
|
||||||
|
@ -183,7 +183,7 @@ DataTableCellUI.prototype._render = function() {
|
|||||||
if (addSuggest) {
|
if (addSuggest) {
|
||||||
$('<a href="javascript:{}"></a>')
|
$('<a href="javascript:{}"></a>')
|
||||||
.addClass("data-table-recon-search")
|
.addClass("data-table-recon-search")
|
||||||
.click(function(evt) {console.log(suggestOptions);
|
.click(function(evt) {
|
||||||
self._searchForMatch(suggestOptions);
|
self._searchForMatch(suggestOptions);
|
||||||
return false;
|
return false;
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user