Class AnnotationViewGenerator
java.lang.Object
org.apache.uima.tools.util.htmlview.AnnotationViewGenerator
Utility that uses XSL stylesheets to produce an HTML view (w/ Javascript) of an annotated
document.
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationViewGenerator(File aOutputDir) Creates a new AnnotationViewGenerator. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringautoGenerateStyleMap(AnalysisEngineMetaData aTaeMetaData) Automatically generates a style map for the given text analysis engine.static StringautoGenerateStyleMap(TypeSystemDescription aTypeSystem) Automatically generates a style map for the given type system.voidautoGenerateStyleMapFile(AnalysisEngine aAE, File aStyleMapFile) Automatically generates a style map file for the given analysis engine.voidautoGenerateStyleMapFile(AnalysisEngineMetaData aMetaData, File aStyleMapFile) Automatically generates a style map file for the given analysis engine metadata.voidautoGenerateStyleMapFile(TypeSystemDescription aTypeSystem, File aStyleMapFile) Automatically generates a style map file for the given type system.voidprocessDocument(File aInlineXmlDoc) Processes an annotated document using the docFrame.xsl stylsheet generated by a previous call toprocessStyleMap(File).voidprocessStyleMap(File aStyleMap) Processes a user-specified file map and produces three outputs: annotations.css - A CSS stylesheet for the annotation viewer legend.html - HTML document for legend (bottom pane of viewer) docFrame.xsl - An XSL stylesheet to be applied to annotated documents during calls toprocessDocument(File).
-
Constructor Details
-
AnnotationViewGenerator
Creates a new AnnotationViewGenerator.- Parameters:
aOutputDir- directory in which this program will write its output files.
-
-
Method Details
-
processStyleMap
Processes a user-specified file map and produces three outputs:- annotations.css - A CSS stylesheet for the annotation viewer
- legend.html - HTML document for legend (bottom pane of viewer)
- docFrame.xsl - An XSL stylesheet to be applied to annotated documents during calls to
processDocument(File).
- Parameters:
aStyleMap- path to style map to be processed- Throws:
TransformerException- the transformer exception
-
processDocument
Processes an annotated document using the docFrame.xsl stylsheet generated by a previous call toprocessStyleMap(File). Generates a file named docView.html, which represents the HTML view of the annotated document.- Parameters:
aInlineXmlDoc- path to annotated document to be processed- Throws:
TransformerException- the transformer exception
-
autoGenerateStyleMap
Automatically generates a style map for the given text analysis engine. The style map will be returned as an XML string.- Parameters:
aTaeMetaData- Metadata of the Text Analysis Engine whose outputs will be viewed using the generated style map.- Returns:
- a String containing the XML style map
-
autoGenerateStyleMap
Automatically generates a style map for the given type system. The style map will be returned as an XML string.- Parameters:
aTypeSystem- the type system for which a style map will be generated- Returns:
- a String containing the XML style map
-
autoGenerateStyleMapFile
Automatically generates a style map file for the given analysis engine. The style map will be written to the fileaStyleMapFile.- Parameters:
aAE- the Analysis Engine whose outputs will be viewed using the generated style map.aStyleMapFile- file to which autogenerated style map will be written- Throws:
IOException- Signals that an I/O exception has occurred.
-
autoGenerateStyleMapFile
public void autoGenerateStyleMapFile(AnalysisEngineMetaData aMetaData, File aStyleMapFile) throws IOException Automatically generates a style map file for the given analysis engine metadata. The style map will be written to the fileaStyleMapFile.- Parameters:
aMetaData- Metadata of the Analysis Engine whose outputs will be viewed using the generated style map.aStyleMapFile- file to which autogenerated style map will be written- Throws:
IOException- Signals that an I/O exception has occurred.
-
autoGenerateStyleMapFile
public void autoGenerateStyleMapFile(TypeSystemDescription aTypeSystem, File aStyleMapFile) throws IOException Automatically generates a style map file for the given type system. The style map will be written to the fileaStyleMapFile.- Parameters:
aTypeSystem- the type system for which a style map will be generatedaStyleMapFile- file to which autogenerated style map will be written- Throws:
IOException- Signals that an I/O exception has occurred.
-