+

Search Tips   |   Advanced Search


com.ibm.workplace.wcm.api.extensions.validation
Interface FileUploadValidationPlugin


public interface FileUploadValidationPlugin

Represents a FileUploadValidation plugin.

A FileUploadValidation plugin is used to validate the contents of a file/image suite a given customers requirements for storing a file or image into the WCM Repository.

There are any number of validation that can be performed. Some examples include:

The plugin is regerested w/ WCM by providing a plugin.xml in the JAR file including the implementation and specifying and extension provider similiar to this:

    <extension
      point="com.ibm.workplace.wcm.api.FileUploadValidationPlugin" id="SampleValidation">
      <provider class="com.yourco.validation.SampleValidation"/>
    </extension>
    

Each FileUploadValidation plugin must also have a constructor with no arguments


Method Summary
 java.lang.String getName()
          Returns the name for this plugin
 boolean validate(java.io.InputStream inptStream, FileUploadValidationContext context)
          The FileUploadValidation Plugin should validate inputStream to determine if the file or image should be stored in the WCM repository.
 

Method Detail

getName

 java.lang.String getName()
Returns the name for this plugin

Returns:
name of the plugin

validate

 boolean validate(java.io.InputStream inptStream,
                 FileUploadValidationContext context)
                 throws FileUploadValidationException
The FileUploadValidation Plugin should validate inputStream to determine if the file or image should be stored in the WCM repository.

Parameters:
inputStream - String containing the file/image bytes.
context - context to be used to determine additional meta information about the file or image being saved.
Returns:
true if the file/image should be save false otherwise.
Throws:
FileUploadValidationException - - thrown if any errors occur processing the file/image, or if the file fails validation and the plugin wishes to pass back information about why it failed.