Class RepositoryEntityDefReaderImpl<T>

java.lang.Object
fr.becpg.repo.repository.impl.RepositoryEntityDefReaderImpl<T>
All Implemented Interfaces:
RepositoryEntityDefReader<T>, EventListener, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>

@Repository("repositoryEntityDefReader") public class RepositoryEntityDefReaderImpl<T> extends Object implements RepositoryEntityDefReader<T>, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>

RepositoryEntityDefReaderImpl class.

Version:
$Id: $Id
Author:
matthieu
  • Field Details

    • logger

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

      @Autowired private org.alfresco.service.namespace.NamespaceService namespaceService
    • domainMapping

      private final Map<org.alfresco.service.namespace.QName,Class<T>> domainMapping
    • qnameCache

      private final Map<String,org.alfresco.service.namespace.QName> qnameCache
  • Constructor Details

    • RepositoryEntityDefReaderImpl

      public RepositoryEntityDefReaderImpl()
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent refreshEvent)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<T>
    • isRegisteredQName

      public boolean isRegisteredQName(RepositoryEntity entity, org.alfresco.service.namespace.QName qname, boolean allowWrite)

      isRegisteredQName.

      Specified by:
      isRegisteredQName in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a RepositoryEntity object
      qname - a QName object
      allowWrite - a boolean
      Returns:
      a boolean
    • registerEntity

      private void registerEntity(Class<T> clazz)
    • getEntityProperties

      public Map<org.alfresco.service.namespace.QName,T> getEntityProperties(T entity)

      getEntityProperties.

      Specified by:
      getEntityProperties in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getProperties

      public Map<org.alfresco.service.namespace.QName,Serializable> getProperties(T entity)

      getProperties.

      Specified by:
      getProperties in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getSingleAssociations

      public Map<org.alfresco.service.namespace.QName,org.alfresco.service.cmr.repository.NodeRef> getSingleAssociations(T entity)

      getSingleAssociations.

      Specified by:
      getSingleAssociations in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getSingleEntityAssociations

      public Map<org.alfresco.service.namespace.QName,T> getSingleEntityAssociations(T entity)

      getSingleEntityAssociations.

      Specified by:
      getSingleEntityAssociations in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getMultipleAssociations

      public Map<org.alfresco.service.namespace.QName,List<org.alfresco.service.cmr.repository.NodeRef>> getMultipleAssociations(T entity)

      getMultipleAssociations.

      Specified by:
      getMultipleAssociations in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getDataLists

      public <R> Map<org.alfresco.service.namespace.QName,List<? extends RepositoryEntity>> getDataLists(R entity)

      getDataLists.

      Specified by:
      getDataLists in interface RepositoryEntityDefReader<T>
      Type Parameters:
      R - a R object.
      Parameters:
      entity - a R object.
      Returns:
      a Map object.
    • getDataListViews

      public Map<org.alfresco.service.namespace.QName,T> getDataListViews(T entity)

      getDataListViews.

      Specified by:
      getDataListViews in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getIdentifierAttributes

      public Map<org.alfresco.service.namespace.QName,Serializable> getIdentifierAttributes(T entity)

      getIdentifierAttributes.

      Specified by:
      getIdentifierAttributes in interface RepositoryEntityDefReader<T>
      Parameters:
      entity - a T object.
      Returns:
      a Map object.
    • getType

      public org.alfresco.service.namespace.QName getType(Class<? extends RepositoryEntity> clazz)

      getType.

      Specified by:
      getType in interface RepositoryEntityDefReader<T>
      Parameters:
      clazz - a Class object.
      Returns:
      a QName object.
    • readQName

      public org.alfresco.service.namespace.QName readQName(Method readMethod)

      readQName.

      Specified by:
      readQName in interface RepositoryEntityDefReader<T>
      Parameters:
      readMethod - a Method object.
      Returns:
      a QName object.
    • readValueMap

      private <R, Z> Map<org.alfresco.service.namespace.QName,R> readValueMap(Z entity, Class<? extends Annotation> annotationClass, Class<?> returnType)
    • evaluateObject

      private Object evaluateObject(Class<?> propertyType, Object o)
    • getEntityClass

      public Class<T> getEntityClass(org.alfresco.service.namespace.QName type)

      getEntityClass.

      Specified by:
      getEntityClass in interface RepositoryEntityDefReader<T>
      Parameters:
      type - a QName object.
      Returns:
      a Class object.
    • getDefaultPivoAssocName

      public org.alfresco.service.namespace.QName getDefaultPivoAssocName(org.alfresco.service.namespace.QName entityDataListQname)

      getDefaultPivoAssocName.

      Specified by:
      getDefaultPivoAssocName in interface RepositoryEntityDefReader<T>
      Parameters:
      entityDataListQname - a QName object.
      Returns:
      a QName object.
    • isMultiLevelDataList

      public boolean isMultiLevelDataList(org.alfresco.service.namespace.QName dataListItemType)

      isMultiLevelDataList.

      Specified by:
      isMultiLevelDataList in interface RepositoryEntityDefReader<T>
      Parameters:
      dataListItemType - a QName object.
      Returns:
      a boolean.
    • isMultiLevelLeaf

      public boolean isMultiLevelLeaf(org.alfresco.service.namespace.QName entityType)

      isMultiLevelLeaf.

      Specified by:
      isMultiLevelLeaf in interface RepositoryEntityDefReader<T>
      Parameters:
      entityType - a QName object.
      Returns:
      a boolean.
    • getMultiLevelSecondaryPivot

      public org.alfresco.service.namespace.QName getMultiLevelSecondaryPivot(org.alfresco.service.namespace.QName dataListItemType)

      getMultiLevelSecondaryPivot.

      Specified by:
      getMultiLevelSecondaryPivot in interface RepositoryEntityDefReader<T>
      Parameters:
      dataListItemType - a QName object.
      Returns:
      a QName object.
    • getMultiLevelGroupProperty

      public org.alfresco.service.namespace.QName getMultiLevelGroupProperty(org.alfresco.service.namespace.QName entityDataListQname)

      getMultiLevelGroupProperty.

      Specified by:
      getMultiLevelGroupProperty in interface RepositoryEntityDefReader<T>
      Parameters:
      entityDataListQname - a QName object.
      Returns:
      a QName object.