Package org.ametys.plugins.userdirectory
Class DeleteOrgUnitComponent
java.lang.Object
org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
org.ametys.plugins.userdirectory.DeleteOrgUnitComponent
- All Implemented Interfaces:
Component
,Configurable
,Serviceable
Delete orgunit component
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentHelper
The content helperprotected ContentWorkflowHelper
The content workflow helperprotected I18nUtils
The i18n utilsprotected OrganisationChartPageHandler
The organisation chart page handlerstatic final String
The avalon role.Fields inherited from class org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
_currentUserProvider, _observationManager, _removeReferenceActionId, _resolver, _smartHelper, _solrIndexer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
_checkBeforeDeletion
(Content content, Map<String, String> rights, Map<String, Object> results, Logger logger) Check that deletion can be performed without blocking errorsprotected boolean
_checkChildrenBeforeDeletion
(Content contentToCheck, Map<String, String> rights, Map<String, Object> results, Logger logger) Browse children to check if deletion could succeedprotected boolean
_checkParentBeforeDeletion
(Content content, Map<String, Object> results) True if the parent content is not lockedprotected boolean
_checkUsersBeforeDeletion
(Content content, Map<String, Object> results) True if the users content is not locked_getContentIdsToDelete
(Content content, Map<String, String> rights, Map<String, Object> results, Logger logger) Get the id of children to be deleted.protected boolean
_removeRelations
(Content orgUnit, Logger logger) Remove relationsprotected boolean
_removeUsersRelation
(Content orgUnit, Logger logger) Remove users relationboolean
isContentReferenced
(Content content, Logger logger) True if the content is referencedvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
_canDeleteContent, _commitAllChanges, _deleteContent, _finalizeDeleteContents, _getEventParametersForDeletion, _hasRight, _isLocked, _processContentDeletion, configure, deleteContents, deleteContentsWithLog
-
Field Details
-
ROLE
The avalon role. -
_oCPageHandler
The organisation chart page handler -
_contentHelper
The content helper -
_i18nUtils
The i18n utils -
_contentWorkflowHelper
The content workflow helper
-
-
Constructor Details
-
DeleteOrgUnitComponent
public DeleteOrgUnitComponent()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractDeleteUDContentComponent
- Throws:
ServiceException
-
isContentReferenced
Description copied from class:AbstractDeleteUDContentComponent
True if the content is referenced- Specified by:
isContentReferenced
in classAbstractDeleteUDContentComponent
- Parameters:
content
- the contentlogger
- The logger- Returns:
- true if the content is referenced
-
_checkBeforeDeletion
protected boolean _checkBeforeDeletion(Content content, Map<String, String> rights, Map<String, Object> results, Logger logger) Description copied from class:AbstractDeleteUDContentComponent
Check that deletion can be performed without blocking errors- Specified by:
_checkBeforeDeletion
in classAbstractDeleteUDContentComponent
- Parameters:
content
- The initial content to deleterights
- the map of rights id with its prefixresults
- The resultslogger
- The logger- Returns:
- true if the deletion can be performed
-
_checkParentBeforeDeletion
True if the parent content is not locked- Parameters:
content
- the contentresults
- the results map- Returns:
- true if the parent content is not locked
-
_checkUsersBeforeDeletion
True if the users content is not locked- Parameters:
content
- the contentresults
- the results map- Returns:
- true if the parent content is not locked
-
_checkChildrenBeforeDeletion
protected boolean _checkChildrenBeforeDeletion(Content contentToCheck, Map<String, String> rights, Map<String, Object> results, Logger logger) Browse children to check if deletion could succeed- Parameters:
contentToCheck
- The current content to checkresults
- The resultrights
- the map of rights id with its prefixlogger
- The logger- Returns:
- true if the deletion can be processed
-
_removeRelations
Description copied from class:AbstractDeleteUDContentComponent
Remove relations- Specified by:
_removeRelations
in classAbstractDeleteUDContentComponent
- Parameters:
orgUnit
- the contentlogger
- The logger- Returns:
true
if all relations have been removed
-
_getContentIdsToDelete
protected Set<String> _getContentIdsToDelete(Content content, Map<String, String> rights, Map<String, Object> results, Logger logger) Description copied from class:AbstractDeleteUDContentComponent
Get the id of children to be deleted. All children shared with other contents which are not part of deletion, will be not deleted.- Specified by:
_getContentIdsToDelete
in classAbstractDeleteUDContentComponent
- Parameters:
content
- The content to deleterights
- the map of rights id with its prefixresults
- The resultslogger
- The logger- Returns:
- The id of contents to be deleted
-
_removeUsersRelation
Remove users relation- Parameters:
orgUnit
- the orgunit contentlogger
- The logger- Returns:
- true if relations have been removed
-