Class GetFilesRowCountHelper
- All Implemented Interfaces:
StepHelperInterface
This helper implements step-specific actions that can be invoked from the web UI (Webspoon)
or desktop Spoon interface. It extends BaseStepHelper to provide consistent error handling
and JSON response formatting.
Supported actions:
- showFiles - Retrieves and returns the list of files that will be processed by the Get Files Rows Count step based on the current step configuration
Integration with Web UI:
This helper integrates with the Webspoon UI through REST API calls. When users interact with the step dialog (e.g., clicking "Show Files" button), the frontend makes HTTP requests to Carte server endpoints, which then delegate to this helper through the BaseStep.doAction() mechanism.
- See Also:
-
Field Summary
Fields inherited from class org.pentaho.di.trans.step.BaseStepHelper
IS_TRANS_REFERENCE, IS_VALID_REFERENCE, log, REFERENCE_PATH, SEPARATORFields inherited from interface org.pentaho.di.trans.step.StepHelperInterface
ACTION_STATUS, FAILURE_METHOD_NOT_FOUND_RESPONSE, FAILURE_RESPONSE, STATUS, SUCCESS_RESPONSE -
Constructor Summary
ConstructorsConstructorDescriptionGetFilesRowCountHelper(GetFilesRowsCountMeta getFilesRowsCountMeta) Constructs a new GetFilesRowCountHelper instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.json.simple.JSONObjectgetFilesAction(TransMeta transMeta) Retrieves the list of files that will be processed by the Get Files Rows Count step.protected org.json.simple.JSONObjectHandles step-specific actions for the Get Files Rows Count step.Methods inherited from class org.pentaho.di.trans.step.BaseStepHelper
getReferencePath, isFailedResponse, stepAction, validateAndPutReferenceStatus
-
Constructor Details
-
GetFilesRowCountHelper
Constructs a new GetFilesRowCountHelper instance.- Parameters:
getFilesRowsCountMeta- The step metadata instance
-
-
Method Details
-
handleStepAction
protected org.json.simple.JSONObject handleStepAction(String method, TransMeta transMeta, Map<String, String> queryParams) Handles step-specific actions for the Get Files Rows Count step.This method routes action requests to the appropriate handler method based on the method name. Currently supports the "showFiles" action for retrieving file lists.
- Specified by:
handleStepActionin classBaseStepHelper- Parameters:
method- The name of the action method to execute (e.g., "showFiles")transMeta- The transformation metadata containing the step configurationqueryParams- A map of query parameters including "stepName" for step identification- Returns:
- A JSON object containing the action response with status and data
- Throws:
RuntimeException- if an error occurs during action execution
-
getFilesAction
Retrieves the list of files that will be processed by the Get Files Rows Count step.This action method extracts the file patterns and configurations from the step metadata and returns a JSON response containing the resolved file list. This is typically called from the UI to preview which files will be processed before running the transformation.
The response JSON structure:
- files - JSONArray containing file paths
- actionStatus - "Action successful" if files found
- message - Error message if no files found
- Parameters:
transMeta- The transformation metadata containing the step configuration- Returns:
- A JSON object containing the file list and operation status
- See Also:
-