Class BaseJobEntryHelper

java.lang.Object
org.pentaho.di.job.entry.BaseJobEntryHelper
All Implemented Interfaces:
JobEntryHelperInterface
Direct Known Subclasses:
JobEntryJobHelper, JobEntryTransHelper, JobEntryZipFileHelper

public abstract class BaseJobEntryHelper extends Object implements JobEntryHelperInterface
Base implementation of JobEntryHelperInterface providing shared infrastructure for executing UI-triggered "job entry actions".

Job entry actions are job entry-specific, non-runtime operations initiated from a job entry dialog (e.g. fetching external metadata, validating configuration, testing connections). They do not participate in job execution.

Subclasses implement only the job entry-specific logic in handleJobEntryAction(String, JobMeta, java.util.Map).
See Also:
  • Field Details

  • Constructor Details

    • BaseJobEntryHelper

      protected BaseJobEntryHelper()
  • Method Details

    • jobEntryAction

      public org.json.simple.JSONObject jobEntryAction(String method, JobMeta jobMeta, Map<String,String> queryParams)
      Default implementation for performing a job entry action.

      This method provides shared infrastructure for executing job entry-specific, non-runtime operations initiated from a job entry dialog (e.g. fetching external metadata, validating configuration, testing connections). Subclasses implement only the job entry-specific logic in handleJobEntryAction(String, JobMeta, java.util.Map).

      Specified by:
      jobEntryAction in interface JobEntryHelperInterface
      Parameters:
      method - The name of the method to execute.
      jobMeta - The job metadata associated with the job entry.
      queryParams - A map of query parameters for the action.
      Returns:
      A JSON object containing the action status and any additional response data.
    • handleJobEntryAction

      protected abstract org.json.simple.JSONObject handleJobEntryAction(String method, JobMeta jobMeta, Map<String,String> queryParams)
      Abstract method for handling a specific job entry action. Subclasses must implement this method to provide job entry-specific logic.
      Parameters:
      method - The name of the method to execute.
      jobMeta - The job metadata associated with the job entry.
      queryParams - A map of query parameters for the action.
      Returns:
      A JSON object containing the action status and any additional response data.
    • isFailedResponse

      public boolean isFailedResponse(org.json.simple.JSONObject response)
      Utility method to check if a response indicates a failure.
      Parameters:
      response - The JSON object containing the response data.
      Returns:
      True if the response indicates a failure, false otherwise.
    • getReferencePath

      protected String getReferencePath(JobMeta jobMeta, String directoryPath, String objectName, org.pentaho.di.core.ObjectLocationSpecificationMethod specificationMethod, String fileName)
      Constructs the reference path for a job or transformation based on the provided directory path and name.
      Parameters:
      jobMeta - The job metadata containing the job entry.
      directoryPath - The directory path where the job or transformation is located.
      objectName - The name of the job or transformation.
      specificationMethod - The specification method used (e.g. REPOSITORY_BY_NAME, FILENAME).
      fileName - The filename of the job or transformation (used if the specification method is FILENAME).
      Returns:
      The constructed reference path, or an empty string if neither directoryPath nor objectName is provided.