public class OwnableServiceImpl extends Object implements OwnableService, org.springframework.beans.factory.InitializingBean, NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy
Policy.Arg
NO_OWNER
QNAME
ARG_0, ARG_1, ARG_2, QNAME
QNAME
QNAME
Constructor and Description |
---|
OwnableServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
String |
getOwner(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get the username of the owner of the given object.
|
boolean |
hasOwner(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Does the given node have an owner?
|
void |
init() |
void |
onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Called after an aspect has been added to a node
|
CopyBehaviourCallback |
onCopyNode(org.alfresco.service.namespace.QName classRef,
CopyDetails copyDetails)
When an owned or audited node is copied, control which properties
go over, and which are re-created
|
void |
onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef,
boolean isNodeArchived)
Called after a node is deleted.
|
void |
onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
org.alfresco.service.namespace.QName aspectTypeQName)
Called after an aspect has been removed from a node
|
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
Called after a node's properties have been changed.
|
void |
setAuthenticationService(AuthenticationService authenticationService) |
void |
setNodeOwnerCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.service.cmr.repository.NodeRef,String> ownerCache) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setOwner(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String userName)
Set the owner of the object.
|
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setRenditionService(RenditionService renditionService) |
void |
setStoresToIgnorePolicies(Set<String> storesToIgnorePolicies) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
takeOwnership(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Set the owner of the object to be the current user.
|
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setAuthenticationService(AuthenticationService authenticationService)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setNodeOwnerCache(org.alfresco.repo.cache.SimpleCache<org.alfresco.service.cmr.repository.NodeRef,String> ownerCache)
ownerCache
- a transactionally-safe cache of node ownerspublic void setRenditionService(RenditionService renditionService)
renditionService
- the renditionService to setpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void init()
public String getOwner(org.alfresco.service.cmr.repository.NodeRef nodeRef)
OwnableService
getOwner
in interface OwnableService
nodeRef
- NodeRefpublic void setOwner(org.alfresco.service.cmr.repository.NodeRef nodeRef, String userName)
OwnableService
setOwner
in interface OwnableService
nodeRef
- NodeRefuserName
- Stringpublic void takeOwnership(org.alfresco.service.cmr.repository.NodeRef nodeRef)
OwnableService
takeOwnership
in interface OwnableService
nodeRef
- NodeRefpublic boolean hasOwner(org.alfresco.service.cmr.repository.NodeRef nodeRef)
OwnableService
hasOwner
in interface OwnableService
nodeRef
- NodeRefpublic void onAddAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
NodeServicePolicies.OnAddAspectPolicy
onAddAspect
in interface NodeServicePolicies.OnAddAspectPolicy
nodeRef
- the node to which the aspect was addedaspectTypeQName
- the type of the aspectpublic void onRemoveAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName aspectTypeQName)
NodeServicePolicies.OnRemoveAspectPolicy
onRemoveAspect
in interface NodeServicePolicies.OnRemoveAspectPolicy
nodeRef
- the node from which the aspect will be removedaspectTypeQName
- the type of the aspectpublic void onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef, boolean isNodeArchived)
NodeServicePolicies.OnDeleteNodePolicy
onDeleteNode
in interface NodeServicePolicies.OnDeleteNodePolicy
childAssocRef
- the primary parent-child association of the deleted nodeisNodeArchived
- indicates whether the node has been archived rather than purgedpublic void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
NodeServicePolicies.OnUpdatePropertiesPolicy
onUpdateProperties
in interface NodeServicePolicies.OnUpdatePropertiesPolicy
nodeRef
- reference to the updated nodebefore
- the node's properties before the changeafter
- the node's properties after the changepublic CopyBehaviourCallback onCopyNode(org.alfresco.service.namespace.QName classRef, CopyDetails copyDetails)
Copyright © 2005–2017 Alfresco Software. All rights reserved.