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 Detail

      • getAllModels

        @NotAuditable
        java.util.Collection<QName> getAllModels()
        Returns:
        the names of all models that have been registered with the Repository
      • getAllDataTypes

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

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

        @NotAuditable
        java.util.Collection<QName> getAllTypes​(boolean includeInherited)
      • getSubTypes

        @NotAuditable
        java.util.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 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<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,
                                        java.util.Collection<QName> 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<QName> getAllAspects()
        Returns:
        the names of all aspects that have been registered with the Repository
      • getAllAspects

        @NotAuditable
        java.util.Collection<QName> getAllAspects​(boolean includeInherited)
      • getSubAspects

        @NotAuditable
        java.util.Collection<QName> getSubAspects​(QName aspect,
                                                  boolean follow)
        Parameters:
        aspect - QName
        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<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
        java.util.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 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<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
        java.util.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
        java.util.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 - QName
        dataType - QName
      • getProperties

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

        @NotAuditable
        java.util.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

        java.util.Collection<ConstraintDefinition> getConstraints​(QName model)
        Get constraints for the specified model
        Parameters:
        model - QName
      • getConstraints

        java.util.Collection<ConstraintDefinition> getConstraints​(QName model,
                                                                  boolean referenceableDefsOnly)
        Get constraints for the specified model Optionally return referenceable (ie. non-property specific) constraints only
        Parameters:
        model - QName
        referenceableDefsOnly - boolean
        Since:
        3.2R
      • getModelByNamespaceUri

        ModelDefinition getModelByNamespaceUri​(java.lang.String uri)
        Parameters:
        uri - the namespace uri for search for
        Returns:
        the named model definition