Package org.ametys.odf.helper
Class DeleteODFContentHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.helper.DeleteODFContentHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
Helper to delete an ODF content.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration for the mode of deletion -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteContents(List<String> contentsId, String modeParam) Delete ODF contentsdeleteContents(List<String> contentsId, String modeParam, boolean ignoreRights) Delete ODF contentsbooleanDetermines if the user has sufficient right for the given contentbooleanisContentReferenced(Content content) Test if content is still referenced before removing itvoidservice(ServiceManager manager) trashContents(List<String> contentsId, String modeParam) Trash contents if possible, or delete it.trashContents(List<String> contentsId, String modeParam, boolean ignoreRights) Trash contents if possible, or delete it.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon role.
-
-
Constructor Details
-
DeleteODFContentHelper
public DeleteODFContentHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
trashContents
Trash contents if possible, or delete it.- Parameters:
contentsId- The ids of contents to deletemodeParam- The mode of deletion- Returns:
- the deleted and undeleted contents
-
trashContents
public Map<String,Object> trashContents(List<String> contentsId, String modeParam, boolean ignoreRights) Trash contents if possible, or delete it.- Parameters:
contentsId- The ids of contents to deletemodeParam- The mode of deletionignoreRights- If true, bypass the rights check during the deletion- Returns:
- the deleted and undeleted contents
-
deleteContents
Delete ODF contents- Parameters:
contentsId- The ids of contents to deletemodeParam- The mode of deletion- Returns:
- the deleted and undeleted contents
-
deleteContents
public Map<String,Object> deleteContents(List<String> contentsId, String modeParam, boolean ignoreRights) Delete ODF contents- Parameters:
contentsId- The ids of contents to deletemodeParam- The mode of deletionignoreRights- If true, bypass the rights check during the deletion- Returns:
- the deleted and undeleted contents
-
isContentReferenced
Test if content is still referenced before removing it- Parameters:
content- The content to remove- Returns:
- true if content is still referenced
-
hasRight
Determines if the user has sufficient right for the given content- Parameters:
content- the content- Returns:
- true if user has sufficient right
-