Package org.alfresco.repo.dictionary
Class CustomModelDefinitionImpl
- java.lang.Object
-
- org.alfresco.repo.dictionary.CustomModelDefinitionImpl
-
- All Implemented Interfaces:
CustomModelDefinition
,ModelDefinition
public class CustomModelDefinitionImpl extends java.lang.Object implements CustomModelDefinition
Read-only definition of a Custom Model- Author:
- Jamal Kaabi-Mofrad
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.service.cmr.dictionary.ModelDefinition
ModelDefinition.XMLBindingType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAnalyserResourceBundleName()
Get the name of the property bundle that defines analyser mappings for this model (keyed by the type of the property)java.util.Collection<AspectDefinition>
getAspectDefinitions()
Returns aCollection
of the modelAspectDefinition
sjava.lang.String
getAuthor()
long
getChecksum(ModelDefinition.XMLBindingType xmlbindingtype)
java.lang.String
getDescription()
Returns the model descriptionjava.lang.String
getDescription(MessageLookup messagelookup)
DictionaryDAO
getDictionaryDAO()
java.util.Collection<NamespaceDefinition>
getImportedNamespaces()
java.util.Collection<ConstraintDefinition>
getModelDefinedConstraints()
Returns aCollection
of the model definedConstraintDefinition
sQName
getName()
java.util.Collection<NamespaceDefinition>
getNamespaces()
java.util.Date
getPublishedDate()
java.util.Collection<TypeDefinition>
getTypeDefinitions()
Returns aCollection
of the modelTypeDefinition
sjava.lang.String
getVersion()
boolean
isActive()
Whether the model is active or notboolean
isNamespaceDefined(java.lang.String uri)
boolean
isNamespaceImported(java.lang.String uri)
static java.util.List<ConstraintDefinition>
removeInlineConstraints(CompiledModel compiledModel)
Removes the inline constraints (i.e.void
toXML(ModelDefinition.XMLBindingType xmlbindingtype, java.io.OutputStream xml)
-
-
-
Method Detail
-
removeInlineConstraints
public static java.util.List<ConstraintDefinition> removeInlineConstraints(CompiledModel compiledModel)
Removes the inline constraints (i.e. defined within the property) from all constraints. The result will be constraints that have been defined within the model (Top level) itself.- Parameters:
compiledModel
- the compiled model- Returns:
- list of model defined constraints
-
getDescription
public java.lang.String getDescription()
Description copied from interface:CustomModelDefinition
Returns the model description- Specified by:
getDescription
in interfaceCustomModelDefinition
- Returns:
- the model description
-
isActive
public boolean isActive()
Description copied from interface:CustomModelDefinition
Whether the model is active or not- Specified by:
isActive
in interfaceCustomModelDefinition
- Returns:
- true if the model is active, false otherwise
-
getAnalyserResourceBundleName
public java.lang.String getAnalyserResourceBundleName()
Description copied from interface:ModelDefinition
Get the name of the property bundle that defines analyser mappings for this model (keyed by the type of the property)- Specified by:
getAnalyserResourceBundleName
in interfaceModelDefinition
- Returns:
- the resource or null if not set.
-
getAuthor
public java.lang.String getAuthor()
- Specified by:
getAuthor
in interfaceModelDefinition
- Returns:
- the model author
-
getChecksum
public long getChecksum(ModelDefinition.XMLBindingType xmlbindingtype)
- Specified by:
getChecksum
in interfaceModelDefinition
-
getDescription
public java.lang.String getDescription(MessageLookup messagelookup)
- Specified by:
getDescription
in interfaceModelDefinition
- Returns:
- the model description
-
getDictionaryDAO
public DictionaryDAO getDictionaryDAO()
- Specified by:
getDictionaryDAO
in interfaceModelDefinition
- Returns:
- DictionaryDAO
-
getImportedNamespaces
public java.util.Collection<NamespaceDefinition> getImportedNamespaces()
- Specified by:
getImportedNamespaces
in interfaceModelDefinition
- Returns:
- the namespaces imported by this model
-
getName
public QName getName()
- Specified by:
getName
in interfaceModelDefinition
- Returns:
- the model name
-
getNamespaces
public java.util.Collection<NamespaceDefinition> getNamespaces()
- Specified by:
getNamespaces
in interfaceModelDefinition
- Returns:
- the namespaces defined by this model
-
getPublishedDate
public java.util.Date getPublishedDate()
- Specified by:
getPublishedDate
in interfaceModelDefinition
- Returns:
- the date when the model was published
-
getVersion
public java.lang.String getVersion()
- Specified by:
getVersion
in interfaceModelDefinition
- Returns:
- the model version
-
isNamespaceDefined
public boolean isNamespaceDefined(java.lang.String uri)
- Specified by:
isNamespaceDefined
in interfaceModelDefinition
- Parameters:
uri
- namespace uri- Returns:
- true => model defines the uri
-
isNamespaceImported
public boolean isNamespaceImported(java.lang.String uri)
- Specified by:
isNamespaceImported
in interfaceModelDefinition
- Parameters:
uri
- namespace uri- Returns:
- true => model imports the uri
-
toXML
public void toXML(ModelDefinition.XMLBindingType xmlbindingtype, java.io.OutputStream xml)
- Specified by:
toXML
in interfaceModelDefinition
-
getTypeDefinitions
public java.util.Collection<TypeDefinition> getTypeDefinitions()
Description copied from interface:CustomModelDefinition
Returns aCollection
of the modelTypeDefinition
s- Specified by:
getTypeDefinitions
in interfaceCustomModelDefinition
- Returns:
- an unmodifiable collection of the model types definitions, or an empty collection
-
getAspectDefinitions
public java.util.Collection<AspectDefinition> getAspectDefinitions()
Description copied from interface:CustomModelDefinition
Returns aCollection
of the modelAspectDefinition
s- Specified by:
getAspectDefinitions
in interfaceCustomModelDefinition
- Returns:
- an unmodifiable collection of the model aspects definitions, or an empty collection
-
getModelDefinedConstraints
public java.util.Collection<ConstraintDefinition> getModelDefinedConstraints()
Description copied from interface:CustomModelDefinition
Returns aCollection
of the model definedConstraintDefinition
s- Specified by:
getModelDefinedConstraints
in interfaceCustomModelDefinition
- Returns:
- an unmodifiable collection of the model constraint definitions, or an empty collection
-
-