Package org.codelibs.fess.job
Class PythonJob
java.lang.Object
org.codelibs.fess.job.ExecJob
org.codelibs.fess.job.PythonJob
Job for executing Python scripts within the Fess search engine environment.
This job extends ExecJob to provide Python-specific functionality for running
Python scripts with proper environment setup and argument passing.
Python scripts are executed in the WEB-INF/env/python/resources directory and have access to the Fess system environment including OpenSearch URL and session ID.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of command-line arguments to pass to the Python scriptprotected StringThe Python script filename to executeFields inherited from class org.codelibs.fess.job.ExecJob
jobExecutor, jvmOptions, lastaEnv, logFilePath, logLevel, logSuffix, processTimeout, sessionId, timeout, useLocalFesen -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a single command-line argument to pass to the Python script.Adds multiple command-line arguments to pass to the Python script.execute()Executes the Python script job.protected voidExecutes the Python script with the configured parameters.Sets the Python script filename to execute.protected StringReturns the execution type identifier for Python jobs.protected StringConstructs the file path for the Python script to execute.Methods inherited from class org.codelibs.fess.job.ExecJob
addFessConfigProperties, addFessCustomSystemProperties, addFessSystemProperties, addSystemProperty, appendJarFile, createSystemProperties, createTimeoutTask, deleteTempDir, execute, gcLogging, getLogName, jobExecutor, jvmOptions, lastaEnv, logFilePath, logLevel, logSuffix, remoteDebug, sessionId, timeout, useLocalFesen
-
Field Details
-
filename
The Python script filename to execute -
argList
List of command-line arguments to pass to the Python script
-
-
Constructor Details
-
PythonJob
public PythonJob()Default constructor for PythonJob. Creates a new instance of the Python job with default settings.
-
-
Method Details
-
filename
Sets the Python script filename to execute.- Parameters:
filename- the Python script filename (relative to WEB-INF/env/python/resources)- Returns:
- this PythonJob instance for method chaining
-
arg
Adds a single command-line argument to pass to the Python script.- Parameters:
value- the argument value to add- Returns:
- this PythonJob instance for method chaining
-
args
Adds multiple command-line arguments to pass to the Python script.- Parameters:
values- the argument values to add- Returns:
- this PythonJob instance for method chaining
-
execute
Executes the Python script job. Creates a session ID, sets up the execution environment, and runs the Python script with the configured filename and arguments. -
executePython
protected void executePython()Executes the Python script with the configured parameters. Sets up the command list, working directory, and environment variables, then starts the Python process and waits for completion.- Throws:
JobProcessingException- if the Python script execution fails
-
getPyFilePath
Constructs the file path for the Python script to execute. The path is relative to the web application root and follows the pattern: WEB-INF/env/python/resources/{filename}- Returns:
- the constructed file path for the Python script
-
getExecuteType
Returns the execution type identifier for Python jobs.- Specified by:
getExecuteTypein classExecJob- Returns:
- the execution type constant for Python jobs
-