Interface CustomModelService
-
public interface CustomModelServiceCustom model service configuration API.- Author:
- Jamal Kaabi-Mofrad
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactivateCustomModel(String modelFileName)Activates custom modelCompiledModelcompileModel(M2Model m2Model)Compiles theM2Model.CustomModelDefinitioncreateCustomModel(M2Model m2Model, boolean activate)Creates custom modelNodeRefcreateDownloadNode(String modelName, boolean withAssociatedForm)Creates a downloadable archive file containing the custom model file and if specified, its associated Share extension module file.voiddeactivateCustomModel(String modelFileName)Deactivates custom modelvoiddeleteCustomModel(String modelFileName)Deletes custom model.PagingResults<AspectDefinition>getAllCustomAspects(PagingRequest pagingRequest)Get a paged list of custom aspectsPagingResults<TypeDefinition>getAllCustomTypes(PagingRequest pagingRequest)Gets a paged list of custom typesAspectDefinitiongetCustomAspect(QName name)Gets custom aspectConstraintDefinitiongetCustomConstraint(QName name)Gets custom constraintCustomModelDefinitiongetCustomModel(String modelFileName)Gets custom modelModelDefinitiongetCustomModelByUri(String namespaceUri)Gets custom modelPagingResults<CustomModelDefinition>getCustomModels(PagingRequest pagingRequest)Gets a paged list of custom modelsCustomModelsInfogetCustomModelsInfo()Gets custom models' information.TypeDefinitiongetCustomType(QName name)Gets custom typeNodeRefgetModelNodeRef(String modelFileName)Gets custom model node referencebooleanisModelAdmin(String userName)Indicates whether the specified user is a model-administrator or not.booleanisModelExists(String modelFileName)Whether a model with the given name exists or notbooleanisNamespacePrefixExists(String modelNamespacePrefix)Whether the given namespace prefix has already been used or notbooleanisNamespaceUriExists(String modelNamespaceUri)Whether the given URI has already been used or notCustomModelDefinitionupdateCustomModel(String modelFileName, M2Model m2Model, boolean activate)Updates custom model
-
-
-
Method Detail
-
getCustomModel
CustomModelDefinition getCustomModel(String modelFileName)
Gets custom model- Parameters:
modelFileName- the name of the custom model to retrieve- Returns:
- the
CustomModelDefinition(or null, if it doesn't exist)
-
getCustomModelByUri
ModelDefinition getCustomModelByUri(String namespaceUri)
Gets custom model- Parameters:
namespaceUri- the namespace URI defined within the model- Returns:
- the
ModelDefinition(or null, if it doesn't exist)
-
getCustomModels
PagingResults<CustomModelDefinition> getCustomModels(PagingRequest pagingRequest)
Gets a paged list of custom models- Parameters:
pagingRequest- paging request- Returns:
- paged list of
CustomModelDefinition
-
getCustomAspect
AspectDefinition getCustomAspect(QName name)
Gets custom aspect- Parameters:
name- the name of the custom aspect to retrieve- Returns:
- the
AspectDefinition(or null, if it doesn't exist)
-
getAllCustomAspects
PagingResults<AspectDefinition> getAllCustomAspects(PagingRequest pagingRequest)
Get a paged list of custom aspects- Parameters:
pagingRequest- paging request- Returns:
- paged list of
AspectDefinition
-
getCustomType
TypeDefinition getCustomType(QName name)
Gets custom type- Parameters:
name- the name of the custom type to retrieve- Returns:
- the
TypeDefinition(or null, if it doesn't exist)
-
getAllCustomTypes
PagingResults<TypeDefinition> getAllCustomTypes(PagingRequest pagingRequest)
Gets a paged list of custom types- Parameters:
pagingRequest- paging request- Returns:
- paged list of
TypeDefinition
-
getModelNodeRef
NodeRef getModelNodeRef(String modelFileName)
Gets custom model node reference- Parameters:
modelFileName- the name of the custom model to retrieve- Returns:
- the
NodeRefof the custom model (or null, if it doesn't exist)
-
createCustomModel
CustomModelDefinition createCustomModel(M2Model m2Model, boolean activate)
Creates custom model- Parameters:
m2Model- theM2Modelobjectactivate- whether the model should be activated or not- Returns:
- the created model definition as a
CustomModelDefinitionobject
-
isModelAdmin
boolean isModelAdmin(String userName)
Indicates whether the specified user is a model-administrator or not.Note: The super/repo admin is considered to be a model-administrator too.
- Parameters:
userName- The user name- Returns:
- true if the specified user is a model-administrator, false otherwise
-
activateCustomModel
void activateCustomModel(String modelFileName)
Activates custom model- Parameters:
modelFileName- the name of the custom model
-
deactivateCustomModel
void deactivateCustomModel(String modelFileName)
Deactivates custom model- Parameters:
modelFileName- the name of the custom model
-
updateCustomModel
CustomModelDefinition updateCustomModel(String modelFileName, M2Model m2Model, boolean activate)
Updates custom model- Parameters:
modelFileName- the model namem2Model- theM2Modelobjectactivate- whether the model should be activated or not- Returns:
- the updated model definition as a
CustomModelDefinitionobject
-
deleteCustomModel
void deleteCustomModel(String modelFileName)
Deletes custom model.The model can only be deleted if it is inactive
- Parameters:
modelFileName- the model name
-
isNamespaceUriExists
boolean isNamespaceUriExists(String modelNamespaceUri)
Whether the given URI has already been used or not- Parameters:
modelNamespaceUri- the model namespace URI- Returns:
- true if the URI has been used, false otherwise
-
isModelExists
boolean isModelExists(String modelFileName)
Whether a model with the given name exists or not- Parameters:
modelFileName- the model name- Returns:
- true if the model exists, false otherwise
-
isNamespacePrefixExists
boolean isNamespacePrefixExists(String modelNamespacePrefix)
Whether the given namespace prefix has already been used or not- Parameters:
modelNamespaceUri- the model namespace prefix- Returns:
- true if the prefix has been used, false otherwise
-
getCustomConstraint
ConstraintDefinition getCustomConstraint(QName name)
Gets custom constraint- Parameters:
name- the name of the custom constraint to retrieve- Returns:
- the
ConstraintDefinition(or null, if it doesn't exist)
-
createDownloadNode
NodeRef createDownloadNode(String modelName, boolean withAssociatedForm)
Creates a downloadable archive file containing the custom model file and if specified, its associated Share extension module file.- Parameters:
modelName- the model name to be exportedwithAssociatedForm- whether Share extension module file should be included or not- Returns:
- reference to the node which will contain the archive file
-
compileModel
CompiledModel compileModel(M2Model m2Model)
Compiles theM2Model.- Parameters:
m2Model- the model- Returns:
- the compiled model of the given m2model
- Throws:
CustomModelConstraintExceptionInvalidCustomModelException
-
getCustomModelsInfo
CustomModelsInfo getCustomModelsInfo()
Gets custom models' information.- Returns:
CustomModelsInfocontaining:- number of active models
- number of active models' types
- number of active models' aspects
-
-