public String constructHtmlDescription()

in SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java [315:362]


  public String constructHtmlDescription(String servletURL) {
    ServerSpec rspec = this.server.getServiceSpec();
    String html = "<html>" + "<head>" + "<title>"
            + rspec.getShortDescription()
            + "</title>"
            + "</head>"
            + "<body>"
            + "<h2>"
            + rspec.getShortDescription()
            + "</h2>"
            + rspec.getLongDescription()
            + "<h3>Usage</h3>"
            + "In order to use this service, a POST- or GET-request should be sent to the server with the following URL:"
            + "<pre>"
            + servletURL
            + "</pre>"
            + "<br/>"
            + "The following request parameters are expected:"
            + constructParameterDescription()
            + "<h3>Result</h3>"
            + "If XML or inline-XML output is requested, it will contain the tags listed below. "
            + "The XSD-definition of the output in XML-format can be downloaded "
            + "<a href=\""
            + servletURL
            + "?mode=xsd\">here</a>."
            + constructResultDescription()
            + ""
            + (getCustomDescription().equals("") ? "" : "<h3>Additional description </h3> "
                    + getCustomDescription())
            + ""
            + "<h3>Example of usage</h3>"
            + "<pre>"
            + "String text = \"Hello Mr. John Smith !\"; \n"
            + "String parameters = \"text=\" + URLEncoder.encode(text, \"UTF-8\") + \"&mode=inline\";\n"
            + "URL url = new URL(\""
            + servletURL
            + "\"); \n"
            + "URLConnection connection = url.openConnection(); \n"
            + "connection.setDoOutput(true); \n"
            + "OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream()); \n"
            + "writer.write(parameters);\n"
            + "writer.flush(); \n\n"
            + "BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), \"UTF-8\")); \n"
            + "String line; \n" + "while ((line = reader.readLine()) != null) { \n"
            + "    System.out.println(line);\n" + "} \n" + "</pre>" + "<body>" + "</html>";

    return html;
  }