Package org.alfresco.opencmis.dictionary
Class CMISAbstractDictionaryService
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.opencmis.dictionary.CMISAbstractDictionaryService
-
- All Implemented Interfaces:
EventListener,CMISDictionaryService,DictionaryListener,ExtendedDictionaryListener,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
- Direct Known Subclasses:
CMISStrictDictionaryService
public abstract class CMISAbstractDictionaryService extends org.springframework.extensions.surf.util.AbstractLifecycleBean implements CMISDictionaryService, ExtendedDictionaryListener
Common CMIS Dictionary Support including registry of Types.- Author:
- davidc, florian.mueller
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceCMISAbstractDictionaryService.DictionaryInitializer
-
Field Summary
Fields Modifier and Type Field Description protected PropertyAccessorMappingaccessorMappingprotected CMISMappingcmisMappingprotected DictionaryDAOdictionaryDAOprotected DictionaryServicedictionaryServiceprotected static org.apache.commons.logging.Logloggerprotected PropertyLuceneBuilderMappingluceneBuilderMappingprotected TenantServicetenantService
-
Constructor Summary
Constructors Constructor Description CMISAbstractDictionaryService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidafterDictionaryDestroy()Callback once dictionary destroy is complete (executed in the current tenant context)voidafterDictionaryInit()Callback once dictionary initialisation is complete (executed in the current tenant context)protected CMISDictionaryRegistrycreateCoreDictionaryRegistry()protected CMISDictionaryRegistrycreateDictionaryRegistry(String tenant)protected CMISDictionaryRegistrycreateDictionaryRegistryWithWriteLock()protected CMISDictionaryRegistrycreateTenantDictionaryRegistry(String tenant)QNamefindAlfrescoDataType(org.apache.chemistry.opencmis.commons.enums.PropertyType propertyType)TypeDefinitionWrapperfindAssocType(QName clazz)org.apache.chemistry.opencmis.commons.enums.PropertyTypefindDataType(QName dataType)Find data typeTypeDefinitionWrapperfindNodeType(QName clazz)PropertyDefinitionWrapperfindProperty(String propId)PropertyDefinitionWrapperfindPropertyByQueryName(String queryName)TypeDefinitionWrapperfindType(String typeId)Find type for type idTypeDefinitionWrapperfindTypeByQueryName(String queryName)Find a type by its query nameTypeDefinitionWrapperfindTypeForClass(QName clazz, org.apache.chemistry.opencmis.commons.enums.BaseTypeId... matchingScopes)Find type for Alfresco class name.List<TypeDefinitionWrapper>getAllTypes()Get all TypesList<TypeDefinitionWrapper>getAllTypes(boolean includeParent)List<TypeDefinitionWrapper>getBaseTypes()Get Base TypesList<TypeDefinitionWrapper>getBaseTypes(boolean includeParent)List<TypeDefinitionWrapper>getChildren(String typeId)protected abstract CMISAbstractDictionaryService.DictionaryInitializergetCoreDictionaryInitializer()protected CMISDictionaryRegistrygetRegistry()protected abstract CMISAbstractDictionaryService.DictionaryInitializergetTenantDictionaryInitializer()booleanisExcluded(QName qname)voidmodelAdded(CompiledModel model, String tenantDomain)protected voidonBootstrap(org.springframework.context.ApplicationEvent event)voidonDictionaryInit()Callback for (re-)initialising the Dictionary caches (executed in the current tenant context)protected voidonShutdown(org.springframework.context.ApplicationEvent event)voidsetCmisMapping(CMISMapping cmisMapping)Set the mapping servicevoidsetDictionaryDAO(DictionaryDAO dictionaryDAO)Set the dictionary DAOvoidsetDictionaryService(DictionaryService dictionaryService)Set the dictionary ServicevoidsetPropertyAccessorMapping(PropertyAccessorMapping accessorMapping)Set the property accessor mapping servicevoidsetPropertyLuceneBuilderMapping(PropertyLuceneBuilderMapping luceneBuilderMapping)Set the property lucene mapping servicevoidsetSingletonCache(SimpleCache<String,CMISDictionaryRegistry> singletonCache)voidsetTenantService(TenantService tenantService)
-
-
-
Field Detail
-
logger
protected static final org.apache.commons.logging.Log logger
-
dictionaryDAO
protected DictionaryDAO dictionaryDAO
-
dictionaryService
protected DictionaryService dictionaryService
-
cmisMapping
protected CMISMapping cmisMapping
-
accessorMapping
protected PropertyAccessorMapping accessorMapping
-
luceneBuilderMapping
protected PropertyLuceneBuilderMapping luceneBuilderMapping
-
tenantService
protected TenantService tenantService
-
-
Method Detail
-
setTenantService
public void setTenantService(TenantService tenantService)
-
setCmisMapping
public void setCmisMapping(CMISMapping cmisMapping)
Set the mapping service- Parameters:
cmisMapping- CMISMapping
-
setPropertyAccessorMapping
public void setPropertyAccessorMapping(PropertyAccessorMapping accessorMapping)
Set the property accessor mapping service- Parameters:
accessorMapping- mapping
-
setPropertyLuceneBuilderMapping
public void setPropertyLuceneBuilderMapping(PropertyLuceneBuilderMapping luceneBuilderMapping)
Set the property lucene mapping service- Parameters:
luceneBuilderMapping- mapping
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
Set the dictionary Service- Parameters:
dictionaryService- DictionaryService
-
setDictionaryDAO
public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
Set the dictionary DAO- Parameters:
dictionaryDAO- DictionaryDAO
-
setSingletonCache
public void setSingletonCache(SimpleCache<String,CMISDictionaryRegistry> singletonCache)
-
getCoreDictionaryInitializer
protected abstract CMISAbstractDictionaryService.DictionaryInitializer getCoreDictionaryInitializer()
-
getTenantDictionaryInitializer
protected abstract CMISAbstractDictionaryService.DictionaryInitializer getTenantDictionaryInitializer()
-
getRegistry
protected CMISDictionaryRegistry getRegistry()
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
- Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event)
- Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
createCoreDictionaryRegistry
protected CMISDictionaryRegistry createCoreDictionaryRegistry()
-
createTenantDictionaryRegistry
protected CMISDictionaryRegistry createTenantDictionaryRegistry(String tenant)
-
createDictionaryRegistryWithWriteLock
protected CMISDictionaryRegistry createDictionaryRegistryWithWriteLock()
-
createDictionaryRegistry
protected CMISDictionaryRegistry createDictionaryRegistry(String tenant)
-
findType
public TypeDefinitionWrapper findType(String typeId)
Description copied from interface:CMISDictionaryServiceFind type for type id- Specified by:
findTypein interfaceCMISDictionaryService- Parameters:
typeId- String- Returns:
- TypeDefinitionWrapper
-
isExcluded
public boolean isExcluded(QName qname)
- Specified by:
isExcludedin interfaceCMISDictionaryService
-
findTypeForClass
public TypeDefinitionWrapper findTypeForClass(QName clazz, org.apache.chemistry.opencmis.commons.enums.BaseTypeId... matchingScopes)
Description copied from interface:CMISDictionaryServiceFind type for Alfresco class name. Optionally, constrain match to one of specified CMIS scopes- Specified by:
findTypeForClassin interfaceCMISDictionaryService- Parameters:
clazz- QNamematchingScopes- BaseTypeId...- Returns:
- TypeDefinitionWrapper
-
findNodeType
public TypeDefinitionWrapper findNodeType(QName clazz)
- Specified by:
findNodeTypein interfaceCMISDictionaryService
-
findAssocType
public TypeDefinitionWrapper findAssocType(QName clazz)
- Specified by:
findAssocTypein interfaceCMISDictionaryService
-
findTypeByQueryName
public TypeDefinitionWrapper findTypeByQueryName(String queryName)
Description copied from interface:CMISDictionaryServiceFind a type by its query name- Specified by:
findTypeByQueryNamein interfaceCMISDictionaryService- Parameters:
queryName- String- Returns:
- TypeDefinitionWrapper
-
findProperty
public PropertyDefinitionWrapper findProperty(String propId)
- Specified by:
findPropertyin interfaceCMISDictionaryService
-
findPropertyByQueryName
public PropertyDefinitionWrapper findPropertyByQueryName(String queryName)
- Specified by:
findPropertyByQueryNamein interfaceCMISDictionaryService
-
getBaseTypes
public List<TypeDefinitionWrapper> getBaseTypes()
Description copied from interface:CMISDictionaryServiceGet Base Types- Specified by:
getBaseTypesin interfaceCMISDictionaryService
-
getBaseTypes
public List<TypeDefinitionWrapper> getBaseTypes(boolean includeParent)
- Specified by:
getBaseTypesin interfaceCMISDictionaryService
-
getAllTypes
public List<TypeDefinitionWrapper> getAllTypes()
Description copied from interface:CMISDictionaryServiceGet all Types- Specified by:
getAllTypesin interfaceCMISDictionaryService
-
getAllTypes
public List<TypeDefinitionWrapper> getAllTypes(boolean includeParent)
- Specified by:
getAllTypesin interfaceCMISDictionaryService
-
findDataType
public org.apache.chemistry.opencmis.commons.enums.PropertyType findDataType(QName dataType)
Description copied from interface:CMISDictionaryServiceFind data type- Specified by:
findDataTypein interfaceCMISDictionaryService- Parameters:
dataType- QName- Returns:
- PropertyType
-
findAlfrescoDataType
public QName findAlfrescoDataType(org.apache.chemistry.opencmis.commons.enums.PropertyType propertyType)
- Specified by:
findAlfrescoDataTypein interfaceCMISDictionaryService
-
onDictionaryInit
public void onDictionaryInit()
Description copied from interface:DictionaryListenerCallback for (re-)initialising the Dictionary caches (executed in the current tenant context)- Specified by:
onDictionaryInitin interfaceDictionaryListener
-
modelAdded
public void modelAdded(CompiledModel model, String tenantDomain)
- Specified by:
modelAddedin interfaceExtendedDictionaryListener
-
afterDictionaryInit
public void afterDictionaryInit()
Description copied from interface:DictionaryListenerCallback once dictionary initialisation is complete (executed in the current tenant context)- Specified by:
afterDictionaryInitin interfaceDictionaryListener
-
afterDictionaryDestroy
public void afterDictionaryDestroy()
Description copied from interface:DictionaryListenerCallback once dictionary destroy is complete (executed in the current tenant context)- Specified by:
afterDictionaryDestroyin interfaceDictionaryListener
-
getChildren
public List<TypeDefinitionWrapper> getChildren(String typeId)
- Specified by:
getChildrenin interfaceCMISDictionaryService
-
-