org.alfresco.repo.dictionary
Class DictionaryComponent

java.lang.Object
  extended by org.alfresco.repo.dictionary.DictionaryComponent
All Implemented Interfaces:
TenantDeployer, DictionaryService

public class DictionaryComponent
extends java.lang.Object
implements DictionaryService, TenantDeployer

Data Dictionary Service Implementation


Constructor Summary
DictionaryComponent()
           
 
Method Summary
 void destroy()
           
 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 superAspect, boolean follow)
           
 java.util.Collection getSubTypes(QName superType, boolean follow)
          Get the sub types of the type.
 TypeDefinition getType(QName name)
           
 java.util.Collection getTypes(QName model)
           
 void init()
           
 boolean isSubClass(QName className, QName ofClassName)
          Determines whether a class is a sub-class of another class
 void onDisableTenant()
           
 void onEnableTenant()
           
 void setDictionaryDAO(DictionaryDAO dictionaryDAO)
          Sets the Meta Model DAO
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryComponent

public DictionaryComponent()
Method Detail

setDictionaryDAO

public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
Sets the Meta Model DAO

Parameters:
metaModelDAO - meta model DAO

getAllModels

public java.util.Collection getAllModels()
Specified by:
getAllModels in interface DictionaryService
Returns:
the names of all models that have been registered with the Repository

getModel

