public interface ValidationAction extends Action
FileSet.validate(DbControl). This action is supposed to validated the entire file set as a whole. The
ClientContextparameter passed to the factory has the owner of the file set (eg. the
FileStoreEnabled) item as the current item.
FileSet.setMember(File, DataFileType)or any other method that removs a file from the fileset is called. The
ClientContextin this case also has the owner of the file set as the current item, but the action will only be asked to accept the file(s) that are actually removed/modified.
Tip! For validators that works on a single file at a time the
SingleFileValidationAction can be used as a base class.
|Modifier and Type||Method and Description|
Check if the given file is handled by this validator implementation or not?
Reset all metadata that this class normally can set.
Validate and extract metadata from the file(s) that has been added to this validator.
Accept acceptFile(FileSetMember member)
The file can either be validated immediately or later when this method
has been called for all files in the file set. If the file
is accepted for immediate validation the
is called before the next file is processed. When all files
have been processed the
is called again if at least one was accepted for later validation.
member- A member of the current file set
void validateAndExtractMetadata() throws InvalidDataException, InvalidRelationException
Accept.VALIDATE_IMMEDIATELYthis method is called and the validator should work on the last accepted file.
This method is also called after all files has been processed if at
least one file returned
This method is recommended to throw an
InvalidDataException or a
subclass if the file is not a valid file.
are ignored by the core and will not change the validation status. An
exception of type
InvalidRelationException can be thrown if the
file itself is valid, but a related file that it depends on is not. The
core will still mark the file as invalid and store the error message,
but extracted metadata will not be reset.