org.alfresco.repo.dictionary
Interface DictionaryDAO

All Known Implementing Classes:
DictionaryDAOImpl

public interface DictionaryDAO

Dictionary Data Access


Method Summary
 void destroy()
          Destroy the Dictionary
 java.util.List diffModel(M2Model model)
          Return diffs between input model and model in the Dictionary.
 TypeDefinition getAnonymousType(QName type, java.util.Collection aspects)
          Construct an anonymous type that combines a primary type definition and and one or more aspects
 AspectDefinition getAspect(QName name)
          Gets the specified aspect
 java.util.Collection getAspects(QName model)
           
 AssociationDefinition getAssociation(QName name)
          Gets the specified association
 java.util.Collection getAssociations(QName model)
           
 ClassDefinition getClass(QName name)
          Gets the specified class
 ConstraintDefinition getConstraint(QName name)
          Gets the specified property constraint
 java.util.Collection getConstraints(QName model)
           
 java.util.Collection getConstraints(QName model, boolean referenceableDefsOnly)
           
 DataTypeDefinition getDataType(java.lang.Class javaClass)
          Gets the data type for the specified Java Class
 DataTypeDefinition getDataType(QName name)
          Gets the specified data type
 java.util.Collection getDataTypes(QName model)
           
 java.lang.String getDefaultAnalyserResourceBundleName()
           
 ModelDefinition getModel(QName name)
           
 java.util.Collection getModels()
           
 java.util.Collection getNamespaces(QName modelName)
           
 java.util.Collection getProperties(QName model)
           
 java.util.Collection getProperties(QName modelName, QName dataType)
          Get all properties for the model and that are of the given data type.
 java.util.Collection getPropertiesOfDataType(QName dataType)
          Get all properties for all models of the given data type.
 PropertyDefinition getProperty(QName name)
          Gets the specified property
 java.lang.ClassLoader getResourceClassLoader()
           
 java.util.Collection getSubAspects(QName superAspect, boolean follow)
           
 java.util.Collection getSubTypes(QName superType, boolean follow)
           
 TypeDefinition getType(QName name)
          Gets the specified type
 java.util.Collection getTypes(QName model)
           
 void init()
          Initialise the Dictionary
 boolean isModelInherited(QName name)
           
 QName putModel(M2Model model)
          Adds a model to the dictionary.
 QName putModelIgnoringConstraints(M2Model model)
          Adds a model to the dictionary.
 void register(DictionaryListener dictionaryListener)
          Register listener with the Dictionary
 void removeModel(QName model)
          Removes a model from the dictionary.
 void reset()
          Reset the Dictionary - destroy & re-initialise
 void setResourceClassLoader(java.lang.ClassLoader resourceClassLoader)
           
 

Method Detail

getModels

java.util.Collection getModels()
Returns:
the models known by the dictionary

getModel

ModelDefinition getModel(QName name)
Parameters:
name - the model to retrieve
Returns:
the named model definition

getDataTypes

java.util.Collection getDataTypes(QName model)
Parameters:
model - the model to retrieve property types for
Returns:
the property types of the model

getTypes

java.util.Collection getTypes(QName model)
Parameters:
model - the model to retrieve types for
Returns:
the types of the model

getSubTypes

java.util.Collection getSubTypes(QName superType,
                                 boolean follow)
Parameters:
superType -
follow - true => follow up the super-class hierarchy, false => immediate sub types only
Returns:

getAspects

java.util.Collection getAspects(QName model)
Parameters:
model - the model to retrieve aspects for
Returns:
the aspects of the model

getAssociations

java.util.Collection getAssociations(QName model)
Parameters:
model - the model to retrieve associations for
Returns:
the associations of the model

getSubAspects

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

getProperties

java.util.Collection getProperties(QName model)
Parameters:
model - the model for which to get properties for
Returns:
the properties of the model

getAnonymousType

TypeDefinition getAnonymousType(QName type,
                                java.util.Collection aspects)
