Package org.alfresco.rest.api.impl
Class CustomModelsImpl
- java.lang.Object
-
- org.alfresco.rest.api.impl.CustomModelsImpl
-
- All Implemented Interfaces:
CustomModels
public class CustomModelsImpl extends Object implements CustomModels
- Author:
- Jamal Kaabi-Mofrad
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCustomModelsImpl.ConstraintValidatorConstraint validatorclassCustomModelsImpl.ModelDetails
-
Field Summary
Fields Modifier and Type Field Description static StringASPECT_NAME_NULL_ERRstatic StringCONSTRAINT_NAME_NULL_ERRprotected org.alfresco.service.cmr.dictionary.CustomModelServicecustomModelServiceprotected org.alfresco.service.cmr.dictionary.DictionaryServicedictionaryServicestatic StringMODEL_NAME_NULL_ERRstatic PatternNAME_PATTERNprotected org.alfresco.service.namespace.NamespaceServicenamespaceServiceprotected org.alfresco.service.cmr.repository.NodeServicenodeServiceprotected org.alfresco.service.cmr.security.PersonServicepersonServicestatic StringTYPE_NAME_NULL_ERRstatic PatternURI_PATTERNprotected org.alfresco.repo.dictionary.ValueDataTypeValidatorvalueDataTypeValidator
-
Constructor Summary
Constructors Constructor Description CustomModelsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomAspectcreateCustomAspect(String modelName, CustomAspect aspect)Creates custom model's aspectCustomModelcreateCustomModel(org.alfresco.repo.dictionary.M2Model m2Model)Creates custom model from the importedM2Model.CustomModelcreateCustomModel(CustomModel model)Creates custom modelCustomModelConstraintcreateCustomModelConstraint(String modelName, CustomModelConstraint constraint)Creates custom model's constraintCustomTypecreateCustomType(String modelName, CustomType type)Creates custom model's typeCustomModelDownloadcreateDownload(String modelName, Parameters parameters)Starts the creation of a downloadable archive file containing the custom model file and its associated Share extension module file (if requested).voiddeleteCustomAspect(String modelName, String aspectName)Deletes the custom model's aspectvoiddeleteCustomModel(String modelName)Deletes the custom modelvoiddeleteCustomType(String modelName, String typeName)Deletes the custom model's typeprotected StringgetCurrentUserFullName()Gets the fully authenticated user's full nameCustomAspectgetCustomAspect(String modelName, String aspectName, Parameters parameters)Gets theorg.alfresco.rest.api.model.CustomAspectrepresentation of the given model's aspectCollectionWithPagingInfo<CustomAspect>getCustomAspects(String modelName, Parameters parameters)Gets a paged list of all the given custom model's aspectsCustomModelgetCustomModel(String modelName, Parameters parameters)Gets theorg.alfresco.rest.api.model.CustomModelrepresentation for the given modelCustomModelConstraintgetCustomModelConstraint(String modelName, String constraintName, Parameters parameters)Gets theorg.alfresco.rest.api.model.CustomModelConstraintrepresentation of the given model's constraintCollectionWithPagingInfo<CustomModelConstraint>getCustomModelConstraints(String modelName, Parameters parameters)Gets a paged list of all of the given custom model's constraintsCollectionWithPagingInfo<CustomModel>getCustomModels(Parameters parameters)Gets a paged list of all custom modelsCustomTypegetCustomType(String modelName, String typeName, Parameters parameters)Gets theorg.alfresco.rest.api.model.CustomTyperepresentation of the given model's typeCollectionWithPagingInfo<CustomType>getCustomTypes(String modelName, Parameters parameters)Gets a paged list of all the given custom model's typesprotected org.alfresco.util.Pair<String,String>resolveToUriAndPrefix(String parentName)Gets the namespace URI and prefix from the parent's name, provided that the given name is of a valid format.voidsetCustomModelService(org.alfresco.service.cmr.dictionary.CustomModelService customModelService)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPersonService(org.alfresco.service.cmr.security.PersonService personService)voidsetValueDataTypeValidator(org.alfresco.repo.dictionary.ValueDataTypeValidator valueDataTypeValidator)CustomAspectupdateCustomAspect(String modelName, CustomAspect aspect, Parameters parameters)Updates the custom model's aspectCustomModelupdateCustomModel(String modelName, CustomModel model, Parameters parameters)Updates or activates/deactivates the custom modelCustomTypeupdateCustomType(String modelName, CustomType type, Parameters parameters)Updates the custom model's type
-
-
-
Field Detail
-
NAME_PATTERN
public static final Pattern NAME_PATTERN
-
URI_PATTERN
public static final Pattern URI_PATTERN
-
MODEL_NAME_NULL_ERR
public static final String MODEL_NAME_NULL_ERR
- See Also:
- Constant Field Values
-
TYPE_NAME_NULL_ERR
public static final String TYPE_NAME_NULL_ERR
- See Also:
- Constant Field Values
-
ASPECT_NAME_NULL_ERR
public static final String ASPECT_NAME_NULL_ERR
- See Also:
- Constant Field Values
-
CONSTRAINT_NAME_NULL_ERR
public static final String CONSTRAINT_NAME_NULL_ERR
- See Also:
- Constant Field Values
-
customModelService
protected org.alfresco.service.cmr.dictionary.CustomModelService customModelService
-
dictionaryService
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
-
personService
protected org.alfresco.service.cmr.security.PersonService personService
-
nodeService
protected org.alfresco.service.cmr.repository.NodeService nodeService
-
namespaceService
protected org.alfresco.service.namespace.NamespaceService namespaceService
-
valueDataTypeValidator
protected org.alfresco.repo.dictionary.ValueDataTypeValidator valueDataTypeValidator
-
-
Method Detail
-
setCustomModelService
public void setCustomModelService(org.alfresco.service.cmr.dictionary.CustomModelService customModelService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setPersonService
public void setPersonService(org.alfresco.service.cmr.security.PersonService personService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
-
setValueDataTypeValidator
public void setValueDataTypeValidator(org.alfresco.repo.dictionary.ValueDataTypeValidator valueDataTypeValidator)
-
getCustomModel
public CustomModel getCustomModel(String modelName, Parameters parameters)
Description copied from interface:CustomModelsGets theorg.alfresco.rest.api.model.CustomModelrepresentation for the given model- Specified by:
getCustomModelin interfaceCustomModels- Parameters:
modelName- the model nameparameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModelobject
-
getCustomModels
public CollectionWithPagingInfo<CustomModel> getCustomModels(Parameters parameters)
Description copied from interface:CustomModelsGets a paged list of all custom models- Specified by:
getCustomModelsin interfaceCustomModels- Parameters:
parameters- theParametersobject to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomModelobjects
-
createCustomModel
public CustomModel createCustomModel(CustomModel model)
Description copied from interface:CustomModelsCreates custom model- Specified by:
createCustomModelin interfaceCustomModels- Parameters:
model- the custom model to create- Returns:
org.alfresco.rest.api.model.CustomModelobject
-
updateCustomModel
public CustomModel updateCustomModel(String modelName, CustomModel model, Parameters parameters)
Description copied from interface:CustomModelsUpdates or activates/deactivates the custom model- Specified by:
updateCustomModelin interfaceCustomModels- Parameters:
modelName- the model namemodel- the custom model to update (JSON payload)parameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModelobject
-
deleteCustomModel
public void deleteCustomModel(String modelName)
Description copied from interface:CustomModelsDeletes the custom model- Specified by:
deleteCustomModelin interfaceCustomModels- Parameters:
modelName- the model name
-
getCustomType
public CustomType getCustomType(String modelName, String typeName, Parameters parameters)
Description copied from interface:CustomModelsGets theorg.alfresco.rest.api.model.CustomTyperepresentation of the given model's type- Specified by:
getCustomTypein interfaceCustomModels- Parameters:
modelName- the model nametypeName- the model's type nameparameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomTypeobject
-
getCustomTypes
public CollectionWithPagingInfo<CustomType> getCustomTypes(String modelName, Parameters parameters)
Description copied from interface:CustomModelsGets a paged list of all the given custom model's types- Specified by:
getCustomTypesin interfaceCustomModels- Parameters:
modelName- the model nameparameters- theParametersobject to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomTypeobjects
-
createCustomType
public CustomType createCustomType(String modelName, CustomType type)
Description copied from interface:CustomModelsCreates custom model's type- Specified by:
createCustomTypein interfaceCustomModels- Parameters:
modelName- the model nametype- the custom type to create within the given model- Returns:
org.alfresco.rest.api.model.CustomTypeobject
-
updateCustomType
public CustomType updateCustomType(String modelName, CustomType type, Parameters parameters)
Description copied from interface:CustomModelsUpdates the custom model's type- Specified by:
updateCustomTypein interfaceCustomModels- Parameters:
modelName- the model nametype- the custom model's type to update (JSON payload)parameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomTypeobject
-
deleteCustomType
public void deleteCustomType(String modelName, String typeName)
Description copied from interface:CustomModelsDeletes the custom model's type- Specified by:
deleteCustomTypein interfaceCustomModels- Parameters:
modelName- the model nametypeName- the model's type name
-
getCustomAspect
public CustomAspect getCustomAspect(String modelName, String aspectName, Parameters parameters)
Description copied from interface:CustomModelsGets theorg.alfresco.rest.api.model.CustomAspectrepresentation of the given model's aspect- Specified by:
getCustomAspectin interfaceCustomModels- Parameters:
modelName- the model nameaspectName- the model's aspect nameparameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomAspectobject
-
getCustomAspects
public CollectionWithPagingInfo<CustomAspect> getCustomAspects(String modelName, Parameters parameters)
Description copied from interface:CustomModelsGets a paged list of all the given custom model's aspects- Specified by:
getCustomAspectsin interfaceCustomModels- Parameters:
modelName- the model nameparameters- theParametersobject to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomAspectobjects
-
createCustomAspect
public CustomAspect createCustomAspect(String modelName, CustomAspect aspect)
Description copied from interface:CustomModelsCreates custom model's aspect- Specified by:
createCustomAspectin interfaceCustomModels- Parameters:
modelName- the model nameaspect- the custom aspect to create within the given model- Returns:
org.alfresco.rest.api.model.CustomAspectobject
-
updateCustomAspect
public CustomAspect updateCustomAspect(String modelName, CustomAspect aspect, Parameters parameters)
Description copied from interface:CustomModelsUpdates the custom model's aspect- Specified by:
updateCustomAspectin interfaceCustomModels- Parameters:
modelName- the model nameaspect- the custom model's aspect to update (JSON payload)parameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomAspectobject
-
deleteCustomAspect
public void deleteCustomAspect(String modelName, String aspectName)
Description copied from interface:CustomModelsDeletes the custom model's aspect- Specified by:
deleteCustomAspectin interfaceCustomModels- Parameters:
modelName- the model nameaspectName- the model's aspect name
-
getCustomModelConstraints
public CollectionWithPagingInfo<CustomModelConstraint> getCustomModelConstraints(String modelName, Parameters parameters)
Description copied from interface:CustomModelsGets a paged list of all of the given custom model's constraints- Specified by:
getCustomModelConstraintsin interfaceCustomModels- Parameters:
modelName- the model nameparameters- theParametersobject to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomModelConstraintobjects
-
getCustomModelConstraint
public CustomModelConstraint getCustomModelConstraint(String modelName, String constraintName, Parameters parameters)
Description copied from interface:CustomModelsGets theorg.alfresco.rest.api.model.CustomModelConstraintrepresentation of the given model's constraint- Specified by:
getCustomModelConstraintin interfaceCustomModels- Parameters:
modelName- the model nameconstraintName- the model's constraint nameparameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModelConstraintobject
-
createCustomModelConstraint
public CustomModelConstraint createCustomModelConstraint(String modelName, CustomModelConstraint constraint)
Description copied from interface:CustomModelsCreates custom model's constraint- Specified by:
createCustomModelConstraintin interfaceCustomModels- Parameters:
modelName- the model nameconstraint- the custom constraint to create within the given model- Returns:
org.alfresco.rest.api.model.CustomModelConstraintobject
-
createDownload
public CustomModelDownload createDownload(String modelName, Parameters parameters)
Description copied from interface:CustomModelsStarts the creation of a downloadable archive file containing the custom model file and its associated Share extension module file (if requested).- Specified by:
createDownloadin interfaceCustomModels- Parameters:
modelName- the model nameparameters- theParametersobject to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModelDownloadobject containing the archive node reference
-
getCurrentUserFullName
protected String getCurrentUserFullName()
Gets the fully authenticated user's full name- Returns:
- user's full name or the user's id if the full name dose not exit
-
resolveToUriAndPrefix
protected org.alfresco.util.Pair<String,String> resolveToUriAndPrefix(String parentName)
Gets the namespace URI and prefix from the parent's name, provided that the given name is of a valid format. The valid format consist of a namespace prefix, a colon and a name. E.g. sys:localized- Parameters:
parentName- the parent name- Returns:
- a pair of namespace URI and prefix object
-
createCustomModel
public CustomModel createCustomModel(org.alfresco.repo.dictionary.M2Model m2Model)
Description copied from interface:CustomModelsCreates custom model from the importedM2Model.- Specified by:
createCustomModelin interfaceCustomModels- Parameters:
m2Model- the model- Returns:
org.alfresco.rest.api.model.CustomModelobject
-
-