de.uka.ipd.consensus.foundation.ontology
Interface ExportHandler

All Known Implementing Classes:
XTMExportHandler

public interface ExportHandler

The interface for modules that can export the ontology in a certain file format.

An ExportHandler can be registered with OntologyManager.addExportHandler(). However, it's easier just to declare all export handlers (their fully qualified classes) as a comma separated list under the "cf.exporthandler" key in the ConsensusFoundation.properties configuration file.

The declared export handlers will be loaded by OntologyManager.init(). Instantiation will only be successful if one of the following constructors is available (the first one that matches will be used):

The Properties parameter contains all entries from ConsensusFoundation.properties.

Version:
2006-06-14
Author:
Thomas Much
See Also:
OntologyManager, ImportHandler

Method Summary
 void exportOntology(OutputStream out, boolean exportInternals)
          Exports the ontology to a given OutputStream.
 String getContentType()
          Returns the content (MIME) type that this handler will export, e.h.
 String getDescription()
          Returns a short description about this export handler.
 String getExtension()
          Returns the file extensions of the ontology format that this handler can export, e.g.
 

Method Detail

exportOntology

public void exportOntology(OutputStream out,
                           boolean exportInternals)
                    throws IOException,
                           OntologyManagerException
Exports the ontology to a given OutputStream. Can be called by an application.

This method is responsible for closing the stream!

Parameters:
out - the OutputStream to write the ontology to
exportInternals - a flag if internal element shall be exported (like users and the "created-by" association)
Throws:
IOException - if an IO error occurs while writing the ontology
OntologyManagerException - if the ontology cannot be exported for some other reason

getContentType

public String getContentType()
Returns the content (MIME) type that this handler will export, e.h. "text/xml".

Returns:
the content type of an ontology exported by this handler

getExtension

public String getExtension()
Returns the file extensions of the ontology format that this handler can export, e.g. "xtm".

Returns:
the file extension for the handlers ontology file format

getDescription

public String getDescription()
Returns a short description about this export handler.

Returns:
a description about this handler