public abstract class AbstractDeleteUDContentComponent extends Object implements Component, Serviceable, Configurable
Modifier and Type | Field and Description |
---|---|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected ObservationManager |
_observationManager
The observation manager
|
private static int |
_REMOVE_REFERENCE_DEFAULT_ACTION_ID |
protected int |
_removeReferenceActionId
The action id to call when references are removed
|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected SmartContentClientSideElementHelper |
_smartHelper
Helper for smart content client elements
|
protected SolrIndexer |
_solrIndexer
The Solr indexer.
|
Constructor and Description |
---|
AbstractDeleteUDContentComponent() |
Modifier and Type | Method and Description |
---|---|
protected 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)
|
protected abstract boolean |
_checkBeforeDeletion(Content content,
Map<String,String> rights,
Map<String,Object> results,
Logger logger)
Check that deletion can be performed without blocking errors
|
protected void |
_commitAllChanges(Logger logger)
Commit all changes in solr
|
protected void |
_deleteContent(Content content,
Map<String,Object> parameters,
Map<String,String> rights,
Map<String,Object> results,
Logger logger)
Delete one content
|
protected void |
_finalizeDeleteContents(Set<String> contentIdsToDelete,
ModifiableAmetysObject parent,
Map<String,Object> results,
Logger logger)
Finalize the deletion of contents.
|
protected abstract Set<String> |
_getContentIdsToDelete(Content content,
Map<String,String> rights,
Map<String,Object> results,
Logger logger)
Get the id of children to be deleted.
|
protected Map<String,Object> |
_getEventParametersForDeletion(Content content)
Get parameters for content deleted
Event |
protected boolean |
_hasRight(Content content,
Map<String,String> rights)
Determines if the user has sufficient right for the given content
|
protected boolean |
_isLocked(Content content)
Determines if the content is locked
|
protected void |
_processContentDeletion(Content content,
Map<String,String> rights,
Map<String,Object> results,
Logger logger)
Delete one content
|
protected abstract boolean |
_removeRelations(Content content,
Logger logger)
Remove relations
|
void |
configure(Configuration configuration) |
Map<String,Object> |
deleteContents(List<String> contentsId,
Map<String,Object> parameters,
Map<String,String> rights,
Logger logger)
Delete contents
|
int |
deleteContentsWithLog(List<Content> contentsToRemove,
Map<String,Object> parameters,
Map<String,String> rights,
Logger logger)
Delete contents and logs results
|
abstract boolean |
isContentReferenced(Content content,
Logger logger)
True if the content is referenced
|
void |
service(ServiceManager smanager) |
private static final int _REMOVE_REFERENCE_DEFAULT_ACTION_ID
protected SolrIndexer _solrIndexer
protected AmetysObjectResolver _resolver
protected ObservationManager _observationManager
protected CurrentUserProvider _currentUserProvider
protected SmartContentClientSideElementHelper _smartHelper
protected int _removeReferenceActionId
public AbstractDeleteUDContentComponent()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public int deleteContentsWithLog(List<Content> contentsToRemove, Map<String,Object> parameters, Map<String,String> rights, Logger logger)
contentsToRemove
- the list of contents to removeparameters
- the additional parametersrights
- the map of rights id with its prefixlogger
- The loggerpublic Map<String,Object> deleteContents(List<String> contentsId, Map<String,Object> parameters, Map<String,String> rights, Logger logger)
contentsId
- The ids of contents to deleteparameters
- the additional parametersrights
- the map of rights id with its prefixlogger
- The loggerprotected void _deleteContent(Content content, Map<String,Object> parameters, Map<String,String> rights, Map<String,Object> results, Logger logger)
content
- the content to deleteparameters
- the additional parametersrights
- the map of rights id with its prefixresults
- the results maplogger
- The loggerprotected void _processContentDeletion(Content content, Map<String,String> rights, Map<String,Object> results, Logger logger)
content
- the content to deleterights
- the map of rights id with its prefixresults
- the results maplogger
- The loggerprotected void _finalizeDeleteContents(Set<String> contentIdsToDelete, ModifiableAmetysObject parent, Map<String,Object> results, Logger logger)
contentIdsToDelete
- the list of content id to deleteparent
- the jcr parent for saving changesresults
- the results maplogger
- The loggerprotected boolean _canDeleteContent(Content content, Map<String,String> rights, Map<String,Object> results)
content
- the contentrights
- the map of rights id with its prefixresults
- the results mapprotected Map<String,Object> _getEventParametersForDeletion(Content content)
Event
content
- the removed contentprotected void _commitAllChanges(Logger logger)
logger
- The loggerprotected boolean _isLocked(Content content)
content
- the contentprotected boolean _hasRight(Content content, Map<String,String> rights)
content
- the contentrights
- the map of rights id with its prefixpublic abstract boolean isContentReferenced(Content content, Logger logger)
content
- the contentlogger
- The loggerprotected abstract boolean _checkBeforeDeletion(Content content, Map<String,String> rights, Map<String,Object> results, Logger logger)
content
- The initial content to deleterights
- the map of rights id with its prefixresults
- The resultslogger
- The loggerprotected abstract boolean _removeRelations(Content content, Logger logger)
content
- the contentlogger
- The loggertrue
if all relations have been removedprotected abstract Set<String> _getContentIdsToDelete(Content content, Map<String,String> rights, Map<String,Object> results, Logger logger)
content
- The content to deleterights
- the map of rights id with its prefixresults
- The resultslogger
- The logger