diff --git a/src/main/java/com/metaweb/gridworks/commands/edit/AnnotateOneRowCommand.java b/src/main/java/com/metaweb/gridworks/commands/edit/AnnotateOneRowCommand.java index ae26ca892..27096f998 100644 --- a/src/main/java/com/metaweb/gridworks/commands/edit/AnnotateOneRowCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/edit/AnnotateOneRowCommand.java @@ -81,8 +81,9 @@ public class AnnotateOneRowCommand extends Command { this.starred = starred; } - protected HistoryEntry createHistoryEntry() throws Exception { + protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { return new HistoryEntry( + historyEntryID, _project, (starred ? "Star row " : "Unstar row ") + (rowIndex + 1), null, @@ -106,8 +107,9 @@ public class AnnotateOneRowCommand extends Command { this.flagged = flagged; } - protected HistoryEntry createHistoryEntry() throws Exception { + protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { return new HistoryEntry( + historyEntryID, _project, (flagged ? "Flag row " : "Unflag row ") + (rowIndex + 1), null, diff --git a/src/main/java/com/metaweb/gridworks/commands/edit/EditOneCellCommand.java b/src/main/java/com/metaweb/gridworks/commands/edit/EditOneCellCommand.java index bbbf6c3aa..b7adfb782 100644 --- a/src/main/java/com/metaweb/gridworks/commands/edit/EditOneCellCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/edit/EditOneCellCommand.java @@ -100,7 +100,7 @@ public class EditOneCellCommand extends Command { this.value = value; } - protected HistoryEntry createHistoryEntry() throws Exception { + protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { Cell cell = _project.rows.get(rowIndex).getCell(cellIndex); Column column = _project.columnModel.getColumnByCellIndex(cellIndex); if (column == null) { @@ -119,7 +119,7 @@ public class EditOneCellCommand extends Command { Change change = new CellChange(rowIndex, cellIndex, cell, newCell); return new HistoryEntry( - _project, description, null, change); + historyEntryID, _project, description, null, change); } } } diff --git a/src/main/java/com/metaweb/gridworks/commands/recon/ReconJudgeOneCellCommand.java b/src/main/java/com/metaweb/gridworks/commands/recon/ReconJudgeOneCellCommand.java index b1e8f8b00..70ca797dd 100644 --- a/src/main/java/com/metaweb/gridworks/commands/recon/ReconJudgeOneCellCommand.java +++ b/src/main/java/com/metaweb/gridworks/commands/recon/ReconJudgeOneCellCommand.java @@ -110,7 +110,7 @@ public class ReconJudgeOneCellCommand extends Command { this.match = match; } - protected HistoryEntry createHistoryEntry() throws Exception { + protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { Cell cell = _project.rows.get(rowIndex).getCell(cellIndex); if (cell == null || !ExpressionUtils.isNonBlankData(cell.value)) { throw new Exception("Cell is blank or error"); @@ -125,7 +125,7 @@ public class ReconJudgeOneCellCommand extends Command { newCell = new Cell( cell.value, - cell.recon == null ? new Recon() : cell.recon.dup() + cell.recon == null ? new Recon(historyEntryID) : cell.recon.dup(historyEntryID) ); String cellDescription = @@ -199,7 +199,7 @@ public class ReconJudgeOneCellCommand extends Command { ); return new HistoryEntry( - _project, description, null, change); + historyEntryID, _project, description, null, change); } } } diff --git a/src/main/java/com/metaweb/gridworks/history/HistoryEntry.java b/src/main/java/com/metaweb/gridworks/history/HistoryEntry.java index 778fea58e..b959220b9 100644 --- a/src/main/java/com/metaweb/gridworks/history/HistoryEntry.java +++ b/src/main/java/com/metaweb/gridworks/history/HistoryEntry.java @@ -40,8 +40,12 @@ public class HistoryEntry implements Jsonizable { private final static String OPERATION = "operation"; - public HistoryEntry(Project project, String description, AbstractOperation operation, Change change) { - this.id = Math.round(Math.random() * 1000000) + System.currentTimeMillis(); + static public long allocateID() { + return Math.round(Math.random() * 1000000) + System.currentTimeMillis(); + } + + public HistoryEntry(long id, Project project, String description, AbstractOperation operation, Change change) { + this.id = id; this.projectID = project.id; this.description = description; this.operation = operation; diff --git a/src/main/java/com/metaweb/gridworks/importers/ExcelImporter.java b/src/main/java/com/metaweb/gridworks/importers/ExcelImporter.java index 7465b5f4c..cbcbd4cf4 100644 --- a/src/main/java/com/metaweb/gridworks/importers/ExcelImporter.java +++ b/src/main/java/com/metaweb/gridworks/importers/ExcelImporter.java @@ -212,7 +212,7 @@ public class ExcelImporter implements Importer { recon = reconMap.get(id); recon.judgmentBatchSize++; } else { - recon = new Recon(); + recon = new Recon(0); recon.service = "import"; recon.match = new ReconCandidate(id, "", value.toString(), new String[0], 100); recon.matchRank = 0; diff --git a/src/main/java/com/metaweb/gridworks/model/AbstractOperation.java b/src/main/java/com/metaweb/gridworks/model/AbstractOperation.java index d420c3265..a4cca1bb3 100644 --- a/src/main/java/com/metaweb/gridworks/model/AbstractOperation.java +++ b/src/main/java/com/metaweb/gridworks/model/AbstractOperation.java @@ -17,13 +17,13 @@ abstract public class AbstractOperation implements Jsonizable { public Process createProcess(Project project, Properties options) throws Exception { return new QuickHistoryEntryProcess(project, getBriefDescription(null)) { @Override - protected HistoryEntry createHistoryEntry() throws Exception { - return AbstractOperation.this.createHistoryEntry(_project); + protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception { + return AbstractOperation.this.createHistoryEntry(_project, historyEntryID); } }; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { throw new NotImplementedException(); } diff --git a/src/main/java/com/metaweb/gridworks/model/Recon.java b/src/main/java/com/metaweb/gridworks/model/Recon.java index 3f11251fa..595fff77f 100644 --- a/src/main/java/com/metaweb/gridworks/model/Recon.java +++ b/src/main/java/com/metaweb/gridworks/model/Recon.java @@ -65,22 +65,24 @@ public class Recon implements HasFields, Jsonizable { public Judgment judgment = Judgment.None; public String judgmentAction = "unknown"; - public long judgmentHistoryEntry = -1; + public long judgmentHistoryEntry; public int judgmentBatchSize = 0; public ReconCandidate match = null; public int matchRank = -1; - public Recon() { + public Recon(long judgmentHistoryEntry) { id = System.currentTimeMillis() * 1000000 + Math.round(Math.random() * 1000000); + this.judgmentHistoryEntry = judgmentHistoryEntry; } - protected Recon(long id) { + protected Recon(long id, long judgmentHistoryEntry) { this.id = id; + this.judgmentHistoryEntry = judgmentHistoryEntry; } - public Recon dup() { - Recon r = new Recon(); + public Recon dup(long judgmentHistoryEntry) { + Recon r = new Recon(judgmentHistoryEntry); System.arraycopy(features, 0, r.features, 0, features.length); @@ -93,7 +95,6 @@ public class Recon implements HasFields, Jsonizable { r.judgment = judgment; r.judgmentAction = judgmentAction; - r.judgmentHistoryEntry = judgmentHistoryEntry; r.judgmentBatchSize = judgmentBatchSize; r.match = match; @@ -146,6 +147,8 @@ public class Recon implements HasFields, Jsonizable { return judgmentToString(); } else if ("judgmentAction".equals(name) || "judgementAction".equals(name)) { return judgmentAction; + } else if ("judgmentHistoryEntry".equals(name) || "judgementHistoryEntry".equals(name)) { + return judgmentHistoryEntry; } else if ("judgmentBatchSize".equals(name) || "judgementBatchSize".equals(name)) { return judgmentBatchSize; } else if ("matched".equals(name)) { @@ -188,8 +191,11 @@ public class Recon implements HasFields, Jsonizable { writer.object(); writer.key("id"); writer.value(id); - writer.key("j"); writer.value(judgmentToString()); + if (saveMode) { + writer.key("judgmentHistoryEntry"); writer.value(judgmentHistoryEntry); + } + writer.key("j"); writer.value(judgmentToString()); if (match != null) { writer.key("m"); writer.value(match.topicID); @@ -214,7 +220,6 @@ public class Recon implements HasFields, Jsonizable { writer.key("service"); writer.value(service); writer.key("judgmentAction"); writer.value(judgmentAction); - writer.key("judgmentHistoryEntry"); writer.value(judgmentHistoryEntry); writer.key("judgmentBatchSize"); writer.value(judgmentBatchSize); if (match != null) { @@ -242,72 +247,79 @@ public class Recon implements HasFields, Jsonizable { } Recon recon = null; + long id = -1; + long judgmentHistoryEntry = -1; while (jp.nextToken() != JsonToken.END_OBJECT) { String fieldName = jp.getCurrentName(); jp.nextToken(); if ("id".equals(fieldName)) { - long id = jp.getLongValue(); - recon = new Recon(id); - } else if ("j".equals(fieldName)) { - recon.judgment = stringToJudgment(jp.getText()); - } else if ("m".equals(fieldName)) { - if (jp.getCurrentToken() == JsonToken.VALUE_STRING) { - String candidateID = jp.getText(); - - recon.match = pool.getReconCandidate(candidateID); - } else { - // legacy - recon.match = ReconCandidate.loadStreaming(jp); - } - } else if ("f".equals(fieldName)) { - if (jp.getCurrentToken() != JsonToken.START_ARRAY) { - return null; + id = jp.getLongValue(); + } else if ("judgmentHistoryEntry".equals(fieldName)) { + judgmentHistoryEntry = jp.getLongValue(); + } else { + if (recon == null) { + recon = new Recon(id, judgmentHistoryEntry); } - int feature = 0; - while (jp.nextToken() != JsonToken.END_ARRAY) { - if (feature < recon.features.length) { - JsonToken token = jp.getCurrentToken(); - if (token == JsonToken.VALUE_STRING) { - recon.features[feature++] = jp.getText(); - } else if (token == JsonToken.VALUE_NUMBER_INT) { - recon.features[feature++] = jp.getLongValue(); - } else if (token == JsonToken.VALUE_NUMBER_FLOAT) { - recon.features[feature++] = jp.getDoubleValue(); - } else if (token == JsonToken.VALUE_FALSE) { - recon.features[feature++] = false; - } else if (token == JsonToken.VALUE_TRUE) { - recon.features[feature++] = true; - } - } - } - } else if ("c".equals(fieldName)) { - if (jp.getCurrentToken() != JsonToken.START_ARRAY) { - return null; - } - - while (jp.nextToken() != JsonToken.END_ARRAY) { + if ("j".equals(fieldName)) { + recon.judgment = stringToJudgment(jp.getText()); + } else if ("m".equals(fieldName)) { if (jp.getCurrentToken() == JsonToken.VALUE_STRING) { String candidateID = jp.getText(); - - recon.addCandidate(pool.getReconCandidate(candidateID)); + + recon.match = pool.getReconCandidate(candidateID); } else { // legacy - recon.addCandidate(ReconCandidate.loadStreaming(jp)); + recon.match = ReconCandidate.loadStreaming(jp); } + } else if ("f".equals(fieldName)) { + if (jp.getCurrentToken() != JsonToken.START_ARRAY) { + return null; + } + + int feature = 0; + while (jp.nextToken() != JsonToken.END_ARRAY) { + if (feature < recon.features.length) { + JsonToken token = jp.getCurrentToken(); + if (token == JsonToken.VALUE_STRING) { + recon.features[feature++] = jp.getText(); + } else if (token == JsonToken.VALUE_NUMBER_INT) { + recon.features[feature++] = jp.getLongValue(); + } else if (token == JsonToken.VALUE_NUMBER_FLOAT) { + recon.features[feature++] = jp.getDoubleValue(); + } else if (token == JsonToken.VALUE_FALSE) { + recon.features[feature++] = false; + } else if (token == JsonToken.VALUE_TRUE) { + recon.features[feature++] = true; + } + } + } + } else if ("c".equals(fieldName)) { + if (jp.getCurrentToken() != JsonToken.START_ARRAY) { + return null; + } + + while (jp.nextToken() != JsonToken.END_ARRAY) { + if (jp.getCurrentToken() == JsonToken.VALUE_STRING) { + String candidateID = jp.getText(); + + recon.addCandidate(pool.getReconCandidate(candidateID)); + } else { + // legacy + recon.addCandidate(ReconCandidate.loadStreaming(jp)); + } + } + } else if ("service".equals(fieldName)) { + recon.service = jp.getText(); + } else if ("judgmentAction".equals(fieldName)) { + recon.judgmentAction = jp.getText(); + } else if ("judgmentBatchSize".equals(fieldName)) { + recon.judgmentBatchSize = jp.getIntValue(); + } else if ("matchRank".equals(fieldName)) { + recon.matchRank = jp.getIntValue(); } - } else if ("service".equals(fieldName)) { - recon.service = jp.getText(); - } else if ("judgmentAction".equals(fieldName)) { - recon.judgmentAction = jp.getText(); - } else if ("judgmentHistoryEntry".equals(fieldName)) { - recon.judgmentHistoryEntry = jp.getLongValue(); - } else if ("judgmentBatchSize".equals(fieldName)) { - recon.judgmentBatchSize = jp.getIntValue(); - } else if ("matchRank".equals(fieldName)) { - recon.matchRank = jp.getIntValue(); } } diff --git a/src/main/java/com/metaweb/gridworks/model/changes/DataExtensionChange.java b/src/main/java/com/metaweb/gridworks/model/changes/DataExtensionChange.java index 86faecc45..184651710 100644 --- a/src/main/java/com/metaweb/gridworks/model/changes/DataExtensionChange.java +++ b/src/main/java/com/metaweb/gridworks/model/changes/DataExtensionChange.java @@ -37,6 +37,7 @@ public class DataExtensionChange implements Change { final protected List _rowIndices; final protected List _dataExtensions; + protected long _historyEntryID; protected int _firstNewCellIndex = -1; protected List _oldRows; protected List _newRows; @@ -47,7 +48,8 @@ public class DataExtensionChange implements Change { List columnNames, List columnTypes, List rowIndices, - List dataExtensions + List dataExtensions, + long historyEntryID ) { _baseColumnName = baseColumnName; _columnInsertIndex = columnInsertIndex; @@ -57,6 +59,8 @@ public class DataExtensionChange implements Change { _rowIndices = rowIndices; _dataExtensions = dataExtensions; + + _historyEntryID = historyEntryID; } protected DataExtensionChange( @@ -179,7 +183,7 @@ public class DataExtensionChange implements Change { if (value instanceof ReconCandidate) { ReconCandidate rc = (ReconCandidate) value; - Recon recon = new Recon(); + Recon recon = new Recon(_historyEntryID); recon.addCandidate(rc); recon.service = "mql"; recon.match = rc; diff --git a/src/main/java/com/metaweb/gridworks/model/recon/DataExtensionReconConfig.java b/src/main/java/com/metaweb/gridworks/model/recon/DataExtensionReconConfig.java index f85048cd1..c0315fa3b 100644 --- a/src/main/java/com/metaweb/gridworks/model/recon/DataExtensionReconConfig.java +++ b/src/main/java/com/metaweb/gridworks/model/recon/DataExtensionReconConfig.java @@ -52,7 +52,7 @@ public class DataExtensionReconConfig extends StrictReconConfig { } @Override - public List batchRecon(List jobs) { + public List batchRecon(List jobs, long historyEntryID) { throw new RuntimeException(WARN); } diff --git a/src/main/java/com/metaweb/gridworks/model/recon/GuidBasedReconConfig.java b/src/main/java/com/metaweb/gridworks/model/recon/GuidBasedReconConfig.java index 3ae7f74c1..86e729cab 100644 --- a/src/main/java/com/metaweb/gridworks/model/recon/GuidBasedReconConfig.java +++ b/src/main/java/com/metaweb/gridworks/model/recon/GuidBasedReconConfig.java @@ -77,7 +77,7 @@ public class GuidBasedReconConfig extends StrictReconConfig { } @Override - public List batchRecon(List jobs) { + public List batchRecon(List jobs, long historyEntryID) { List recons = new ArrayList(jobs.size()); Map guidToRecon = new HashMap(); @@ -147,7 +147,7 @@ public class GuidBasedReconConfig extends StrictReconConfig { 100 ); - Recon recon = new Recon(); + Recon recon = new Recon(historyEntryID); recon.addCandidate(candidate); recon.service = "mql"; recon.judgment = Judgment.Matched; diff --git a/src/main/java/com/metaweb/gridworks/model/recon/HeuristicReconConfig.java b/src/main/java/com/metaweb/gridworks/model/recon/HeuristicReconConfig.java index d69be5f7e..ccf9b48f9 100644 --- a/src/main/java/com/metaweb/gridworks/model/recon/HeuristicReconConfig.java +++ b/src/main/java/com/metaweb/gridworks/model/recon/HeuristicReconConfig.java @@ -190,15 +190,15 @@ public class HeuristicReconConfig extends ReconConfig { } @Override - public List batchRecon(List jobs) { + public List batchRecon(List jobs, long historyEntryID) { if ("relevance".equals(service)) { - return batchReconUsingRelevance(jobs); + return batchReconUsingRelevance(jobs, historyEntryID); } else { - return batchReconUsingReconService(jobs); + return batchReconUsingReconService(jobs, historyEntryID); } } - protected List batchReconUsingRelevance(List jobs) { + protected List batchReconUsingRelevance(List jobs, long historyEntryID) { List recons = new ArrayList(jobs.size()); try { @@ -251,9 +251,9 @@ public class HeuristicReconConfig extends ReconConfig { if (o2.has("result")) { JSONArray results = o2.getJSONArray("result"); - recon = createReconFromRelevanceResults(text, results); + recon = createReconFromRelevanceResults(text, results, historyEntryID); } else { - recon = new Recon(); + recon = new Recon(historyEntryID); } recon.service = "recon"; @@ -269,8 +269,8 @@ public class HeuristicReconConfig extends ReconConfig { return recons; } - protected Recon createReconFromRelevanceResults(String text, JSONArray results) { - Recon recon = new Recon(); + protected Recon createReconFromRelevanceResults(String text, JSONArray results, long historyEntryID) { + Recon recon = new Recon(historyEntryID); try { int length = results.length(); int count = 0; @@ -332,7 +332,7 @@ public class HeuristicReconConfig extends ReconConfig { static final String s_reconService = "http://data.labs.freebase.com/recon/query"; - protected List batchReconUsingReconService(List jobs) { + protected List batchReconUsingReconService(List jobs, long historyEntryID) { List recons = new ArrayList(jobs.size()); for (int i = 0; i < jobs.size(); i++) { @@ -353,7 +353,7 @@ public class HeuristicReconConfig extends ReconConfig { String s = ParsingUtilities.inputStreamToString(is); JSONArray a = ParsingUtilities.evaluateJsonStringToArray(s); - recon = createReconFromReconResults(job.text, a); + recon = createReconFromReconResults(job.text, a, historyEntryID); } finally { is.close(); } @@ -362,7 +362,7 @@ public class HeuristicReconConfig extends ReconConfig { } if (recon == null) { - recon = new Recon(); + recon = new Recon(historyEntryID); } recon.service = "recon"; recons.add(recon); @@ -371,8 +371,8 @@ public class HeuristicReconConfig extends ReconConfig { return recons; } - protected Recon createReconFromReconResults(String text, JSONArray results) { - Recon recon = new Recon(); + protected Recon createReconFromReconResults(String text, JSONArray results, long historyEntryID) { + Recon recon = new Recon(historyEntryID); try { int length = results.length(); int count = 0; diff --git a/src/main/java/com/metaweb/gridworks/model/recon/IdBasedReconConfig.java b/src/main/java/com/metaweb/gridworks/model/recon/IdBasedReconConfig.java index d40bf56bf..a42c9c26c 100644 --- a/src/main/java/com/metaweb/gridworks/model/recon/IdBasedReconConfig.java +++ b/src/main/java/com/metaweb/gridworks/model/recon/IdBasedReconConfig.java @@ -81,7 +81,7 @@ public class IdBasedReconConfig extends StrictReconConfig { } @Override - public List batchRecon(List jobs) { + public List batchRecon(List jobs, long historyEntryID) { List recons = new ArrayList(jobs.size()); Map idToRecon = new HashMap(); @@ -151,7 +151,7 @@ public class IdBasedReconConfig extends StrictReconConfig { 100 ); - Recon recon = new Recon(); + Recon recon = new Recon(historyEntryID); recon.addCandidate(candidate); recon.service = "mql"; recon.judgment = Judgment.Matched; diff --git a/src/main/java/com/metaweb/gridworks/model/recon/KeyBasedReconConfig.java b/src/main/java/com/metaweb/gridworks/model/recon/KeyBasedReconConfig.java index a4bd3084c..4de94a1e4 100644 --- a/src/main/java/com/metaweb/gridworks/model/recon/KeyBasedReconConfig.java +++ b/src/main/java/com/metaweb/gridworks/model/recon/KeyBasedReconConfig.java @@ -82,7 +82,7 @@ public class KeyBasedReconConfig extends StrictReconConfig { } @Override - public List batchRecon(List jobs) { + public List batchRecon(List jobs, long historyEntryID) { List recons = new ArrayList(jobs.size()); Map keyToRecon = new HashMap(); @@ -165,7 +165,7 @@ public class KeyBasedReconConfig extends StrictReconConfig { 100 ); - Recon recon = new Recon(); + Recon recon = new Recon(historyEntryID); recon.addCandidate(candidate); recon.service = "mql"; recon.judgment = Judgment.Matched; diff --git a/src/main/java/com/metaweb/gridworks/model/recon/ReconConfig.java b/src/main/java/com/metaweb/gridworks/model/recon/ReconConfig.java index d562d826d..a66cb2cb0 100644 --- a/src/main/java/com/metaweb/gridworks/model/recon/ReconConfig.java +++ b/src/main/java/com/metaweb/gridworks/model/recon/ReconConfig.java @@ -39,7 +39,7 @@ abstract public class ReconConfig implements Jsonizable { Cell cell ); - abstract public List batchRecon(List jobs); + abstract public List batchRecon(List jobs, long historyEntryID); public void save(Writer writer) { JSONWriter jsonWriter = new JSONWriter(writer); diff --git a/src/main/java/com/metaweb/gridworks/operations/ColumnAdditionOperation.java b/src/main/java/com/metaweb/gridworks/operations/ColumnAdditionOperation.java index 20de421ac..d5bf9d292 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ColumnAdditionOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ColumnAdditionOperation.java @@ -93,7 +93,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation { " rows with " + _expression; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); Column column = project.columnModel.getColumnByName(_baseColumnName); @@ -111,7 +111,7 @@ public class ColumnAdditionOperation extends EngineDependentOperation { Change change = new ColumnAdditionChange(_newColumnName, _columnInsertIndex, cellsAtRows); return new HistoryEntry( - project, description, this, change); + historyEntryID, project, description, this, change); } protected RowVisitor createRowVisitor(Project project, List cellsAtRows) throws Exception { diff --git a/src/main/java/com/metaweb/gridworks/operations/ColumnRemovalOperation.java b/src/main/java/com/metaweb/gridworks/operations/ColumnRemovalOperation.java index 012fa473a..971106160 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ColumnRemovalOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ColumnRemovalOperation.java @@ -43,7 +43,7 @@ public class ColumnRemovalOperation extends AbstractOperation { return "Remove column " + _columnName; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); if (column == null) { throw new Exception("No column named " + _columnName); @@ -53,6 +53,6 @@ public class ColumnRemovalOperation extends AbstractOperation { Change change = new ColumnRemovalChange(project.columnModel.columns.indexOf(column)); - return new HistoryEntry(project, description, ColumnRemovalOperation.this, change); + return new HistoryEntry(historyEntryID, project, description, ColumnRemovalOperation.this, change); } } diff --git a/src/main/java/com/metaweb/gridworks/operations/ColumnRenameOperation.java b/src/main/java/com/metaweb/gridworks/operations/ColumnRenameOperation.java index eafc531cb..522e8dd9c 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ColumnRenameOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ColumnRenameOperation.java @@ -47,7 +47,7 @@ public class ColumnRenameOperation extends AbstractOperation { return "Rename column " + _oldColumnName + " to " + _newColumnName; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { if (project.columnModel.getColumnByName(_oldColumnName) == null) { throw new Exception("No column named " + _oldColumnName); } @@ -57,6 +57,6 @@ public class ColumnRenameOperation extends AbstractOperation { Change change = new ColumnRenameChange(_oldColumnName, _newColumnName); - return new HistoryEntry(project, getBriefDescription(null), ColumnRenameOperation.this, change); + return new HistoryEntry(historyEntryID, project, getBriefDescription(null), ColumnRenameOperation.this, change); } } diff --git a/src/main/java/com/metaweb/gridworks/operations/ColumnSplitOperation.java b/src/main/java/com/metaweb/gridworks/operations/ColumnSplitOperation.java index 7e8776646..365057875 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ColumnSplitOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ColumnSplitOperation.java @@ -138,7 +138,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { ("separator".equals(_mode) ? " by separator" : " by field lengths"); } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); Column column = project.columnModel.getColumnByName(_columnName); @@ -212,7 +212,7 @@ public class ColumnSplitOperation extends EngineDependentOperation { ); return new HistoryEntry( - project, description, this, change); + historyEntryID, project, description, this, change); } protected class ColumnSplitRowVisitor implements RowVisitor { diff --git a/src/main/java/com/metaweb/gridworks/operations/EngineDependentMassCellOperation.java b/src/main/java/com/metaweb/gridworks/operations/EngineDependentMassCellOperation.java index b94291b36..a1ea76cd5 100644 --- a/src/main/java/com/metaweb/gridworks/operations/EngineDependentMassCellOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/EngineDependentMassCellOperation.java @@ -26,7 +26,7 @@ abstract public class EngineDependentMassCellOperation extends EngineDependentOp _updateRowContextDependencies = updateRowContextDependencies; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); Column column = project.columnModel.getColumnByName(_columnName); @@ -38,7 +38,7 @@ abstract public class EngineDependentMassCellOperation extends EngineDependentOp FilteredRows filteredRows = engine.getAllFilteredRows(false); try { - filteredRows.accept(project, createRowVisitor(project, cellChanges)); + filteredRows.accept(project, createRowVisitor(project, cellChanges, historyEntryID)); } catch (Exception e) { e.printStackTrace(); } @@ -46,7 +46,7 @@ abstract public class EngineDependentMassCellOperation extends EngineDependentOp String description = createDescription(column, cellChanges); return new HistoryEntry( - project, description, this, createChange(project, column, cellChanges)); + historyEntryID, project, description, this, createChange(project, column, cellChanges)); } protected Change createChange(Project project, Column column, List cellChanges) { @@ -54,6 +54,6 @@ abstract public class EngineDependentMassCellOperation extends EngineDependentOp cellChanges, column.getName(), _updateRowContextDependencies); } - abstract protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception; + abstract protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception; abstract protected String createDescription(Column column, List cellChanges); } diff --git a/src/main/java/com/metaweb/gridworks/operations/ExtendDataOperation.java b/src/main/java/com/metaweb/gridworks/operations/ExtendDataOperation.java index 0592ea0d2..5e615f353 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ExtendDataOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ExtendDataOperation.java @@ -95,6 +95,7 @@ public class ExtendDataOperation extends EngineDependentOperation { public class ExtendDataProcess extends LongRunningProcess implements Runnable { final protected Project _project; final protected JSONObject _engineConfig; + final protected long _historyEntryID; protected int _cellIndex; protected FreebaseDataExtensionJob _job; @@ -106,6 +107,7 @@ public class ExtendDataOperation extends EngineDependentOperation { super(description); _project = project; _engineConfig = engineConfig; + _historyEntryID = HistoryEntry.allocateID(); _job = new FreebaseDataExtensionJob(_extension); } @@ -230,6 +232,7 @@ public class ExtendDataOperation extends EngineDependentOperation { } HistoryEntry historyEntry = new HistoryEntry( + _historyEntryID, _project, _description, ExtendDataOperation.this, @@ -239,7 +242,8 @@ public class ExtendDataOperation extends EngineDependentOperation { columnNames, columnTypes, rowIndices, - dataExtensions) + dataExtensions, + _historyEntryID) ); _project.history.addEntry(historyEntry); diff --git a/src/main/java/com/metaweb/gridworks/operations/MassEditOperation.java b/src/main/java/com/metaweb/gridworks/operations/MassEditOperation.java index 668a2f83b..901cf4f5d 100644 --- a/src/main/java/com/metaweb/gridworks/operations/MassEditOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/MassEditOperation.java @@ -129,7 +129,7 @@ public class MassEditOperation extends EngineDependentMassCellOperation { " cells in column " + column.getName(); } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); Evaluable eval = MetaParser.parse(_expression); diff --git a/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellJoinOperation.java b/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellJoinOperation.java index febf641ce..0ee7e6c31 100644 --- a/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellJoinOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellJoinOperation.java @@ -56,7 +56,7 @@ public class MultiValuedCellJoinOperation extends AbstractOperation { return "Join multi-valued cells in column " + _columnName; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); if (column == null) { throw new Exception("No column named " + _columnName); @@ -118,6 +118,7 @@ public class MultiValuedCellJoinOperation extends AbstractOperation { } return new HistoryEntry( + historyEntryID, project, getBriefDescription(null), this, diff --git a/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellSplitOperation.java b/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellSplitOperation.java index d98234b6e..bfc695938 100644 --- a/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellSplitOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/MultiValuedCellSplitOperation.java @@ -62,7 +62,7 @@ public class MultiValuedCellSplitOperation extends AbstractOperation { } @Override - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); if (column == null) { throw new Exception("No column named " + _columnName); @@ -136,6 +136,7 @@ public class MultiValuedCellSplitOperation extends AbstractOperation { } return new HistoryEntry( + historyEntryID, project, getBriefDescription(null), this, diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconDiscardJudgmentsOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconDiscardJudgmentsOperation.java index 974d8468f..82d4ff60d 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconDiscardJudgmentsOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconDiscardJudgmentsOperation.java @@ -58,17 +58,19 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera " cells in column " + column.getName(); } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); return new RowVisitor() { int cellIndex; List cellChanges; Map dupReconMap = new HashMap(); + long historyEntryID; - public RowVisitor init(int cellIndex, List cellChanges) { + public RowVisitor init(int cellIndex, List cellChanges, long historyEntryID) { this.cellIndex = cellIndex; this.cellChanges = cellChanges; + this.historyEntryID = historyEntryID; return this; } @@ -80,7 +82,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera newRecon = dupReconMap.get(cell.recon.id); newRecon.judgmentBatchSize++; } else { - newRecon = cell.recon.dup(); + newRecon = cell.recon.dup(historyEntryID); newRecon.match = null; newRecon.matchRank = -1; newRecon.judgment = Judgment.None; @@ -97,7 +99,7 @@ public class ReconDiscardJudgmentsOperation extends EngineDependentMassCellOpera } return false; } - }.init(column.getCellIndex(), cellChanges); + }.init(column.getCellIndex(), cellChanges, historyEntryID); } protected Change createChange(Project project, Column column, List cellChanges) { diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java index 66e94f43e..f819b0dda 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconJudgeSimilarCellsOperation.java @@ -145,7 +145,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper throw new InternalError("Can't get here"); } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); return new RowVisitor() { @@ -153,10 +153,12 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper List _cellChanges; Recon _sharedNewRecon = null; Map _dupReconMap = new HashMap(); + long _historyEntryID; - public RowVisitor init(int cellIndex, List cellChanges) { + public RowVisitor init(int cellIndex, List cellChanges, long historyEntryID) { _cellIndex = cellIndex; _cellChanges = cellChanges; + _historyEntryID = historyEntryID; return this; } @@ -169,7 +171,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper Recon recon = null; if (_judgment == Judgment.New && _shareNewTopics) { if (_sharedNewRecon == null) { - _sharedNewRecon = new Recon(); + _sharedNewRecon = new Recon(_historyEntryID); _sharedNewRecon.judgment = Judgment.New; _sharedNewRecon.judgmentBatchSize = 0; _sharedNewRecon.judgmentAction = "similar"; @@ -182,7 +184,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper recon = _dupReconMap.get(cell.recon.id); recon.judgmentBatchSize++; } else { - recon = cell.recon.dup(); + recon = cell.recon.dup(_historyEntryID); recon.judgmentBatchSize = 1; recon.matchRank = -1; recon.judgmentAction = "similar"; @@ -218,7 +220,7 @@ public class ReconJudgeSimilarCellsOperation extends EngineDependentMassCellOper } return false; } - }.init(column.getCellIndex(), cellChanges); + }.init(column.getCellIndex(), cellChanges, historyEntryID); } diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconMarkNewTopicsOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconMarkNewTopicsOperation.java index cd73db324..a5589240c 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconMarkNewTopicsOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconMarkNewTopicsOperation.java @@ -68,7 +68,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio ", one topic for each cell"); } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); return new RowVisitor() { @@ -76,10 +76,12 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio List cellChanges; Map sharedRecons = new HashMap(); Map dupReconMap = new HashMap(); + long historyEntryID; - public RowVisitor init(int cellIndex, List cellChanges) { + public RowVisitor init(int cellIndex, List cellChanges, long historyEntryID) { this.cellIndex = cellIndex; this.cellChanges = cellChanges; + this.historyEntryID = historyEntryID; return this; } @@ -93,7 +95,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio recon = sharedRecons.get(s); recon.judgmentBatchSize++; } else { - recon = new Recon(); + recon = new Recon(historyEntryID); recon.judgment = Judgment.New; recon.judgmentBatchSize = 1; recon.judgmentAction = "mass"; @@ -106,7 +108,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio recon = dupReconMap.get(reconID); recon.judgmentBatchSize++; } else { - recon = cell.recon == null ? new Recon() : cell.recon.dup(); + recon = cell.recon == null ? new Recon(historyEntryID) : cell.recon.dup(historyEntryID); recon.match = null; recon.matchRank = -1; recon.judgment = Judgment.New; @@ -124,7 +126,7 @@ public class ReconMarkNewTopicsOperation extends EngineDependentMassCellOperatio } return false; } - }.init(column.getCellIndex(), cellChanges); + }.init(column.getCellIndex(), cellChanges, historyEntryID); } protected Change createChange(Project project, Column column, List cellChanges) { diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconMatchBestCandidatesOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconMatchBestCandidatesOperation.java index c70d97fa3..2a22f5cb9 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconMatchBestCandidatesOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconMatchBestCandidatesOperation.java @@ -59,17 +59,19 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp " cells to its best candidate in column " + column.getName(); } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); return new RowVisitor() { int cellIndex; List cellChanges; Map dupReconMap = new HashMap(); + long historyEntryID; - public RowVisitor init(int cellIndex, List cellChanges) { + public RowVisitor init(int cellIndex, List cellChanges, long historyEntryID) { this.cellIndex = cellIndex; this.cellChanges = cellChanges; + this.historyEntryID = historyEntryID; return this; } @@ -84,7 +86,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp newRecon = dupReconMap.get(cell.recon.id); newRecon.judgmentBatchSize++; } else { - newRecon = cell.recon.dup(); + newRecon = cell.recon.dup(historyEntryID); newRecon.judgmentBatchSize = 1; newRecon.match = candidate; newRecon.matchRank = 0; @@ -105,7 +107,7 @@ public class ReconMatchBestCandidatesOperation extends EngineDependentMassCellOp } return false; } - }.init(column.getCellIndex(), cellChanges); + }.init(column.getCellIndex(), cellChanges, historyEntryID); } protected Change createChange(Project project, Column column, List cellChanges) { diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconMatchSpecificTopicOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconMatchSpecificTopicOperation.java index dc6f81ff6..2ec4c7028 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconMatchSpecificTopicOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconMatchSpecificTopicOperation.java @@ -92,17 +92,19 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe " cells in column " + column.getName(); } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); return new RowVisitor() { int cellIndex; List cellChanges; Map dupReconMap = new HashMap(); + long historyEntryID; - public RowVisitor init(int cellIndex, List cellChanges) { + public RowVisitor init(int cellIndex, List cellChanges, long historyEntryID) { this.cellIndex = cellIndex; this.cellChanges = cellChanges; + this.historyEntryID = historyEntryID; return this; } @@ -116,7 +118,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe newRecon = dupReconMap.get(reconID); newRecon.judgmentBatchSize++; } else { - newRecon = cell.recon != null ? cell.recon.dup() : new Recon(); + newRecon = cell.recon != null ? cell.recon.dup(historyEntryID) : new Recon(historyEntryID); newRecon.match = match; newRecon.matchRank = -1; newRecon.judgment = Judgment.Matched; @@ -136,7 +138,7 @@ public class ReconMatchSpecificTopicOperation extends EngineDependentMassCellOpe } return false; } - }.init(column.getCellIndex(), cellChanges); + }.init(column.getCellIndex(), cellChanges, historyEntryID); } protected Change createChange(Project project, Column column, List cellChanges) { diff --git a/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java b/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java index fb46bb2f9..eca322405 100644 --- a/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/ReconOperation.java @@ -99,6 +99,7 @@ public class ReconOperation extends EngineDependentOperation { public class ReconProcess extends LongRunningProcess implements Runnable { final protected Project _project; final protected JSONObject _engineConfig; + final protected long _historyEntryID; protected List _entries; protected int _cellIndex; @@ -110,6 +111,7 @@ public class ReconOperation extends EngineDependentOperation { super(description); _project = project; _engineConfig = engineConfig; + _historyEntryID = HistoryEntry.allocateID(); } public void write(JSONWriter writer, Properties options) @@ -226,7 +228,7 @@ public class ReconOperation extends EngineDependentOperation { jobs.add(groups.get(j).job); } - List recons = _reconConfig.batchRecon(jobs); + List recons = _reconConfig.batchRecon(jobs, _historyEntryID); for (int j = i; j < to; j++) { Recon recon = recons.get(j - i); List entries = groups.get(j).entries; @@ -268,6 +270,7 @@ public class ReconOperation extends EngineDependentOperation { ); HistoryEntry historyEntry = new HistoryEntry( + _historyEntryID, _project, _description, ReconOperation.this, diff --git a/src/main/java/com/metaweb/gridworks/operations/RowFlagOperation.java b/src/main/java/com/metaweb/gridworks/operations/RowFlagOperation.java index c9c425d7b..aa7a5af3b 100644 --- a/src/main/java/com/metaweb/gridworks/operations/RowFlagOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/RowFlagOperation.java @@ -52,7 +52,7 @@ public class RowFlagOperation extends EngineDependentOperation { return (_flagged ? "Flag rows" : "Unflag rows"); } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); List changes = new ArrayList(project.rows.size()); @@ -61,6 +61,7 @@ public class RowFlagOperation extends EngineDependentOperation { filteredRows.accept(project, createRowVisitor(project, changes)); return new HistoryEntry( + historyEntryID, project, (_flagged ? "Flag" : "Unflag") + " " + changes.size() + " rows", this, diff --git a/src/main/java/com/metaweb/gridworks/operations/RowRemovalOperation.java b/src/main/java/com/metaweb/gridworks/operations/RowRemovalOperation.java index 0d17a2640..f750d11ce 100644 --- a/src/main/java/com/metaweb/gridworks/operations/RowRemovalOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/RowRemovalOperation.java @@ -44,7 +44,7 @@ public class RowRemovalOperation extends EngineDependentOperation { return "Remove rows"; } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); List rowIndices = new ArrayList(); @@ -53,6 +53,7 @@ public class RowRemovalOperation extends EngineDependentOperation { filteredRows.accept(project, createRowVisitor(project, rowIndices)); return new HistoryEntry( + historyEntryID, project, "Remove " + rowIndices.size() + " rows", this, diff --git a/src/main/java/com/metaweb/gridworks/operations/RowStarOperation.java b/src/main/java/com/metaweb/gridworks/operations/RowStarOperation.java index f122ed00d..74439b722 100644 --- a/src/main/java/com/metaweb/gridworks/operations/RowStarOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/RowStarOperation.java @@ -52,7 +52,7 @@ public class RowStarOperation extends EngineDependentOperation { return (_starred ? "Star rows" : "Unstar rows"); } - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { Engine engine = createEngine(project); List changes = new ArrayList(project.rows.size()); @@ -61,6 +61,7 @@ public class RowStarOperation extends EngineDependentOperation { filteredRows.accept(project, createRowVisitor(project, changes)); return new HistoryEntry( + historyEntryID, project, (_starred ? "Star" : "Unstar") + " " + changes.size() + " rows", this, diff --git a/src/main/java/com/metaweb/gridworks/operations/SaveProtographOperation.java b/src/main/java/com/metaweb/gridworks/operations/SaveProtographOperation.java index 88ee7262e..e43a75283 100644 --- a/src/main/java/com/metaweb/gridworks/operations/SaveProtographOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/SaveProtographOperation.java @@ -45,12 +45,12 @@ public class SaveProtographOperation extends AbstractOperation { } @Override - protected HistoryEntry createHistoryEntry(Project project) throws Exception { + protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception { String description = "Save schema-alignment protograph"; Change change = new ProtographChange(_protograph); - return new HistoryEntry(project, description, SaveProtographOperation.this, change); + return new HistoryEntry(historyEntryID, project, description, SaveProtographOperation.this, change); } static public class ProtographChange implements Change { diff --git a/src/main/java/com/metaweb/gridworks/operations/TextTransformOperation.java b/src/main/java/com/metaweb/gridworks/operations/TextTransformOperation.java index 476f2c46a..56c9fe122 100644 --- a/src/main/java/com/metaweb/gridworks/operations/TextTransformOperation.java +++ b/src/main/java/com/metaweb/gridworks/operations/TextTransformOperation.java @@ -98,7 +98,7 @@ public class TextTransformOperation extends EngineDependentMassCellOperation { " cells in column " + column.getName() + ": " + _expression; } - protected RowVisitor createRowVisitor(Project project, List cellChanges) throws Exception { + protected RowVisitor createRowVisitor(Project project, List cellChanges, long historyEntryID) throws Exception { Column column = project.columnModel.getColumnByName(_columnName); Evaluable eval = MetaParser.parse(_expression); diff --git a/src/main/java/com/metaweb/gridworks/process/QuickHistoryEntryProcess.java b/src/main/java/com/metaweb/gridworks/process/QuickHistoryEntryProcess.java index 7070af170..47cc65a45 100644 --- a/src/main/java/com/metaweb/gridworks/process/QuickHistoryEntryProcess.java +++ b/src/main/java/com/metaweb/gridworks/process/QuickHistoryEntryProcess.java @@ -33,7 +33,7 @@ abstract public class QuickHistoryEntryProcess extends Process { public HistoryEntry performImmediate() throws Exception { if (_historyEntry == null) { - _historyEntry = createHistoryEntry(); + _historyEntry = createHistoryEntry(HistoryEntry.allocateID()); } _project.history.addEntry(_historyEntry); _done = true; @@ -62,5 +62,5 @@ abstract public class QuickHistoryEntryProcess extends Process { return _done; } - abstract protected HistoryEntry createHistoryEntry() throws Exception; + abstract protected HistoryEntry createHistoryEntry(long historyEntryID) throws Exception; }