Class AssociationServiceImplV2

java.lang.Object
fr.becpg.repo.policy.AbstractBeCPGPolicy
fr.becpg.repo.helper.impl.AssociationServiceImplV2
All Implemented Interfaces:
AssociationService, org.alfresco.repo.cache.RefreshableCacheListener, org.alfresco.repo.coci.CheckOutCheckInServicePolicies.OnCheckIn, org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy, org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy, org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy, org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy, org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy, org.alfresco.repo.policy.AssociationPolicy, org.alfresco.repo.policy.ClassPolicy, org.alfresco.repo.policy.Policy, org.alfresco.util.cache.RefreshableCacheListener, org.springframework.beans.factory.InitializingBean

public class AssociationServiceImplV2 extends AbstractBeCPGPolicy implements AssociationService, org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy, org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy, org.alfresco.repo.coci.CheckOutCheckInServicePolicies.OnCheckIn, org.alfresco.repo.cache.RefreshableCacheListener, org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy, org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy, org.springframework.beans.factory.InitializingBean

AssociationServiceImpl class.

Version:
$Id: $Id
Author:
matthieu
  • Nested Class Summary

    Nested classes/interfaces inherited from class fr.becpg.repo.policy.AbstractBeCPGPolicy

    AbstractBeCPGPolicy.BeCPGPolicyTransactionListener

    Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy

    org.alfresco.repo.policy.Policy.Arg
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,Set<org.alfresco.service.cmr.repository.NodeRef>>
     
    private org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,ChildAssocCacheEntry>
     
     
    private DataSource
     
     
    private static Set<org.alfresco.service.namespace.QName>
     
    private static Set<org.alfresco.service.cmr.repository.StoreRef>
     
    private static final org.apache.commons.logging.Log
     
    private static final String
     
    private org.alfresco.service.namespace.NamespaceService
     
    private org.alfresco.repo.domain.node.NodeDAO
     
    private static final String
     
    private org.alfresco.service.cmr.security.PermissionService
     
    private org.alfresco.repo.domain.qname.QNameDAO
     
    private org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry
     
    private org.mybatis.spring.SqlSessionTemplate
     
    private org.alfresco.repo.tenant.TenantService
     
    private static final String
     

    Fields inherited from interface org.alfresco.repo.coci.CheckOutCheckInServicePolicies.OnCheckIn

    QNAME

    Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyNodePolicy

    ARG_0, ARG_1, QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy

    QNAME

    Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy

    ARG_0, ARG_1, ARG_2, QNAME

    Fields inherited from interface org.alfresco.repo.policy.Policy

    NAMESPACE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    private Map<String,Object>
     
    private Map<String,Object>
    buildQueryParameters(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName listTypeQname)
     
    protected boolean
    canCurrentUserRead(Long aclId, Set<String> authorities)
    Checks if the current user has read permissions for the given ACL ID.
    private List<org.alfresco.service.cmr.repository.NodeRef>
    dbChildAssocSearch(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName childType, Map<String,Boolean> sortProps)
     
    void
    doInit.
    org.alfresco.service.cmr.repository.NodeRef
    getChildAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Retrieves the child association for a given node with the specified association type.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getChildAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Retrieves the child associations for a given node with the specified association type.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getChildAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.QName childTypeQName)
    Retrieves the child associations for a given node with the specified association type and child type.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getChildAssocs(org.alfresco.service.cmr.repository.NodeRef listNodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.QName childTypeQName, Map<String,Boolean> sortMap)
    Retrieves the child associations for a given list node with the specified association type and list type.
    getChildAssocsByType(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Retrieves the child associations by type for a given node with the specified association type.
    private List<org.alfresco.service.cmr.repository.NodeRef>
    getChildAssocsImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.QName childType, Map<String,Boolean> sortProps)
     
    getEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.namespace.QName listTypeQname, boolean isOrOperator, List<AssociationCriteriaFilter> criteriaFilters)
    Retrieves entity source associations with filtering and pagination.
    getEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.namespace.QName listTypeQname, boolean isOrOperator, List<AssociationCriteriaFilter> criteriaFilters, org.alfresco.query.PagingRequest pagingRequest)
    Retrieves entity source associations with filtering, pagination, and permission checking.
    getEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName listTypeQname, boolean isOrOperator, List<AssociationCriteriaFilter> criteriaFilters, org.alfresco.query.PagingRequest pagingRequest, boolean checkPermissions)
    Retrieves entity source associations with filtering, pagination, and permission checking.
    <T> T
    getFromCache(org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,T> cache, AssociationCacheRegion cacheKey, Supplier<T> callback)
    getFromCache.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef)
    Retrieves the source associations for a given node.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Retrieves the source associations for a given node with the specified association type.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, Boolean includeVersions)
    Retrieves the source associations for a given node with the specified association type and versioning options.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, Boolean includeVersions, Integer maxResults, Integer offset)
    Retrieves the source associations for a given node with the specified association type, versioning options, and pagination.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, Boolean includeVersions, Integer maxResults, Integer offset, boolean checkPermissions)
    Retrieves the source associations for a given node with the specified association type, versioning options, pagination, and permission checking.
    org.alfresco.service.cmr.repository.NodeRef
    getTargetAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Retrieves the target association for a given node with the specified association type.
    List<org.alfresco.service.cmr.repository.NodeRef>
    getTargetAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Retrieves the target associations for a given node with the specified association type.
    internalEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName listTypeQname, List<AssociationCriteriaFilter> criteriaFilters, org.alfresco.query.PagingRequest pagingRequest, boolean checkPermissions)
     
    private boolean
     
    void
    onCheckIn(org.alfresco.service.cmr.repository.NodeRef nodeRef)
    void
    onCopyComplete(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destinationRef, boolean copyToNewNode, Map<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef> copyMap)
    void
    onCreateAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)
    void
    onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef, boolean arg1)
    void
    onDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)
    void
    onDeleteChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef)
    void
    onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef, boolean arg1)
    void
    onRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent)
    void
    onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef)
    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)
    private <T> List<T>
    queryItems(String template, Map<String,Object> params, Integer maxResults, Integer offset, boolean checkPermissions, Predicate<T> permissionChecker)
     
    void
    removeAllCacheAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef)
    Removes all cached associations for a given node.
    private void
    removeCachedAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
     
    void
    removeChildCachedAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    Removes the child cached association for a given node with the specified association type.
    void
    setAssocsCache(org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,Set<org.alfresco.service.cmr.repository.NodeRef>> assocsCache)
    Setter for the field assocsCache.
    void
    setChildsAssocsCache(org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,ChildAssocCacheEntry> childsAssocsCache)
    Setter for the field childsAssocsCache.
    void
    Setter for the field dataSource.
    void
    Setter for the field entityDictionaryService.
    void
    setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
    Setter for the field namespaceService.
    void
    setNodeDAO(org.alfresco.repo.domain.node.NodeDAO nodeDAO)
    Setter for the field nodeDAO.
    void
    setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
    Setter for the field nodeService.
    void
    setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
    Setter for the field permissionService.
    void
    setQnameDAO(org.alfresco.repo.domain.qname.QNameDAO qnameDAO)
    Setter for the field qnameDAO.
    void
    setRegistry(org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry)
    Setter for the field registry.
    void
    setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
    Setter for the field sqlSessionTemplate.
    void
    setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
    Setter for the field tenantService.
    void
    update(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, List<org.alfresco.service.cmr.repository.NodeRef> toUpdateNodeRefs)
    Updates the associations for a given node with the specified association type.
    void
    update(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.cmr.repository.NodeRef assocNodeRef)
    Updates the associations for a given node with the specified association type.
    private String
    wrap(String fieldName, String value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      private static final org.apache.commons.logging.Log logger
    • entityDictionaryService

      private EntityDictionaryService entityDictionaryService
    • dataSource

      private DataSource dataSource
    • tenantService

      private org.alfresco.repo.tenant.TenantService tenantService
    • namespaceService

      private org.alfresco.service.namespace.NamespaceService namespaceService
    • commonDataListSort

      private CommonDataListSort commonDataListSort
    • sqlSessionTemplate

      private org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate
    • permissionService

      private org.alfresco.service.cmr.security.PermissionService permissionService
    • nodeDAO

      private org.alfresco.repo.domain.node.NodeDAO nodeDAO
    • childsAssocsCache

      private org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,ChildAssocCacheEntry> childsAssocsCache
    • assocsCache

      private org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,Set<org.alfresco.service.cmr.repository.NodeRef>> assocsCache
    • registry

      private org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry
    • ignoredAssocs

      private static Set<org.alfresco.service.namespace.QName> ignoredAssocs
    • ignoredStoreRefs

      private static Set<org.alfresco.service.cmr.repository.StoreRef> ignoredStoreRefs
    • qnameDAO

      private org.alfresco.repo.domain.qname.QNameDAO qnameDAO
    • UPDATE_ASSOC_COUNT

      private static final String UPDATE_ASSOC_COUNT
      See Also:
    • OFFSET_PARAM

      private static final String OFFSET_PARAM
      See Also:
    • MAXRESULTS_PARAM

      private static final String MAXRESULTS_PARAM
      See Also:
  • Constructor Details

    • AssociationServiceImplV2

      public AssociationServiceImplV2()
  • Method Details

    • setNodeDAO

      public void setNodeDAO(org.alfresco.repo.domain.node.NodeDAO nodeDAO)

      Setter for the field nodeDAO.

      Parameters:
      nodeDAO - a NodeDAO object
    • setPermissionService

      public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)

      Setter for the field permissionService.

      Parameters:
      permissionService - a PermissionService object
    • setSqlSessionTemplate

      public void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)

      Setter for the field sqlSessionTemplate.

      Parameters:
      sqlSessionTemplate - a SqlSessionTemplate object
    • setRegistry

      public void setRegistry(org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry)

      Setter for the field registry.

      Parameters:
      registry - a AsynchronouslyRefreshedCacheRegistry object
    • setNodeService

      public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)

      Setter for the field nodeService.

      Overrides:
      setNodeService in class AbstractBeCPGPolicy
      Parameters:
      nodeService - a NodeService object.
    • setEntityDictionaryService

      public void setEntityDictionaryService(EntityDictionaryService entityDictionaryService)

      Setter for the field entityDictionaryService.

      Parameters:
      entityDictionaryService - a EntityDictionaryService object.
    • setDataSource

      public void setDataSource(DataSource dataSource)

      Setter for the field dataSource.

      Parameters:
      dataSource - a DataSource object.
    • setTenantService

      public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)

      Setter for the field tenantService.

      Parameters:
      tenantService - a TenantService object.
    • setNamespaceService

      public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)

      Setter for the field namespaceService.

      Parameters:
      namespaceService - a NamespaceService object.
    • setQnameDAO

      public void setQnameDAO(org.alfresco.repo.domain.qname.QNameDAO qnameDAO)

      Setter for the field qnameDAO.

      Parameters:
      qnameDAO - a QNameDAO object.
    • setChildsAssocsCache

      public void setChildsAssocsCache(org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,ChildAssocCacheEntry> childsAssocsCache)

      Setter for the field childsAssocsCache.

      Parameters:
      childsAssocsCache - a SimpleCache object
    • setAssocsCache

      public void setAssocsCache(org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,Set<org.alfresco.service.cmr.repository.NodeRef>> assocsCache)

      Setter for the field assocsCache.

      Parameters:
      assocsCache - a SimpleCache object
    • update

      public void update(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, List<org.alfresco.service.cmr.repository.NodeRef> toUpdateNodeRefs)
      Updates the associations for a given node with the specified association type.
      Specified by:
      update in interface AssociationService
      Parameters:
      nodeRef - the node reference to update associations for
      qName - the association type QName
      toUpdateNodeRefs - the list of node references to associate with the node
    • update

      public void update(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.cmr.repository.NodeRef assocNodeRef)
      Updates the associations for a given node with the specified association type.
      Specified by:
      update in interface AssociationService
      Parameters:
      nodeRef - the node reference to update associations for
      qName - the association type QName
      assocNodeRef - the node reference to associate with the node
    • getTargetAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getTargetAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Retrieves the target associations for a given node with the specified association type.
      Specified by:
      getTargetAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the target associations for
      qName - the association type QName
      Returns:
      the list of target association node references
    • getTargetAssoc

      public org.alfresco.service.cmr.repository.NodeRef getTargetAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Retrieves the target association for a given node with the specified association type.
      Specified by:
      getTargetAssoc in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the target association for
      qName - the association type QName
      Returns:
      the target association node reference
    • getChildAssoc

      public org.alfresco.service.cmr.repository.NodeRef getChildAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Retrieves the child association for a given node with the specified association type.
      Specified by:
      getChildAssoc in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the child association for
      qName - the association type QName
      Returns:
      the child association node reference
    • getChildAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getChildAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Retrieves the child associations for a given node with the specified association type.
      Specified by:
      getChildAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the child associations for
      qName - the association type QName
      Returns:
      the list of child association node references
    • getChildAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getChildAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.QName childTypeQName)
      Retrieves the child associations for a given node with the specified association type and child type.
      Specified by:
      getChildAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the child associations for
      qName - the association type QName
      childTypeQName - the child type QName
      Returns:
      the list of child association node references
    • getChildAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getChildAssocs(org.alfresco.service.cmr.repository.NodeRef listNodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.QName childTypeQName, @Nullable Map<String,Boolean> sortMap)
      Retrieves the child associations for a given list node with the specified association type and list type.
      Specified by:
      getChildAssocs in interface AssociationService
      Parameters:
      listNodeRef - the list node reference to retrieve the child associations for
      qName - the association type QName
      childTypeQName - the list type QName filter
      sortMap - the sort map
      Returns:
      the list of child association node references
    • getChildAssocsImpl

      @Nonnull private List<org.alfresco.service.cmr.repository.NodeRef> getChildAssocsImpl(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, org.alfresco.service.namespace.QName childType, Map<String,Boolean> sortProps)
    • getChildAssocsByType

      public ChildAssocCacheEntry getChildAssocsByType(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Retrieves the child associations by type for a given node with the specified association type.
      Specified by:
      getChildAssocsByType in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the child associations by type for
      qName - the association type QName
      Returns:
      the child association cache entry
    • isDefaultSort

      private boolean isDefaultSort(Map<String,Boolean> sortProps)
    • dbChildAssocSearch

      private List<org.alfresco.service.cmr.repository.NodeRef> dbChildAssocSearch(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName childType, Map<String,Boolean> sortProps)
    • getSourcesAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Retrieves the source associations for a given node.
      Specified by:
      getSourcesAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the source associations for
      Returns:
      the list of source association node references
    • getSourcesAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Retrieves the source associations for a given node with the specified association type.
      Specified by:
      getSourcesAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the source associations for
      qName - the association type QName pattern
      Returns:
      the list of source association node references
    • getSourcesAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, Boolean includeVersions)
      Retrieves the source associations for a given node with the specified association type and versioning options.
      Specified by:
      getSourcesAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the source associations for
      qName - the association type QName pattern
      includeVersions - whether to include versioned associations
      Returns:
      the list of source association node references
    • getSourcesAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, Boolean includeVersions, Integer maxResults, Integer offset)
      Retrieves the source associations for a given node with the specified association type, versioning options, and pagination.
      Specified by:
      getSourcesAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the source associations for
      qName - the association type QName pattern
      includeVersions - whether to include versioned associations
      maxResults - the maximum number of results to return
      offset - the offset for pagination
      Returns:
      the list of source association node references
    • getSourcesAssocs

      public List<org.alfresco.service.cmr.repository.NodeRef> getSourcesAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName, Boolean includeVersions, Integer maxResults, Integer offset, boolean checkPermissions)
      Retrieves the source associations for a given node with the specified association type, versioning options, pagination, and permission checking.
      Specified by:
      getSourcesAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to retrieve the source associations for
      qName - the association type QName
      includeVersions - whether to include versioned associations
      maxResults - the maximum number of results to return
      offset - the offset for pagination
      checkPermissions - whether to check permissions
      Returns:
      the list of source association node references
    • queryItems

      private <T> List<T> queryItems(String template, Map<String,Object> params, Integer maxResults, Integer offset, boolean checkPermissions, Predicate<T> permissionChecker)
    • canCurrentUserRead

      protected boolean canCurrentUserRead(Long aclId, Set<String> authorities)
      Checks if the current user has read permissions for the given ACL ID.
      Parameters:
      aclId - the ACL ID to check
      authorities - the user's authorities
      Returns:
      true if the user can read, false otherwise
    • getEntitySourceAssocs

      public List<EntitySourceAssoc> getEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.namespace.QName listTypeQname, boolean isOrOperator, List<AssociationCriteriaFilter> criteriaFilters)
      Retrieves entity source associations with filtering and pagination.
      Specified by:
      getEntitySourceAssocs in interface AssociationService
      Parameters:
      nodeRefs - the node references to check
      assocQName - the association type QName
      listTypeQname - the list type QName
      isOrOperator - whether to use OR operator for filtering
      criteriaFilters - the criteria filters to apply
      Returns:
      the list of entity source associations
    • getEntitySourceAssocs

      public List<EntitySourceAssoc> getEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.namespace.QName listTypeQname, boolean isOrOperator, List<AssociationCriteriaFilter> criteriaFilters, org.alfresco.query.PagingRequest pagingRequest)
      Retrieves entity source associations with filtering, pagination, and permission checking.
      Specified by:
      getEntitySourceAssocs in interface AssociationService
      Parameters:
      nodeRefs - the node references to check
      assocQName - the association type QName
      listTypeQname - the list type QName
      isOrOperator - whether to use OR operator for filtering
      criteriaFilters - the criteria filters to apply
      pagingRequest - the pagination request
      Returns:
      the list of entity source associations
    • getEntitySourceAssocs

      public List<EntitySourceAssoc> getEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName listTypeQname, boolean isOrOperator, List<AssociationCriteriaFilter> criteriaFilters, org.alfresco.query.PagingRequest pagingRequest, boolean checkPermissions)
      Retrieves entity source associations with filtering, pagination, and permission checking.
      Specified by:
      getEntitySourceAssocs in interface AssociationService
      Parameters:
      nodeRefs - the node references to check
      assocTypeQName - the association type QName
      listTypeQname - the list type QName
      isOrOperator - whether to use OR operator for filtering
      criteriaFilters - the criteria filters to apply
      pagingRequest - the pagination request
      checkPermissions - whether to check permissions
      Returns:
      the list of entity source associations
    • internalEntitySourceAssocs

      private List<EntitySourceAssoc> internalEntitySourceAssocs(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName listTypeQname, List<AssociationCriteriaFilter> criteriaFilters, org.alfresco.query.PagingRequest pagingRequest, boolean checkPermissions)
    • buildQueryParameters

      private Map<String,Object> buildQueryParameters(List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName listTypeQname)
    • buildCriteriaFilterMap

      private Map<String,Object> buildCriteriaFilterMap(List<AssociationCriteriaFilter> criteriaFilters)
    • wrap

      private String wrap(String fieldName, String value)
    • doInit

      public void doInit()

      doInit.

      Specified by:
      doInit in class AbstractBeCPGPolicy
    • onCopyComplete

      public void onCopyComplete(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef destinationRef, boolean copyToNewNode, Map<org.alfresco.service.cmr.repository.NodeRef,org.alfresco.service.cmr.repository.NodeRef> copyMap)
      Specified by:
      onCopyComplete in interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy
      Overrides:
      onCopyComplete in class AbstractBeCPGPolicy
    • onDeleteAssociation

      public void onDeleteAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)
      Specified by:
      onDeleteAssociation in interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteAssociationPolicy
    • onCreateAssociation

      public void onCreateAssociation(org.alfresco.service.cmr.repository.AssociationRef associationRef)
      Specified by:
      onCreateAssociation in interface org.alfresco.repo.node.NodeServicePolicies.OnCreateAssociationPolicy
    • onRestoreNode

      public void onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef)
      Specified by:
      onRestoreNode in interface org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy
    • onDeleteChildAssociation

      public void onDeleteChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef)
      Specified by:
      onDeleteChildAssociation in interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteChildAssociationPolicy
    • onCreateChildAssociation

      public void onCreateChildAssociation(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef, boolean arg1)
      Specified by:
      onCreateChildAssociation in interface org.alfresco.repo.node.NodeServicePolicies.OnCreateChildAssociationPolicy
    • onDeleteNode

      public void onDeleteNode(org.alfresco.service.cmr.repository.ChildAssociationRef associationRef, boolean arg1)
      Specified by:
      onDeleteNode in interface org.alfresco.repo.node.NodeServicePolicies.OnDeleteNodePolicy
    • onCheckIn

      public void onCheckIn(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Specified by:
      onCheckIn in interface org.alfresco.repo.coci.CheckOutCheckInServicePolicies.OnCheckIn
    • onUpdateProperties

      public 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)
      Specified by:
      onUpdateProperties in interface org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy
    • removeCachedAssoc

      private void removeCachedAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
    • removeChildCachedAssoc

      public void removeChildCachedAssoc(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName qName)
      Removes the child cached association for a given node with the specified association type.
      Specified by:
      removeChildCachedAssoc in interface AssociationService
      Parameters:
      nodeRef - the node reference to remove the child cached association for
      qName - the association type QName
    • removeAllCacheAssocs

      public void removeAllCacheAssocs(org.alfresco.service.cmr.repository.NodeRef nodeRef)
      Removes all cached associations for a given node.
      Specified by:
      removeAllCacheAssocs in interface AssociationService
      Parameters:
      nodeRef - the node reference to remove all cached associations for
    • getFromCache

      public <T> T getFromCache(org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,T> cache, AssociationCacheRegion cacheKey, Supplier<T> callback)

      getFromCache.

      Type Parameters:
      T - a T class
      Parameters:
      cache - a SimpleCache object
      cacheKey - a AssociationCacheRegion object
      callback - a Supplier object
      Returns:
      a T object
    • onRefreshableCacheEvent

      public void onRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent)
      Specified by:
      onRefreshableCacheEvent in interface org.alfresco.util.cache.RefreshableCacheListener
    • getCacheId

      public String getCacheId()
      Specified by:
      getCacheId in interface org.alfresco.util.cache.RefreshableCacheListener
    • afterPropertiesSet

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