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 classColumnAdditionByFetchingURLsOperation.HttpHeaderprotected static classColumnAdditionByFetchingURLsOperation.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_baseColumnNameprotected boolean_cacheResponsesprotected int_columnInsertIndexprotected int_delayprotected List<ColumnAdditionByFetchingURLsOperation.HttpHeader>_httpHeadersJsonprotected String_newColumnNameprotected OnError_onErrorprotected 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 RowInRecordChangeDataJoinerchangeDataJoiner(Grid grid, ChangeContext context)Returns the joiner used to insert the result of the evaluation of the expression into a row or record.protected StringcreateDescription(ColumnMetadata column, List<CellAtRow> cellsAtRows)StringgetBaseColumnName()booleangetCacheResponses()protected RowInRecordChangeDataProducer<Cell>getChangeDataProducer(Grid state, ChangeContext context)intgetColumnInsertIndex()intgetDelay()StringgetDescription()A short human-readable description of what this operation does.List<ColumnAdditionByFetchingURLsOperation.HttpHeader>getHttpHeadersJson()protected ColumnModelgetNewColumnModel(Grid grid, ChangeContext context, Evaluable evaluable)Returns the new column model after the operation has run.StringgetNewColumnName()OnErrorgetOnError()StringgetUrlExpression()-
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:
getChangeDataProducerin classExpressionBasedOperation- Throws:
OperationException
-
changeDataJoiner
protected RowInRecordChangeDataJoiner changeDataJoiner(Grid grid, ChangeContext context) throws OperationException
Description copied from class:ExpressionBasedOperationReturns 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 aChangeDataobject which will then be joined by this joiner.- Specified by:
changeDataJoinerin 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:ExpressionBasedOperationReturns the new column model after the operation has run.- Overrides:
getNewColumnModelin 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:OperationA short human-readable description of what this operation does.
-
createDescription
protected String createDescription(ColumnMetadata column, List<CellAtRow> cellsAtRows)
-
-