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 static final String
    Constant ASPECT_Q_NAME_ID="aspectQNameId"
    private org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,Set<org.alfresco.service.cmr.repository.NodeRef>>
     
    private org.alfresco.repo.cache.SimpleCache<AssociationCacheRegion,ChildAssocCacheEntry>
     
     
    private static final String
    Constant CRITERIA_FILTERS="criteriaFilters"
    private static final String
    Constant DATA_LIST_ITEM_TYPE="dataListItemType"
    private DataSource
     
    private static final String
    Constant DATE_RANGE="dateRange"
    private static final String
    Constant ENTITY_FILTER="entityFilter"
     
    private static final String
    Constant EXCLUDE_PROP_MAP="excludePropMap"
    private static final String
    Constant FIELD_NAME="fieldName"
    private static final String
    Constant FILTER_VALUES="filterValues"
    private static final String
    Constant FROM_RANGE="fromRange"
    private static Set<org.alfresco.service.namespace.QName>
    Constant ignoredAssocs
    private static Set<org.alfresco.service.cmr.repository.StoreRef>
    Constant ignoredStoreRefs
    private static final String
    Constant INDEX="index"
    private static final String
    Constant IS_ENTITY="isEntity"
    private static final String
    Constant LIST_TYPE_Q_NAME="listTypeQName"
    private static final org.apache.commons.logging.Log
    Constant logger
    private static final String
    Constant MAXRESULTS_PARAM="maxResults"
    private static final String
    Constant MODE="mode"
    private org.alfresco.service.namespace.NamespaceService
     
    private org.alfresco.repo.domain.node.NodeDAO
     
    private static final String
    Constant OFFSET_PARAM="offset"
    private org.alfresco.service.cmr.security.PermissionService
     
    private static final String
    Constant Q_NAME_ID="qNameId"
    private org.alfresco.repo.domain.qname.QNameDAO
     
    private org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry
     
    private org.mybatis.spring.SqlSessionTemplate
     
    private static final String
    Constant STORE_REF="storeRef"
    private org.alfresco.repo.tenant.TenantService
     
    private static final String
    Constant TO_RANGE="toRange"
    private static final String
    Constant TYPE_Q_NAME_ID="typeQNameId"
    private static final String
    Constant TYPE_Q_NAME_IDS="typeQNameIds"
    private static final String
    Constant UPDATE_ASSOC_COUNT="AssociationServiceImplV2.updateAssocCou"{trunked}

    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>
    buildCriteriaFilterMap.
    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)
    buildQueryParameters.
    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)
    dbChildAssocSearch.
    void
    doInit.
    private Object
    formatFilterValue(String fieldName, String value)
    Formats an equality filter value to match the property column type.
    private List<Object>
    formatFilterValues(String fieldName, String[] values)
    Formats equality filter values to match the property column type.
    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)
    getChildAssocsImpl.
    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)
    internalEntitySourceAssocs.
    internalEntitySourceAssocsChunk(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
    isAuditProperty.
    private boolean
    isDefaultSort.
    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 Boolean
    Parses a boolean filter value.
    private <T> List<T>
    queryItems(String template, Map<String,Object> params, Integer maxResults, Integer offset, boolean checkPermissions, Predicate<T> permissionChecker)
    queryItems.
    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)
    removeCachedAssoc.
    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.
    private boolean
    tryCreateAssociation(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef assocNodeRef, org.alfresco.service.namespace.QName qName)
    tryCreateAssociation.
    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.

    Methods inherited from class java.lang.Object

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

    • EXCLUDE_PROP_MAP

      private static final String EXCLUDE_PROP_MAP
      Constant EXCLUDE_PROP_MAP="excludePropMap"
      See Also:
    • CRITERIA_FILTERS

      private static final String CRITERIA_FILTERS
      Constant CRITERIA_FILTERS="criteriaFilters"
      See Also:
    • FILTER_VALUES

      private static final String FILTER_VALUES
      Constant FILTER_VALUES="filterValues"
      See Also:
    • FIELD_NAME

      private static final String FIELD_NAME
      Constant FIELD_NAME="fieldName"
      See Also:
    • Q_NAME_ID

      private static final String Q_NAME_ID
      Constant Q_NAME_ID="qNameId"
      See Also:
    • TO_RANGE

      private static final String TO_RANGE
      Constant TO_RANGE="toRange"
      See Also:
    • FROM_RANGE

      private static final String FROM_RANGE
      Constant FROM_RANGE="fromRange"
      See Also:
    • MODE

      private static final String MODE
      Constant MODE="mode"
      See Also:
    • ENTITY_FILTER

      private static final String ENTITY_FILTER
      Constant ENTITY_FILTER="entityFilter"
      See Also:
    • DATE_RANGE

      private static final String DATE_RANGE
      Constant DATE_RANGE="dateRange"
      See Also:
    • INDEX

      private static final String INDEX
      Constant INDEX="index"
      See Also:
    • STORE_REF

      private static final String STORE_REF
      Constant STORE_REF="storeRef"
      See Also:
    • TYPE_Q_NAME_IDS

      private static final String TYPE_Q_NAME_IDS
      Constant TYPE_Q_NAME_IDS="typeQNameIds"
      See Also:
    • LIST_TYPE_Q_NAME

      private static final String LIST_TYPE_Q_NAME
      Constant LIST_TYPE_Q_NAME="listTypeQName"
      See Also:
    • ASPECT_Q_NAME_ID

      private static final String ASPECT_Q_NAME_ID
      Constant ASPECT_Q_NAME_ID="aspectQNameId"
      See Also:
    • TYPE_Q_NAME_ID

      private static final String TYPE_Q_NAME_ID
      Constant TYPE_Q_NAME_ID="typeQNameId"
      See Also:
    • DATA_LIST_ITEM_TYPE

      private static final String DATA_LIST_ITEM_TYPE
      Constant DATA_LIST_ITEM_TYPE="dataListItemType"
      See Also:
    • IS_ENTITY

      private static final String IS_ENTITY
      Constant IS_ENTITY="isEntity"
      See Also:
    • OFFSET_PARAM

      private static final String OFFSET_PARAM
      Constant OFFSET_PARAM="offset"
      See Also:
    • MAXRESULTS_PARAM

      private static final String MAXRESULTS_PARAM
      Constant MAXRESULTS_PARAM="maxResults"
      See Also:
    • logger

      private static final org.apache.commons.logging.Log logger
      Constant 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
      Constant ignoredAssocs
    • ignoredStoreRefs

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

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

      private static final String UPDATE_ASSOC_COUNT
      Constant UPDATE_ASSOC_COUNT="AssociationServiceImplV2.updateAssocCou"{trunked}
      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
    • tryCreateAssociation

      private boolean tryCreateAssociation(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef assocNodeRef, org.alfresco.service.namespace.QName qName)

      tryCreateAssociation.

      Creates the association, tolerating the case where the cached targets say it is missing while the database already holds it. The removal side has always tolerated the mirror case, a target the cache outlived; without the same tolerance here a stale entry aborts the whole caller, which for a report association means losing the formulation that asked for it.
      Parameters:
      nodeRef - a NodeRef object
      assocNodeRef - a NodeRef object
      qName - a QName object
      Returns:
      false when the association was already there, so the cached targets cannot be trusted
    • 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)

      getChildAssocsImpl.

      Parameters:
      nodeRef - a NodeRef object
      qName - a QName object
      childType - a QName object
      sortProps - a Map object
      Returns:
      a List object
    • 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)

      isDefaultSort.

      Parameters:
      sortProps - a Map object
      Returns:
      a boolean
    • 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)

      dbChildAssocSearch.

      Parameters:
      nodeRef - a NodeRef object
      childType - a QName object
      sortProps - a Map object
      Returns:
      a List object
    • 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)

      queryItems.

      Type Parameters:
      T - a T class
      Parameters:
      template - a String object
      params - a Map object
      maxResults - a Integer object
      offset - a Integer object
      checkPermissions - a boolean
      permissionChecker - a Predicate object
      Returns:
      a List object
    • 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)

      internalEntitySourceAssocs.

      Parameters:
      nodeRefs - a List object
      assocTypeQName - a QName object
      listTypeQname - a QName object
      criteriaFilters - a List object
      pagingRequest - a PagingRequest object
      checkPermissions - a boolean
      Returns:
      a List object
    • internalEntitySourceAssocsChunk

      private List<EntitySourceAssoc> internalEntitySourceAssocsChunk(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)

      buildQueryParameters.

      Parameters:
      nodeRefs - a List object
      assocTypeQName - a QName object
      listTypeQname - a QName object
      Returns:
      a Map object
    • buildCriteriaFilterMap

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

      buildCriteriaFilterMap.

      Parameters:
      criteriaFilters - a List object
      Returns:
      a Map object
    • formatFilterValues

      private List<Object> formatFilterValues(String fieldName, String[] values)
      Formats equality filter values to match the property column type.
      Parameters:
      fieldName - the persisted field name
      values - the raw filter values
      Returns:
      the typed filter values
    • formatFilterValue

      private Object formatFilterValue(String fieldName, String value)
      Formats an equality filter value to match the property column type.
      Parameters:
      fieldName - the persisted field name
      value - the raw filter value
      Returns:
      the typed filter value
    • parseBooleanFilterValue

      private Boolean parseBooleanFilterValue(String value)
      Parses a boolean filter value.
      Parameters:
      value - the raw boolean value
      Returns:
      the parsed boolean
    • isAuditProperty

      private boolean isAuditProperty(String fieldName)

      isAuditProperty.

      Parameters:
      fieldName - a String object
      Returns:
      a boolean
    • 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)

      removeCachedAssoc.

      Parameters:
      nodeRef - a NodeRef object
      qName - a QName object
    • 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