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 class
CustomModelsImpl.ConstraintValidator
Constraint validatorclass
CustomModelsImpl.ModelDetails
-
Field Summary
Fields Modifier and Type Field Description static String
ASPECT_NAME_NULL_ERR
static String
CONSTRAINT_NAME_NULL_ERR
protected CustomModelService
customModelService
protected DictionaryService
dictionaryService
static String
MODEL_NAME_NULL_ERR
static Pattern
NAME_PATTERN
protected NamespaceService
namespaceService
protected NodeService
nodeService
protected PersonService
personService
static String
TYPE_NAME_NULL_ERR
static Pattern
URI_PATTERN
protected ValueDataTypeValidator
valueDataTypeValidator
-
Constructor Summary
Constructors Constructor Description CustomModelsImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomAspect
createCustomAspect(String modelName, CustomAspect aspect)
Creates custom model's aspectCustomModel
createCustomModel(M2Model m2Model)
Creates custom model from the importedM2Model
.CustomModel
createCustomModel(CustomModel model)
Creates custom modelCustomModelConstraint
createCustomModelConstraint(String modelName, CustomModelConstraint constraint)
Creates custom model's constraintCustomType
createCustomType(String modelName, CustomType type)
Creates custom model's typeCustomModelDownload
createDownload(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).void
deleteCustomAspect(String modelName, String aspectName)
Deletes the custom model's aspectvoid
deleteCustomModel(String modelName)
Deletes the custom modelvoid
deleteCustomType(String modelName, String typeName)
Deletes the custom model's typeprotected String
getCurrentUserFullName()
Gets the fully authenticated user's full nameCustomAspect
getCustomAspect(String modelName, String aspectName, Parameters parameters)
Gets theorg.alfresco.rest.api.model.CustomAspect
representation of the given model's aspectCollectionWithPagingInfo<CustomAspect>
getCustomAspects(String modelName, Parameters parameters)
Gets a paged list of all the given custom model's aspectsCustomModel
getCustomModel(String modelName, Parameters parameters)
Gets theorg.alfresco.rest.api.model.CustomModel
representation for the given modelCustomModelConstraint
getCustomModelConstraint(String modelName, String constraintName, Parameters parameters)
Gets theorg.alfresco.rest.api.model.CustomModelConstraint
representation 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 modelsCustomType
getCustomType(String modelName, String typeName, Parameters parameters)
Gets theorg.alfresco.rest.api.model.CustomType
representation of the given model's typeCollectionWithPagingInfo<CustomType>
getCustomTypes(String modelName, Parameters parameters)
Gets a paged list of all the given custom model's typesprotected 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.void
setCustomModelService(CustomModelService customModelService)
void
setDictionaryService(DictionaryService dictionaryService)
void
setNamespaceService(NamespaceService namespaceService)
void
setNodeService(NodeService nodeService)
void
setPersonService(PersonService personService)
void
setValueDataTypeValidator(ValueDataTypeValidator valueDataTypeValidator)
CustomAspect
updateCustomAspect(String modelName, CustomAspect aspect, Parameters parameters)
Updates the custom model's aspectCustomModel
updateCustomModel(String modelName, CustomModel model, Parameters parameters)
Updates or activates/deactivates the custom modelCustomType
updateCustomType(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 CustomModelService customModelService
-
dictionaryService
protected DictionaryService dictionaryService
-
personService
protected PersonService personService
-
nodeService
protected NodeService nodeService
-
namespaceService
protected NamespaceService namespaceService
-
valueDataTypeValidator
protected ValueDataTypeValidator valueDataTypeValidator
-
-
Method Detail
-
setCustomModelService
public void setCustomModelService(CustomModelService customModelService)
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
-
setPersonService
public void setPersonService(PersonService personService)
-
setNodeService
public void setNodeService(NodeService nodeService)
-
setNamespaceService
public void setNamespaceService(NamespaceService namespaceService)
-
setValueDataTypeValidator
public void setValueDataTypeValidator(ValueDataTypeValidator valueDataTypeValidator)
-
getCustomModel
public CustomModel getCustomModel(String modelName, Parameters parameters)
Description copied from interface:CustomModels
Gets theorg.alfresco.rest.api.model.CustomModel
representation for the given model- Specified by:
getCustomModel
in interfaceCustomModels
- Parameters:
modelName
- the model nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModel
object
-
getCustomModels
public CollectionWithPagingInfo<CustomModel> getCustomModels(Parameters parameters)
Description copied from interface:CustomModels
Gets a paged list of all custom models- Specified by:
getCustomModels
in interfaceCustomModels
- Parameters:
parameters
- theParameters
object to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomModel
objects
-
createCustomModel
public CustomModel createCustomModel(CustomModel model)
Description copied from interface:CustomModels
Creates custom model- Specified by:
createCustomModel
in interfaceCustomModels
- Parameters:
model
- the custom model to create- Returns:
org.alfresco.rest.api.model.CustomModel
object
-
updateCustomModel
public CustomModel updateCustomModel(String modelName, CustomModel model, Parameters parameters)
Description copied from interface:CustomModels
Updates or activates/deactivates the custom model- Specified by:
updateCustomModel
in interfaceCustomModels
- Parameters:
modelName
- the model namemodel
- the custom model to update (JSON payload)parameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModel
object
-
deleteCustomModel
public void deleteCustomModel(String modelName)
Description copied from interface:CustomModels
Deletes the custom model- Specified by:
deleteCustomModel
in interfaceCustomModels
- Parameters:
modelName
- the model name
-
getCustomType
public CustomType getCustomType(String modelName, String typeName, Parameters parameters)
Description copied from interface:CustomModels
Gets theorg.alfresco.rest.api.model.CustomType
representation of the given model's type- Specified by:
getCustomType
in interfaceCustomModels
- Parameters:
modelName
- the model nametypeName
- the model's type nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomType
object
-
getCustomTypes
public CollectionWithPagingInfo<CustomType> getCustomTypes(String modelName, Parameters parameters)
Description copied from interface:CustomModels
Gets a paged list of all the given custom model's types- Specified by:
getCustomTypes
in interfaceCustomModels
- Parameters:
modelName
- the model nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomType
objects
-
createCustomType
public CustomType createCustomType(String modelName, CustomType type)
Description copied from interface:CustomModels
Creates custom model's type- Specified by:
createCustomType
in interfaceCustomModels
- Parameters:
modelName
- the model nametype
- the custom type to create within the given model- Returns:
org.alfresco.rest.api.model.CustomType
object
-
updateCustomType
public CustomType updateCustomType(String modelName, CustomType type, Parameters parameters)
Description copied from interface:CustomModels
Updates the custom model's type- Specified by:
updateCustomType
in interfaceCustomModels
- Parameters:
modelName
- the model nametype
- the custom model's type to update (JSON payload)parameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomType
object
-
deleteCustomType
public void deleteCustomType(String modelName, String typeName)
Description copied from interface:CustomModels
Deletes the custom model's type- Specified by:
deleteCustomType
in 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:CustomModels
Gets theorg.alfresco.rest.api.model.CustomAspect
representation of the given model's aspect- Specified by:
getCustomAspect
in interfaceCustomModels
- Parameters:
modelName
- the model nameaspectName
- the model's aspect nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomAspect
object
-
getCustomAspects
public CollectionWithPagingInfo<CustomAspect> getCustomAspects(String modelName, Parameters parameters)
Description copied from interface:CustomModels
Gets a paged list of all the given custom model's aspects- Specified by:
getCustomAspects
in interfaceCustomModels
- Parameters:
modelName
- the model nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomAspect
objects
-
createCustomAspect
public CustomAspect createCustomAspect(String modelName, CustomAspect aspect)
Description copied from interface:CustomModels
Creates custom model's aspect- Specified by:
createCustomAspect
in interfaceCustomModels
- Parameters:
modelName
- the model nameaspect
- the custom aspect to create within the given model- Returns:
org.alfresco.rest.api.model.CustomAspect
object
-
updateCustomAspect
public CustomAspect updateCustomAspect(String modelName, CustomAspect aspect, Parameters parameters)
Description copied from interface:CustomModels
Updates the custom model's aspect- Specified by:
updateCustomAspect
in interfaceCustomModels
- Parameters:
modelName
- the model nameaspect
- the custom model's aspect to update (JSON payload)parameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomAspect
object
-
deleteCustomAspect
public void deleteCustomAspect(String modelName, String aspectName)
Description copied from interface:CustomModels
Deletes the custom model's aspect- Specified by:
deleteCustomAspect
in interfaceCustomModels
- Parameters:
modelName
- the model nameaspectName
- the model's aspect name
-
getCustomModelConstraints
public CollectionWithPagingInfo<CustomModelConstraint> getCustomModelConstraints(String modelName, Parameters parameters)
Description copied from interface:CustomModels
Gets a paged list of all of the given custom model's constraints- Specified by:
getCustomModelConstraints
in interfaceCustomModels
- Parameters:
modelName
- the model nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
- a paged list of
org.alfresco.rest.api.model.CustomModelConstraint
objects
-
getCustomModelConstraint
public CustomModelConstraint getCustomModelConstraint(String modelName, String constraintName, Parameters parameters)
Description copied from interface:CustomModels
Gets theorg.alfresco.rest.api.model.CustomModelConstraint
representation of the given model's constraint- Specified by:
getCustomModelConstraint
in interfaceCustomModels
- Parameters:
modelName
- the model nameconstraintName
- the model's constraint nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModelConstraint
object
-
createCustomModelConstraint
public CustomModelConstraint createCustomModelConstraint(String modelName, CustomModelConstraint constraint)
Description copied from interface:CustomModels
Creates custom model's constraint- Specified by:
createCustomModelConstraint
in interfaceCustomModels
- Parameters:
modelName
- the model nameconstraint
- the custom constraint to create within the given model- Returns:
org.alfresco.rest.api.model.CustomModelConstraint
object
-
createDownload
public CustomModelDownload createDownload(String modelName, Parameters parameters)
Description copied from interface:CustomModels
Starts the creation of a downloadable archive file containing the custom model file and its associated Share extension module file (if requested).- Specified by:
createDownload
in interfaceCustomModels
- Parameters:
modelName
- the model nameparameters
- theParameters
object to get the parameters passed into the request- Returns:
org.alfresco.rest.api.model.CustomModelDownload
object 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 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(M2Model m2Model)
Description copied from interface:CustomModels
Creates custom model from the importedM2Model
.- Specified by:
createCustomModel
in interfaceCustomModels
- Parameters:
m2Model
- the model- Returns:
org.alfresco.rest.api.model.CustomModel
object
-
-