Interface DocumentValidationService
- All Known Implementing Classes:
DocumentValidationServiceImpl
public interface DocumentValidationService
Provides a way to validate
DocumentModel according to their Schema's constraints.- Since:
- 7.1
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanisActivated(String context, Map<String, Serializable> contextMap) To activate validation in some context, for example "CoreSession.saveDocument", you have to contribute to component "org.nuxeo.ecm.core.api.DocumentValidationService" with extension point "activations".Validates a value according to someFielddefinition.Validates a value according to someFielddefinition.validate(DocumentModel document) validate(DocumentModel document, boolean dirtyOnly) Validates a property according to itsFielddefinition.Validates a property according to itsFielddefinition.Validates a value according to someFielddefinition.Validates a value according to someFielddefinition.
-
Field Details
-
CTX_MAP_KEY
- See Also:
-
CTX_CREATEDOC
- See Also:
-
CTX_SAVEDOC
- See Also:
-
CTX_IMPORTDOC
- See Also:
-
-
Method Details
-
isActivated
To activate validation in some context, for example "CoreSession.saveDocument", you have to contribute to component "org.nuxeo.ecm.core.api.DocumentValidationService" with extension point "activations".Example :
<extension target="org.nuxeo.ecm.core.api.DocumentValidationService" point="activations"> <validation context="CoreSession.saveDocument" activated="false" /> </extension>Here are some available context :
- CoreSession.createDocument
- CoreSession.saveDocument
- CoreSession.importDocument
- Parameters:
context- A string representation of the context, where validation service should be activated.contextMap- if not null, search forcing flag in the context map. seeDocumentValidationService.Forcingfor values andCTX_MAP_KEYfor the key.- Returns:
- true if validation is activated in the specified context, false otherwise.
- Since:
- 7.1
-
validate
- Since:
- 7.1
-
validate
- Parameters:
dirtyOnly- If true, limit validation to dirty properties of theDocumentModel.- Since:
- 7.1
-
validate
Validates a value according to someFielddefinition.- Since:
- 7.1
-
validate
Validates a value according to someFielddefinition.- Parameters:
validateSubProperties- Tell whether the sub properties must be validated.- Since:
- 7.2
-
validate
Validates a property according to itsFielddefinition.- Since:
- 7.1
-
validate
Validates a property according to itsFielddefinition.- Parameters:
validateSubProperties- Tell whether the sub properties must be validated.- Since:
- 7.10
-
validate
Validates a value according to someFielddefinition.- Parameters:
xpath- schema:fieldName, for example dc:title - the xpath could also be a value that match a complex property field (for example, an field of a complex type in a list: schema:list:complex:field).- Throws:
IllegalArgumentException- If the xpath does not match any field.- Since:
- 7.1
-
validate
Validates a value according to someFielddefinition.- Parameters:
xpath- schema:fieldName, for example dc:title - the xpath could also be a value that match a complex property field (for example, an field of a complex type in a list: schema:list:complex:field).validateSubProperties- Tell whether the sub properties must be validated.- Throws:
IllegalArgumentException- If the xpath does not match any field.- Since:
- 7.10
-