Transform summary information to HTML.

@param htmlWriter
the Writer to write the HTML output to
345863
public void transformSummaryToHTML(Writer htmlWriter) throws IOException, TransformerException {

        ByteArrayOutputStream summaryOut = new ByteArrayOutputStream(8096);
        reportSummary(summaryOut);

        StreamSource in = new StreamSource(new ByteArrayInputStream(summaryOut.toByteArray()));
        StreamResult out = new StreamResult(htmlWriter);
        InputStream xslInputStream = this.getClass().getClassLoader().getResourceAsStream("summary.xsl");
        if (xslInputStream == null) {
            throw new IOException("Could not load summary stylesheet");
        }
        StreamSource xsl = new StreamSource(xslInputStream);

        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer transformer = tf.newTransformer(xsl);
        transformer.transform(in, out);

        Reader rdr = in.getReader();
        if (rdr != null) {
            rdr.close();
        }
        htmlWriter.close();
        InputStream is = xsl.getInputStream();
        if (is != null) {
            is.close();
        }
    }
288428
private void createHtmlDoc() throws PrompterException {
        HtmlDocConfiguration configuration = new HtmlDocConfiguration();

        String heading = prompter.prompt("Enter overview title:", configuration.getHeading());
        String columns = prompter.prompt("Enter number of columns in overview:", configuration.getColumns());
        String pageTitle = prompter.prompt("Enter page title:", configuration.getPageTitle());
        String outputFile = prompter.prompt("Enter output file name:", configuration.getOutputFile());
        String logo = prompter.prompt("Enter file path to logo:", configuration.getLogo());

        String confirm = prompter.prompt("Confirm HTML documentation: outputFile='target/" + outputFile + (outputFile.endsWith(".html") ? "" : ".html") + "'\n",
                Arrays.asList("y", "n"), "y");

        if (confirm.equalsIgnoreCase("n")) {
            return;
        }

        HtmlTestDocsGenerator generator = getHtmlTestDocsGenerator();

        generator.withOutputFile(outputFile + (outputFile.endsWith(".html") ? "" : ".html"))
                .withPageTitle(pageTitle)
                .withOverviewTitle(heading)
                .withColumns(columns)
                .useSrcDirectory(getTestSrcDirectory())
                .withLogo(logo);

        generator.generateDoc();

        getLog().info("Successfully created HTML documentation: outputFile='target/" + outputFile + (outputFile.endsWith(".html") ? "" : ".html") + "'");
    }
1209829
public void write(XMLStreamWriter writer, String xmlElementName) throws XMLStreamException {
      if (isModified()) {
         writer.writeStartElement(xmlElementName);
         write(writer);
         writer.writeEndElement();
      }
   }
1354652
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
      writer.newLine();
      writer.taggedValue("remoteMEId", remoteMEId);
      writer.newLine();
      writer.taggedValue("streamId", streamId);
      writer.newLine();
      writer.taggedValue("gatheringTargetDestUuid", gatheringTargetDestUuid);
  }
986536
public Result<String> convertToHtml(InputStream stream) throws IOException {
        return new InternalDocumentConverter(options).convertToHtml(stream).toResult();
    }
395421
public static void writeEscapedForHTML(String s, Writer w)
    throws IOException {
        PrintWriter out = new PrintWriter(w);
        BufferedReader reader = new BufferedReader(new StringReader(s));
        String line;
        while((line=reader.readLine()) != null){
            out.println(StringEscapeUtils.escapeHtml(line));
        }
    }
446358
private void printTitle(HtmlPage htmlPage, PrintWriter out) {
        out.println(String.format("BitvUnit %s Report - %s - %s", getBitvUnitVersion(), htmlPage.getUrl(), getFormattedDate()));
    }
1360487
public static void writeXHTML(Document htmldoc, OutputStream out) throws IOException {
    javax.xml.transform.Result result = new StreamResult(out);
    // Use a transformer for pretty printing
    Transformer xformer;
    try {
      xformer = TransformerFactory.newInstance().newTransformer();
      xformer.setOutputProperty(OutputKeys.INDENT, "yes");
      // TODO: ensure the "meta" tag doesn't claim a different encoding!
      xformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
      xformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, HTML_XHTML_TRANSITIONAL_DOCTYPE_PUBLIC);
      xformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, HTML_XHTML_TRANSITIONAL_DOCTYPE_SYSTEM);
      xformer.transform(new DOMSource(htmldoc), result);
    }
    catch(TransformerException e1) {
      throw new IOException(e1);
    }
    out.flush();
  }
209948
private void writeRow(String... columns) throws IOException {
        StringBuilder html = new StringBuilder();
        html.append("<tr>");
        for(String data : columns) {
            html.append("<td>").append(data).append("</td>");
        }
        html.append("</tr>\n");
        writer.write(html.toString());
    }
1340029
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("streamId", streamId);
    writer.newLine();
    writer.taggedValue("flushStarted", flushStarted);
  }
100712
public void append(String html) {

        if ((html != null) && (html.length() > 0)) {
            appendHtmlInternal(m_reportContent.getElement(), html);
            scrollToBottom(getElement(), m_reportContent.getElement());
        }
    }
221013
public static void writeAnalysisHTMLToFile(String outputPath, DataAnalysis dataAnalysis, JavaSparkContext sc) {
        try {
            String analysisAsHtml = HtmlAnalysis.createHtmlAnalysisString(dataAnalysis);
            writeStringToFile(outputPath, analysisAsHtml, sc);
        } catch (Exception e) {
            throw new RuntimeException("Error generating or writing HTML analysis file (normalized data)", e);
        }
    }
577393
public static boolean renderHTMLStringPreserveEmptyAttribute(ResponseWriter writer,
            String componentProperty, String htmlAttrName, String value)
            throws IOException
    {
        if (!isDefaultStringPreserveEmptyAttributeValue(value))
        {
            writer.writeAttribute(htmlAttrName, value, componentProperty);
            return true;
        }
        return false;
    }
408403
public void xmlWriteOn(FormattedWriter writer) throws IOException  
  {
    writer.newLine();
    writer.startTag("messagingEngineUuid");
    writer.write(messagingEngineUuid.toString());
    writer.endTag("messagingEngineUuid");
  }
1181889
public static void writelnTo(String html, Writer writer) throws IOException {
		writeTo(html, writer);
		writer.write('\n');
	}
309032
public void printHtmlHeading(PrintWriter out)
    {
        if (this.getScreenField().getConverter() == null)
            return;
        String strField = this.getScreenField().getConverter().getFieldDesc();
        if ((strField == null) || (strField.length() == 0))
            strField = "&nbsp;";    //?"<br>";
        out.println("<th>" + strField + "</th>");
    }
1368445
public final void xmlWriteOn(FormattedWriter writer, String tagName) throws IOException
    {
        Link link = getHead();
        if (link != null)
        {
            writer.newLine();
            writer.startTag(tagName);
            writer.indent();

            while (link != null)
            {
                writer.newLine();
                link.xmlWriteOn(writer);
                link = link.getNextPhysicalLink();
            }

            writer.outdent();
            writer.newLine();
            writer.endTag(tagName);
        }
    }