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
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isActivated
(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 someField
definition.Validates a value according to someField
definition.validate
(DocumentModel document) validate
(DocumentModel document, boolean dirtyOnly) Validates a property according to itsField
definition.Validates a property according to itsField
definition.Validates a value according to someField
definition.Validates a value according to someField
definition.
-
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.Forcing
for values andCTX_MAP_KEY
for 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 someField
definition.- Since:
- 7.1
-
validate
Validates a value according to someField
definition.- Parameters:
validateSubProperties
- Tell whether the sub properties must be validated.- Since:
- 7.2
-
validate
Validates a property according to itsField
definition.- Since:
- 7.1
-
validate
Validates a property according to itsField
definition.- Parameters:
validateSubProperties
- Tell whether the sub properties must be validated.- Since:
- 7.10
-
validate
Validates a value according to someField
definition.- 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 someField
definition.- 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
-