public class TrashManager extends java.lang.Object implements JPropertiesListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IS_AUTOMATIC_TRASH_DELETE
Name of attribute added in context map during performDelete()
to indicate delete is being automatically after a specific period in the trash.
|
static java.lang.String |
PROP_AUTOMATIC_DELETE_DELAY
Name of property from which delay (in days) before automatic delete is read.
|
static java.lang.String |
PROP_AUTOMATIC_DELETE_ENABLED
Name of property from which automatic delete after a specific duration is enabled or not.
|
static java.lang.String |
PROP_AUTOMATIC_DELETE_SCHEDULE
Name of property from which automatic delete schedule is read (jdring cron syntax).
|
static java.lang.String |
PROP_FINAL_DELETE_ENABLED
Name of property from which option to propose final delete (to end user) for trashable type is read (i.e.
|
static java.lang.String |
PROP_TRASHABLE_TYPES
Name of property from which trashable types is read (i.e.
|
static java.util.Set<java.lang.Class<? extends Publication>> |
TRASHABLE_TYPES_DEFAULT
Default configuration of trashable types (i.e.
|
REVISION
Modifier and Type | Method and Description |
---|---|
java.time.Duration |
getAutoDeleteDelay()
Retrieve the duration publications are kept in trash before
being permanently deleted automatically (if auto delete is enabled).
|
static TrashManager |
getInstance()
Retrieve the TrashManager singleton intance
|
java.util.Set<java.lang.Class<? extends Publication>> |
getTrashableTypes()
Retrieve publication class authorized to be put in trash.
|
boolean |
isAutoDeleteEnabled()
Check if automatic delete is enabled
|
boolean |
isFinalDeleteEnabled()
Check if final delete should be proposed to end user for enabled
|
boolean |
isTrashableClass(java.lang.Class<? extends Publication> clazz)
Check if an instance of the specified Publication class can be put in trash
|
void |
propertiesChange(JProperties properties)
Invoked after properties have been modified in JCMS and save on disk.
|
boolean |
proposeFinalDeleteAction(Publication pub,
Member loggedMember)
Check if final delete action should be proposed for the specified publication
given current logged member.
|
boolean |
proposeTrashAction(Publication pub)
Check if Trash action should be proposed for the specified publication
|
public static final java.lang.String IS_AUTOMATIC_TRASH_DELETE
public static final java.lang.String PROP_AUTOMATIC_DELETE_ENABLED
public static final java.lang.String PROP_AUTOMATIC_DELETE_DELAY
public static final java.lang.String PROP_AUTOMATIC_DELETE_SCHEDULE
public static final java.lang.String PROP_TRASHABLE_TYPES
public static final java.lang.String PROP_FINAL_DELETE_ENABLED
If true, final delete action will be displayed to all users. If false, final delete action will only be displayed to administrators.
public static final java.util.Set<java.lang.Class<? extends Publication>> TRASHABLE_TYPES_DEFAULT
public static TrashManager getInstance()
public void propertiesChange(JProperties properties)
JPropertiesListener
You cannot alter the value received in parameters.
propertiesChange
in interface JPropertiesListener
properties
- the properties which have been modified (may not contain all JCMS properties)public boolean isAutoDeleteEnabled()
public java.time.Duration getAutoDeleteDelay()
public java.util.Set<java.lang.Class<? extends Publication>> getTrashableTypes()
public boolean isTrashableClass(java.lang.Class<? extends Publication> clazz)
clazz
- a publication subclass classpublic boolean isFinalDeleteEnabled()
public boolean proposeTrashAction(Publication pub)
pub
- the Publication for which trash action display is verifiedpublic boolean proposeFinalDeleteAction(Publication pub, Member loggedMember)
pub
- the Publication for which final delete action display is verifiedloggedMember
- the currentCopyright © 2001-2021 Jalios SA. All Rights Reserved.