Package org.alfresco.repo.dictionary
Class CustomModelServiceImpl
- java.lang.Object
-
- org.alfresco.repo.dictionary.CustomModelServiceImpl
-
- All Implemented Interfaces:
org.alfresco.service.cmr.dictionary.CustomModelService
public class CustomModelServiceImpl extends java.lang.Object implements org.alfresco.service.cmr.dictionary.CustomModelServiceCustom Model Service Implementation- Author:
- Jamal Kaabi-Mofrad
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALFRESCO_MODEL_ADMINISTRATORS_AUTHORITYstatic org.alfresco.service.namespace.QNameASPECT_CUSTOM_MODELstatic java.lang.StringDEFAULT_CUSTOM_MODEL_ASPECTstatic java.lang.StringGROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITYstatic java.lang.StringSHARE_EXT_MODULE_SUFFIX
-
Constructor Summary
Constructors Constructor Description CustomModelServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateCustomModel(java.lang.String modelName)org.alfresco.repo.dictionary.CompiledModelcompileModel(org.alfresco.repo.dictionary.M2Model m2Model)org.alfresco.service.cmr.dictionary.CustomModelDefinitioncreateCustomModel(org.alfresco.repo.dictionary.M2Model m2Model, boolean activate)protected org.alfresco.service.cmr.repository.NodeRefcreateCustomModelCopy(java.lang.String newName, org.alfresco.service.cmr.repository.NodeRef modelNodeRef)Creates a copy of the custom model where the created node will be a child of download container.protected org.alfresco.service.cmr.repository.NodeRefcreateCustomModelShareExtModuleRef(java.lang.String modelName)Finds themoduleelement within the Share persisted-extension XML file and then writes the XML fragment as the content of a newly created node.org.alfresco.service.cmr.repository.NodeRefcreateDownloadNode(java.lang.String modelFileName, boolean withAssociatedForm)voiddeactivateCustomModel(java.lang.String modelName)voiddeleteCustomModel(java.lang.String modelName)org.alfresco.query.PagingResults<org.alfresco.service.cmr.dictionary.AspectDefinition>getAllCustomAspects(org.alfresco.query.PagingRequest pagingRequest)protected java.util.List<org.alfresco.service.cmr.dictionary.CustomModelDefinition>getAllCustomModels()org.alfresco.query.PagingResults<org.alfresco.service.cmr.dictionary.TypeDefinition>getAllCustomTypes(org.alfresco.query.PagingRequest pagingRequest)org.alfresco.service.cmr.dictionary.AspectDefinitiongetCustomAspect(org.alfresco.service.namespace.QName name)protected org.alfresco.util.Pair<org.alfresco.repo.dictionary.CompiledModel,java.lang.Boolean>getCustomCompiledModel(java.lang.String modelName)Returns compiled custom model and whether the model is active or not as aPairobjectorg.alfresco.service.cmr.dictionary.ConstraintDefinitiongetCustomConstraint(org.alfresco.service.namespace.QName name)org.alfresco.service.cmr.dictionary.CustomModelDefinitiongetCustomModel(java.lang.String modelName)org.alfresco.service.cmr.dictionary.ModelDefinitiongetCustomModelByUri(java.lang.String namespaceUri)org.alfresco.query.PagingResults<org.alfresco.service.cmr.dictionary.CustomModelDefinition>getCustomModels(org.alfresco.query.PagingRequest pagingRequest)org.alfresco.repo.dictionary.CustomModelsInfogetCustomModelsInfo()org.alfresco.service.cmr.dictionary.TypeDefinitiongetCustomType(org.alfresco.service.namespace.QName name)org.alfresco.service.cmr.repository.NodeRefgetModelNodeRef(java.lang.String modelName)protected org.alfresco.service.cmr.repository.NodeRefgetShareExtModule()Gets Share persisted-extension nodeRefvoidinit()Checks that all necessary properties and services have been provided.booleanisModelAdmin(java.lang.String userName)booleanisModelExists(java.lang.String modelFileName)booleanisNamespacePrefixExists(java.lang.String modelNamespacePrefix)booleanisNamespaceUriExists(java.lang.String modelNamespaceUri)voidsetAuthorityService(AuthorityService authorityService)voidsetContentService(ContentService contentService)voidsetDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAOImpl dictionaryDAO)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetDownloadService(DownloadService downloadSerivce)voidsetDownloadStorage(DownloadStorage downloadStorage)voidsetHiddenAspect(HiddenAspect hiddenAspect)voidsetNamespaceDAO(org.alfresco.repo.dictionary.NamespaceDAO namespaceDAO)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetRepoAdminService(RepoAdminService repoAdminService)voidsetRepositoryModelsLocation(RepositoryLocation repoModelsLocation)voidsetRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)voidsetSearchService(org.alfresco.service.cmr.search.SearchService searchService)voidsetShareExtModulePath(java.lang.String shareExtModulePath)org.alfresco.service.cmr.dictionary.CustomModelDefinitionupdateCustomModel(java.lang.String modelFileName, org.alfresco.repo.dictionary.M2Model m2Model, boolean activate)protected <T> org.alfresco.query.PagingResults<T>wrapResult(org.alfresco.query.PagingRequest pagingRequest, java.util.List<T> result)
-
-
-
Field Detail
-
DEFAULT_CUSTOM_MODEL_ASPECT
public static final java.lang.String DEFAULT_CUSTOM_MODEL_ASPECT
- See Also:
- Constant Field Values
-
ASPECT_CUSTOM_MODEL
public static final org.alfresco.service.namespace.QName ASPECT_CUSTOM_MODEL
-
ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
public static final java.lang.String ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
- See Also:
- Constant Field Values
-
GROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
public static final java.lang.String GROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
- See Also:
- Constant Field Values
-
SHARE_EXT_MODULE_SUFFIX
public static final java.lang.String SHARE_EXT_MODULE_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setDictionaryDAO
public void setDictionaryDAO(org.alfresco.repo.dictionary.DictionaryDAOImpl dictionaryDAO)
-
setContentService
public void setContentService(ContentService contentService)
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
-
setRepositoryModelsLocation
public void setRepositoryModelsLocation(RepositoryLocation repoModelsLocation)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setNamespaceDAO
public void setNamespaceDAO(org.alfresco.repo.dictionary.NamespaceDAO namespaceDAO)
-
setRetryingTransactionHelper
public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
-
setRepoAdminService
public void setRepoAdminService(RepoAdminService repoAdminService)
-
setAuthorityService
public void setAuthorityService(AuthorityService authorityService)
-
setHiddenAspect
public void setHiddenAspect(HiddenAspect hiddenAspect)
-
setDownloadService
public void setDownloadService(DownloadService downloadSerivce)
-
setDownloadStorage
public void setDownloadStorage(DownloadStorage downloadStorage)
-
setShareExtModulePath
public void setShareExtModulePath(java.lang.String shareExtModulePath)
-
init
public void init()
Checks that all necessary properties and services have been provided.
-
getModelNodeRef
public org.alfresco.service.cmr.repository.NodeRef getModelNodeRef(java.lang.String modelName)
- Specified by:
getModelNodeRefin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getCustomModel
public org.alfresco.service.cmr.dictionary.CustomModelDefinition getCustomModel(java.lang.String modelName)
- Specified by:
getCustomModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getCustomModelByUri
public org.alfresco.service.cmr.dictionary.ModelDefinition getCustomModelByUri(java.lang.String namespaceUri)
- Specified by:
getCustomModelByUriin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getCustomCompiledModel
protected org.alfresco.util.Pair<org.alfresco.repo.dictionary.CompiledModel,java.lang.Boolean> getCustomCompiledModel(java.lang.String modelName)
Returns compiled custom model and whether the model is active or not as aPairobject- Parameters:
modelName- the name of the custom model to retrieve- Returns:
- the
Pair<CompiledModel, Boolean>(or null, if it doesn't exist)
-
getCustomModels
public org.alfresco.query.PagingResults<org.alfresco.service.cmr.dictionary.CustomModelDefinition> getCustomModels(org.alfresco.query.PagingRequest pagingRequest)
- Specified by:
getCustomModelsin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getAllCustomModels
protected java.util.List<org.alfresco.service.cmr.dictionary.CustomModelDefinition> getAllCustomModels()
-
getCustomAspect
public org.alfresco.service.cmr.dictionary.AspectDefinition getCustomAspect(org.alfresco.service.namespace.QName name)
- Specified by:
getCustomAspectin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getAllCustomAspects
public org.alfresco.query.PagingResults<org.alfresco.service.cmr.dictionary.AspectDefinition> getAllCustomAspects(org.alfresco.query.PagingRequest pagingRequest)
- Specified by:
getAllCustomAspectsin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getCustomType
public org.alfresco.service.cmr.dictionary.TypeDefinition getCustomType(org.alfresco.service.namespace.QName name)
- Specified by:
getCustomTypein interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getAllCustomTypes
public org.alfresco.query.PagingResults<org.alfresco.service.cmr.dictionary.TypeDefinition> getAllCustomTypes(org.alfresco.query.PagingRequest pagingRequest)
- Specified by:
getAllCustomTypesin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
getCustomConstraint
public org.alfresco.service.cmr.dictionary.ConstraintDefinition getCustomConstraint(org.alfresco.service.namespace.QName name)
- Specified by:
getCustomConstraintin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
createCustomModel
public org.alfresco.service.cmr.dictionary.CustomModelDefinition createCustomModel(org.alfresco.repo.dictionary.M2Model m2Model, boolean activate)- Specified by:
createCustomModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
updateCustomModel
public org.alfresco.service.cmr.dictionary.CustomModelDefinition updateCustomModel(java.lang.String modelFileName, org.alfresco.repo.dictionary.M2Model m2Model, boolean activate)- Specified by:
updateCustomModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
compileModel
public org.alfresco.repo.dictionary.CompiledModel compileModel(org.alfresco.repo.dictionary.M2Model m2Model)
- Specified by:
compileModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
wrapResult
protected <T> org.alfresco.query.PagingResults<T> wrapResult(org.alfresco.query.PagingRequest pagingRequest, java.util.List<T> result)
-
isModelAdmin
public boolean isModelAdmin(java.lang.String userName)
- Specified by:
isModelAdminin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
activateCustomModel
public void activateCustomModel(java.lang.String modelName)
- Specified by:
activateCustomModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
deactivateCustomModel
public void deactivateCustomModel(java.lang.String modelName)
- Specified by:
deactivateCustomModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
deleteCustomModel
public void deleteCustomModel(java.lang.String modelName)
- Specified by:
deleteCustomModelin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
isNamespaceUriExists
public boolean isNamespaceUriExists(java.lang.String modelNamespaceUri)
- Specified by:
isNamespaceUriExistsin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
isNamespacePrefixExists
public boolean isNamespacePrefixExists(java.lang.String modelNamespacePrefix)
- Specified by:
isNamespacePrefixExistsin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
isModelExists
public boolean isModelExists(java.lang.String modelFileName)
- Specified by:
isModelExistsin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
createDownloadNode
public org.alfresco.service.cmr.repository.NodeRef createDownloadNode(java.lang.String modelFileName, boolean withAssociatedForm)- Specified by:
createDownloadNodein interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
createCustomModelShareExtModuleRef
protected org.alfresco.service.cmr.repository.NodeRef createCustomModelShareExtModuleRef(java.lang.String modelName)
Finds themoduleelement within the Share persisted-extension XML file and then writes the XML fragment as the content of a newly created node.- Parameters:
modelName- the model name- Returns:
- the created nodeRef
-
getShareExtModule
protected org.alfresco.service.cmr.repository.NodeRef getShareExtModule()
Gets Share persisted-extension nodeRef
-
createCustomModelCopy
protected org.alfresco.service.cmr.repository.NodeRef createCustomModelCopy(java.lang.String newName, org.alfresco.service.cmr.repository.NodeRef modelNodeRef)Creates a copy of the custom model where the created node will be a child of download container.- Parameters:
newName- the model new namemodelNodeRef- existing model nodeRef- Returns:
- the created nodeRef
-
getCustomModelsInfo
public org.alfresco.repo.dictionary.CustomModelsInfo getCustomModelsInfo()
- Specified by:
getCustomModelsInfoin interfaceorg.alfresco.service.cmr.dictionary.CustomModelService
-
-