Search in sources :

Example 1 with HTMLVis

use of annis.visualizers.htmlvis.HTMLVis in project ANNIS by korpling.

the class EmbeddedVisUI method showHtmlDoc.

private void showHtmlDoc(String corpus, String doc, Map<String, String[]> args) {
    // do nothing for empty fragments
    if (args == null || args.isEmpty()) {
        return;
    }
    if (args.get("config") != null && args.get("config").length > 0) {
        String config = args.get("config")[0];
        // get input parameters
        HTMLVis visualizer;
        visualizer = new HTMLVis();
        VisualizerInput input;
        Visualizer visConfig;
        visConfig = new Visualizer();
        visConfig.setDisplayName(" ");
        visConfig.setMappings("config:" + config);
        visConfig.setNamespace(null);
        visConfig.setType("htmldoc");
        // create input
        try {
            input = DocBrowserController.createInput(corpus, doc, visConfig, false, null);
            // create components, put in a panel
            Panel viszr = visualizer.createComponent(input, null);
            // Set the panel as the content of the UI
            setContent(viszr);
        } catch (UniformInterfaceException ex) {
            displayMessage("Could not query document", "error was \"" + ex.getMessage() + "\" (detailed error is available in the server log-files)");
            log.error("Could not get document for embedded visualizer", ex);
        }
    } else {
        displayMessage("Missing required argument for visualizer \"htmldoc\"", "The following arguments are required:" + "<ul>" + "<li><code>config</code>: the internal config file to use (same as <a href=\"http://korpling.github.io/ANNIS/doc/classannis_1_1visualizers_1_1htmlvis_1_1HTMLVis.html\">\"config\" mapping parameter)</a></li>" + "</ul>");
    }
}
Also used : Panel(com.vaadin.ui.Panel) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) VisualizerInput(annis.libgui.visualizers.VisualizerInput) Visualizer(annis.service.objects.Visualizer) HTMLVis(annis.visualizers.htmlvis.HTMLVis)

Aggregations

VisualizerInput (annis.libgui.visualizers.VisualizerInput)1 Visualizer (annis.service.objects.Visualizer)1 HTMLVis (annis.visualizers.htmlvis.HTMLVis)1 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)1 Panel (com.vaadin.ui.Panel)1