org.alfresco.service.cmr.dictionary
Interface DictionaryService

All Known Implementing Classes:
DictionaryComponent

public interface DictionaryService

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).


Method Summary
 java.util.Collection getAllAspects()
           
 java.util.Collection getAllAssociations()
          Get all the association definitions
 java.util.Collection getAllDataTypes()
           
 java.util.Collection getAllModels()
           
 java.util.Collection getAllProperties(QName dataType)
          Get all properties defined across all models with the given data type.
 java.util.Collection getAllTypes()
           
 TypeDefinition getAnonymousType(QName name)
          Creates an anonymous TypeDefinition with all the mandatory Aspects applied.
 TypeDefinition getAnonymousType(QName type, java.util.Collection aspects)
          Construct an anonymous type that combines the definitions of the specified type and aspects.
 AspectDefinition getAspect(QName name)
           
 java.util.Collection getAspects(QName model)
           
 AssociationDefinition getAssociation(QName associationName)
          Gets the definition of the association as defined by its owning Class.
 java.util.Collection getAssociations(QName model)
           
 ClassDefinition getClass(QName name)
           
 ConstraintDefinition getConstraint(QName constraintQName)
          Gets the definition of the constraint
 java.util.Collection getConstraints(QName model)
          Get constraints for the specified model
 java.util.Collection getConstraints(QName model, boolean referenceableDefsOnly)
          Get constraints for the specified model Optionally return referenceable (ie.
 DataTypeDefinition getDataType(java.lang.Class javaClass)
           
 DataTypeDefinition getDataType(QName name)
           
 java.util.Collection getDataTypes(QName model)
           
 ModelDefinition getModel(QName model)
           
 java.util.Collection getProperties(QName model)
          Get all properties for the specified model
 java.util.Collection 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.
 java.util.Map getPropertyDefs(QName className)
          Gets the definitions of the properties defined by the specified Class.
 java.util.Collection getSubAspects(QName aspect, boolean follow)
           
 java.util.Collection getSubTypes(QName type, boolean follow)
          Get the sub types of the type.
 TypeDefinition getType(QName name)
           
 java.util.Collection getTypes(QName model)
           
 boolean isSubClass(QName className, QName ofClassName)
          Determines whether a class is a sub-class of another class
 

Method Detail

getAllModels

@NotAuditable
java.util.Collection 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 (or null, if it doesn't exist)

getAllDataTypes

@NotAuditable
java.util.Collection getAllDataTypes()
Returns:
the names of all data types that have been registered with the Repository

getDataTypes

@NotAuditable
java.util.Collection 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(java.lang.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
java.util.Collection getAllTypes()
Returns:
the names of all types that have been registered with the Repository

getSubTypes

@NotAuditable
java.util.Collection 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 type
follow - 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
java.util.Collection 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,
                                             java.util.Collection aspects)
Construct an anonymous type that combines the definitions of the specified type and aspects.

Parameters:
type - the type to start with
aspects - the aspects to combine with the type
Returns:
the anonymous type definition

getAnonymousType

TypeDefinition getAnonymousType(QName name)
Creates an anonymous TypeDefinition with all the mandatory Aspects applied. This collapses all mandatory Aspects into a single TypeDefinition.

Parameters:
name - the name of the type definition.
Returns:
the anonymous type definition

getAllAspects

@NotAuditable
java.util.Collection getAllAspects()
Returns:
the names of all aspects that have been registered with the Repository

getSubAspects

@NotAuditable
java.util.Collection getSubAspects(QName aspect,
                                                boolean follow)
Parameters:
aspect -
follow - true => follow up the super-class hierarchy, false => immediate sub aspects only
Returns:
the sub aspects of specified aspect

getAspects

@NotAuditable
java.util.Collection getAspects(QName model)
Parameters:
model - the model to retrieve aspects for
Returns:
the names of all aspects defined within the specified model

getAssociations

@NotAuditable
java.util.Collection 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 test
ofClassName - 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 name
propertyName - the property name
Returns:
the property definition (or null, if it doesn't exist)

getPropertyDefs

@NotAuditable
java.util.Map 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
java.util.Collection 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 -
Returns:

getProperties

@NotAuditable
java.util.Collection 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:
dataType -
Returns:

getProperties

java.util.Collection getProperties(QName model)
Get all properties for the specified model

Parameters:
model -
Returns:

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
java.util.Collection getAllAssociations()
Get all the association definitions

Returns:
all the association qnames

getConstraint

@NotAuditable
ConstraintDefinition getConstraint(QName constraintQName)
Gets the definition of the constraint

Parameters:
constraintName - the constraint name
Returns:
the constraint definition (or null, if it doesn't exist)
Since:
3.2.1

getConstraints

java.util.Collection getConstraints(QName model)
Get constraints for the specified model

Parameters:
model -
Returns:

getConstraints

java.util.Collection getConstraints(QName model,
                                    boolean referenceableDefsOnly)
Get constraints for the specified model Optionally return referenceable (ie. non-property specific) constraints only

Parameters:
model -
referenceableDefsOnly -
Returns:
Since:
3.2R


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.