public class DeleteOrgUnitComponent extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Field and Description |
---|---|
protected ContentWorkflowHelper |
_contentWorkflowHelper
The Content workflow helper
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected ObservationManager |
_observationManager
The observation manager
|
protected OrganisationChartPageHandler |
_oCPageHandler
The organisation chart page handler
|
private static int |
_REMOVE_REFERENCE_DEFAULT_ACTION_ID |
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected SmartContentClientSideElementHelper |
_smartHelper
Helper for smart content client elements
|
protected SolrIndexer |
_solrIndexer
The Solr indexer.
|
static String |
ROLE
The avalon role.
|
Constructor and Description |
---|
DeleteOrgUnitComponent() |
Modifier and Type | Method and Description |
---|---|
private void |
_applyChanges(WorkflowAwareContent content,
int actionId) |
protected boolean |
_canDeleteContent(Content content,
Map<String,Object> results,
Map<String,String> rights)
True if we can delete the content (check if removable, rights and if locked)
|
private boolean |
_checkChildrenBeforeDeletion(Content contentToCheck,
Map<String,Object> results,
Map<String,String> rights)
Browse children to check if deletion could succeed
|
protected boolean |
_checkParentBeforeDeletion(Content content,
Map<String,Object> results)
True if the parent content is not locked
|
protected void |
_commitAllChanges()
Commit all changes in solr
|
private void |
_finalizeDeleteContents(Set<String> contentIdsToDelete,
ModifiableAmetysObject parent,
Map<String,Object> results)
Finalize the deletion of contents.
|
protected Set<String> |
_getChildrenIdToDelete(Content orgUnit,
Map<String,Object> results,
Map<String,String> rights)
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 boolean |
_removeRelation(WorkflowAwareContent contentToEdit,
Content refContentToRemove,
String metadataName,
int actionId,
Map<String,Object> results)
Remove the relation parent-child relation on content.
|
protected boolean |
checkBeforeDeletion(Content content,
Map<String,Object> results,
Map<String,String> rights)
Check that deletion can be performed without blocking errors
|
protected void |
deleteContent(Content content,
Map<String,Object> results,
Map<String,Object> parameters,
Map<String,String> rights)
Delete one content
|
Map<String,Object> |
deleteContents(List<String> contentsId,
Map<String,Object> parameters,
Map<String,String> rights)
Delete orgUnits contents
|
protected void |
deleteOrgUnit(Content orgUnit,
Map<String,Object> results,
Map<String,String> rights)
Delete one orgUnit
|
void |
service(ServiceManager smanager) |
getLogger, setLogger
private static final int _REMOVE_REFERENCE_DEFAULT_ACTION_ID
protected OrganisationChartPageHandler _oCPageHandler
protected ContentWorkflowHelper _contentWorkflowHelper
protected SolrIndexer _solrIndexer
protected AmetysObjectResolver _resolver
protected ObservationManager _observationManager
protected CurrentUserProvider _currentUserProvider
protected SmartContentClientSideElementHelper _smartHelper
public DeleteOrgUnitComponent()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> deleteContents(List<String> contentsId, Map<String,Object> parameters, Map<String,String> rights)
contentsId
- The ids of contents to deleteparameters
- the additional parametersrights
- the map of rights id with its prefixprotected void deleteContent(Content content, Map<String,Object> results, Map<String,Object> parameters, Map<String,String> rights)
content
- the content to deleteresults
- the results maprights
- the map of rights id with its prefixparameters
- the additional parametersprotected void deleteOrgUnit(Content orgUnit, Map<String,Object> results, Map<String,String> rights)
orgUnit
- the orgUnit to deleterights
- the map of rights id with its prefixresults
- the results mapprotected Set<String> _getChildrenIdToDelete(Content orgUnit, Map<String,Object> results, Map<String,String> rights)
orgUnit
- The orgunit to deleteresults
- The resultsrights
- the map of rights id with its prefixprivate void _finalizeDeleteContents(Set<String> contentIdsToDelete, ModifiableAmetysObject parent, Map<String,Object> results)
contentIdsToDelete
- the list of content id to deleteparent
- the jcr parent for saving changesresults
- the results mapprotected boolean checkBeforeDeletion(Content content, Map<String,Object> results, Map<String,String> rights)
content
- The initial content to deleteresults
- The resultsrights
- the map of rights id with its prefixprotected boolean _canDeleteContent(Content content, Map<String,Object> results, Map<String,String> rights)
content
- the contentresults
- the results maprights
- the map of rights id with its prefixprotected boolean _checkParentBeforeDeletion(Content content, Map<String,Object> results)
content
- the contentresults
- the results mapprivate boolean _checkChildrenBeforeDeletion(Content contentToCheck, Map<String,Object> results, Map<String,String> rights)
contentToCheck
- The current content to checkresults
- The resultrights
- the map of rights id with its prefixprotected boolean _removeRelation(WorkflowAwareContent contentToEdit, Content refContentToRemove, String metadataName, int actionId, Map<String,Object> results)
contentToEdit
- The content to modifiedrefContentToRemove
- The referenced content to be removed from contentmetadataName
- The name of metadata holding the child or parent relationshipactionId
- The id of workflow action to edit the relationresults
- the results mapprivate void _applyChanges(WorkflowAwareContent content, int actionId) throws com.opensymphony.workflow.WorkflowException
com.opensymphony.workflow.WorkflowException
protected Map<String,Object> _getEventParametersForDeletion(Content content)
Event
content
- the removed contentprotected void _commitAllChanges()
protected boolean _isLocked(Content content)
content
- the content