Interface DictionaryService
- All Superinterfaces:
MessageLookup
- All Known Implementing Classes:
DictionaryComponent
,FilteredDictionaryComponent
This interface represents the Repository Data Dictionary. The
dictionary provides access to content meta-data such as Type
and Aspect descriptions.
Content meta-data is organised into models where each model is given a qualified name. This means that it is safe to develop independent models and bring them together into the same Repository without name clashes (as long their namespace is different).
- Author:
- David Caruana
-
Method Summary
Modifier and TypeMethodDescriptiongetAllAspects
(boolean includeInherited) Get all the association definitionsgetAllAssociations
(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) 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 aspect, boolean follow) getSubTypes
(QName type, boolean follow) Get the sub types of the type.boolean
isSubClass
(QName className, QName ofClassName) Determines whether a class is a sub-class of another classMethods inherited from interface org.alfresco.service.cmr.i18n.MessageLookup
getMessage, getMessage, getMessage, getMessage
-
Method Details
-
getAllModels
- Returns:
- the names of all models that have been registered with the Repository
-
getModel
- Parameters:
model
- the model name to retrieve- Returns:
- the specified model (never null)
- Throws:
DictionaryException
- if the model could not be found
-
getAllDataTypes
- Returns:
- the names of all data types that have been registered with the Repository
-
getDataTypes
- Parameters:
model
- the model to retrieve data types for- Returns:
- the names of all data types defined within the specified model
-
getDataType
- Parameters:
name
- the name of the data type to retrieve- Returns:
- the data type definition (or null, if it doesn't exist)
-
getDataType
- Parameters:
javaClass
- java class to find datatype for- Returns:
- the data type definition (or null, if a mapping does not exist)
-
getAllTypes
- Returns:
- the names of all types that have been registered with the Repository
-
getAllTypes
-
getSubTypes
Get the sub types of the type. The returned list includes the base type which is passed in as a parameter.- Parameters:
type
- 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
- Parameters:
model
- the model to retrieve types for- Returns:
- the names of all types defined within the specified model
-
getType
- Parameters:
name
- the name of the type to retrieve- Returns:
- the type definition (or null, if it doesn't exist)
-
getAnonymousType
Construct an anonymous type that combines the definitions of the specified type and aspects.- 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
.- Parameters:
name
- the name of the type definition.- Returns:
- the anonymous type definition
-
getAllAspects
- Returns:
- the names of all aspects that have been registered with the Repository
-
getAllAspects
-
getSubAspects
- Parameters:
aspect
- QNamefollow
- true => follow up the super-class hierarchy, false => immediate sub aspects only- Returns:
- the sub aspects of specified aspect
-
getAspects
- Parameters:
model
- the model to retrieve aspects for- Returns:
- the names of all aspects defined within the specified model
-
getAssociations
- Parameters:
model
- the model to retrieve associations for- Returns:
- the names of all associations defined within the specified model
-
getAspect
- Parameters:
name
- the name of the aspect to retrieve- Returns:
- the aspect definition (or null, if it doesn't exist)
-
getClass
- Parameters:
name
- the name of the class (type or aspect) to retrieve- Returns:
- the class definition (or null, if it doesn't exist)
-
isSubClass
Determines whether a class is a sub-class of another class- Parameters:
className
- the sub-class to testofClassName
- the class to test against- Returns:
- true => the class is a sub-class (or itself)
-
getProperty
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.- Parameters:
className
- the class namepropertyName
- the property name- Returns:
- the property definition (or null, if it doesn't exist)
-
getPropertyDefs
Gets the definitions of the properties defined by the specified Class.- Parameters:
className
- the class name- Returns:
- the property definitions
-
getProperty
Gets the definition of the property as defined by its owning Class.- Parameters:
propertyName
- the property name- Returns:
- the property definition (or null, if it doesn't exist)
-
getAllProperties
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.- Parameters:
dataType
- QName
-
getProperties
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.- Parameters:
model
- QNamedataType
- QName
-
getProperties
Get all properties for the specified model- Parameters:
model
- QName
-
getAssociation
Gets the definition of the association as defined by its owning Class.- Parameters:
associationName
- the property name- Returns:
- the association definition (or null, if it doesn't exist)
-
getAllAssociations
Get all the association definitions- Returns:
- all the association qnames
-
getAllAssociations
-
getConstraint
Gets the definition of the constraint- Parameters:
constraintQName
- the constraint name- Returns:
- the constraint definition (or null, if it doesn't exist)
- Since:
- 3.2.1
-
getConstraints
Get constraints for the specified model- Parameters:
model
- QName
-
getConstraints
Get constraints for the specified model Optionally return referenceable (ie. non-property specific) constraints only- Parameters:
model
- QNamereferenceableDefsOnly
- boolean- Since:
- 3.2R
-
getModelByNamespaceUri
- Parameters:
uri
- the namespace uri for search for- Returns:
- the named model definition
-