be.re.repo
Interface XMLPreviewExtract


public interface XMLPreviewExtract

The interface for external modules to extract the preview from an XML document. Such modules are declared in /configuration/maps.xml using the preview-extract element as in the following example:

 <preview-extract>
   <mime-type>application/xhtml+xml</mime-type>
   <class><name>be.re.repo.mod.PreviewExtractXHTML</name></class>
 </preview-extract>
 
 

Author:
Werner Donné

Method Summary
 boolean extract(String vcr, String version, XMLEventReader in, OutputStream out, String mimeType, Context context)
          The module should create a preview image of sufficient quality for the system to be able to create three sizes from it: 64 pixels wide for thumbnails, 380 pixels wide for a medium format and 760 pixels wide for a larger preview.
 

Method Detail

extract

boolean extract(String vcr,
                String version,
                XMLEventReader in,
                OutputStream out,
                String mimeType,
                Context context)
                throws IOException,
                       XMLStreamException
The module should create a preview image of sufficient quality for the system to be able to create three sizes from it: 64 pixels wide for thumbnails, 380 pixels wide for a medium format and 760 pixels wide for a larger preview.

Parameters:
vcr - the local path of the resource.
version - the version path of the resource.
in - the XML-stream for the document.
out - the outputstream into which the generated image should be written.
mimeType - the MIME type of the document.
context - the repository context.
Returns:
true if an image could be created, false otherwise.
Throws:
IOException
XMLStreamException