Package org.alfresco.repo.dictionary
Class DictionaryComponent
java.lang.Object
org.alfresco.repo.dictionary.DictionaryComponent
- All Implemented Interfaces:
TenantDeployer
,DictionaryService
,MessageLookup
- Direct Known Subclasses:
FilteredDictionaryComponent
Data Dictionary Service Implementation
- Author:
- David Caruana, sglover
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
getAllAspects
(boolean includeInherited) Get all the association definitionsgetAllAssociations
(boolean includeInherited) getAllModels
(boolean includeInherited) getAllProperties
(QName dataType) Get all properties defined across all models with the given data type.getAllTypes
(boolean includeInherited) getAnonymousType
(QName name) Creates an anonymousTypeDefinition
with all the mandatoryAspects
applied.getAnonymousType
(QName type, Collection<QName> aspects) Construct an anonymous type that combines the definitions of the specified type and aspects.getAspects
(QName model) getAssociation
(QName associationName) Gets the definition of the association as defined by its owning Class.getAssociations
(QName model) getConstraint
(QName constraintQName) Gets the definition of the constraintgetConstraints
(QName model) Get constraints for the specified modelgetConstraints
(QName model, boolean referenceableDefsOnly) Get constraints for the specified model Optionally return referenceable (ie.getDataType
(Class<?> javaClass) getDataType
(QName name) getDataTypes
(QName model) getMessage
(String messageKey) Get message from registered resource bundle.getMessage
(String messageKey, Object... params) Get a localised message string, parameterized using standard MessageFormatter.getMessage
(String messageKey, Locale locale) Get a localised message stringgetMessage
(String messageKey, Locale locale, Object... params) Get a localised message string, parameterized using standard MessageFormatter.getProperties
(QName model) Get all properties for the specified modelgetProperties
(QName model, QName dataType) Get all properties defined for the given model with the given data type.getProperty
(QName propertyName) Gets the definition of the property as defined by its owning Class.getProperty
(QName className, QName propertyName) Gets the definition of the property as defined by the specified Class.getPropertyDefs
(QName className) Gets the definitions of the properties defined by the specified Class.getSubAspects
(QName superAspect, boolean follow) getSubTypes
(QName superType, boolean follow) Get the sub types of the type.void
init()
boolean
isSubClass
(QName className, QName ofClassName) Determines whether a class is a sub-class of another classvoid
void
void
setDictionaryDAO
(DictionaryDAO dictionaryDAO) Sets the Meta Model DAOvoid
setMessageLookup
(MessageLookup messageLookup) Sets the message lookup service
-
Constructor Details
-
DictionaryComponent
public DictionaryComponent()
-
-
Method Details
-
setDictionaryDAO
Sets the Meta Model DAO- Parameters:
dictionaryDAO
- dictionary DAO
-
setMessageLookup
Sets the message lookup service- Parameters:
messageLookup
- the message lookup service
-
getAllModels
- Specified by:
getAllModels
in interfaceDictionaryService
- Returns:
- the names of all models that have been registered with the Repository
-
getAllModels
-
getModel
- Specified by:
getModel
in interfaceDictionaryService
- Parameters:
model
- the model name to retrieve- Returns:
- the specified model (never null)
-
getAllDataTypes
- Specified by:
getAllDataTypes
in interfaceDictionaryService
- Returns:
- the names of all data types that have been registered with the Repository
-
getDataTypes
- Specified by:
getDataTypes
in interfaceDictionaryService
- Parameters:
model
- the model to retrieve data types for- Returns:
- the names of all data types defined within the specified model
-
getAllTypes
- Specified by:
getAllTypes
in interfaceDictionaryService
- Returns:
- the names of all types that have been registered with the Repository
-
getAllTypes
- Specified by:
getAllTypes
in interfaceDictionaryService
-
getSubTypes
Description copied from interface:DictionaryService
Get the sub types of the type. The returned list includes the base type which is passed in as a parameter.- Specified by:
getSubTypes
in interfaceDictionaryService
- Parameters:
superType
- the qualified name of the typefollow
- true => all sub-type descendants, false => immediate sub-type children- Returns:
- the names of the sub types of the specified type, including the value passed in.
-
getTypes
- Specified by:
getTypes
in interfaceDictionaryService
- Parameters:
model
- the model to retrieve types for- Returns:
- the names of all types defined within the specified model
-
getAllAspects
- Specified by:
getAllAspects
in interfaceDictionaryService
- Returns:
- the names of all aspects that have been registered with the Repository
-
getAllAspects
- Specified by:
getAllAspects
in interfaceDictionaryService
-
getAllAssociations
Description copied from interface:DictionaryService
Get all the association definitions- Specified by:
getAllAssociations
in interfaceDictionaryService
- Returns:
- all the association qnames
-
getAllAssociations
- Specified by:
getAllAssociations
in interfaceDictionaryService
-
getSubAspects
- Specified by:
getSubAspects
in interfaceDictionaryService
- Parameters:
superAspect
- QNamefollow
- true => follow up the super-class hierarchy, false => immediate sub aspects only- Returns:
- the sub aspects of specified aspect
-
getAspects
- Specified by:
getAspects
in interfaceDictionaryService
- Parameters:
model
- the model to retrieve aspects for- Returns:
- the names of all aspects defined within the specified model
-
getAssociations
- Specified by:
getAssociations
in interfaceDictionaryService
- Parameters:
model
- the model to retrieve associations for- Returns:
- the names of all associations defined within the specified model
-
isSubClass
Description copied from interface:DictionaryService
Determines whether a class is a sub-class of another class- Specified by:
isSubClass
in interfaceDictionaryService
- Parameters:
className
- the sub-class to testofClassName
- the class to test against- Returns:
- true => the class is a sub-class (or itself)
-
getDataType
- Specified by:
getDataType
in interfaceDictionaryService
- Parameters:
name
- the name of the data type to retrieve- Returns:
- the data type definition (or null, if it doesn't exist)
-
getDataType
- Specified by:
getDataType
in interfaceDictionaryService
- Parameters:
javaClass
- java class to find datatype for- Returns:
- the data type definition (or null, if a mapping does not exist)
-
getType
- Specified by:
getType
in interfaceDictionaryService
- Parameters:
name
- the name of the type to retrieve- Returns:
- the type definition (or null, if it doesn't exist)
-
getAspect
- Specified by:
getAspect
in interfaceDictionaryService
- Parameters:
name
- the name of the aspect to retrieve- Returns:
- the aspect definition (or null, if it doesn't exist)
-
getClass
- Specified by:
getClass
in interfaceDictionaryService
- Parameters:
name
- the name of the class (type or aspect) to retrieve- Returns:
- the class definition (or null, if it doesn't exist)
-
getAnonymousType
Description copied from interface:DictionaryService
Construct an anonymous type that combines the definitions of the specified type and aspects.- Specified by:
getAnonymousType
in interfaceDictionaryService
- Parameters:
type
- the type to start withaspects
- the aspects to combine with the type- Returns:
- the anonymous type definition
-
getAnonymousType
Creates an anonymousTypeDefinition
with all the mandatoryAspects
applied. This collapses all mandatoryAspects
into a singleTypeDefinition
.- Specified by:
getAnonymousType
in interfaceDictionaryService
- Parameters:
name
- the name of the type definition.- Returns:
- the anonymous type definition
-
getProperty
Description copied from interface:DictionaryService
Gets the definition of the property as defined by the specified Class. Note: A sub-class may override the definition of a property that's defined in a super-class.- Specified by:
getProperty
in interfaceDictionaryService
- Parameters:
className
- the class namepropertyName
- the property name- Returns:
- the property definition (or null, if it doesn't exist)
-
getPropertyDefs
Description copied from interface:DictionaryService
Gets the definitions of the properties defined by the specified Class.- Specified by:
getPropertyDefs
in interfaceDictionaryService
- Parameters:
className
- the class name- Returns:
- the property definitions
-
getProperty
Description copied from interface:DictionaryService
Gets the definition of the property as defined by its owning Class.- Specified by:
getProperty
in interfaceDictionaryService
- Parameters:
propertyName
- the property name- Returns:
- the property definition (or null, if it doesn't exist)
-
getAssociation
Description copied from interface:DictionaryService
Gets the definition of the association as defined by its owning Class.- Specified by:
getAssociation
in interfaceDictionaryService
- Parameters:
associationName
- the property name- Returns:
- the association definition (or null, if it doesn't exist)
-
getAllProperties
Description copied from interface:DictionaryService
Get all properties defined across all models with the given data type. Note that DataTypeDefinition.ANY will only match this type and can not be used as get all properties. If dataType is null then this method will return *ALL* properties regardless of data type.- Specified by:
getAllProperties
in interfaceDictionaryService
- Parameters:
dataType
- QName
-
getProperties
Description copied from interface:DictionaryService
Get all properties defined for the given model with the given data type. Note that DataTypeDefinition.ANY will only match this type and can not be used as get all properties. If dataType is null then this method will return *ALL* properties regardless of data type.- Specified by:
getProperties
in interfaceDictionaryService
- Parameters:
model
- QNamedataType
- QName
-
getProperties
Description copied from interface:DictionaryService
Get all properties for the specified model- Specified by:
getProperties
in interfaceDictionaryService
- Parameters:
model
- QName
-
getConstraint
Description copied from interface:DictionaryService
Gets the definition of the constraint- Specified by:
getConstraint
in interfaceDictionaryService
- Parameters:
constraintQName
- the constraint name- Returns:
- the constraint definition (or null, if it doesn't exist)
-
getConstraints
Description copied from interface:DictionaryService
Get constraints for the specified model- Specified by:
getConstraints
in interfaceDictionaryService
- Parameters:
model
- QName
-
getConstraints
Description copied from interface:DictionaryService
Get constraints for the specified model Optionally return referenceable (ie. non-property specific) constraints only- Specified by:
getConstraints
in interfaceDictionaryService
- Parameters:
model
- QNamereferenceableDefsOnly
- boolean
-
init
public void init()- Specified by:
init
in interfaceTenantDeployer
-
destroy
public void destroy()- Specified by:
destroy
in interfaceTenantDeployer
-
onEnableTenant
public void onEnableTenant()- Specified by:
onEnableTenant
in interfaceTenantDeployer
-
onDisableTenant
public void onDisableTenant()- Specified by:
onDisableTenant
in interfaceTenantDeployer
-
getMessage
Description copied from interface:MessageLookup
Get message from registered resource bundle.- Specified by:
getMessage
in interfaceMessageLookup
- Parameters:
messageKey
- message key- Returns:
- localised message string, null if not found
-
getMessage
Description copied from interface:MessageLookup
Get a localised message string- Specified by:
getMessage
in interfaceMessageLookup
- Parameters:
messageKey
- the message keylocale
- override the current locale- Returns:
- the localised message string, null if not found
-
getMessage
Description copied from interface:MessageLookup
Get a localised message string, parameterized using standard MessageFormatter.- Specified by:
getMessage
in interfaceMessageLookup
- Parameters:
messageKey
- message keyparams
- format parameters- Returns:
- the localised string, null if not found
-
getMessage
Description copied from interface:MessageLookup
Get a localised message string, parameterized using standard MessageFormatter.- Specified by:
getMessage
in interfaceMessageLookup
- Parameters:
messageKey
- the message keylocale
- override current localeparams
- the localised message string- Returns:
- the localised string, null if not found
-
getModelByNamespaceUri
- Specified by:
getModelByNamespaceUri
in interfaceDictionaryService
- Parameters:
uri
- the namespace uri for search for- Returns:
- the named model definition
-