Package org.openrefine.operations.column
Class ColumnAdditionByFetchingURLsOperation
- java.lang.Object
-
- org.openrefine.operations.EngineDependentOperation
-
- org.openrefine.operations.RowMapOperation
-
- org.openrefine.operations.ExpressionBasedOperation
-
- org.openrefine.operations.column.ColumnAdditionByFetchingURLsOperation
-
- All Implemented Interfaces:
Operation
public class ColumnAdditionByFetchingURLsOperation extends ExpressionBasedOperation
Adds a column by fetching URLs generated by an expression, based on a column.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ColumnAdditionByFetchingURLsOperation.HttpHeader
protected static class
ColumnAdditionByFetchingURLsOperation.URLFetchingChangeProducer
-
Nested classes/interfaces inherited from class org.openrefine.operations.ExpressionBasedOperation
ExpressionBasedOperation.NegativeRowMapper, ExpressionBasedOperation.PositiveRowMapper
-
Nested classes/interfaces inherited from class org.openrefine.operations.RowMapOperation
RowMapOperation.GridMap
-
-
Field Summary
Fields Modifier and Type Field Description protected String
_baseColumnName
protected boolean
_cacheResponses
protected int
_columnInsertIndex
protected int
_delay
protected List<ColumnAdditionByFetchingURLsOperation.HttpHeader>
_httpHeadersJson
protected String
_newColumnName
protected OnError
_onError
protected String
_urlExpression
-
Fields inherited from class org.openrefine.operations.ExpressionBasedOperation
_changeDataId, _eval, _expression, _forceEagerEvaluation, _repeatCount
-
Fields inherited from class org.openrefine.operations.EngineDependentOperation
_engineConfig
-
-
Constructor Summary
Constructors Constructor Description ColumnAdditionByFetchingURLsOperation(EngineConfig engineConfig, String baseColumnName, String urlExpression, OnError onError, String newColumnName, int columnInsertIndex, int delay, boolean cacheResponses, List<ColumnAdditionByFetchingURLsOperation.HttpHeader> httpHeadersJson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RowInRecordChangeDataJoiner
changeDataJoiner(Grid grid, ChangeContext context)
Returns the joiner used to insert the result of the evaluation of the expression into a row or record.protected String
createDescription(ColumnMetadata column, List<CellAtRow> cellsAtRows)
String
getBaseColumnName()
boolean
getCacheResponses()
protected RowInRecordChangeDataProducer<Cell>
getChangeDataProducer(Grid state, ChangeContext context)
int
getColumnInsertIndex()
int
getDelay()
String
getDescription()
A short human-readable description of what this operation does.List<ColumnAdditionByFetchingURLsOperation.HttpHeader>
getHttpHeadersJson()
protected ColumnModel
getNewColumnModel(Grid grid, ChangeContext context, Evaluable evaluable)
Returns the new column model after the operation has run.String
getNewColumnName()
OnError
getOnError()
String
getUrlExpression()
-
Methods inherited from class org.openrefine.operations.ExpressionBasedOperation
apply, evaluatingChangeDataProducer, getEvaluable, getGridMap, getNewOverlayModels, postTransform
-
Methods inherited from class org.openrefine.operations.RowMapOperation
getNegativeRowMapper, getNewColumnModel, getNewOverlayModels, getPositiveRowMapper, postTransform
-
Methods inherited from class org.openrefine.operations.EngineDependentOperation
getEngine, getEngineConfig
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrefine.operations.Operation
getOperationId, isReproducible
-
-
-
-
Field Detail
-
_baseColumnName
protected final String _baseColumnName
-
_urlExpression
protected final String _urlExpression
-
_onError
protected final OnError _onError
-
_newColumnName
protected final String _newColumnName
-
_columnInsertIndex
protected final int _columnInsertIndex
-
_delay
protected final int _delay
-
_cacheResponses
protected final boolean _cacheResponses
-
_httpHeadersJson
protected final List<ColumnAdditionByFetchingURLsOperation.HttpHeader> _httpHeadersJson
-
-
Constructor Detail
-
ColumnAdditionByFetchingURLsOperation
public ColumnAdditionByFetchingURLsOperation(EngineConfig engineConfig, String baseColumnName, String urlExpression, OnError onError, String newColumnName, int columnInsertIndex, int delay, boolean cacheResponses, List<ColumnAdditionByFetchingURLsOperation.HttpHeader> httpHeadersJson)
-
-
Method Detail
-
getChangeDataProducer
protected RowInRecordChangeDataProducer<Cell> getChangeDataProducer(Grid state, ChangeContext context) throws OperationException
- Overrides:
getChangeDataProducer
in classExpressionBasedOperation
- Throws:
OperationException
-
changeDataJoiner
protected RowInRecordChangeDataJoiner changeDataJoiner(Grid grid, ChangeContext context) throws OperationException
Description copied from class:ExpressionBasedOperation
Returns the joiner used to insert the result of the evaluation of the expression into a row or record. Depending on whether the expression is local or not (seeEvaluable.isLocal()
), this will either be used to build a row / record mapper to apply the change lazily on the grid, or the results of the evaluation will be stored in aChangeData
object which will then be joined by this joiner.- Specified by:
changeDataJoiner
in classExpressionBasedOperation
- Parameters:
grid
- the initial state of the grid- Throws:
OperationException
-
getNewColumnModel
protected ColumnModel getNewColumnModel(Grid grid, ChangeContext context, Evaluable evaluable) throws OperationException
Description copied from class:ExpressionBasedOperation
Returns the new column model after the operation has run.- Overrides:
getNewColumnModel
in classExpressionBasedOperation
- Throws:
OperationException
-
getNewColumnName
public String getNewColumnName()
-
getColumnInsertIndex
public int getColumnInsertIndex()
-
getBaseColumnName
public String getBaseColumnName()
-
getUrlExpression
public String getUrlExpression()
-
getOnError
public OnError getOnError()
-
getDelay
public int getDelay()
-
getHttpHeadersJson
public List<ColumnAdditionByFetchingURLsOperation.HttpHeader> getHttpHeadersJson()
-
getCacheResponses
public boolean getCacheResponses()
-
getDescription
public String getDescription()
Description copied from interface:Operation
A short human-readable description of what this operation does.
-
createDescription
protected String createDescription(ColumnMetadata column, List<CellAtRow> cellsAtRows)
-
-