Store engine configuration as EngineConfig rather than JSONObject

This commit is contained in:
Antonin Delpeuch 2018-09-05 14:49:39 +01:00
parent f6256aae62
commit fbc9b27640
61 changed files with 214 additions and 189 deletions

View File

@ -25,9 +25,9 @@ package org.openrefine.wikidata.commands;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject;
import org.openrefine.wikidata.operations.PerformWikibaseEditsOperation; import org.openrefine.wikidata.operations.PerformWikibaseEditsOperation;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -35,7 +35,7 @@ import com.google.refine.model.Project;
public class PerformWikibaseEditsCommand extends EngineDependentCommand { public class PerformWikibaseEditsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, HttpServletRequest request, JSONObject engineConfig) protected AbstractOperation createOperation(Project project, HttpServletRequest request, EngineConfig engineConfig)
throws Exception { throws Exception {
String summary = request.getParameter("summary"); String summary = request.getParameter("summary");
return new PerformWikibaseEditsOperation(engineConfig, summary); return new PerformWikibaseEditsOperation(engineConfig, summary);

View File

@ -49,6 +49,7 @@ import org.wikidata.wdtk.wikibaseapi.WikibaseDataFetcher;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.history.HistoryEntry; import com.google.refine.history.HistoryEntry;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -65,7 +66,7 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
private String summary; private String summary;
public PerformWikibaseEditsOperation(JSONObject engineConfig, String summary) { public PerformWikibaseEditsOperation(EngineConfig engineConfig, String summary) {
super(engineConfig); super(engineConfig);
Validate.notNull(summary, "An edit summary must be provided."); Validate.notNull(summary, "An edit summary must be provided.");
Validate.notEmpty(summary, "An edit summary must be provided."); Validate.notEmpty(summary, "An edit summary must be provided.");
@ -79,7 +80,8 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
if (obj.has("summary")) { if (obj.has("summary")) {
summary = obj.getString("summary"); summary = obj.getString("summary");
} }
return new PerformWikibaseEditsOperation(engineConfig, summary); return new PerformWikibaseEditsOperation(
EngineConfig.reconstruct(engineConfig), summary);
} }
@Override @Override
@ -93,7 +95,7 @@ public class PerformWikibaseEditsOperation extends EngineDependentOperation {
writer.key("summary"); writer.key("summary");
writer.value(summary); writer.value(summary);
writer.key("engineConfig"); writer.key("engineConfig");
writer.value(getEngineConfig()); getEngineConfig().write(writer, options);
writer.endObject(); writer.endObject();
} }

View File

@ -32,6 +32,7 @@ import org.openrefine.wikidata.testing.TestingData;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Recon; import com.google.refine.model.Recon;
@ -58,7 +59,7 @@ public class PerformWikibaseEditsOperationTest extends OperationTest {
@Test(expectedExceptions=IllegalArgumentException.class) @Test(expectedExceptions=IllegalArgumentException.class)
public void testConstructor() { public void testConstructor() {
new PerformWikibaseEditsOperation(new JSONObject("{}"), ""); new PerformWikibaseEditsOperation(EngineConfig.reconstruct(new JSONObject("{}")), "");
} }
@Test @Test

View File

@ -55,6 +55,7 @@ import org.wikidata.wdtk.datamodel.interfaces.TimeValue;
import com.fasterxml.jackson.databind.exc.InvalidDefinitionException; import com.fasterxml.jackson.databind.exc.InvalidDefinitionException;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.tests.RefineTest; import com.google.refine.tests.RefineTest;
import com.google.refine.util.ParsingUtilities; import com.google.refine.util.ParsingUtilities;
@ -149,12 +150,21 @@ public class WikibaseSchemaTest extends RefineTest {
JSONObject serialized = TestingData.jsonFromFile("data/schema/inception.json"); JSONObject serialized = TestingData.jsonFromFile("data/schema/inception.json");
WikibaseSchema schema = WikibaseSchema.reconstruct(serialized); WikibaseSchema schema = WikibaseSchema.reconstruct(serialized);
Engine engine = new Engine(project); Engine engine = new Engine(project);
JSONObject engineConfig = new JSONObject("{\n" + " \"mode\": \"row-based\",\n" + " \"facets\": [\n" EngineConfig engineConfig = EngineConfig.reconstruct(new JSONObject("{\n"
+ " {\n" + " \"mode\": \"text\",\n" + " \"invert\": false,\n" + " \"mode\": \"row-based\",\n"
+ " \"caseSensitive\": false,\n" + " \"query\": \"www\",\n" + " \"facets\": [\n"
+ " \"name\": \"reference\",\n" + " \"type\": \"text\",\n" + " {\n"
+ " \"columnName\": \"reference\"\n" + " }\n" + " ]\n" + " }"); + " \"mode\": \"text\",\n"
engine.initializeFromJSON(engineConfig); + " \"invert\": false,\n"
+ " \"caseSensitive\": false,\n"
+ " \"query\": \"www\",\n"
+ " \"name\": \"reference\",\n"
+ " \"type\": \"text\",\n"
+ " \"columnName\": \"reference\"\n"
+ " }\n"
+ " ]\n"
+ " }"));
engine.initializeFromConfig(engineConfig);
List<ItemUpdate> updates = schema.evaluate(project, engine); List<ItemUpdate> updates = schema.evaluate(project, engine);
List<ItemUpdate> expected = new ArrayList<>(); List<ItemUpdate> expected = new ArrayList<>();
ItemUpdate update1 = new ItemUpdateBuilder(qid1).addStatement(statement1).build(); ItemUpdate update1 = new ItemUpdateBuilder(qid1).addStatement(statement1).build();

View File

@ -168,6 +168,7 @@ public class Engine implements Jsonizable {
throw new InternalError("This method should not be called when the engine is not in record mode."); throw new InternalError("This method should not be called when the engine is not in record mode.");
} }
@Deprecated
public void initializeFromJSON(JSONObject o) throws JSONException { public void initializeFromJSON(JSONObject o) throws JSONException {
EngineConfig config = EngineConfig.reconstruct(o); EngineConfig config = EngineConfig.reconstruct(o);
initializeFromConfig(config); initializeFromConfig(config);

View File

@ -12,6 +12,7 @@ import org.json.JSONWriter;
import com.google.refine.Jsonizable; import com.google.refine.Jsonizable;
import com.google.refine.browsing.Engine.Mode; import com.google.refine.browsing.Engine.Mode;
import com.google.refine.browsing.facets.Facet;
import com.google.refine.browsing.facets.FacetConfig; import com.google.refine.browsing.facets.FacetConfig;
import com.google.refine.browsing.facets.ListFacet.ListFacetConfig; import com.google.refine.browsing.facets.ListFacet.ListFacetConfig;
import com.google.refine.browsing.facets.RangeFacet.RangeFacetConfig; import com.google.refine.browsing.facets.RangeFacet.RangeFacetConfig;

View File

@ -54,6 +54,7 @@ import com.google.refine.Jsonizable;
import com.google.refine.ProjectManager; import com.google.refine.ProjectManager;
import com.google.refine.RefineServlet; import com.google.refine.RefineServlet;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.history.HistoryEntry; import com.google.refine.history.HistoryEntry;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.model.metadata.ProjectMetadata; import com.google.refine.model.metadata.ProjectMetadata;
@ -115,7 +116,7 @@ public abstract class Command {
* @return * @return
* @throws JSONException * @throws JSONException
*/ */
static protected JSONObject getEngineConfig(HttpServletRequest request) static protected EngineConfig getEngineConfig(HttpServletRequest request)
throws JSONException { throws JSONException {
if (request == null) { if (request == null) {
throw new IllegalArgumentException("parameter 'request' should not be null"); throw new IllegalArgumentException("parameter 'request' should not be null");
@ -123,7 +124,8 @@ public abstract class Command {
String json = request.getParameter("engine"); String json = request.getParameter("engine");
try{ try{
return (json == null) ? null : ParsingUtilities.evaluateJsonStringToObject(json); return (json == null) ? null :
EngineConfig.reconstruct(ParsingUtilities.evaluateJsonStringToObject(json));
} catch (JSONException e){ } catch (JSONException e){
logger.debug( json + " could not be parsed to JSON"); logger.debug( json + " could not be parsed to JSON");
return null; return null;
@ -149,9 +151,9 @@ public abstract class Command {
} }
Engine engine = new Engine(project); Engine engine = new Engine(project);
JSONObject o = getEngineConfig(request); EngineConfig c = getEngineConfig(request);
if (o != null) { if (c != null) {
engine.initializeFromJSON(o); engine.initializeFromConfig(c);
} }
return engine; return engine;
} }

View File

@ -40,8 +40,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.process.Process; import com.google.refine.process.Process;
@ -85,5 +84,5 @@ abstract public class EngineDependentCommand extends Command {
} }
abstract protected AbstractOperation createOperation( abstract protected AbstractOperation createOperation(
Project project, HttpServletRequest request, JSONObject engineConfig) throws Exception; Project project, HttpServletRequest request, EngineConfig engineConfig) throws Exception;
} }

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.cell;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -45,7 +44,7 @@ import com.google.refine.operations.cell.BlankDownOperation;
public class BlankDownCommand extends EngineDependentCommand { public class BlankDownCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.cell;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -45,7 +44,7 @@ import com.google.refine.operations.cell.FillDownOperation;
public class FillDownCommand extends EngineDependentCommand { public class FillDownCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.cell;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -46,7 +45,7 @@ import com.google.refine.util.ParsingUtilities;
public class MassEditCommand extends EngineDependentCommand { public class MassEditCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
String expression = request.getParameter("expression"); String expression = request.getParameter("expression");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.cell;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -45,7 +44,7 @@ import com.google.refine.operations.cell.TextTransformOperation;
public class TextTransformCommand extends EngineDependentCommand { public class TextTransformCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
String expression = request.getParameter("expression"); String expression = request.getParameter("expression");

View File

@ -35,9 +35,9 @@ package com.google.refine.commands.column;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject;
import org.json.JSONArray; import org.json.JSONArray;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -47,7 +47,7 @@ import com.google.refine.operations.column.ColumnAdditionByFetchingURLsOperation
public class AddColumnByFetchingURLsCommand extends EngineDependentCommand { public class AddColumnByFetchingURLsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String baseColumnName = request.getParameter("baseColumnName"); String baseColumnName = request.getParameter("baseColumnName");
String urlExpression = request.getParameter("urlExpression"); String urlExpression = request.getParameter("urlExpression");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.column;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -46,7 +45,7 @@ import com.google.refine.operations.column.ColumnAdditionOperation;
public class AddColumnCommand extends EngineDependentCommand { public class AddColumnCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String baseColumnName = request.getParameter("baseColumnName"); String baseColumnName = request.getParameter("baseColumnName");
String expression = request.getParameter("expression"); String expression = request.getParameter("expression");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.column;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -48,7 +47,7 @@ public class ReorderColumnsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnNames = request.getParameter("columnNames"); String columnNames = request.getParameter("columnNames");
return new ColumnReorderOperation( return new ColumnReorderOperation(

View File

@ -36,8 +36,8 @@ package com.google.refine.commands.column;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -47,7 +47,7 @@ import com.google.refine.util.ParsingUtilities;
public class SplitColumnCommand extends EngineDependentCommand { public class SplitColumnCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
boolean guessCellType = Boolean.parseBoolean(request.getParameter("guessCellType")); boolean guessCellType = Boolean.parseBoolean(request.getParameter("guessCellType"));

View File

@ -37,6 +37,7 @@ import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import org.json.JSONObject;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.operations.recon.ExtendDataOperation; import com.google.refine.operations.recon.ExtendDataOperation;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -46,7 +47,7 @@ import com.google.refine.util.ParsingUtilities;
public class ExtendDataCommand extends EngineDependentCommand { public class ExtendDataCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String baseColumnName = request.getParameter("baseColumnName"); String baseColumnName = request.getParameter("baseColumnName");
int columnInsertIndex = Integer.parseInt(request.getParameter("columnInsertIndex")); int columnInsertIndex = Integer.parseInt(request.getParameter("columnInsertIndex"));

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -46,7 +45,7 @@ public class ReconClearSimilarCellsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation( protected AbstractOperation createOperation(
Project project, HttpServletRequest request, JSONObject engineConfig) throws Exception { Project project, HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
String similarValue = request.getParameter("similarValue"); String similarValue = request.getParameter("similarValue");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -45,7 +44,7 @@ import com.google.refine.operations.recon.ReconCopyAcrossColumnsOperation;
public class ReconCopyAcrossColumnsCommand extends EngineDependentCommand { public class ReconCopyAcrossColumnsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String fromColumnName = request.getParameter("fromColumnName"); String fromColumnName = request.getParameter("fromColumnName");
String[] toColumnNames = request.getParameterValues("toColumnName[]"); String[] toColumnNames = request.getParameterValues("toColumnName[]");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -45,7 +44,7 @@ import com.google.refine.operations.recon.ReconDiscardJudgmentsOperation;
public class ReconDiscardJudgmentsCommand extends EngineDependentCommand { public class ReconDiscardJudgmentsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
boolean clearData = Boolean.parseBoolean(request.getParameter("clearData")); boolean clearData = Boolean.parseBoolean(request.getParameter("clearData"));

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -49,7 +48,7 @@ public class ReconJudgeSimilarCellsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation( protected AbstractOperation createOperation(
Project project, HttpServletRequest request, JSONObject engineConfig) throws Exception { Project project, HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
String similarValue = request.getParameter("similarValue"); String similarValue = request.getParameter("similarValue");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -46,7 +45,7 @@ public class ReconMarkNewTopicsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
return new ReconMarkNewTopicsOperation( return new ReconMarkNewTopicsOperation(
engineConfig, engineConfig,

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -46,7 +45,7 @@ public class ReconMatchBestCandidatesCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.recon;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -47,7 +46,7 @@ public class ReconMatchSpecificTopicCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
ReconCandidate match = new ReconCandidate( ReconCandidate match = new ReconCandidate(

View File

@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONTokener; import org.json.JSONTokener;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -48,7 +49,7 @@ public class ReconcileCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String columnName = request.getParameter("columnName"); String columnName = request.getParameter("columnName");
String configString = request.getParameter("config"); String configString = request.getParameter("config");

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.row;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -47,7 +46,7 @@ public class AnnotateRowsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String starredString = request.getParameter("starred"); String starredString = request.getParameter("starred");
if (starredString != null) { if (starredString != null) {

View File

@ -35,8 +35,7 @@ package com.google.refine.commands.row;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.json.JSONObject; import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -46,7 +45,7 @@ public class RemoveRowsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
return new RowRemovalOperation(engineConfig); return new RowRemovalOperation(engineConfig);
} }

View File

@ -39,6 +39,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.EngineDependentCommand; import com.google.refine.commands.EngineDependentCommand;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -49,7 +50,7 @@ public class ReorderRowsCommand extends EngineDependentCommand {
@Override @Override
protected AbstractOperation createOperation(Project project, protected AbstractOperation createOperation(Project project,
HttpServletRequest request, JSONObject engineConfig) throws Exception { HttpServletRequest request, EngineConfig engineConfig) throws Exception {
String mode = request.getParameter("mode"); String mode = request.getParameter("mode");
JSONObject sorting = null; JSONObject sorting = null;

View File

@ -36,9 +36,8 @@ package com.google.refine.operations;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.json.JSONObject;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
@ -53,7 +52,7 @@ abstract public class EngineDependentMassCellOperation extends EngineDependentOp
final protected boolean _updateRowContextDependencies; final protected boolean _updateRowContextDependencies;
protected EngineDependentMassCellOperation( protected EngineDependentMassCellOperation(
JSONObject engineConfig, String columnName, boolean updateRowContextDependencies) { EngineConfig engineConfig, String columnName, boolean updateRowContextDependencies) {
super(engineConfig); super(engineConfig);
_columnName = columnName; _columnName = columnName;
_updateRowContextDependencies = updateRowContextDependencies; _updateRowContextDependencies = updateRowContextDependencies;

View File

@ -34,9 +34,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package com.google.refine.operations; package com.google.refine.operations;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.util.ParsingUtilities; import com.google.refine.util.ParsingUtilities;
@ -44,24 +44,25 @@ import com.google.refine.util.ParsingUtilities;
abstract public class EngineDependentOperation extends AbstractOperation { abstract public class EngineDependentOperation extends AbstractOperation {
final private String _engineConfigString; final private String _engineConfigString;
transient protected JSONObject _engineConfig; transient protected EngineConfig _engineConfig;
protected EngineDependentOperation(JSONObject engineConfig) { protected EngineDependentOperation(EngineConfig engineConfig) {
_engineConfig = engineConfig; _engineConfig = engineConfig;
_engineConfigString = engineConfig == null || engineConfig.length() == 0 _engineConfigString = engineConfig == null
? null : engineConfig.toString(); ? null : engineConfig.toString();
} }
protected Engine createEngine(Project project) throws Exception { protected Engine createEngine(Project project) throws Exception {
Engine engine = new Engine(project); Engine engine = new Engine(project);
engine.initializeFromJSON(getEngineConfig()); engine.initializeFromConfig(getEngineConfig());
return engine; return engine;
} }
protected JSONObject getEngineConfig() { protected EngineConfig getEngineConfig() {
if (_engineConfig == null && _engineConfigString != null) { if (_engineConfig == null && _engineConfigString != null) {
try { try {
_engineConfig = ParsingUtilities.evaluateJsonStringToObject(_engineConfigString); _engineConfig = EngineConfig.reconstruct(
ParsingUtilities.evaluateJsonStringToObject(_engineConfigString));
} catch (JSONException e) { } catch (JSONException e) {
// ignore // ignore
} }

View File

@ -41,6 +41,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine.Mode; import com.google.refine.browsing.Engine.Mode;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -58,13 +59,13 @@ public class BlankDownOperation extends EngineDependentMassCellOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new BlankDownOperation( return new BlankDownOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName") obj.getString("columnName")
); );
} }
public BlankDownOperation( public BlankDownOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName String columnName
) { ) {
super(engineConfig, columnName, true); super(engineConfig, columnName, true);
@ -77,7 +78,7 @@ public class BlankDownOperation extends EngineDependentMassCellOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.endObject(); writer.endObject();
} }

View File

@ -42,6 +42,7 @@ import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.Engine.Mode; import com.google.refine.browsing.Engine.Mode;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -59,13 +60,13 @@ public class FillDownOperation extends EngineDependentMassCellOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new FillDownOperation( return new FillDownOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName") obj.getString("columnName")
); );
} }
public FillDownOperation( public FillDownOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName String columnName
) { ) {
super(engineConfig, columnName, true); super(engineConfig, columnName, true);
@ -78,7 +79,7 @@ public class FillDownOperation extends EngineDependentMassCellOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.endObject(); writer.endObject();
} }

View File

@ -46,6 +46,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.Jsonizable; import com.google.refine.Jsonizable;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.Evaluable; import com.google.refine.expr.Evaluable;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
@ -101,7 +102,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation {
obj.getJSONObject("engineConfig") : null; obj.getJSONObject("engineConfig") : null;
return new MassEditOperation( return new MassEditOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.getString("expression"), obj.getString("expression"),
reconstructEdits(obj.getJSONArray("edits")) reconstructEdits(obj.getJSONArray("edits"))
@ -145,7 +146,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation {
return edits; return edits;
} }
public MassEditOperation(JSONObject engineConfig, String columnName, String expression, List<Edit> edits) { public MassEditOperation(EngineConfig engineConfig, String columnName, String expression, List<Edit> edits) {
super(engineConfig, columnName, true); super(engineConfig, columnName, true);
_expression = expression; _expression = expression;
_edits = edits; _edits = edits;
@ -158,7 +159,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("expression"); writer.value(_expression); writer.key("expression"); writer.value(_expression);
writer.key("edits"); writer.key("edits");

View File

@ -41,6 +41,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.Evaluable; import com.google.refine.expr.Evaluable;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
@ -66,7 +67,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new TextTransformOperation( return new TextTransformOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.getString("expression"), obj.getString("expression"),
stringToOnError(obj.getString("onError")), stringToOnError(obj.getString("onError")),
@ -95,7 +96,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation {
} }
public TextTransformOperation( public TextTransformOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
String expression, String expression,
OnError onError, OnError onError,
@ -116,7 +117,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("expression"); writer.value(_expression); writer.key("expression"); writer.value(_expression);
writer.key("onError"); writer.value(onErrorToString(_onError)); writer.key("onError"); writer.value(onErrorToString(_onError));

View File

@ -42,18 +42,20 @@ import java.net.URL;
import java.net.URLConnection; import java.net.URLConnection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.ExecutionException;
import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.EvalError; import com.google.refine.expr.EvalError;
@ -69,8 +71,6 @@ import com.google.refine.model.Project;
import com.google.refine.model.Row; import com.google.refine.model.Row;
import com.google.refine.model.changes.CellAtRow; import com.google.refine.model.changes.CellAtRow;
import com.google.refine.model.changes.ColumnAdditionChange; import com.google.refine.model.changes.ColumnAdditionChange;
import com.google.refine.commands.HttpHeadersSupport;
import com.google.refine.commands.HttpHeadersSupport.HttpHeaderInfo;
import com.google.refine.operations.EngineDependentOperation; import com.google.refine.operations.EngineDependentOperation;
import com.google.refine.operations.OnError; import com.google.refine.operations.OnError;
import com.google.refine.operations.OperationRegistry; import com.google.refine.operations.OperationRegistry;
@ -78,9 +78,6 @@ import com.google.refine.operations.cell.TextTransformOperation;
import com.google.refine.process.LongRunningProcess; import com.google.refine.process.LongRunningProcess;
import com.google.refine.process.Process; import com.google.refine.process.Process;
import com.google.refine.util.ParsingUtilities; import com.google.refine.util.ParsingUtilities;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.LoadingCache;
import com.google.common.cache.CacheLoader;
public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperation { public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperation {
@ -98,7 +95,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ColumnAdditionByFetchingURLsOperation( return new ColumnAdditionByFetchingURLsOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("baseColumnName"), obj.getString("baseColumnName"),
obj.getString("urlExpression"), obj.getString("urlExpression"),
TextTransformOperation.stringToOnError(obj.getString("onError")), TextTransformOperation.stringToOnError(obj.getString("onError")),
@ -111,7 +108,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat
} }
public ColumnAdditionByFetchingURLsOperation( public ColumnAdditionByFetchingURLsOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String baseColumnName, String baseColumnName,
String urlExpression, String urlExpression,
OnError onError, OnError onError,
@ -142,7 +139,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("newColumnName"); writer.value(_newColumnName); writer.key("newColumnName"); writer.value(_newColumnName);
writer.key("columnInsertIndex"); writer.value(_columnInsertIndex); writer.key("columnInsertIndex"); writer.value(_columnInsertIndex);
writer.key("baseColumnName"); writer.value(_baseColumnName); writer.key("baseColumnName"); writer.value(_baseColumnName);
@ -173,7 +170,7 @@ public class ColumnAdditionByFetchingURLsOperation extends EngineDependentOperat
@Override @Override
public Process createProcess(Project project, Properties options) throws Exception { public Process createProcess(Project project, Properties options) throws Exception {
Engine engine = createEngine(project); Engine engine = createEngine(project);
engine.initializeFromJSON(_engineConfig); engine.initializeFromConfig(_engineConfig);
Evaluable eval = MetaParser.parse(_urlExpression); Evaluable eval = MetaParser.parse(_urlExpression);

View File

@ -43,6 +43,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.Evaluable; import com.google.refine.expr.Evaluable;
@ -75,7 +76,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ColumnAdditionOperation( return new ColumnAdditionOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("baseColumnName"), obj.getString("baseColumnName"),
obj.getString("expression"), obj.getString("expression"),
TextTransformOperation.stringToOnError(obj.getString("onError")), TextTransformOperation.stringToOnError(obj.getString("onError")),
@ -85,7 +86,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation {
} }
public ColumnAdditionOperation( public ColumnAdditionOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String baseColumnName, String baseColumnName,
String expression, String expression,
OnError onError, OnError onError,
@ -109,7 +110,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("newColumnName"); writer.value(_newColumnName); writer.key("newColumnName"); writer.value(_newColumnName);
writer.key("columnInsertIndex"); writer.value(_columnInsertIndex); writer.key("columnInsertIndex"); writer.value(_columnInsertIndex);
writer.key("baseColumnName"); writer.value(_baseColumnName); writer.key("baseColumnName"); writer.value(_baseColumnName);

View File

@ -45,6 +45,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
@ -78,7 +79,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
if ("separator".equals(mode)) { if ("separator".equals(mode)) {
return new ColumnSplitOperation( return new ColumnSplitOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.getBoolean("guessCellType"), obj.getBoolean("guessCellType"),
obj.getBoolean("removeOriginalColumn"), obj.getBoolean("removeOriginalColumn"),
@ -88,7 +89,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
); );
} else { } else {
return new ColumnSplitOperation( return new ColumnSplitOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.getBoolean("guessCellType"), obj.getBoolean("guessCellType"),
obj.getBoolean("removeOriginalColumn"), obj.getBoolean("removeOriginalColumn"),
@ -98,7 +99,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
} }
public ColumnSplitOperation( public ColumnSplitOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
boolean guessCellType, boolean guessCellType,
boolean removeOriginalColumn, boolean removeOriginalColumn,
@ -121,7 +122,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
} }
public ColumnSplitOperation( public ColumnSplitOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
boolean guessCellType, boolean guessCellType,
boolean removeOriginalColumn, boolean removeOriginalColumn,
@ -148,7 +149,7 @@ public class ColumnSplitOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("guessCellType"); writer.value(_guessCellType); writer.key("guessCellType"); writer.value(_guessCellType);
writer.key("removeOriginalColumn"); writer.value(_removeOriginalColumn); writer.key("removeOriginalColumn"); writer.value(_removeOriginalColumn);

View File

@ -41,18 +41,14 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.model.changes.DataExtensionChange;
import com.google.refine.model.recon.ReconciledDataExtensionJob;
import com.google.refine.model.recon.ReconciledDataExtensionJob.ColumnInfo;
import com.google.refine.model.recon.ReconciledDataExtensionJob.DataExtension;
import com.google.refine.history.HistoryEntry; import com.google.refine.history.HistoryEntry;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Cell; import com.google.refine.model.Cell;
@ -62,6 +58,10 @@ import com.google.refine.model.ReconCandidate;
import com.google.refine.model.ReconType; import com.google.refine.model.ReconType;
import com.google.refine.model.Row; import com.google.refine.model.Row;
import com.google.refine.model.changes.CellAtRow; import com.google.refine.model.changes.CellAtRow;
import com.google.refine.model.changes.DataExtensionChange;
import com.google.refine.model.recon.ReconciledDataExtensionJob;
import com.google.refine.model.recon.ReconciledDataExtensionJob.ColumnInfo;
import com.google.refine.model.recon.ReconciledDataExtensionJob.DataExtension;
import com.google.refine.operations.EngineDependentOperation; import com.google.refine.operations.EngineDependentOperation;
import com.google.refine.operations.OperationRegistry; import com.google.refine.operations.OperationRegistry;
import com.google.refine.process.LongRunningProcess; import com.google.refine.process.LongRunningProcess;
@ -79,7 +79,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ExtendDataOperation( return new ExtendDataOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("baseColumnName"), obj.getString("baseColumnName"),
obj.getString("endpoint"), obj.getString("endpoint"),
obj.getString("identifierSpace"), obj.getString("identifierSpace"),
@ -90,7 +90,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
} }
public ExtendDataOperation( public ExtendDataOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String baseColumnName, String baseColumnName,
String endpoint, String endpoint,
String identifierSpace, String identifierSpace,
@ -115,7 +115,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnInsertIndex"); writer.value(_columnInsertIndex); writer.key("columnInsertIndex"); writer.value(_columnInsertIndex);
writer.key("baseColumnName"); writer.value(_baseColumnName); writer.key("baseColumnName"); writer.value(_baseColumnName);
writer.key("endpoint"); writer.value(_endpoint); writer.key("endpoint"); writer.value(_endpoint);
@ -148,14 +148,14 @@ public class ExtendDataOperation extends EngineDependentOperation {
public class ExtendDataProcess extends LongRunningProcess implements Runnable { public class ExtendDataProcess extends LongRunningProcess implements Runnable {
final protected Project _project; final protected Project _project;
final protected JSONObject _engineConfig; final protected EngineConfig _engineConfig;
final protected long _historyEntryID; final protected long _historyEntryID;
protected int _cellIndex; protected int _cellIndex;
protected ReconciledDataExtensionJob _job; protected ReconciledDataExtensionJob _job;
public ExtendDataProcess( public ExtendDataProcess(
Project project, Project project,
JSONObject engineConfig, EngineConfig engineConfig,
String description String description
) throws JSONException { ) throws JSONException {
super(description); super(description);
@ -186,7 +186,7 @@ public class ExtendDataOperation extends EngineDependentOperation {
protected void populateRowsWithMatches(List<Integer> rowIndices) throws Exception { protected void populateRowsWithMatches(List<Integer> rowIndices) throws Exception {
Engine engine = new Engine(_project); Engine engine = new Engine(_project);
engine.initializeFromJSON(_engineConfig); engine.initializeFromConfig(_engineConfig);
Column column = _project.columnModel.getColumnByName(_baseColumnName); Column column = _project.columnModel.getColumnByName(_baseColumnName);
if (column == null) { if (column == null) {

View File

@ -40,6 +40,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -58,14 +59,14 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception { static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ReconClearSimilarCellsOperation( return new ReconClearSimilarCellsOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.getString("similarValue") obj.getString("similarValue")
); );
} }
public ReconClearSimilarCellsOperation( public ReconClearSimilarCellsOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
String similarValue String similarValue
) { ) {
@ -80,7 +81,7 @@ public class ReconClearSimilarCellsOperation extends EngineDependentMassCellOper
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("similarValue"); writer.value(_similarValue); writer.key("similarValue"); writer.value(_similarValue);

View File

@ -47,6 +47,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.HistoryEntry; import com.google.refine.history.HistoryEntry;
@ -72,7 +73,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation {
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception { static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ReconCopyAcrossColumnsOperation( return new ReconCopyAcrossColumnsOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("fromColumnName"), obj.getString("fromColumnName"),
JSONUtilities.getStringArray(obj, "toColumnNames"), JSONUtilities.getStringArray(obj, "toColumnNames"),
JSONUtilities.getStringArray(obj, "judgments"), JSONUtilities.getStringArray(obj, "judgments"),
@ -81,7 +82,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation {
} }
public ReconCopyAcrossColumnsOperation( public ReconCopyAcrossColumnsOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String fromColumnName, String fromColumnName,
String[] toColumnNames, String[] toColumnNames,
String[] judgments, String[] judgments,
@ -100,7 +101,7 @@ public class ReconCopyAcrossColumnsOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("fromColumnName"); writer.value(_fromColumnName); writer.key("fromColumnName"); writer.value(_fromColumnName);
writer.key("toColumnNames"); writer.key("toColumnNames");
writer.array(); writer.array();

View File

@ -42,6 +42,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -62,13 +63,13 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera
static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception { static public AbstractOperation reconstruct(Project project, JSONObject obj) throws Exception {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ReconDiscardJudgmentsOperation( return new ReconDiscardJudgmentsOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.has("clearData") && obj.getBoolean("clearData") obj.has("clearData") && obj.getBoolean("clearData")
); );
} }
public ReconDiscardJudgmentsOperation(JSONObject engineConfig, String columnName, boolean clearData) { public ReconDiscardJudgmentsOperation(EngineConfig engineConfig, String columnName, boolean clearData) {
super(engineConfig, columnName, false); super(engineConfig, columnName, false);
_clearData = clearData; _clearData = clearData;
} }
@ -80,7 +81,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("clearData"); writer.value(_clearData); writer.key("clearData"); writer.value(_clearData);
writer.endObject(); writer.endObject();

View File

@ -43,6 +43,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
import com.google.refine.history.Change; import com.google.refine.history.Change;
@ -93,7 +94,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper
} }
return new ReconJudgeSimilarCellsOperation( return new ReconJudgeSimilarCellsOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.getString("similarValue"), obj.getString("similarValue"),
judgment, judgment,
@ -103,7 +104,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper
} }
public ReconJudgeSimilarCellsOperation( public ReconJudgeSimilarCellsOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
String similarValue, String similarValue,
Judgment judgment, Judgment judgment,
@ -124,7 +125,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("similarValue"); writer.value(_similarValue); writer.key("similarValue"); writer.value(_similarValue);
writer.key("judgment"); writer.value(Recon.judgmentToString(_judgment)); writer.key("judgment"); writer.value(Recon.judgmentToString(_judgment));

View File

@ -42,6 +42,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -64,13 +65,13 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ReconMarkNewTopicsOperation( return new ReconMarkNewTopicsOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
obj.has("shareNewTopics") ? obj.getBoolean("shareNewTopics") : false obj.has("shareNewTopics") ? obj.getBoolean("shareNewTopics") : false
); );
} }
public ReconMarkNewTopicsOperation(JSONObject engineConfig, String columnName, boolean shareNewTopics) { public ReconMarkNewTopicsOperation(EngineConfig engineConfig, String columnName, boolean shareNewTopics) {
super(engineConfig, columnName, false); super(engineConfig, columnName, false);
_shareNewTopics = shareNewTopics; _shareNewTopics = shareNewTopics;
} }
@ -82,7 +83,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("shareNewTopics"); writer.value(_shareNewTopics); writer.key("shareNewTopics"); writer.value(_shareNewTopics);
writer.endObject(); writer.endObject();

View File

@ -42,6 +42,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -63,12 +64,12 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp
String columnName = obj.getString("columnName"); String columnName = obj.getString("columnName");
return new ReconMatchBestCandidatesOperation( return new ReconMatchBestCandidatesOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
columnName columnName
); );
} }
public ReconMatchBestCandidatesOperation(JSONObject engineConfig, String columnName) { public ReconMatchBestCandidatesOperation(EngineConfig engineConfig, String columnName) {
super(engineConfig, columnName, false); super(engineConfig, columnName, false);
} }
@ -79,7 +80,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.endObject(); writer.endObject();
} }

View File

@ -43,6 +43,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
@ -75,7 +76,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe
} }
return new ReconMatchSpecificTopicOperation( return new ReconMatchSpecificTopicOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
new ReconCandidate( new ReconCandidate(
match.getString("id"), match.getString("id"),
@ -89,7 +90,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe
} }
public ReconMatchSpecificTopicOperation( public ReconMatchSpecificTopicOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
ReconCandidate match, ReconCandidate match,
String identifierSpace, String identifierSpace,
@ -108,7 +109,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("match"); writer.key("match");
writer.object(); writer.object();

View File

@ -46,6 +46,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
@ -77,14 +78,14 @@ public class ReconOperation extends EngineDependentOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new ReconOperation( return new ReconOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
obj.getString("columnName"), obj.getString("columnName"),
ReconConfig.reconstruct(obj.getJSONObject("config")) ReconConfig.reconstruct(obj.getJSONObject("config"))
); );
} }
public ReconOperation( public ReconOperation(
JSONObject engineConfig, EngineConfig engineConfig,
String columnName, String columnName,
ReconConfig reconConfig ReconConfig reconConfig
) { ) {
@ -116,7 +117,7 @@ public class ReconOperation extends EngineDependentOperation {
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("columnName"); writer.value(_columnName); writer.key("columnName"); writer.value(_columnName);
writer.key("config"); _reconConfig.write(writer, options); writer.key("config"); _reconConfig.write(writer, options);
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.endObject(); writer.endObject();
} }
@ -140,15 +141,15 @@ public class ReconOperation extends EngineDependentOperation {
} }
public class ReconProcess extends LongRunningProcess implements Runnable { public class ReconProcess extends LongRunningProcess implements Runnable {
final protected Project _project; final protected Project _project;
final protected JSONObject _engineConfig; final protected EngineConfig _engineConfig;
final protected long _historyEntryID; final protected long _historyEntryID;
protected List<ReconEntry> _entries; protected List<ReconEntry> _entries;
protected int _cellIndex; protected int _cellIndex;
public ReconProcess( public ReconProcess(
Project project, Project project,
JSONObject engineConfig, EngineConfig engineConfig,
String description String description
) { ) {
super(description); super(description);
@ -208,7 +209,7 @@ public class ReconOperation extends EngineDependentOperation {
protected void populateEntries() throws Exception { protected void populateEntries() throws Exception {
Engine engine = new Engine(_project); Engine engine = new Engine(_project);
engine.initializeFromJSON(_engineConfig); engine.initializeFromConfig(_engineConfig);
Column column = _project.columnModel.getColumnByName(_columnName); Column column = _project.columnModel.getColumnByName(_columnName);
if (column == null) { if (column == null) {

View File

@ -42,6 +42,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
@ -62,12 +63,12 @@ public class RowFlagOperation extends EngineDependentOperation {
boolean flagged = obj.getBoolean("flagged"); boolean flagged = obj.getBoolean("flagged");
return new RowFlagOperation( return new RowFlagOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
flagged flagged
); );
} }
public RowFlagOperation(JSONObject engineConfig, boolean flagged) { public RowFlagOperation(EngineConfig engineConfig, boolean flagged) {
super(engineConfig); super(engineConfig);
_flagged = flagged; _flagged = flagged;
} }
@ -79,7 +80,7 @@ public class RowFlagOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("flagged"); writer.value(_flagged); writer.key("flagged"); writer.value(_flagged);
writer.endObject(); writer.endObject();
} }

View File

@ -42,6 +42,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.HistoryEntry; import com.google.refine.history.HistoryEntry;
@ -57,11 +58,11 @@ public class RowRemovalOperation extends EngineDependentOperation {
JSONObject engineConfig = obj.getJSONObject("engineConfig"); JSONObject engineConfig = obj.getJSONObject("engineConfig");
return new RowRemovalOperation( return new RowRemovalOperation(
engineConfig EngineConfig.reconstruct(engineConfig)
); );
} }
public RowRemovalOperation(JSONObject engineConfig) { public RowRemovalOperation(EngineConfig engineConfig) {
super(engineConfig); super(engineConfig);
} }
@ -72,7 +73,7 @@ public class RowRemovalOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.endObject(); writer.endObject();
} }

View File

@ -42,6 +42,7 @@ import org.json.JSONObject;
import org.json.JSONWriter; import org.json.JSONWriter;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.FilteredRows; import com.google.refine.browsing.FilteredRows;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.history.Change; import com.google.refine.history.Change;
@ -62,12 +63,12 @@ public class RowStarOperation extends EngineDependentOperation {
boolean starred = obj.getBoolean("starred"); boolean starred = obj.getBoolean("starred");
return new RowStarOperation( return new RowStarOperation(
engineConfig, EngineConfig.reconstruct(engineConfig),
starred starred
); );
} }
public RowStarOperation(JSONObject engineConfig, boolean starred) { public RowStarOperation(EngineConfig engineConfig, boolean starred) {
super(engineConfig); super(engineConfig);
_starred = starred; _starred = starred;
} }
@ -79,7 +80,7 @@ public class RowStarOperation extends EngineDependentOperation {
writer.object(); writer.object();
writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass())); writer.key("op"); writer.value(OperationRegistry.s_opClassToName.get(this.getClass()));
writer.key("description"); writer.value(getBriefDescription(null)); writer.key("description"); writer.value(getBriefDescription(null));
writer.key("engineConfig"); writer.value(getEngineConfig()); writer.key("engineConfig"); getEngineConfig().write(writer, options);
writer.key("starred"); writer.value(_starred); writer.key("starred"); writer.value(_starred);
writer.endObject(); writer.endObject();
} }

View File

@ -7,7 +7,7 @@ import com.google.refine.tests.util.TestUtils;
public class EvalErrorTests { public class EvalErrorTests {
@Test @Test
public void serializeEvalError() { public void serializeEvalError() {
EvalError e = new EvalError("this is a critical error"); EvalError e = new EvalError("This is a critical error");
TestUtils.isSerializedTo(e, "{\"type\":\"error\",\"message\":\"This is a critical error\"}"); TestUtils.isSerializedTo(e, "{\"type\":\"error\",\"message\":\"This is a critical error\"}");
} }
} }

View File

@ -7,8 +7,6 @@ import com.google.refine.browsing.Engine;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.tests.util.TestUtils; import com.google.refine.tests.util.TestUtils;
// TODO Engine and engine config should be separated
// create an EngineConfig class that can be used in operations directly (to avoid manipulating JSONObject)
public class EngineTests { public class EngineTests {
@Test @Test

View File

@ -40,6 +40,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.commands.Command; import com.google.refine.commands.Command;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -53,7 +54,7 @@ public class CommandStub extends Command {
return getProject(request); return getProject(request);
} }
public JSONObject wrapGetEngineConfig(HttpServletRequest request) public EngineConfig wrapGetEngineConfig(HttpServletRequest request)
throws JSONException { throws JSONException {
return getEngineConfig(request); return getEngineConfig(request);
} }

View File

@ -52,6 +52,8 @@ import org.testng.annotations.Test;
import com.google.refine.ProjectManager; import com.google.refine.ProjectManager;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.Engine.Mode;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.tests.RefineTest; import com.google.refine.tests.RefineTest;
@ -151,11 +153,11 @@ public class CommandTests extends RefineTest {
@Test @Test
public void getEngineConfigRegressionTest() { public void getEngineConfigRegressionTest() {
when(request.getParameter("engine")).thenReturn("{\"hello\":\"world\"}"); when(request.getParameter("engine")).thenReturn("{\"mode\":\"row-based\"}");
JSONObject o = null; EngineConfig o = null;
try { try {
o = SUT.wrapGetEngineConfig(request); o = SUT.wrapGetEngineConfig(request);
Assert.assertEquals("world", o.getString("hello")); Assert.assertEquals(Mode.RowBased, o.getMode());
} catch (JSONException e) { } catch (JSONException e) {
Assert.fail(); Assert.fail();
} catch (Exception e) { } catch (Exception e) {

View File

@ -45,6 +45,7 @@ import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.browsing.RowVisitor; import com.google.refine.browsing.RowVisitor;
import com.google.refine.expr.functions.FacetCount; import com.google.refine.expr.functions.FacetCount;
import com.google.refine.grel.Function; import com.google.refine.grel.Function;
@ -72,7 +73,7 @@ public class CacheTests extends RefineTest {
// dependencies // dependencies
Project project; Project project;
Properties options; Properties options;
JSONObject engine_config; EngineConfig engine_config;
Engine engine; Engine engine;
Properties bindings; Properties bindings;
@ -81,8 +82,8 @@ public class CacheTests extends RefineTest {
project = createProjectWithColumns("CacheTests", "Column A"); project = createProjectWithColumns("CacheTests", "Column A");
engine = new Engine(project); engine = new Engine(project);
engine_config = new JSONObject(ENGINE_JSON_DUPLICATES); engine_config = EngineConfig.reconstruct(new JSONObject(ENGINE_JSON_DUPLICATES));
engine.initializeFromJSON(engine_config); engine.initializeFromConfig(engine_config);
engine.setMode(Engine.Mode.RowBased); engine.setMode(Engine.Mode.RowBased);
bindings = new Properties(); bindings = new Properties();

View File

@ -11,6 +11,7 @@ import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.ProjectManager; import com.google.refine.ProjectManager;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.operations.OperationRegistry; import com.google.refine.operations.OperationRegistry;
@ -56,7 +57,7 @@ public class BlankDownTests extends RefineTest {
@Test @Test
public void testBlankDownRecords() throws Exception { public void testBlankDownRecords() throws Exception {
AbstractOperation op = new BlankDownOperation( AbstractOperation op = new BlankDownOperation(
new JSONObject("{\"mode\":\"record-based\",\"facets\":[]}"), EngineConfig.reconstruct(new JSONObject("{\"mode\":\"record-based\",\"facets\":[]}")),
"second"); "second");
Process process = op.createProcess(project, new Properties()); Process process = op.createProcess(project, new Properties());
process.performImmediate(); process.performImmediate();
@ -70,7 +71,7 @@ public class BlankDownTests extends RefineTest {
@Test @Test
public void testBlankDownRows() throws Exception { public void testBlankDownRows() throws Exception {
AbstractOperation op = new BlankDownOperation( AbstractOperation op = new BlankDownOperation(
new JSONObject("{\"mode\":\"row-based\",\"facets\":[]}"), EngineConfig.reconstruct(new JSONObject("{\"mode\":\"row-based\",\"facets\":[]}")),
"second"); "second");
Process process = op.createProcess(project, new Properties()); Process process = op.createProcess(project, new Properties());
process.performImmediate(); process.performImmediate();

View File

@ -11,6 +11,7 @@ import org.testng.annotations.BeforeSuite;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.ProjectManager; import com.google.refine.ProjectManager;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.operations.OperationRegistry; import com.google.refine.operations.OperationRegistry;
@ -55,7 +56,7 @@ public class FillDownTests extends RefineTest {
@Test @Test
public void testFillDownRecordKey() throws Exception { public void testFillDownRecordKey() throws Exception {
AbstractOperation op = new FillDownOperation( AbstractOperation op = new FillDownOperation(
new JSONObject("{\"mode\":\"record-based\",\"facets\":[]}"), EngineConfig.reconstruct(new JSONObject("{\"mode\":\"record-based\",\"facets\":[]}")),
"key"); "key");
Process process = op.createProcess(project, new Properties()); Process process = op.createProcess(project, new Properties());
process.performImmediate(); process.performImmediate();
@ -71,7 +72,7 @@ public class FillDownTests extends RefineTest {
@Test @Test
public void testFillDownRecords() throws Exception { public void testFillDownRecords() throws Exception {
AbstractOperation op = new FillDownOperation( AbstractOperation op = new FillDownOperation(
new JSONObject("{\"mode\":\"record-based\",\"facets\":[]}"), EngineConfig.reconstruct(new JSONObject("{\"mode\":\"record-based\",\"facets\":[]}")),
"second"); "second");
Process process = op.createProcess(project, new Properties()); Process process = op.createProcess(project, new Properties());
process.performImmediate(); process.performImmediate();
@ -87,7 +88,7 @@ public class FillDownTests extends RefineTest {
@Test @Test
public void testFillDownRows() throws Exception { public void testFillDownRows() throws Exception {
AbstractOperation op = new FillDownOperation( AbstractOperation op = new FillDownOperation(
new JSONObject("{\"mode\":\"row-based\",\"facets\":[]}"), EngineConfig.reconstruct(new JSONObject("{\"mode\":\"row-based\",\"facets\":[]}")),
"second"); "second");
Process process = op.createProcess(project, new Properties()); Process process = op.createProcess(project, new Properties());
process.performImmediate(); process.performImmediate();

View File

@ -46,6 +46,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.expr.ExpressionUtils; import com.google.refine.expr.ExpressionUtils;
import com.google.refine.model.Cell; import com.google.refine.model.Cell;
import com.google.refine.model.ModelException; import com.google.refine.model.ModelException;
@ -75,7 +76,7 @@ public class ColumnAdditionByFetchingURLsOperationTests extends RefineTest {
// dependencies // dependencies
private Project project; private Project project;
private Properties options; private Properties options;
private JSONObject engine_config; private EngineConfig engine_config = EngineConfig.reconstruct(new JSONObject(ENGINE_JSON_URLS));
@BeforeMethod @BeforeMethod
public void SetUp() throws JSONException, IOException, ModelException { public void SetUp() throws JSONException, IOException, ModelException {

View File

@ -50,6 +50,7 @@ import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.browsing.Engine; import com.google.refine.browsing.Engine;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.Cell; import com.google.refine.model.Cell;
import com.google.refine.model.ModelException; import com.google.refine.model.ModelException;
import com.google.refine.model.Project; import com.google.refine.model.Project;
@ -81,7 +82,7 @@ public class ExtendDataOperationTests extends RefineTest {
// dependencies // dependencies
Project project; Project project;
Properties options; Properties options;
JSONObject engine_config; EngineConfig engine_config;
Engine engine; Engine engine;
@BeforeMethod @BeforeMethod
@ -91,8 +92,8 @@ public class ExtendDataOperationTests extends RefineTest {
options = mock(Properties.class); options = mock(Properties.class);
engine = new Engine(project); engine = new Engine(project);
engine_config = new JSONObject(ENGINE_JSON_URLS); engine_config = EngineConfig.reconstruct(new JSONObject(ENGINE_JSON_URLS));
engine.initializeFromJSON(engine_config); engine.initializeFromConfig(engine_config);
engine.setMode(Engine.Mode.RowBased); engine.setMode(Engine.Mode.RowBased);
Row row = new Row(2); Row row = new Row(2);

View File

@ -21,7 +21,7 @@ public class ReconCopyAcrossColumnsOperationTests extends RefineTest {
public void serializeReconCopyAcrossColumnsOperation() throws Exception { public void serializeReconCopyAcrossColumnsOperation() throws Exception {
String json = "{\"op\":\"core/recon-copy-across-columns\"," String json = "{\"op\":\"core/recon-copy-across-columns\","
+ "\"description\":\"Copy recon judgments from column source column to firstsecond\"," + "\"description\":\"Copy recon judgments from column source column to firstsecond\","
+ "\"engineConfig\":{\"mode\":\"row-based\"}," + "\"engineConfig\":{\"mode\":\"row-based\",\"facets\":[]},"
+ "\"fromColumnName\":\"source column\"," + "\"fromColumnName\":\"source column\","
+ "\"toColumnNames\":[\"first\",\"second\"]," + "\"toColumnNames\":[\"first\",\"second\"],"
+ "\"judgments\":[\"matched\",\"new\"]," + "\"judgments\":[\"matched\",\"new\"],"

View File

@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeTest; import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import com.google.refine.browsing.EngineConfig;
import com.google.refine.model.AbstractOperation; import com.google.refine.model.AbstractOperation;
import com.google.refine.model.Cell; import com.google.refine.model.Cell;
import com.google.refine.model.Column; import com.google.refine.model.Column;
@ -26,7 +27,7 @@ import com.google.refine.tests.util.TestUtils;
public class ReconJudgeSimilarCellsTests extends RefineTest { public class ReconJudgeSimilarCellsTests extends RefineTest {
static final JSONObject ENGINE_CONFIG = new JSONObject("{\"mode\":\"row-based\"}}"); static final EngineConfig ENGINE_CONFIG = EngineConfig.reconstruct(new JSONObject("{\"mode\":\"row-based\"}}"));
@Override @Override
@BeforeTest @BeforeTest
@ -45,7 +46,7 @@ public class ReconJudgeSimilarCellsTests extends RefineTest {
null, true); null, true);
TestUtils.isSerializedTo(op, "{\"op\":\"core/recon-judge-similar-cells\"," TestUtils.isSerializedTo(op, "{\"op\":\"core/recon-judge-similar-cells\","
+ "\"description\":\"Mark to create one single new item for all cells containing \\\"foo\\\" in column A\"," + "\"description\":\"Mark to create one single new item for all cells containing \\\"foo\\\" in column A\","
+ "\"engineConfig\":{\"mode\":\"row-based\"}," + "\"engineConfig\":{\"mode\":\"row-based\",\"facets\":[]},"
+ "\"columnName\":\"A\"," + "\"columnName\":\"A\","
+ "\"similarValue\":\"foo\"," + "\"similarValue\":\"foo\","
+ "\"judgment\":\"new\"," + "\"judgment\":\"new\","

View File

@ -21,7 +21,7 @@ public class ReconMarkNewTopicsOperationTests extends RefineTest {
public void serializeReconMarkNewTopicsOperation() throws Exception { public void serializeReconMarkNewTopicsOperation() throws Exception {
String json = "{" String json = "{"
+ "\"op\":\"core/recon-mark-new-topics\"," + "\"op\":\"core/recon-mark-new-topics\","
+ "\"engineConfig\":{\"mode\":\"row-based\"}," + "\"engineConfig\":{\"mode\":\"row-based\",\"facets\":[]},"
+ "\"columnName\":\"my column\"," + "\"columnName\":\"my column\","
+ "\"shareNewTopics\":true," + "\"shareNewTopics\":true,"
+ "\"description\":\"Mark to create new items for cells in column my column, one item for each group of similar cells\"" + "\"description\":\"Mark to create new items for cells in column my column, one item for each group of similar cells\""