Package fr.becpg.repo.entity.impl
Class EntityDictionaryServiceImpl
java.lang.Object
org.alfresco.repo.dictionary.DictionaryComponent
fr.becpg.repo.entity.impl.EntityDictionaryServiceImpl
- All Implemented Interfaces:
EntityDictionaryService,org.alfresco.repo.tenant.TenantDeployer,org.alfresco.service.cmr.dictionary.DictionaryService,org.alfresco.service.cmr.i18n.MessageLookup,org.alfresco.util.cache.RefreshableCacheListener,org.springframework.beans.factory.InitializingBean
public class EntityDictionaryServiceImpl
extends org.alfresco.repo.dictionary.DictionaryComponent
implements org.alfresco.service.cmr.dictionary.DictionaryService, EntityDictionaryService, org.alfresco.util.cache.RefreshableCacheListener, org.springframework.beans.factory.InitializingBean
Enhanced implementation of EntityDictionaryService with performance optimizations
including improved caching, reduced object creation, and optimized data structures.
- Version:
- $Id: $Id
- Author:
- matthieu Fast and cached access to dataDictionary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BeCPGCacheServiceprivate final Map<String, Map<org.alfresco.service.namespace.QName, org.alfresco.service.cmr.dictionary.ClassDefinition>> private static final StringConstantCOLON_REPLACEMENT="_"private static final StringConstantCOMPILED_MODELS_CACHE="compiledModelsCache"private final Map<String, Map<org.alfresco.service.namespace.QName, List<org.alfresco.service.namespace.QName>>> private static final StringConstantDESCRIPTION_SUFFIX=".description"private org.alfresco.repo.dictionary.DictionaryDAOprivate final Map<String, Map<org.alfresco.service.namespace.QName, Map<org.alfresco.service.namespace.QName, Boolean>>> private static final org.apache.commons.logging.LogConstantloggerprivate org.alfresco.repo.i18n.MessageServiceprivate static final StringConstantMODEL_OVERRIDE_PREFIX="model.override."private org.alfresco.service.namespace.NamespaceServiceprivate final Map<String, Map<org.alfresco.service.namespace.QName, List<org.alfresco.service.cmr.dictionary.AssociationDefinition>>> private final Map<String, Map<org.alfresco.service.namespace.QName, org.alfresco.service.cmr.dictionary.ClassAttributeDefinition>> private final Map<org.alfresco.service.namespace.QName, org.alfresco.service.namespace.QName> private org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistryprivate final Map<String, Map<org.alfresco.service.namespace.QName, Collection<org.alfresco.service.namespace.QName>>> private final Map<String, Map<org.alfresco.service.namespace.QName, Collection<org.alfresco.service.namespace.QName>>> private final Map<String, Map<org.alfresco.service.namespace.QName, List<org.alfresco.service.namespace.QName>>> private static final StringConstantTITLE_SUFFIX=".title" -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate booleancomputeIsSubClass(org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName ofClassName) Computes the actual isSubClass logic separated for better readabilityprivate StringcomputeOverrideKey(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attributeDefinition, org.alfresco.service.namespace.QName nodeType) Computes override keys with caching to avoid repeated string operationsprivate List<org.alfresco.service.cmr.dictionary.AssociationDefinition> computePivotAssocDefs(org.alfresco.service.namespace.QName sourceType, boolean exactMatch) org.alfresco.service.cmr.dictionary.ClassAttributeDefinitionfindMatchingPropDef(org.alfresco.service.namespace.QName itemType, org.alfresco.service.namespace.QName newItemType, org.alfresco.service.namespace.QName fieldQname) findMatchingPropDef.org.alfresco.service.namespace.QNamegetAssocIndexQName(org.alfresco.service.namespace.QName assocQName) getAssocIndexQName.org.alfresco.service.cmr.dictionary.ClassDefinitiongetClass(org.alfresco.service.namespace.QName name) org.alfresco.service.namespace.QNamegetDefaultPivotAssoc(org.alfresco.service.namespace.QName dataListItemType) getDefaultPivotAssoc.List<org.alfresco.service.namespace.QName> getDefaultPivotAssocsFromTargetType(org.alfresco.service.namespace.QName targetType) getDefaultPivotAssocsFromTargetType.getDescription(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attributeDefinition, org.alfresco.service.namespace.QName nodeType) getDescription.org.alfresco.service.namespace.QNamegetMultiLevelGroupProperty(org.alfresco.service.namespace.QName dataListItemType) getMultiLevelGroupProperty.org.alfresco.service.namespace.QNamegetMultiLevelSecondaryPivot(org.alfresco.service.namespace.QName dataListItemType) getMultiLevelSecondaryPivot.List<org.alfresco.service.cmr.dictionary.AssociationDefinition> getPivotAssocDefs(org.alfresco.service.namespace.QName sourceType) getPivotAssocDefs.List<org.alfresco.service.cmr.dictionary.AssociationDefinition> getPivotAssocDefs(org.alfresco.service.namespace.QName sourceType, boolean exactMatch) getPivotAssocDefs.org.alfresco.service.cmr.dictionary.ClassAttributeDefinitiongetPropDef(org.alfresco.service.namespace.QName fieldQname) getPropDef.Collection<org.alfresco.service.namespace.QName> getSubAspects(org.alfresco.service.namespace.QName superAspect, boolean follow) Collection<org.alfresco.service.namespace.QName> getSubTypes(org.alfresco.service.namespace.QName typeQname) getSubTypes.Collection<org.alfresco.service.namespace.QName> getSubTypes(org.alfresco.service.namespace.QName superType, boolean follow) org.alfresco.service.namespace.QNamegetTargetType(org.alfresco.service.namespace.QName assocName) getTargetType.List<org.alfresco.service.namespace.QName> getTargetTypes(org.alfresco.service.namespace.QName assocName) getTargetTypes.private <K,V> Map <K, V> getTenantCache(Map<String, Map<K, V>> caches) getTitle(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attributeDefinition, org.alfresco.service.namespace.QName nodeType) getTitle.booleanisAssoc(org.alfresco.service.namespace.QName assocName) isAssoc.booleanisMultiLevelDataList(org.alfresco.service.namespace.QName dataListItemType) isMultiLevelDataList.booleanisMultiLevelLeaf(org.alfresco.service.namespace.QName entityType) isMultiLevelLeaf.booleanisSubClass(org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName ofClassName) voidonRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent) voidregisterExtraAssocsDefMapping(org.alfresco.service.namespace.QName orig, org.alfresco.service.namespace.QName dest) registerExtraAssocsDefMapping.voidregisterPropDefMapping(org.alfresco.service.namespace.QName orig, org.alfresco.service.namespace.QName dest) registerPropDefMapping.voidsetBeCPGCacheService(BeCPGCacheService beCPGCacheService) Setter for the fieldbeCPGCacheService.voidsetDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO) voidsetMessageService(org.alfresco.repo.i18n.MessageService messageService) Setter for the fieldmessageService.voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) Setter for the fieldnamespaceService.voidsetRegistry(org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry) Setter for the fieldregistry.voidsetRepositoryEntityDefReader(RepositoryEntityDefReader<RepositoryEntity> repositoryEntityDefReader) Setter for the fieldrepositoryEntityDefReader.toPrefixString(org.alfresco.service.namespace.QName propertyQName) toPrefixString.Methods inherited from class org.alfresco.repo.dictionary.DictionaryComponent
destroy, getAllAspects, getAllAspects, getAllAssociations, getAllAssociations, getAllDataTypes, getAllModels, getAllModels, getAllProperties, getAllTypes, getAllTypes, getAnonymousType, getAnonymousType, getAspect, getAspects, getAssociation, getAssociations, getConstraint, getConstraints, getConstraints, getDataType, getDataType, getDataTypes, getMessage, getMessage, getMessage, getMessage, getModel, getModelByNamespaceUri, getProperties, getProperties, getProperty, getProperty, getPropertyDefs, getType, getTypes, init, onDisableTenant, onEnableTenant, setMessageLookupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.service.cmr.dictionary.DictionaryService
getAllAspects, getAllAspects, getAllAssociations, getAllAssociations, getAllDataTypes, getAllModels, getAllProperties, getAllTypes, getAllTypes, getAnonymousType, getAnonymousType, getAspect, getAspects, getAssociation, getAssociations, getConstraint, getConstraints, getConstraints, getDataType, getDataType, getDataTypes, getModel, getModelByNamespaceUri, getProperties, getProperties, getProperty, getProperty, getPropertyDefs, getType, getTypesMethods inherited from interface org.alfresco.service.cmr.i18n.MessageLookup
getMessage, getMessage, getMessage, getMessage
-
Field Details
-
logger
private static final org.apache.commons.logging.Log loggerConstantlogger -
MODEL_OVERRIDE_PREFIX
ConstantMODEL_OVERRIDE_PREFIX="model.override."- See Also:
-
TITLE_SUFFIX
ConstantTITLE_SUFFIX=".title"- See Also:
-
DESCRIPTION_SUFFIX
ConstantDESCRIPTION_SUFFIX=".description"- See Also:
-
COLON_REPLACEMENT
ConstantCOLON_REPLACEMENT="_"- See Also:
-
COMPILED_MODELS_CACHE
ConstantCOMPILED_MODELS_CACHE="compiledModelsCache"- See Also:
-
dictionaryDAO
private org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO -
beCPGCacheService
-
registry
private org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry -
repositoryEntityDefReader
-
namespaceService
private org.alfresco.service.namespace.NamespaceService namespaceService -
messageService
private org.alfresco.repo.i18n.MessageService messageService -
propDefMapping
private final Map<org.alfresco.service.namespace.QName,org.alfresco.service.namespace.QName> propDefMapping -
extraAssocsDefMapping
-
prefixStringCache
-
overrideKeyCache
-
subTypesCache
private final Map<String,Map<org.alfresco.service.namespace.QName, subTypesCacheCollection<org.alfresco.service.namespace.QName>>> -
subTypesNoFollowCache
private final Map<String,Map<org.alfresco.service.namespace.QName, subTypesNoFollowCacheCollection<org.alfresco.service.namespace.QName>>> -
propDefCache
-
classDefCache
-
pivotAssocDefsCache
-
isSubClassCache
-
defaultPivotAssocsFromTargetTypeCache
-
targetTypesFromAssocCache
-
-
Constructor Details
-
EntityDictionaryServiceImpl
public EntityDictionaryServiceImpl()
-
-
Method Details
-
getTenantCache
-
setMessageService
public void setMessageService(org.alfresco.repo.i18n.MessageService messageService) Setter for the field
messageService.- Parameters:
messageService- aMessageServiceobject
-
setRepositoryEntityDefReader
public void setRepositoryEntityDefReader(RepositoryEntityDefReader<RepositoryEntity> repositoryEntityDefReader) Setter for the field
repositoryEntityDefReader.- Parameters:
repositoryEntityDefReader- aRepositoryEntityDefReaderobject
-
setRegistry
public void setRegistry(org.alfresco.util.cache.AsynchronouslyRefreshedCacheRegistry registry) Setter for the field
registry.- Parameters:
registry- aAsynchronouslyRefreshedCacheRegistryobject- Since:
- 23.4.2.28
-
setBeCPGCacheService
Setter for the field
beCPGCacheService.- Parameters:
beCPGCacheService- aBeCPGCacheServiceobject- Since:
- 23.4.2.28
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) Setter for the field
namespaceService.- Parameters:
namespaceService- aNamespaceServiceobject
-
setDictionaryDAO
public void setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAO dictionaryDAO) - Overrides:
setDictionaryDAOin classorg.alfresco.repo.dictionary.DictionaryComponent
-
getDefaultPivotAssoc
public org.alfresco.service.namespace.QName getDefaultPivotAssoc(org.alfresco.service.namespace.QName dataListItemType) getDefaultPivotAssoc.
- Specified by:
getDefaultPivotAssocin interfaceEntityDictionaryService- Parameters:
dataListItemType- aQNameobject.- Returns:
- a
QNameobject.
-
isMultiLevelDataList
public boolean isMultiLevelDataList(org.alfresco.service.namespace.QName dataListItemType) isMultiLevelDataList.
- Specified by:
isMultiLevelDataListin interfaceEntityDictionaryService- Parameters:
dataListItemType- aQNameobject.- Returns:
- a boolean.
-
isMultiLevelLeaf
public boolean isMultiLevelLeaf(org.alfresco.service.namespace.QName entityType) isMultiLevelLeaf.
- Specified by:
isMultiLevelLeafin interfaceEntityDictionaryService- Parameters:
entityType- aQNameobject.- Returns:
- a boolean.
-
getMultiLevelSecondaryPivot
public org.alfresco.service.namespace.QName getMultiLevelSecondaryPivot(org.alfresco.service.namespace.QName dataListItemType) getMultiLevelSecondaryPivot.
- Specified by:
getMultiLevelSecondaryPivotin interfaceEntityDictionaryService- Parameters:
dataListItemType- aQNameobject.- Returns:
- a
QNameobject.
-
getMultiLevelGroupProperty
public org.alfresco.service.namespace.QName getMultiLevelGroupProperty(org.alfresco.service.namespace.QName dataListItemType) getMultiLevelGroupProperty.
- Specified by:
getMultiLevelGroupPropertyin interfaceEntityDictionaryService- Parameters:
dataListItemType- aQNameobject.- Returns:
- a
QNameobject.
-
registerPropDefMapping
public void registerPropDefMapping(org.alfresco.service.namespace.QName orig, org.alfresco.service.namespace.QName dest) registerPropDefMapping.
- Specified by:
registerPropDefMappingin interfaceEntityDictionaryService- Parameters:
orig- aQNameobject.dest- aQNameobject.
-
registerExtraAssocsDefMapping
public void registerExtraAssocsDefMapping(org.alfresco.service.namespace.QName orig, org.alfresco.service.namespace.QName dest) registerExtraAssocsDefMapping.
- Specified by:
registerExtraAssocsDefMappingin interfaceEntityDictionaryService- Parameters:
orig- aQNameobjectdest- aQNameobject
-
getPivotAssocDefs
public List<org.alfresco.service.cmr.dictionary.AssociationDefinition> getPivotAssocDefs(org.alfresco.service.namespace.QName sourceType) getPivotAssocDefs.
- Specified by:
getPivotAssocDefsin interfaceEntityDictionaryService- Parameters:
sourceType- aQNameobject.- Returns:
- a
Listobject.
-
getPivotAssocDefs
public List<org.alfresco.service.cmr.dictionary.AssociationDefinition> getPivotAssocDefs(org.alfresco.service.namespace.QName sourceType, boolean exactMatch) getPivotAssocDefs.
- Specified by:
getPivotAssocDefsin interfaceEntityDictionaryService- Parameters:
sourceType- aQNameobject.exactMatch- aBooleanobject.- Returns:
- a
Listobject.
-
computePivotAssocDefs
private List<org.alfresco.service.cmr.dictionary.AssociationDefinition> computePivotAssocDefs(org.alfresco.service.namespace.QName sourceType, boolean exactMatch) -
getDefaultPivotAssocsFromTargetType
public List<org.alfresco.service.namespace.QName> getDefaultPivotAssocsFromTargetType(org.alfresco.service.namespace.QName targetType) getDefaultPivotAssocsFromTargetType.
- Specified by:
getDefaultPivotAssocsFromTargetTypein interfaceEntityDictionaryService- Parameters:
targetType- aQNameobject- Returns:
- a
Listobject
-
getTargetTypes
public List<org.alfresco.service.namespace.QName> getTargetTypes(org.alfresco.service.namespace.QName assocName) getTargetTypes.
- Specified by:
getTargetTypesin interfaceEntityDictionaryService- Parameters:
assocName- aQNameobject- Returns:
- a
Listobject
-
getTargetType
public org.alfresco.service.namespace.QName getTargetType(org.alfresco.service.namespace.QName assocName) getTargetType.
- Specified by:
getTargetTypein interfaceEntityDictionaryService- Parameters:
assocName- aQNameobject.- Returns:
- a
QNameobject.
-
findMatchingPropDef
public org.alfresco.service.cmr.dictionary.ClassAttributeDefinition findMatchingPropDef(org.alfresco.service.namespace.QName itemType, org.alfresco.service.namespace.QName newItemType, org.alfresco.service.namespace.QName fieldQname) findMatchingPropDef.
- Specified by:
findMatchingPropDefin interfaceEntityDictionaryService- Parameters:
itemType- aQNameobject.newItemType- aQNameobject.fieldQname- aQNameobject.- Returns:
- a
ClassAttributeDefinitionobject.
-
getPropDef
public org.alfresco.service.cmr.dictionary.ClassAttributeDefinition getPropDef(org.alfresco.service.namespace.QName fieldQname) getPropDef.
- Specified by:
getPropDefin interfaceEntityDictionaryService- Parameters:
fieldQname- aQNameobject.- Returns:
- a
ClassAttributeDefinitionobject.
-
isAssoc
public boolean isAssoc(org.alfresco.service.namespace.QName assocName) isAssoc.
- Specified by:
isAssocin interfaceEntityDictionaryService- Parameters:
assocName- aQNameobject.- Returns:
- a boolean.
-
getSubTypes
public Collection<org.alfresco.service.namespace.QName> getSubTypes(org.alfresco.service.namespace.QName typeQname) getSubTypes.
- Specified by:
getSubTypesin interfaceEntityDictionaryService- Parameters:
typeQname- aQNameobject.- Returns:
- a
Collectionobject.
-
getSubTypes
public Collection<org.alfresco.service.namespace.QName> getSubTypes(org.alfresco.service.namespace.QName superType, boolean follow) - Specified by:
getSubTypesin interfaceorg.alfresco.service.cmr.dictionary.DictionaryService- Overrides:
getSubTypesin classorg.alfresco.repo.dictionary.DictionaryComponent
-
getSubAspects
public Collection<org.alfresco.service.namespace.QName> getSubAspects(org.alfresco.service.namespace.QName superAspect, boolean follow) - Specified by:
getSubAspectsin interfaceorg.alfresco.service.cmr.dictionary.DictionaryService- Overrides:
getSubAspectsin classorg.alfresco.repo.dictionary.DictionaryComponent
-
toPrefixString
toPrefixString.
- Specified by:
toPrefixStringin interfaceEntityDictionaryService- Parameters:
propertyQName- aQNameobject- Returns:
- a
Stringobject
-
isSubClass
public boolean isSubClass(org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName ofClassName) isSubClass.
- Specified by:
isSubClassin interfaceorg.alfresco.service.cmr.dictionary.DictionaryService- Specified by:
isSubClassin interfaceEntityDictionaryService- Overrides:
isSubClassin classorg.alfresco.repo.dictionary.DictionaryComponent
-
onRefreshableCacheEvent
public void onRefreshableCacheEvent(org.alfresco.util.cache.RefreshableCacheEvent refreshableCacheEvent) - Specified by:
onRefreshableCacheEventin interfaceorg.alfresco.util.cache.RefreshableCacheListener
-
getCacheId
- Specified by:
getCacheIdin interfaceorg.alfresco.util.cache.RefreshableCacheListener
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getTitle
public String getTitle(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attributeDefinition, org.alfresco.service.namespace.QName nodeType) getTitle.
- Specified by:
getTitlein interfaceEntityDictionaryService- Parameters:
attributeDefinition- aClassAttributeDefinitionobjectnodeType- aQNameobject- Returns:
- a
Stringobject
-
getDescription
public String getDescription(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attributeDefinition, org.alfresco.service.namespace.QName nodeType) getDescription.
- Specified by:
getDescriptionin interfaceEntityDictionaryService- Parameters:
attributeDefinition- aClassAttributeDefinitionobjectnodeType- aQNameobject- Returns:
- a
Stringobject
-
getAssocIndexQName
public org.alfresco.service.namespace.QName getAssocIndexQName(org.alfresco.service.namespace.QName assocQName) getAssocIndexQName.
- Specified by:
getAssocIndexQNamein interfaceEntityDictionaryService- Parameters:
assocQName- aQNameobject- Returns:
- a
QNameobject
-
getClass
public org.alfresco.service.cmr.dictionary.ClassDefinition getClass(org.alfresco.service.namespace.QName name) - Specified by:
getClassin interfaceorg.alfresco.service.cmr.dictionary.DictionaryService- Overrides:
getClassin classorg.alfresco.repo.dictionary.DictionaryComponent
-
computeIsSubClass
private boolean computeIsSubClass(org.alfresco.service.namespace.QName className, org.alfresco.service.namespace.QName ofClassName) Computes the actual isSubClass logic separated for better readability- Parameters:
className- aQNameobjectofClassName- aQNameobject- Returns:
- a boolean
-
computeOverrideKey
private String computeOverrideKey(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attributeDefinition, org.alfresco.service.namespace.QName nodeType) Computes override keys with caching to avoid repeated string operations- Parameters:
attributeDefinition- aClassAttributeDefinitionobjectnodeType- aQNameobject- Returns:
- a
Stringobject
-