Package org.alfresco.repo.dictionary
Class CustomModelServiceImpl
java.lang.Object
org.alfresco.repo.dictionary.CustomModelServiceImpl
- All Implemented Interfaces:
CustomModelService
Custom Model Service Implementation
- Author:
- Jamal Kaabi-Mofrad
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateCustomModel(String modelName) compileModel(M2Model m2Model) createCustomModel(M2Model m2Model, boolean activate) protected NodeRefcreateCustomModelCopy(String newName, NodeRef modelNodeRef) Creates a copy of the custom model where the created node will be a child of download container.protected NodeRefcreateCustomModelShareExtModuleRef(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.createDownloadNode(String modelFileName, boolean withAssociatedForm) createDownloadNode(String modelFileName, boolean withAssociatedForm, String downloadNodeName) voiddeactivateCustomModel(String modelName) voiddeleteCustomModel(String modelName) org.alfresco.query.PagingResults<AspectDefinition>getAllCustomAspects(org.alfresco.query.PagingRequest pagingRequest) protected List<CustomModelDefinition>org.alfresco.query.PagingResults<TypeDefinition>getAllCustomTypes(org.alfresco.query.PagingRequest pagingRequest) getCustomAspect(QName name) protected Pair<CompiledModel,Boolean> getCustomCompiledModel(String modelName) Returns compiled custom model and whether the model is active or not as aPairobjectgetCustomConstraint(QName name) getCustomModel(String modelName) getCustomModelByUri(String namespaceUri) org.alfresco.query.PagingResults<CustomModelDefinition>getCustomModels(org.alfresco.query.PagingRequest pagingRequest) getCustomType(QName name) getM2Model(NodeRef modelNodeRef) getModelNodeRef(String modelName) protected NodeRefGets Share persisted-extension nodeRefvoidinit()Checks that all necessary properties and services have been provided.booleanisModelAdmin(String userName) booleanisModelExists(String modelFileName) booleanisNamespacePrefixExists(String modelNamespacePrefix) booleanisNamespacePrefixExists(NodeRef modelNodeRef) booleanisNamespaceUriExists(String modelNamespaceUri) voidsetAuthorityService(AuthorityService authorityService) voidsetContentService(ContentService contentService) voidsetDictionaryDAO(DictionaryDAOImpl dictionaryDAO) voidsetDictionaryService(DictionaryService dictionaryService) voidsetDownloadService(DownloadService downloadSerivce) voidsetDownloadStorage(DownloadStorage downloadStorage) voidsetHiddenAspect(HiddenAspect hiddenAspect) voidsetNamespaceDAO(NamespaceDAO namespaceDAO) voidsetNodeService(NodeService nodeService) voidsetRepoAdminService(RepoAdminService repoAdminService) voidsetRepositoryModelsLocation(RepositoryLocation repoModelsLocation) voidsetRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper) voidsetSearchService(SearchService searchService) voidsetShareExtModulePath(String shareExtModulePath) updateCustomModel(String modelFileName, M2Model m2Model, boolean activate) voidvalidateModelNamespacePrefix(String prefix) voidvalidateModelNamespacePrefix(NodeRef modelNodeRef) protected <T> org.alfresco.query.PagingResults<T>wrapResult(org.alfresco.query.PagingRequest pagingRequest, List<T> result)
-
Field Details
-
DEFAULT_CUSTOM_MODEL_ASPECT
- See Also:
-
ASPECT_CUSTOM_MODEL
-
ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
- See Also:
-
GROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
- See Also:
-
SHARE_EXT_MODULE_SUFFIX
- See Also:
-
-
Constructor Details
-
CustomModelServiceImpl
public CustomModelServiceImpl()
-
-
Method Details
-
setNodeService
-
setDictionaryDAO
-
setContentService
-
setSearchService
-
setRepositoryModelsLocation
-
setDictionaryService
-
setNamespaceDAO
-
setRetryingTransactionHelper
-
setRepoAdminService
-
setAuthorityService
-
setHiddenAspect
-
setDownloadService
-
setDownloadStorage
-
init
public void init()Checks that all necessary properties and services have been provided. -
getModelNodeRef
- Specified by:
getModelNodeRefin interfaceCustomModelService
-
getM2Model
- Specified by:
getM2Modelin interfaceCustomModelService
-
getCustomModel
- Specified by:
getCustomModelin interfaceCustomModelService
-
getCustomModelByUri
- Specified by:
getCustomModelByUriin interfaceCustomModelService
-
getCustomCompiledModel
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<CustomModelDefinition> getCustomModels(org.alfresco.query.PagingRequest pagingRequest) - Specified by:
getCustomModelsin interfaceCustomModelService
-
getAllCustomModels
-
getCustomAspect
- Specified by:
getCustomAspectin interfaceCustomModelService
-
getAllCustomAspects
public org.alfresco.query.PagingResults<AspectDefinition> getAllCustomAspects(org.alfresco.query.PagingRequest pagingRequest) - Specified by:
getAllCustomAspectsin interfaceCustomModelService
-
getCustomType
- Specified by:
getCustomTypein interfaceCustomModelService
-
getAllCustomTypes
public org.alfresco.query.PagingResults<TypeDefinition> getAllCustomTypes(org.alfresco.query.PagingRequest pagingRequest) - Specified by:
getAllCustomTypesin interfaceCustomModelService
-
getCustomConstraint
- Specified by:
getCustomConstraintin interfaceCustomModelService
-
createCustomModel
- Specified by:
createCustomModelin interfaceCustomModelService
-
updateCustomModel
public CustomModelDefinition updateCustomModel(String modelFileName, M2Model m2Model, boolean activate) - Specified by:
updateCustomModelin interfaceCustomModelService
-
compileModel
- Specified by:
compileModelin interfaceCustomModelService
-
wrapResult
protected <T> org.alfresco.query.PagingResults<T> wrapResult(org.alfresco.query.PagingRequest pagingRequest, List<T> result) -
isModelAdmin
- Specified by:
isModelAdminin interfaceCustomModelService
-
activateCustomModel
- Specified by:
activateCustomModelin interfaceCustomModelService
-
deactivateCustomModel
- Specified by:
deactivateCustomModelin interfaceCustomModelService
-
deleteCustomModel
- Specified by:
deleteCustomModelin interfaceCustomModelService
-
isNamespaceUriExists
- Specified by:
isNamespaceUriExistsin interfaceCustomModelService
-
isNamespacePrefixExists
- Specified by:
isNamespacePrefixExistsin interfaceCustomModelService
-
isNamespacePrefixExists
- Specified by:
isNamespacePrefixExistsin interfaceCustomModelService
-
isModelExists
- Specified by:
isModelExistsin interfaceCustomModelService
-
getModelNamespaceUriPrefix
- Specified by:
getModelNamespaceUriPrefixin interfaceCustomModelService
-
validateModelNamespacePrefix
- Specified by:
validateModelNamespacePrefixin interfaceCustomModelService
-
validateModelNamespacePrefix
- Specified by:
validateModelNamespacePrefixin interfaceCustomModelService
-
createDownloadNode
- Specified by:
createDownloadNodein interfaceCustomModelService
-
createDownloadNode
public NodeRef createDownloadNode(String modelFileName, boolean withAssociatedForm, String downloadNodeName) - Specified by:
createDownloadNodein interfaceCustomModelService
-
createCustomModelCopy
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
- Specified by:
getCustomModelsInfoin interfaceCustomModelService
-