be.re.repo
Interface XMLOutputFactory

All Known Implementing Classes:
ZipCollectionFactory

public interface XMLOutputFactory

The interface to create a byte stream from a StAX stream. A transformation to a non-XML format may take place. The result is written on the response stream of a request. The module is combined with an XML-transformer that comes between this module and a XMLStorage or XMLStorageDelta module. This chain is constructed dynamically based on the requested MIME type and the MIME type of the document in the repository.

Such modules are declared in /configuration/maps.xml using the xml-out element as in the following example:

 <xml-out>
   <!-- Several path elements can come here. -->
   <from>
     <mime-type>* /*</mime-type>
     <namespace>*</namespace>
     <local-name>*</local-name>
   </from>
   <to>
     <mime-type>* /*+xml</mime-type>
   </to>
   <class>
     <name>be.re.repo.mod.DefaultXMLOutputFactory</name>
     <!-- Optional URL relative to maps.xml.
     <jar>modules/my_module.jar</jar>
     -->
   </class>
 </xml-out>
 
 

Author:
Werner Donné
See Also:
XMLStorage, XMLStorageDelta

Method Summary
 XMLEventWriter create(String vcr, String version, String systemId, OutputStream out, String mimeType, Context context)
           
 

Method Detail

create

XMLEventWriter create(String vcr,
                      String version,
                      String systemId,
                      OutputStream out,
                      String mimeType,
                      Context context)
                      throws XMLStreamException
Parameters:
vcr - the local path of the VCR.
version - the local path of the version.
systemId - the system identifier of the resource.
out - the stream to which the transformed document should written.
mimeType - the MIME type of the resource.
context - the repository context.
Returns:
The StAX stream into which the original document will be written.
Throws:
XMLStreamException