Overview
The Image Linking Job parses a field in an image module and creates or updates links to items in a product module. It can perform direct linking (images → products) or reverse linking (products → images). If a product does not exist, it can be created automatically.
How it works
The Image Linking Job works as below:
In direct linking, the job parses a text field in the Image module containing Product IDs and links the images to the corresponding products.
In reverse linking, the job parses the same field but creates links from products back to images.
Product IDs are extracted based on a regex pattern and may be separated by commas, semicolons, forward slashes, or spaces. A Product ID cannot contain any of these separators.
Parameters
The table below provides an overview of parameters supported for the Image Linking Job
Parameter | Description |
---|---|
| Name of the scheduler job. |
| Class that performs the job: |
| ID of the module containing images. |
| Field in the Image module that links to the Product module (or reverse linking). |
| Field containing product IDs in the Image module. |
| ID of the module containing products. |
| Field in Product module storing the Product ID. |
|
|
| Regex pattern to identify valid Product IDs. |
| Interval in seconds at which the job is re-run. |
Note:
Ensure all IDs and directories exist and are correctly configured to avoid job failures.
Example Configuration
The below is an example of the Image Linking Job
joblist=ImageLinkingJob
job.ImageLinkingJob.type=enCode.app.common.scheduler.jobs.ImageLinkingJob
job.ImageLinkingJob.param.ModuleLinker=201
job.ImageLinkingJob.param.FieldModuleLink=301
job.ImageLinkingJob.param.FieldProductText=302
job.ImageLinkingJob.param.ModuleLinked=202
job.ImageLinkingJob.param.FieldProductID=401
job.ImageLinkingJob.param.createNew=true
job.ImageLinkingJob.param.Pattern=(\d+)/(.*)
job.ImageLinkingJob.interval=6000
Explanation:
Links images from module 201 to products in module 202.
Creates new products automatically if they don’t exist.
Uses regex
(\d+)/(.*)
to identify valid Product IDs.Product IDs in the Image module can be separated by comma, semicolon, forward slash, or space.
Runs every 6000 seconds.
Can be configured for reverse linking by adjusting
FieldModuleLink
to the Product module field linking to images.