Package org.ametys.plugins.userdirectory
Class AbstractDeleteUDContentComponent
java.lang.Object
org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
- All Implemented Interfaces:
- Component,- Configurable,- Serviceable
- Direct Known Subclasses:
- DeleteOrgUnitComponent,- DeleteUserComponent
public abstract class AbstractDeleteUDContentComponent
extends Object
implements Component, Serviceable, Configurable
Delete UD content component
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected ObservationManagerThe observation managerprotected intThe action id to call when references are removedprotected AmetysObjectResolverThe Ametys object resolverprotected SmartContentClientSideElementHelperHelper for smart content client elements
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanTrue if we can delete the content (check if removable, rights and if locked)protected abstract boolean_checkBeforeDeletion(Content content, Map<String, String> rights, Map<String, Object> results, Logger logger) Check that deletion can be performed without blocking errorsprotected void_deleteContent(Content content, Map<String, Object> parameters, Map<String, String> rights, Map<String, Object> results, Logger logger) Delete one contentprotected void_finalizeDeleteContents(Set<String> contentIdsToDelete, ModifiableAmetysObject parent, Map<String, Object> results, Logger logger) Finalize the deletion of contents._getContentIdsToDelete(Content content, Map<String, Object> parameters, Map<String, String> rights, Map<String, Object> results, Logger logger) Get the id of children to be deleted._getEventParametersForDeletion(Content content) Get parameters for content deletedEventprotected booleanDetermines if the user has sufficient right for the given contentprotected booleanDetermines if the content is lockedprotected void_processContentDeletion(Content content, Map<String, Object> parameters, Map<String, String> rights, Map<String, Object> results, Logger logger) Delete one contentprotected abstract booleanRemove relationsvoidconfigure(Configuration configuration) deleteContents(List<String> contentsId, Map<String, Object> parameters, Map<String, String> rights, Logger logger) Delete contentsintdeleteContentsWithLog(List<Content> contentsToRemove, Map<String, Object> parameters, Map<String, String> rights, Logger logger) Delete contents and logs resultsabstract booleanisContentReferenced(Content content, Logger logger) True if the content is referencedvoidservice(ServiceManager smanager) 
- 
Field Details- 
_resolverThe Ametys object resolver
- 
_observationManagerThe observation manager
- 
_currentUserProviderThe current user provider
- 
_smartHelperHelper for smart content client elements
- 
_removeReferenceActionIdThe action id to call when references are removed
 
- 
- 
Constructor Details- 
AbstractDeleteUDContentComponentpublic AbstractDeleteUDContentComponent()
 
- 
- 
Method Details- 
service- Specified by:
- servicein interface- Serviceable
- Throws:
- ServiceException
 
- 
configure- Specified by:
- configurein interface- Configurable
- Throws:
- ConfigurationException
 
- 
deleteContentsWithLogpublic int deleteContentsWithLog(List<Content> contentsToRemove, Map<String, Object> parameters, Map<String, String> rights, Logger logger) Delete contents and logs results- Parameters:
- contentsToRemove- the list of contents to remove
- parameters- the additional parameters
- rights- the map of rights id with its prefix
- logger- The logger
- Returns:
- the number of deleted contents
 
- 
deleteContentspublic Map<String,Object> deleteContents(List<String> contentsId, Map<String, Object> parameters, Map<String, String> rights, Logger logger) Delete contents- Parameters:
- contentsId- The ids of contents to delete
- parameters- the additional parameters
- rights- the map of rights id with its prefix
- logger- The logger
- Returns:
- the deleted and undeleted contents
 
- 
_deleteContentprotected void _deleteContent(Content content, Map<String, Object> parameters, Map<String, String> rights, Map<String, Object> results, Logger logger) Delete one content- Parameters:
- content- the content to delete
- parameters- the additional parameters
- rights- the map of rights id with its prefix
- results- the results map
- logger- The logger
 
- 
_processContentDeletionprotected void _processContentDeletion(Content content, Map<String, Object> parameters, Map<String, String> rights, Map<String, Object> results, Logger logger) Delete one content- Parameters:
- content- the content to delete
- parameters- the additional parameters
- rights- the map of rights id with its prefix
- results- the results map
- logger- The logger
 
- 
_finalizeDeleteContentsprotected void _finalizeDeleteContents(Set<String> contentIdsToDelete, ModifiableAmetysObject parent, Map<String, Object> results, Logger logger) Finalize the deletion of contents. Call observers and remove contents- Parameters:
- contentIdsToDelete- the list of content id to delete
- parent- the jcr parent for saving changes
- results- the results map
- logger- The logger
 
- 
_canDeleteContentprotected boolean _canDeleteContent(Content content, Map<String, String> rights, Map<String, Object> results) True if we can delete the content (check if removable, rights and if locked)- Parameters:
- content- the content
- rights- the map of rights id with its prefix
- results- the results map
- Returns:
- true if we can delete the content
 
- 
_getEventParametersForDeletionGet parameters for content deletedEvent- Parameters:
- content- the removed content
- Returns:
- the event's parameters
 
- 
_isLockedDetermines if the content is locked- Parameters:
- content- the content
- Returns:
- true if the content is locked
 
- 
_hasRightDetermines if the user has sufficient right for the given content- Parameters:
- content- the content
- rights- the map of rights id with its prefix
- Returns:
- true if user has sufficient right
 
- 
isContentReferencedTrue if the content is referenced- Parameters:
- content- the content
- logger- The logger
- Returns:
- true if the content is referenced
 
- 
_checkBeforeDeletionprotected abstract boolean _checkBeforeDeletion(Content content, Map<String, String> rights, Map<String, Object> results, Logger logger) Check that deletion can be performed without blocking errors- Parameters:
- content- The initial content to delete
- rights- the map of rights id with its prefix
- results- The results
- logger- The logger
- Returns:
- true if the deletion can be performed
 
- 
_removeRelationsprotected abstract boolean _removeRelations(Content content, Map<String, Object> parameters, Logger logger) Remove relations- Parameters:
- content- the content
- parameters- the additional parameters
- logger- The logger
- Returns:
- trueif all relations have been removed
 
- 
_getContentIdsToDeleteprotected abstract Set<String> _getContentIdsToDelete(Content content, Map<String, Object> parameters, Map<String, String> rights, Map<String, Object> results, Logger logger) Get the id of children to be deleted. All children shared with other contents which are not part of deletion, will be not deleted.- Parameters:
- content- The content to delete
- parameters- the additional parameters
- rights- the map of rights id with its prefix
- results- The results
- logger- The logger
- Returns:
- The id of contents to be deleted
 
 
-