Search in sources :

Example 21 with HistoryEntry

use of com.google.refine.history.HistoryEntry in project OpenRefine by OpenRefine.

the class RowRemovalOperation method createHistoryEntry.

@Override
protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception {
    Engine engine = createEngine(project);
    List<Integer> rowIndices = new ArrayList<Integer>();
    FilteredRows filteredRows = engine.getAllFilteredRows();
    filteredRows.accept(project, createRowVisitor(project, rowIndices));
    return new HistoryEntry(historyEntryID, project, "Remove " + rowIndices.size() + " rows", this, new RowRemovalChange(rowIndices));
}
Also used : RowRemovalChange(com.google.refine.model.changes.RowRemovalChange) ArrayList(java.util.ArrayList) HistoryEntry(com.google.refine.history.HistoryEntry) FilteredRows(com.google.refine.browsing.FilteredRows) Engine(com.google.refine.browsing.Engine)

Example 22 with HistoryEntry

use of com.google.refine.history.HistoryEntry in project OpenRefine by OpenRefine.

the class RowStarOperation method createHistoryEntry.

@Override
protected HistoryEntry createHistoryEntry(Project project, long historyEntryID) throws Exception {
    Engine engine = createEngine(project);
    List<Change> changes = new ArrayList<Change>(project.rows.size());
    FilteredRows filteredRows = engine.getAllFilteredRows();
    filteredRows.accept(project, createRowVisitor(project, changes));
    return new HistoryEntry(historyEntryID, project, (_starred ? "Star" : "Unstar") + " " + changes.size() + " rows", this, new MassChange(changes, false));
}
Also used : MassChange(com.google.refine.model.changes.MassChange) ArrayList(java.util.ArrayList) HistoryEntry(com.google.refine.history.HistoryEntry) RowStarChange(com.google.refine.model.changes.RowStarChange) Change(com.google.refine.history.Change) MassChange(com.google.refine.model.changes.MassChange) FilteredRows(com.google.refine.browsing.FilteredRows) Engine(com.google.refine.browsing.Engine)

Aggregations

HistoryEntry (com.google.refine.history.HistoryEntry)22 ArrayList (java.util.ArrayList)15 Column (com.google.refine.model.Column)10 Engine (com.google.refine.browsing.Engine)8 JSONException (org.json.JSONException)8 FilteredRows (com.google.refine.browsing.FilteredRows)7 Cell (com.google.refine.model.Cell)7 Row (com.google.refine.model.Row)7 Project (com.google.refine.model.Project)6 Properties (java.util.Properties)6 Change (com.google.refine.history.Change)5 JSONWriter (org.json.JSONWriter)5 JSONObject (org.json.JSONObject)4 RowVisitor (com.google.refine.browsing.RowVisitor)3 MassChange (com.google.refine.model.changes.MassChange)3 MassRowChange (com.google.refine.model.changes.MassRowChange)3 MassRowColumnChange (com.google.refine.model.changes.MassRowColumnChange)3 Pool (com.google.refine.util.Pool)3 IOException (java.io.IOException)3 ServletException (javax.servlet.ServletException)3