public class DocumentValidationServiceImpl extends DefaultComponent implements DocumentValidationService
DocumentValidationService.ForcinglastModified, nameCTX_CREATEDOC, CTX_IMPORTDOC, CTX_MAP_KEY, CTX_SAVEDOC| Constructor and Description |
|---|
DocumentValidationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(ComponentContext context)
Activates the component.
|
protected SchemaManager |
getSchemaManager() |
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".
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
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. |
protected List<ConstraintViolation> |
validate(Schema schema,
Field field,
Object value,
boolean validateSubProperties) |
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. |
deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderpublic DocumentValidationServiceImpl()
protected SchemaManager getSchemaManager()
public void activate(ComponentContext context)
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentpublic boolean isActivated(String context, Map<String,Serializable> contextMap)
DocumentValidationServiceExample :
<extension target="org.nuxeo.ecm.core.api.DocumentValidationService" point="activations">
<validation context="CoreSession.saveDocument" activated="false" />
</extension>
Here are some available context :
isActivated in interface DocumentValidationServicecontext - 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
DocumentValidationService.CTX_MAP_KEY for the key.public DocumentValidationReport validate(DocumentModel document)
DocumentValidationServicevalidate in interface DocumentValidationServicepublic DocumentValidationReport validate(DocumentModel document, boolean dirtyOnly)
DocumentValidationServicevalidate in interface DocumentValidationServicedirtyOnly - If true, limit validation to dirty properties of the DocumentModel.public DocumentValidationReport validate(Field field, Object value)
DocumentValidationServiceField definition.validate in interface DocumentValidationServicepublic DocumentValidationReport validate(Field field, Object value, boolean validateSubProperties)
DocumentValidationServiceField definition.validate in interface DocumentValidationServicevalidateSubProperties - Tell whether the sub properties must be validated.public DocumentValidationReport validate(Property property)
DocumentValidationServiceField definition.validate in interface DocumentValidationServicepublic DocumentValidationReport validate(Property property, boolean validateSubProperties)
DocumentValidationServiceField definition.validate in interface DocumentValidationServicevalidateSubProperties - Tell whether the sub properties must be validated.public DocumentValidationReport validate(String xpath, Object value)
DocumentValidationServiceField definition.validate in interface DocumentValidationServicexpath - 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).public DocumentValidationReport validate(String xpath, Object value, boolean validateSubProperties) throws IllegalArgumentException
DocumentValidationServiceField definition.validate in interface DocumentValidationServicexpath - 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.