Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Interface DocumentTypeValidator


public interface DocumentTypeValidator

A document type validator is useful to validate document input when there are interdepencies between multiple document fields. For example: if the document type has two fields, product and version, you may create a validator that verifies that the version provided is a valid version for the selected product. Each document type can have a single validator.

See Also:
DocumentType.getValidator(), DocumentType.setValidator(DocumentTypeValidator)

Method Summary
 java.util.Map<DocumentField,java.lang.String> validate(java.util.Map<java.lang.String,?> fieldValueMap, User user)
          Performs cross field validation on user supplied input.
 

Method Detail

validate

java.util.Map<DocumentField,java.lang.String> validate(java.util.Map<java.lang.String,?> fieldValueMap,
                                                       User user)
Performs cross field validation on user supplied input. Returns an empty map if validation succeeds, or a map with field -> error string if validation fails.

Parameters:
fieldValueMap - a map of DocumentField -> String (or String[]) of user supplied values. If no value has been provided then the value will be null.
user - the user supplying the values.
Returns:
an empty map if validation succeeds, or a map with DocumentField -> error String if validation fails.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.