public ModelDefinition getModel(QName model)
Specified by:
getModel in interface DictionaryService
Parameters:
model - the model name to retrieve
Returns:
the specified model (or null, if it doesn't exist)

getAllDataTypes

public java.util.Collection getAllDataTypes()
Specified by:
getAllDataTypes in interface DictionaryService
Returns:
the names of all data types that have been registered with the Repository

getDataTypes

public java.util.Collection getDataTypes(QName model)
Specified by:
getDataTypes in interface DictionaryService
Parameters:
model - the model to retrieve data types for
Returns:
the names of all data types defined within the specified model

getAllTypes

public java.util.Collection getAllTypes()
Specified by:
getAllTypes in interface DictionaryService
Returns:
the names of all types that have been registered with the Repository

getSubTypes

public java.util.Collection getSubTypes(QName superType,
                                        boolean follow)
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 interface DictionaryService
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

public java.util.Collection getTypes(QName model)
Specified by:
getTypes in interface DictionaryService
Parameters:
model - the model to retrieve types for
Returns:
the names of all types defined within the specified model

getAllAspects

public java.util.Collection getAllAspects()
Specified by:
getAllAspects in interface DictionaryService
Returns:
the names of all aspects that have been registered with the Repository

getAllAssociations

public java.util.Collection getAllAssociations()
Description copied from interface: DictionaryService
Get all the association definitions

Specified by:
getAllAssociations in interface DictionaryService
Returns:
all the association qnames

getSubAspects

public java.util.Collection getSubAspects(QName superAspect,
                                          boolean follow)
Specified by:
getSubAspects in interface DictionaryService
follow - true => follow up the super-class hierarchy, false => immediate sub aspects only
Returns:
the sub aspects of specified aspect

getAspects

public java.util.Collection getAspects(QName model)
Specified by:
getAspects in interface DictionaryService
Parameters:
model - the model to retrieve aspects for
Returns:
the names of all aspects defined within the specified model

getAssociations

public java.util.Collection getAssociations(QName model)
Specified by:
getAssociations in interface DictionaryService
Parameters:
model - the model to retrieve associations for
Returns:
the names of all associations defined within the specified model

isSubClass

public boolean isSubClass(QName className,
                          QName ofClassName)
Description copied from interface: DictionaryService
Determines whether a class is a sub-class of another class

Specified by:
isSubClass in interface DictionaryService
Parameters:
className - the sub-class to test
ofClassName - the class to test against
Returns:
true => the class is a sub-class (or itself)

getDataType

public DataTypeDefinition getDataType(QName name)
Specified by:
getDataType in interface DictionaryService
Parameters:
name - the name of the data type to retrieve
Returns:
the data type definition (or null, if it doesn't exist)

getDataType

public DataTypeDefinition getDataType(java.lang.Class javaClass)
Specified by:
getDataType in interface DictionaryService
Parameters:
javaClass - java class to find datatype for
Returns:
the data type definition (or null, if a mapping does not exist)

getType

public TypeDefinition getType(QName name)
Specified by:
getType in interface DictionaryService
Parameters:
name - the name of the type to retrieve
Returns:
the type definition (or null, if it doesn't exist)

getAspect

public AspectDefinition getAspect(QName name)
Specified by:
getAspect in interface DictionaryService
Parameters:
name - the name of the aspect to retrieve
Returns:
the aspect definition (or null, if it doesn't exist)

getClass

public ClassDefinition getClass(QName name)
Specified by:
getClass in interface DictionaryService
Parameters:
name - the name of the class (type or aspect) to retrieve
Returns:
the class definition (or null, if it doesn't exist)

getAnonymousType

public TypeDefinition getAnonymousType(QName type,
                                       java.util.Collection aspects)
Description copied from interface: DictionaryService
Construct an anonymous type that combines the definitions of the specified type and aspects.

Specified by:
getAnonymousType in interface DictionaryService
Parameters:
type - the type to start with
aspects - the aspects to combine with the type
Returns:
the anonymous type definition

getAnonymousType

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

Specified by:
getAnonymousType in interface DictionaryService
Parameters:
name - the name of the type definition.
Returns:
the anonymous type definition

getProperty

public PropertyDefinition getProperty(QName className,
                                      QName propertyName)
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 interface DictionaryService
Parameters:
className - the class name
propertyName - the property name
Returns:
the property definition (or null, if it doesn't exist)

getPropertyDefs

public java.util.Map getPropertyDefs(QName className)
Description copied from interface: DictionaryService
Gets the definitions of the properties defined by the specified Class.

Specified by:
getPropertyDefs in interface DictionaryService
Parameters:
className - the class name
Returns:
the property definitions

getProperty

public PropertyDefinition getProperty(QName propertyName)
Description copied from interface: DictionaryService
Gets the definition of the property as defined by its owning Class.

Specified by:
getProperty in interface DictionaryService
Parameters:
propertyName - the property name
Returns:
the property definition (or null, if it doesn't exist)

getAssociation

public AssociationDefinition getAssociation(QName associationName)
Description copied from interface: DictionaryService
Gets the definition of the association as defined by its owning Class.

Specified by:
getAssociation in interface DictionaryService
Parameters:
associationName - the property name
Returns:
the association definition (or null, if it doesn't exist)

getAllProperties

public java.util.Collection getAllProperties(QName dataType)
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 interface DictionaryService
Returns:

getProperties

public java.util.Collection getProperties(QName model,
                                          QName dataType)
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 interface DictionaryService
Returns:

getProperties

public java.util.Collection getProperties(QName model)
Description copied from interface: DictionaryService
Get all properties for the specified model

Specified by:
getProperties in interface DictionaryService
Returns:

getConstraint

public ConstraintDefinition getConstraint(QName constraintQName)
Description copied from interface: DictionaryService
Gets the definition of the constraint

Specified by:
getConstraint in interface DictionaryService
Returns:
the constraint definition (or null, if it doesn't exist)

getConstraints

public java.util.Collection getConstraints(QName model)
Description copied from interface: DictionaryService
Get constraints for the specified model

Specified by:
getConstraints in interface DictionaryService
Returns:

getConstraints

public java.util.Collection getConstraints(QName model,
                                           boolean referenceableDefsOnly)
Description copied from interface: DictionaryService
Get constraints for the specified model Optionally return referenceable (ie. non-property specific) constraints only

Specified by:
getConstraints in interface DictionaryService
Returns:

init

public void init()
Specified by:
init in interface TenantDeployer

destroy

public void destroy()
Specified by:
destroy in interface TenantDeployer

onEnableTenant

public void onEnableTenant()
Specified by:
onEnableTenant in interface TenantDeployer

onDisableTenant

public void onDisableTenant()
Specified by:
onDisableTenant in interface TenantDeployer


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