Package org.ametys.cms.trash
Class TrashManager
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.trash.TrashManager
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
public class TrashManager
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
Trash manager to search in the trash, empty the trash, restore or delete objects from the trash.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Context
The avalon contextprotected TrashElementTypeExtensionPoint
The trash element type extension pointstatic final String
The avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) void
Delete definitively an object from the trash.void
empty()
Empty the trash.Get the search model for trash tool.Restore anAmetysObject
from the trashSearch trash elements from criteria and facets, and taking account of sorting, grouping and pagination.void
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon role -
_context
The avalon context -
_trashElementTypeEP
The trash element type extension point
-
-
Constructor Details
-
TrashManager
public TrashManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
getSearchModel
Get the search model for trash tool.- Returns:
- The search model as JSON
-
search
Search trash elements from criteria and facets, and taking account of sorting, grouping and pagination.- Parameters:
jsonParams
- The JSON parameters of the search- Returns:
- The search results as JSON
- Throws:
Exception
- if an exception occurs
-
empty
Empty the trash.- Throws:
javax.jcr.RepositoryException
- if an error occurs
-
restore
Restore anAmetysObject
from the trash- Parameters:
trashElementId
- The trash element identifier- Returns:
true
if it has been restored
-
delete
Delete definitively an object from the trash.- Parameters:
trashElementId
- The trash element identifier- Throws:
Exception
- if an error occurs
-