Class OwnableServiceImpl

java.lang.Object
org.alfresco.repo.ownable.impl.OwnableServiceImpl
All Implemented Interfaces:
NodeServicePolicies.OnAddAspectPolicy, NodeServicePolicies.OnDeleteNodePolicy, NodeServicePolicies.OnRemoveAspectPolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy, OwnableService, org.springframework.beans.factory.InitializingBean

Ownership service support. Use in permissions framework as dynamic authority.
Author:
Andy Hind
  • Constructor Details

    • OwnableServiceImpl

      public OwnableServiceImpl()
  • Method Details

    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setAuthenticationService

      public void setAuthenticationService(AuthenticationService authenticationService)
    • setPolicyComponent

      public void setPolicyComponent(PolicyComponent policyComponent)
    • setTenantService

      public void setTenantService(TenantService tenantService)
    • setStoresToIgnorePolicies

      public void setStoresToIgnorePolicies(Set<String> storesToIgnorePolicies)
    • setNodeOwnerCache

      public void setNodeOwnerCache(SimpleCache<NodeRef,String> ownerCache)
      Parameters:
      ownerCache - a transactionally-safe cache of node owners
    • setRenditionService

      public void setRenditionService(RenditionService renditionService)
      Parameters:
      renditionService - the renditionService to set
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • init

      public void init()
    • getOwner

      public String getOwner(NodeRef nodeRef)
      Description copied from interface: OwnableService
      Get the username of the owner of the given object.
      Specified by:
      getOwner in interface OwnableService
      Parameters:
      nodeRef - NodeRef
      Returns:
      the username or null if the object has no owner
    • setOwner

      public void setOwner(NodeRef nodeRef, String userName)
      Description copied from interface: OwnableService
      Set the owner of the object.
      Specified by:
      setOwner in interface OwnableService
      Parameters:
      nodeRef - NodeRef
      userName - String
    • takeOwnership

      public void takeOwnership(NodeRef nodeRef)
      Description copied from interface: OwnableService
      Set the owner of the object to be the current user.
      Specified by:
      takeOwnership in interface OwnableService
      Parameters:
      nodeRef - NodeRef
    • hasOwner

      public boolean hasOwner(NodeRef nodeRef)
      Description copied from interface: OwnableService
      Does the given node have an owner?
      Specified by:
      hasOwner in interface OwnableService
      Parameters:
      nodeRef - NodeRef
      Returns:
      boolean
    • onAddAspect

      public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName)
      Description copied from interface: NodeServicePolicies.OnAddAspectPolicy
      Called after an aspect has been added to a node
      Specified by:
      onAddAspect in interface NodeServicePolicies.OnAddAspectPolicy
      Parameters:
      nodeRef - the node to which the aspect was added
      aspectTypeQName - the type of the aspect
    • onRemoveAspect

      public void onRemoveAspect(NodeRef nodeRef, QName aspectTypeQName)
      Description copied from interface: NodeServicePolicies.OnRemoveAspectPolicy
      Called after an aspect has been removed from a node
      Specified by:
      onRemoveAspect in interface NodeServicePolicies.OnRemoveAspectPolicy
      Parameters:
      nodeRef - the node from which the aspect will be removed
      aspectTypeQName - the type of the aspect
    • onDeleteNode

      public void onDeleteNode(ChildAssociationRef childAssocRef, boolean isNodeArchived)
      Description copied from interface: NodeServicePolicies.OnDeleteNodePolicy
      Called after a node is deleted. The reference given is for an association which has been deleted and cannot be used to retrieve node or associaton information from any of the services.
      Specified by:
      onDeleteNode in interface NodeServicePolicies.OnDeleteNodePolicy
      Parameters:
      childAssocRef - the primary parent-child association of the deleted node
      isNodeArchived - indicates whether the node has been archived rather than purged
    • onUpdateProperties

      public void onUpdateProperties(NodeRef nodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)
      Description copied from interface: NodeServicePolicies.OnUpdatePropertiesPolicy
      Called after a node's properties have been changed.
      Specified by:
      onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
      Parameters:
      nodeRef - reference to the updated node
      before - the node's properties before the change
      after - the node's properties after the change
    • onCopyNode

      public CopyBehaviourCallback onCopyNode(QName classRef, CopyDetails copyDetails)
      When an owned or audited node is copied, control which properties go over, and which are re-created