|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.scheduler.jobs.CmsDeleteExpiredResourcesJob
public class CmsDeleteExpiredResourcesJob
A schedulable OpenCms job to delete expired resources.
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}
resourcetypes={csv list}
folder={csv list}
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).
Field Summary | |
---|---|
static java.lang.String |
PARAM_EXPIRATIONSDAYS
Name of the parameter where to configure the amount of days a resource has to be expired before deletion. |
static java.lang.String |
PARAM_FOLDER
Name of the parameter where to configure the folder below which the operation will be done. |
static java.lang.String |
PARAM_RESOURCETYPES
Name of the parameter where to configure the resource types for resources to delete if expired. |
static java.lang.String |
PROPERTY_VALUE_DELETE_EXPIRED_NEVER
Setting for the to disallow deletion. |
static java.lang.String |
PROPERTY_VALUE_DELETE_EXPIRED_NONE
Setting for the to disallow deletion. |
Constructor Summary | |
---|---|
CmsDeleteExpiredResourcesJob()
|
Method Summary | |
---|---|
java.lang.String |
launch(CmsObject cms,
java.util.Map parameters)
This method will be called when this scheduled job is executed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PARAM_EXPIRATIONSDAYS
public static final java.lang.String PARAM_RESOURCETYPES
public static final java.lang.String PARAM_FOLDER
public static final java.lang.String PROPERTY_VALUE_DELETE_EXPIRED_NEVER
CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
to disallow deletion.
public static final java.lang.String PROPERTY_VALUE_DELETE_EXPIRED_NONE
CmsPropertyDefinition.PROPERTY_DELETE_EXPIRED
to disallow deletion.
Constructor Detail |
---|
public CmsDeleteExpiredResourcesJob()
Method Detail |
---|
public java.lang.String launch(CmsObject cms, java.util.Map parameters) throws java.lang.Exception
I_CmsScheduledJob
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,
on INFO
log level.
launch
in interface I_CmsScheduledJob
cms
- will be initialized with the configured users cms contextparameters
- the configured parameters
java.lang.Exception
- if something goes wrongI_CmsScheduledJob.launch(org.opencms.file.CmsObject, java.util.Map)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |