Class CmsDeleteExpiredResourcesJob
- All Implemented Interfaces:
I_CmsScheduledJob
The user to execute the process should have have access to the required "Workplace manager" role.
The "Offline" project has to be configured for this job because the operations cannot be performed in the "Online" project.
Job parameters:
expirationdays={Number/Integer}
- Amount of days a resource has to be expired to be deleted.
resourcetypes={csv list}
- Comma separated list of resource type names to specify the types of expired resources that may be deleted. If left out, expired resources of all types will be deleted. .
folder={csv list}
- Allows to specify a comma separated list of folders in which all expired resources will be deleted. If omitted "/" will be taken as single folder for this operation.
The property "delete.expired" (
) may be used
to override the global setting of the parameter CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
expirationdays
. A value of "never", "false" or "none" will
prevent resources from being deleted. Other values are "true" (default) or the amount of days a resource has
to be expired for qualification of deletion.
Only published / unchanged files will be processed. Anything with unpublished changes will not be touched by the job.
Folders with expiration dates are ignored by default. Only if the scheduler parameter "resourcetypes" contains "folder" a folder that has been expired will be deleted (with all contained resources).
- Since:
- 7.5.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Name of the parameter where to configure the amount of days a resource has to be expired before deletion.static final String
Name of the parameter where to configure the folder below which the operation will be done.static final String
Name of the parameter where to configure the resource types for resources to delete if expired.static final String
Setting for the
to disallow deletion.CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
static final String
Setting for the
to disallow deletion.CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
-
Constructor Summary
-
Method Summary
-
Field Details
-
PARAM_EXPIRATIONSDAYS
Name of the parameter where to configure the amount of days a resource has to be expired before deletion.- See Also:
-
PARAM_RESOURCETYPES
Name of the parameter where to configure the resource types for resources to delete if expired.- See Also:
-
PARAM_FOLDER
Name of the parameter where to configure the folder below which the operation will be done.- See Also:
-
PROPERTY_VALUE_DELETE_EXPIRED_NEVER
Setting for the
to disallow deletion.CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
- See Also:
-
PROPERTY_VALUE_DELETE_EXPIRED_NONE
Setting for the
to disallow deletion.CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
- See Also:
-
-
Constructor Details
-
CmsDeleteExpiredResourcesJob
public CmsDeleteExpiredResourcesJob()
-
-
Method Details
-
launch
Description copied from interface:I_CmsScheduledJob
This method will be called when this scheduled job is executed.Depending on the configuration of this job, a new instance of the configured class will be instantiated every time the job is launched, or a new instance will be generated only the first time the job is launched, and re-used afterwards.
The result String will be written to the OpenCms logfile in the
org.opencms.scheduler.CmsScheduleManager
channel, onINFO
log level.- Specified by:
launch
in interfaceI_CmsScheduledJob
- Parameters:
cms
- will be initialized with the configured users cms contextparameters
- the configured parameters- Returns:
- a String that will be written to the OpenCms logfile
- Throws:
Exception
- if something goes wrong- See Also:
-