Speed up parsing and tweak edit comment
This commit is contained in:
parent
1eaaa00824
commit
54b25d714b
@ -34,7 +34,6 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
|
||||||
import org.json.JSONWriter;
|
import org.json.JSONWriter;
|
||||||
|
|
||||||
import com.google.refine.browsing.Engine;
|
import com.google.refine.browsing.Engine;
|
||||||
@ -49,7 +48,6 @@ import org.openrefine.wikidata.updates.ItemUpdate;
|
|||||||
import org.openrefine.wikidata.utils.FirstLinesExtractor;
|
import org.openrefine.wikidata.utils.FirstLinesExtractor;
|
||||||
|
|
||||||
import com.google.refine.model.Project;
|
import com.google.refine.model.Project;
|
||||||
import com.google.refine.util.ParsingUtilities;
|
|
||||||
|
|
||||||
public class PreviewWikibaseSchemaCommand extends Command {
|
public class PreviewWikibaseSchemaCommand extends Command {
|
||||||
|
|
||||||
@ -68,8 +66,7 @@ public class PreviewWikibaseSchemaCommand extends Command {
|
|||||||
WikibaseSchema schema = null;
|
WikibaseSchema schema = null;
|
||||||
if (jsonString != null) {
|
if (jsonString != null) {
|
||||||
try {
|
try {
|
||||||
JSONObject json = ParsingUtilities.evaluateJsonStringToObject(jsonString);
|
schema = WikibaseSchema.reconstruct(jsonString);
|
||||||
schema = WikibaseSchema.reconstruct(json);
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
respond(response, "error", "Wikibase schema could not be parsed.");
|
respond(response, "error", "Wikibase schema could not be parsed.");
|
||||||
return;
|
return;
|
||||||
|
@ -190,7 +190,7 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
|
|||||||
|
|
||||||
// Generate batch token
|
// Generate batch token
|
||||||
long token = (new Random()).nextLong();
|
long token = (new Random()).nextLong();
|
||||||
String summary = _summary + String.format(" ([[Wikidata:Edit groups/OR/%s|discuss]])",
|
String summary = _summary + String.format(" ([[:toollabs:editgroups/b/OR/%s|details]])",
|
||||||
(Long.toHexString(token).substring(0, 7)));
|
(Long.toHexString(token).substring(0, 7)));
|
||||||
|
|
||||||
// Evaluate the schema
|
// Evaluate the schema
|
||||||
|
Loading…
Reference in New Issue
Block a user