org.alfresco.repo.dictionary
Interface DictionaryDAO

All Known Implementing Classes:
DictionaryDAOImpl

public interface DictionaryDAO

Dictionary Data Access


Method Summary
 void destroy()
          Destroy 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
 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)
           
 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.
 PropertyDefinition getProperty(QName name)
          Gets the specified property
 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.
 void register(DictionaryDeployer dictionaryDeployer)
          Register with the Dictionary
 void removeModel(QName model)
          Removes a model from the dictionary.
 void reset()
          Reset the Dictionary - destroy & re-initialise
 void validateModel(M2Model newOrUpdatedModel)
          validate against dictionary if new model then nothing to validate else if an existing model then could be updated (or unchanged) so validate to currently only allow incremental updates - addition of new types, aspects (except default aspects), properties, associations - no deletion of types, aspects or properties or associations - no addition, update or deletion of default/mandatory aspects
 

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

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 -
dataType -
Returns:

getNamespaces

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

validateModel

void validateModel(M2Model newOrUpdatedModel)
validate against dictionary if new model then nothing to validate else if an existing model then could be updated (or unchanged) so validate to currently only allow incremental updates - addition of new types, aspects (except default aspects), properties, associations - no deletion of types, aspects or properties or associations - no addition, update or deletion of default/mandatory aspects

Parameters:
newOrUpdatedModel -

register

void register(DictionaryDeployer dictionaryDeployer)
Register with the Dictionary

Parameters:
dictionaryDeployer -

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)

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 - 2008 Alfresco Software, Inc. All Rights Reserved.