Class GetFilesRowCountHelper

java.lang.Object
org.pentaho.di.trans.step.BaseStepHelper
org.pentaho.di.trans.steps.getfilesrowscount.GetFilesRowCountHelper
All Implemented Interfaces:
StepHelperInterface

public class GetFilesRowCountHelper extends BaseStepHelper
Helper class for the "Get Files Rows Count" step providing UI-triggered actions.

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:
  • Constructor Details

    • GetFilesRowCountHelper

      public GetFilesRowCountHelper(GetFilesRowsCountMeta getFilesRowsCountMeta)
      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:
      handleStepAction in class BaseStepHelper
      Parameters:
      method - The name of the action method to execute (e.g., "showFiles")
      transMeta - The transformation metadata containing the step configuration
      queryParams - 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

      public org.json.simple.JSONObject getFilesAction(TransMeta transMeta)
      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:
      • FileInputList.getFileStrings()