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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
AbstractDeleteUDContentComponent.DeletionInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHelperThe content helperprotected ContentWorkflowHelperThe content workflow helperprotected ExternalizableDataProviderExtensionPointThe external data provider extension pointprotected I18nUtilsThe i18n utilsprotected OrganisationChartPageHandlerThe organisation chart page handlerstatic final StringThe avalon role.static final StringConstant for storing the scc identifier into the parameters mapFields inherited from class org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
_currentUserProvider, _observationManager, _removeReferenceActionId, _resolver, _smartHelper, _solrIndexHelper, _trashElementDAO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_checkBeforeDeletion(Content content, Map<String, String> rights, Map<String, Object> results, org.slf4j.Logger logger) Check that deletion can be performed without blocking errorsprotected boolean_checkChildrenBeforeDeletion(Content contentToCheck, Map<String, String> rights, Map<String, Object> results, org.slf4j.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 lockedprotected Set<AbstractDeleteUDContentComponent.DeletionInfo> _getContentIdsToDelete(Content content, Map<String, Object> parameters, Map<String, String> rights, boolean hidden, Map<String, Object> results, org.slf4j.Logger logger) Get the id of children to be deleted.protected boolean_removeRelations(Content orgUnit, Map<String, Object> parameters, org.slf4j.Logger logger) Remove relationsprotected boolean_removeUsersRelation(Content orgUnit, Map<String, Object> parameters, org.slf4j.Logger logger) Remove users relationbooleanisContentReferenced(Content content, org.slf4j.Logger logger) True if the content is referencedvoidservice(ServiceManager smanager) Methods inherited from class org.ametys.plugins.userdirectory.AbstractDeleteUDContentComponent
_canDeleteContent, _deleteContent, _finalizeDeleteContents, _getEventParametersForDeletion, _hasRight, _isLocked, _processContentDeletion, configure, deleteContents, deleteContentsWithLog, trashContents, trashContentsWithLog
-
Field Details
-
ROLE
The avalon role. -
SCC_ID_PARAMETERS_KEY
Constant for storing the scc identifier into the parameters map- See Also:
-
_oCPageHandler
The organisation chart page handler -
_contentHelper
The content helper -
_i18nUtils
The i18n utils -
_contentWorkflowHelper
The content workflow helper -
_externalizableDataProviderExtensionPoint
The external data provider extension point
-
-
Constructor Details
-
DeleteOrgUnitComponent
public DeleteOrgUnitComponent()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractDeleteUDContentComponent- Throws:
ServiceException
-
isContentReferenced
Description copied from class:AbstractDeleteUDContentComponentTrue if the content is referenced- Specified by:
isContentReferencedin 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, org.slf4j.Logger logger) Description copied from class:AbstractDeleteUDContentComponentCheck that deletion can be performed without blocking errors- Specified by:
_checkBeforeDeletionin 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, org.slf4j.Logger logger) Browse children to check if deletion could succeed- Parameters:
contentToCheck- The current content to checkrights- the map of rights id with its prefixresults- The resultlogger- The logger- Returns:
- true if the deletion can be processed
-
_removeRelations
protected boolean _removeRelations(Content orgUnit, Map<String, Object> parameters, org.slf4j.Logger logger) Description copied from class:AbstractDeleteUDContentComponentRemove relations- Specified by:
_removeRelationsin classAbstractDeleteUDContentComponent- Parameters:
orgUnit- the contentparameters- the additional parameterslogger- The logger- Returns:
trueif all relations have been removed
-
_getContentIdsToDelete
protected Set<AbstractDeleteUDContentComponent.DeletionInfo> _getContentIdsToDelete(Content content, Map<String, Object> parameters, Map<String, String> rights, boolean hidden, Map<String, Object> results, org.slf4j.Logger logger) Description copied from class:AbstractDeleteUDContentComponentGet 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:
_getContentIdsToDeletein classAbstractDeleteUDContentComponent- Parameters:
content- The content to deleteparameters- the additional parametersrights- the map of rights id with its prefixhidden- to hide the trash elementresults- The resultslogger- The logger- Returns:
- The id of contents to be deleted
-
_removeUsersRelation
protected boolean _removeUsersRelation(Content orgUnit, Map<String, Object> parameters, org.slf4j.Logger logger) Remove users relation- Parameters:
orgUnit- the orgunit contentparameters- the additional parameterslogger- The logger- Returns:
- true if relations have been removed
-