Interface DictionaryService
-
- All Superinterfaces:
MessageLookup
- All Known Implementing Classes:
DictionaryComponent
,FilteredDictionaryComponent
@AlfrescoPublicApi public interface DictionaryService extends MessageLookup
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<QName>
getAllAspects()
Collection<QName>
getAllAspects(boolean includeInherited)
Collection<QName>
getAllAssociations()
Get all the association definitionsCollection<QName>
getAllAssociations(boolean includeInherited)
Collection<QName>
getAllDataTypes()
Collection<QName>
getAllModels()
Collection<QName>
getAllProperties(QName dataType)
Get all properties defined across all models with the given data type.Collection<QName>
getAllTypes()
Collection<QName>
getAllTypes(boolean includeInherited)
TypeDefinition
getAnonymousType(QName name)
Creates an anonymousTypeDefinition
with all the mandatoryAspects
applied.TypeDefinition
getAnonymousType(QName type, Collection<QName> aspects)
Construct an anonymous type that combines the definitions of the specified type and aspects.AspectDefinition
getAspect(QName name)
Collection<QName>
getAspects(QName model)
AssociationDefinition
getAssociation(QName associationName)
Gets the definition of the association as defined by its owning Class.Collection<QName>
getAssociations(QName model)
ClassDefinition
getClass(QName name)
ConstraintDefinition
getConstraint(QName constraintQName)
Gets the definition of the constraintCollection<ConstraintDefinition>
getConstraints(QName model)
Get constraints for the specified modelCollection<ConstraintDefinition>
getConstraints(QName model, boolean referenceableDefsOnly)
Get constraints for the specified model Optionally return referenceable (ie.DataTypeDefinition
getDataType(Class<?> javaClass)
DataTypeDefinition
getDataType(QName name)
Collection<QName>
getDataTypes(QName model)
ModelDefinition
getModel(QName model)
ModelDefinition
getModelByNamespaceUri(String uri)
Collection<QName>
getProperties(QName model)
Get all properties for the specified modelCollection<QName>
getProperties(QName model, QName dataType)
Get all properties defined for the given model with the given data type.PropertyDefinition
getProperty(QName propertyName)
Gets the definition of the property as defined by its owning Class.PropertyDefinition
getProperty(QName className, QName propertyName)
Gets the definition of the property as defined by the specified Class.Map<QName,PropertyDefinition>
getPropertyDefs(QName className)
Gets the definitions of the properties defined by the specified Class.Collection<QName>
getSubAspects(QName aspect, boolean follow)
Collection<QName>
getSubTypes(QName type, boolean follow)
Get the sub types of the type.TypeDefinition
getType(QName name)
Collection<QName>
getTypes(QName model)
boolean
isSubClass(QName className, QName ofClassName)
Determines whether a class is a sub-class of another class-
Methods inherited from interface org.alfresco.service.cmr.i18n.MessageLookup
getMessage, getMessage, getMessage, getMessage
-
-
-
-
Method Detail
-
getAllModels
@NotAuditable Collection<QName> getAllModels()
- Returns:
- the names of all models that have been registered with the Repository
-
getModel
@NotAuditable ModelDefinition getModel(QName model)
- Parameters:
model
- the model name to retrieve- Returns:
- the specified model (never null)
- Throws:
DictionaryException
- if the model could not be found
-
getAllDataTypes
@NotAuditable Collection<QName> getAllDataTypes()
- Returns:
- the names of all data types that have been registered with the Repository
-
getDataTypes
@NotAuditable Collection<QName> getDataTypes(QName model)
- Parameters:
model
- the model to retrieve data types for- Returns:
- the names of all data types defined within the specified model
-
getDataType
@NotAuditable DataTypeDefinition getDataType(QName name)
- Parameters:
name
- the name of the data type to retrieve- Returns:
- the data type definition (or null, if it doesn't exist)
-
getDataType
@NotAuditable DataTypeDefinition getDataType(Class<?> javaClass)
- Parameters:
javaClass
- java class to find datatype for- Returns:
- the data type definition (or null, if a mapping does not exist)
-
getAllTypes
@NotAuditable Collection<QName> getAllTypes()
- Returns:
- the names of all types that have been registered with the Repository
-
getAllTypes
@NotAuditable Collection<QName> getAllTypes(boolean includeInherited)
-
getSubTypes
@NotAuditable Collection<QName> getSubTypes(QName type, boolean follow)
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
@NotAuditable Collection<QName> getTypes(QName model)
- Parameters:
model
- the model to retrieve types for- Returns:
- the names of all types defined within the specified model
-
getType
@NotAuditable TypeDefinition getType(QName name)
- Parameters:
name
- the name of the type to retrieve- Returns:
- the type definition (or null, if it doesn't exist)
-
getAnonymousType
@NotAuditable TypeDefinition getAnonymousType(QName type, Collection<QName> aspects)
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
TypeDefinition getAnonymousType(QName name)
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
@NotAuditable Collection<QName> getAllAspects()
- Returns:
- the names of all aspects that have been registered with the Repository
-
getAllAspects
@NotAuditable Collection<QName> getAllAspects(boolean includeInherited)
-
getSubAspects
@NotAuditable Collection<QName> getSubAspects(QName aspect, boolean follow)
- Parameters:
aspect
- QNamefollow
- true => follow up the super-class hierarchy, false => immediate sub aspects only- Returns:
- the sub aspects of specified aspect
-
getAspects
@NotAuditable Collection<QName> getAspects(QName model)
- Parameters:
model
- the model to retrieve aspects for- Returns:
- the names of all aspects defined within the specified model
-
getAssociations
@NotAuditable Collection<QName> getAssociations(QName model)
- Parameters:
model
- the model to retrieve associations for- Returns:
- the names of all associations defined within the specified model
-
getAspect
@NotAuditable AspectDefinition getAspect(QName name)
- Parameters:
name
- the name of the aspect to retrieve- Returns:
- the aspect definition (or null, if it doesn't exist)
-
getClass
@NotAuditable ClassDefinition getClass(QName name)
- Parameters:
name
- the name of the class (type or aspect) to retrieve- Returns:
- the class definition (or null, if it doesn't exist)
-
isSubClass
@NotAuditable boolean isSubClass(QName className, QName ofClassName)
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
@NotAuditable PropertyDefinition getProperty(QName className, QName propertyName)
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
@NotAuditable Map<QName,PropertyDefinition> getPropertyDefs(QName className)
Gets the definitions of the properties defined by the specified Class.- Parameters:
className
- the class name- Returns:
- the property definitions
-
getProperty
@NotAuditable PropertyDefinition getProperty(QName propertyName)
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
@NotAuditable Collection<QName> getAllProperties(QName dataType)
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
@NotAuditable Collection<QName> getProperties(QName model, QName dataType)
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
Collection<QName> getProperties(QName model)
Get all properties for the specified model- Parameters:
model
- QName
-
getAssociation
@NotAuditable AssociationDefinition getAssociation(QName associationName)
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
@NotAuditable Collection<QName> getAllAssociations()
Get all the association definitions- Returns:
- all the association qnames
-
getAllAssociations
@NotAuditable Collection<QName> getAllAssociations(boolean includeInherited)
-
getConstraint
@NotAuditable ConstraintDefinition getConstraint(QName constraintQName)
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
Collection<ConstraintDefinition> getConstraints(QName model)
Get constraints for the specified model- Parameters:
model
- QName
-
getConstraints
Collection<ConstraintDefinition> getConstraints(QName model, boolean referenceableDefsOnly)
Get constraints for the specified model Optionally return referenceable (ie. non-property specific) constraints only- Parameters:
model
- QNamereferenceableDefsOnly
- boolean- Since:
- 3.2R
-
getModelByNamespaceUri
ModelDefinition getModelByNamespaceUri(String uri)
- Parameters:
uri
- the namespace uri for search for- Returns:
- the named model definition
-
-