Package org.alfresco.repo.dictionary
Class CustomModelServiceImpl
- java.lang.Object
-
- org.alfresco.repo.dictionary.CustomModelServiceImpl
-
- All Implemented Interfaces:
CustomModelService
public class CustomModelServiceImpl extends Object implements CustomModelService
Custom Model Service Implementation- Author:
- Jamal Kaabi-Mofrad
-
-
Field Summary
Fields Modifier and Type Field Description static StringALFRESCO_MODEL_ADMINISTRATORS_AUTHORITYstatic QNameASPECT_CUSTOM_MODELstatic StringDEFAULT_CUSTOM_MODEL_ASPECTstatic StringGROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITYstatic StringSHARE_EXT_MODULE_SUFFIX
-
Constructor Summary
Constructors Constructor Description CustomModelServiceImpl()
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_CUSTOM_MODEL_ASPECT
public static final String DEFAULT_CUSTOM_MODEL_ASPECT
- See Also:
- Constant Field Values
-
ASPECT_CUSTOM_MODEL
public static final QName ASPECT_CUSTOM_MODEL
-
ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
public static final String ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
- See Also:
- Constant Field Values
-
GROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
public static final String GROUP_ALFRESCO_MODEL_ADMINISTRATORS_AUTHORITY
- See Also:
- Constant Field Values
-
SHARE_EXT_MODULE_SUFFIX
public static final String SHARE_EXT_MODULE_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
setNodeService
public void setNodeService(NodeService nodeService)
-
setDictionaryDAO
public void setDictionaryDAO(DictionaryDAOImpl dictionaryDAO)
-
setContentService
public void setContentService(ContentService contentService)
-
setSearchService
public void setSearchService(SearchService searchService)
-
setRepositoryModelsLocation
public void setRepositoryModelsLocation(RepositoryLocation repoModelsLocation)
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
-
setNamespaceDAO
public void setNamespaceDAO(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(String shareExtModulePath)
-
init
public void init()
Checks that all necessary properties and services have been provided.
-
getModelNodeRef
public NodeRef getModelNodeRef(String modelName)
- Specified by:
getModelNodeRefin interfaceCustomModelService
-
getCustomModel
public CustomModelDefinition getCustomModel(String modelName)
- Specified by:
getCustomModelin interfaceCustomModelService
-
getCustomModelByUri
public ModelDefinition getCustomModelByUri(String namespaceUri)
- Specified by:
getCustomModelByUriin interfaceCustomModelService
-
getCustomCompiledModel
protected Pair<CompiledModel,Boolean> getCustomCompiledModel(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 PagingResults<CustomModelDefinition> getCustomModels(PagingRequest pagingRequest)
- Specified by:
getCustomModelsin interfaceCustomModelService
-
getAllCustomModels
protected List<CustomModelDefinition> getAllCustomModels()
-
getCustomAspect
public AspectDefinition getCustomAspect(QName name)
- Specified by:
getCustomAspectin interfaceCustomModelService
-
getAllCustomAspects
public PagingResults<AspectDefinition> getAllCustomAspects(PagingRequest pagingRequest)
- Specified by:
getAllCustomAspectsin interfaceCustomModelService
-
getCustomType
public TypeDefinition getCustomType(QName name)
- Specified by:
getCustomTypein interfaceCustomModelService
-
getAllCustomTypes
public PagingResults<TypeDefinition> getAllCustomTypes(PagingRequest pagingRequest)
- Specified by:
getAllCustomTypesin interfaceCustomModelService
-
getCustomConstraint
public ConstraintDefinition getCustomConstraint(QName name)
- Specified by:
getCustomConstraintin interfaceCustomModelService
-
createCustomModel
public CustomModelDefinition createCustomModel(M2Model m2Model, boolean activate)
- Specified by:
createCustomModelin interfaceCustomModelService
-
updateCustomModel
public CustomModelDefinition updateCustomModel(String modelFileName, M2Model m2Model, boolean activate)
- Specified by:
updateCustomModelin interfaceCustomModelService
-
compileModel
public CompiledModel compileModel(M2Model m2Model)
- Specified by:
compileModelin interfaceCustomModelService
-
wrapResult
protected <T> PagingResults<T> wrapResult(PagingRequest pagingRequest, List<T> result)
-
isModelAdmin
public boolean isModelAdmin(String userName)
- Specified by:
isModelAdminin interfaceCustomModelService
-
activateCustomModel
public void activateCustomModel(String modelName)
- Specified by:
activateCustomModelin interfaceCustomModelService
-
deactivateCustomModel
public void deactivateCustomModel(String modelName)
- Specified by:
deactivateCustomModelin interfaceCustomModelService
-
deleteCustomModel
public void deleteCustomModel(String modelName)
- Specified by:
deleteCustomModelin interfaceCustomModelService
-
isNamespaceUriExists
public boolean isNamespaceUriExists(String modelNamespaceUri)
- Specified by:
isNamespaceUriExistsin interfaceCustomModelService
-
isNamespacePrefixExists
public boolean isNamespacePrefixExists(String modelNamespacePrefix)
- Specified by:
isNamespacePrefixExistsin interfaceCustomModelService
-
isModelExists
public boolean isModelExists(String modelFileName)
- Specified by:
isModelExistsin interfaceCustomModelService
-
createDownloadNode
public NodeRef createDownloadNode(String modelFileName, boolean withAssociatedForm)
- Specified by:
createDownloadNodein interfaceCustomModelService
-
createCustomModelShareExtModuleRef
protected NodeRef createCustomModelShareExtModuleRef(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 NodeRef getShareExtModule()
Gets Share persisted-extension nodeRef
-
createCustomModelCopy
protected NodeRef createCustomModelCopy(String newName, 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 CustomModelsInfo getCustomModelsInfo()
- Specified by:
getCustomModelsInfoin interfaceCustomModelService
-
-