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 ContextThe avalon contextprotected TrashElementTypeExtensionPointThe trash element type extension pointstatic final StringThe avalon role -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) voidDelete definitively an object from the trash.voidempty()Empty the trash.Get the search model for trash tool.Restore anAmetysObjectfrom the trashSearch trash elements from criteria and facets, and taking account of sorting, grouping and pagination.voidservice(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:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein 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 anAmetysObjectfrom the trash- Parameters:
trashElementId- The trash element identifier- Returns:
trueif it has been restored
-
delete
Delete definitively an object from the trash.- Parameters:
trashElementId- The trash element identifier- Throws:
Exception- if an error occurs
-