Address review comments
This commit is contained in:
parent
580c0bed80
commit
7f1cfd2db7
@ -27,7 +27,7 @@
|
|||||||
"label": "Label",
|
"label": "Label",
|
||||||
"description": "Description",
|
"description": "Description",
|
||||||
"alias": "Alias",
|
"alias": "Alias",
|
||||||
"item-or-reconciled-column": "item or reconciled column",
|
"item-or-reconciled-column": "type item or drag reconciled column here",
|
||||||
"amount": "amount",
|
"amount": "amount",
|
||||||
"unit": "unit",
|
"unit": "unit",
|
||||||
"full-url": "full URL including the protocol",
|
"full-url": "full URL including the protocol",
|
||||||
|
@ -6,7 +6,6 @@ WarningsRenderer._renderEntity = function(entity) {
|
|||||||
entity.id = entity.value.id;
|
entity.id = entity.value.id;
|
||||||
}
|
}
|
||||||
var id = entity.id;
|
var id = entity.id;
|
||||||
console.log(entity);
|
|
||||||
var is_new = entity.siteIri == "http://localhost/entity/";
|
var is_new = entity.siteIri == "http://localhost/entity/";
|
||||||
if (is_new) {
|
if (is_new) {
|
||||||
id = $.i18n._('wikidata-preview')['new-id'];
|
id = $.i18n._('wikidata-preview')['new-id'];
|
||||||
|
@ -28,6 +28,8 @@ import java.io.IOException;
|
|||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.wikidata.wdtk.wikibaseapi.ApiConnection;
|
import org.wikidata.wdtk.wikibaseapi.ApiConnection;
|
||||||
import org.wikidata.wdtk.wikibaseapi.LoginFailedException;
|
import org.wikidata.wdtk.wikibaseapi.LoginFailedException;
|
||||||
|
|
||||||
@ -49,6 +51,8 @@ import com.google.refine.preference.PreferenceStore;
|
|||||||
|
|
||||||
public class ConnectionManager {
|
public class ConnectionManager {
|
||||||
|
|
||||||
|
final static Logger logger = LoggerFactory.getLogger("connection_mananger");
|
||||||
|
|
||||||
public static final String PREFERENCE_STORE_KEY = "wikidata_credentials";
|
public static final String PREFERENCE_STORE_KEY = "wikidata_credentials";
|
||||||
|
|
||||||
private PreferenceStore prefStore;
|
private PreferenceStore prefStore;
|
||||||
@ -76,7 +80,7 @@ public class ConnectionManager {
|
|||||||
array.put(obj);
|
array.put(obj);
|
||||||
prefStore.put(PREFERENCE_STORE_KEY, array);
|
prefStore.put(PREFERENCE_STORE_KEY, array);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
logger.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +112,7 @@ public class ConnectionManager {
|
|||||||
try {
|
try {
|
||||||
return array.getJSONObject(0);
|
return array.getJSONObject(0);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
logger.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -121,7 +125,7 @@ public class ConnectionManager {
|
|||||||
connection.logout();
|
connection.logout();
|
||||||
connection = null;
|
connection = null;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
logger.error(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,8 @@ public class QSValuePrinter implements ValueVisitor<String> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String visit(DatatypeIdValue value) {
|
public String visit(DatatypeIdValue value) {
|
||||||
// unsupported according to
|
// impossible case (this is actually a bug in WDTK, DatatypeIdValue should not subclass Value)
|
||||||
// https://tools.wmflabs.org/wikidata-todo/quick_statements.php?
|
throw new IllegalArgumentException();
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user