Construct an anonymous type that combines a primary type definition and and one or more aspects

Parameters:
type - the primary type
aspects - the aspects to combine
Returns:
the anonymous type definition

putModel

QName putModel(M2Model model)
Adds a model to the dictionary. The model is compiled and validated.

Parameters:
model - the model to add
Returns:
QName name of model

putModelIgnoringConstraints

QName putModelIgnoringConstraints(M2Model model)
Adds a model to the dictionary. The model is compiled and validated. Constraints are not loaded. This method should only be used to load models where the enforcement of constraints is never required. For example, SOLR read only use of the index where contraints are not required and thier definitions may not be available.

Parameters:
model - the model to add
Returns:
QName name of model

removeModel

void removeModel(QName model)
Removes a model from the dictionary. The types and aspect in the model will no longer be available.

Parameters:
model - the qname of the model to remove

getProperties

java.util.Collection getProperties(QName modelName,
                                   QName dataType)
Get all properties for the model and that are of the given data type. If dataType is null then the all properties will be returned.

Parameters:
modelName - the name of the model
dataType - null to get all properties
Returns:
the properties associated with the model

getPropertiesOfDataType

java.util.Collection getPropertiesOfDataType(QName dataType)
Get all properties for all models of the given data type.

Parameters:
modelName -
dataType -
Returns:

getNamespaces

java.util.Collection getNamespaces(QName modelName)
Parameters:
model - the model to retrieve namespaces for
Returns:
the namespaces of the model

getConstraints

java.util.Collection getConstraints(QName model)
Parameters:
model - the model to retrieve constraint defs (including property constaint refs)
Returns:
the constraints of the model

getConstraints

java.util.Collection getConstraints(QName model,
                                    boolean referenceableDefsOnly)
Parameters:
model - the model to retrieve constraint defs (optionally only referenceable constraints)
Returns:
the constraints of the model

diffModel

java.util.List diffModel(M2Model model)
Return diffs between input model and model in the Dictionary. If the input model does not exist in the Dictionary then no diffs will be returned.

Parameters:
model -
Returns:
model diffs (if any)

register

void register(DictionaryListener dictionaryListener)
Register listener with the Dictionary

Parameters:
dictionaryListener -

reset

void reset()
Reset the Dictionary - destroy & re-initialise


init

void init()
Initialise the Dictionary


destroy

void destroy()
Destroy the Dictionary


isModelInherited

boolean isModelInherited(QName name)

getDefaultAnalyserResourceBundleName

java.lang.String getDefaultAnalyserResourceBundleName()
Returns:

getResourceClassLoader

java.lang.ClassLoader getResourceClassLoader()
Returns:

setResourceClassLoader

void setResourceClassLoader(java.lang.ClassLoader resourceClassLoader)
Parameters:
resourceClassLoader -

getDataType

DataTypeDefinition getDataType(QName name)
Gets the specified data type

Parameters:
name - name of the data type
Returns:
data type definition

getDataType

DataTypeDefinition getDataType(java.lang.Class javaClass)
Gets the data type for the specified Java Class

Parameters:
javaClass - the java class
Returns:
the data type definition (or null, if mapping is not available)

getType

TypeDefinition getType(QName name)
Gets the specified type

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

getAspect

AspectDefinition getAspect(QName name)
Gets the specified aspect

Parameters:
name - name of the aspect
Returns:
aspect definition

getClass

ClassDefinition getClass(QName name)
Gets the specified class

Parameters:
name - name of the class
Returns:
class definition

getProperty

PropertyDefinition getProperty(QName name)
Gets the specified property

Parameters:
name - name of the property
Returns:
property definition

getConstraint

ConstraintDefinition getConstraint(QName name)
Gets the specified property constraint

Parameters:
name - the qualified name of the property constraint
Returns:

getAssociation

AssociationDefinition getAssociation(QName name)
Gets the specified association

Parameters:
name - name of the association
Returns:
association definition


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