public interface DocumentValidationService
DocumentModel according to their Schema's constraints.| Modifier and Type | Interface and Description | 
|---|---|
static class  | 
DocumentValidationService.Forcing  | 
| Modifier and Type | Field and Description | 
|---|---|
static String | 
CTX_CREATEDOC  | 
static String | 
CTX_IMPORTDOC  | 
static String | 
CTX_MAP_KEY  | 
static String | 
CTX_SAVEDOC  | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
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". 
 | 
DocumentValidationReport | 
validate(DocumentModel document)
 | 
DocumentValidationReport | 
validate(DocumentModel document,
        boolean dirtyOnly)
 | 
DocumentValidationReport | 
validate(Field field,
        Object value)
Validates a value according to some  
Field definition. | 
DocumentValidationReport | 
validate(Field field,
        Object value,
        boolean validateSubProperties)
Validates a value according to some  
Field definition. | 
DocumentValidationReport | 
validate(Property property)
Validates a property according to its  
Field definition. | 
DocumentValidationReport | 
validate(Property property,
        boolean validateSubProperties)
Validates a property according to its  
Field definition. | 
DocumentValidationReport | 
validate(String xpath,
        Object value)
Validates a value according to some  
Field definition. | 
DocumentValidationReport | 
validate(String xpath,
        Object value,
        boolean validateSubProperties)
Validates a value according to some  
Field definition. | 
static final String CTX_MAP_KEY
static final String CTX_CREATEDOC
static final String CTX_SAVEDOC
static final String CTX_IMPORTDOC
boolean isActivated(String context, Map<String,Serializable> contextMap)
Example :
 
 <extension target="org.nuxeo.ecm.core.api.DocumentValidationService" point="activations">
   <validation context="CoreSession.saveDocument" activated="false" />
 </extension>
 
 
 Here are some available context :
context - A string representation of the context, where validation service should be activated.contextMap - if not null, search forcing flag in the context map. see DocumentValidationService.Forcing for values and
            CTX_MAP_KEY for the key.DocumentValidationReport validate(DocumentModel document)
DocumentValidationReport validate(DocumentModel document, boolean dirtyOnly)
dirtyOnly - If true, limit validation to dirty properties of the DocumentModel.DocumentValidationReport validate(Field field, Object value)
Field definition.DocumentValidationReport validate(Field field, Object value, boolean validateSubProperties)
Field definition.validateSubProperties - Tell whether the sub properties must be validated.DocumentValidationReport validate(Property property)
Field definition.DocumentValidationReport validate(Property property, boolean validateSubProperties)
Field definition.validateSubProperties - Tell whether the sub properties must be validated.DocumentValidationReport validate(String xpath, Object value)
Field definition.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).IllegalArgumentException - If the xpath does not match any field.DocumentValidationReport validate(String xpath, Object value, boolean validateSubProperties)
Field definition.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.IllegalArgumentException - If the xpath does not match any field.Copyright © 2019 Nuxeo. All rights reserved.