Examples of HtmlGenerator


Examples of br.com.caelum.tubaina.parser.html.HtmlGenerator

      }
    }

    if (html) {
      HtmlParser htmlParser = new HtmlParser(conf.read("/regex.properties", "/html.properties"), noAnswer);
      HtmlGenerator generator = new HtmlGenerator(htmlParser, strictXhtml, templateDir);
      File file = new File(outputDir, "html");
      FileUtils.forceMkdir(file);
      try {
        generator.generate(b, file);
      } catch (TubainaException e) {
        LOG.warn(e.getMessage());
      }
    }
View Full Code Here

Examples of com.olabini.jescov.generators.HtmlGenerator

    public static void main(final String[] args) throws Exception {
        Configuration c = new Configuration();
        String fileout = c.getJsonOutputFile();
        FileWriter fw = new FileWriter(fileout);
        c.setGenerator(new CombinedGenerator(new JsonGenerator(fw), new HtmlGenerator(c)));
        Runner r = new Runner(c);
        for(String file : args) {
            r.executeReader(file, new FileReader(file));
        }
        CoverageData data = r.done();
View Full Code Here

Examples of org.infinispan.tools.doclet.html.HtmlGenerator

      }

      // sort components alphabetically
      Collections.sort(mbeans);

      HtmlGenerator generator = new JmxHtmlGenerator(encoding, jmxTitle(), bottom, footer, header,
            "JMX components exposed by Infinispan", Arrays.asList("JMX", "Infinispan", "Data Grids", "Documentation",
                  "Reference", "MBeans", "Management", "Console"), mbeans);
      generator.generateHtml(new File(outputDirectory, "jmxComponents.html").getAbsolutePath());

      return true;
   }
View Full Code Here

Examples of org.jboss.as.console.client.domain.topology.HtmlGenerator

    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index)
    {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty())
        {
            // no server/groups available ...
            Hint blank = new Hint(Console.MESSAGES.topology_no_server());
            container.clear();
            container.insert(blank, 0);
            return;
        }


        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups)
        {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++)
            {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0)
                {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++)
                {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size())
                    {
                        html.emptyCell();
                    }
                    else
                    {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds())
        {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null)
            {
                DOM.setEventListener(element, lifecycleLinkListener);
View Full Code Here

Examples of org.jboss.as.console.client.domain.topology.HtmlGenerator

    @Override
    public void updateHosts(SortedSet<ServerGroup> groups, final int index)
    {
        // validation
        HtmlGenerator html = new HtmlGenerator();
        if (groups == null || groups.isEmpty())
        {
            // TODO Add "no data" html
            return;
        }

        // initialization
        assignColors(groups);
        List<HostInfo> hosts = groups.first().getHosts();
        this.hostSize = hosts.size();
        this.visibleHosts = min(TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);
        this.hostIndex = index;
        this.hostIndex = max(0, this.hostIndex);
        this.hostIndex = min(this.hostIndex, this.hostSize - 1);
        int endIndex = min(this.hostIndex + TopologyPresenter.VISIBLE_HOSTS_COLUMNS, hostSize);

        // start table and add columns
        html.startTable().appendHtmlConstant("<colgroup>");
        int columnWidth = HOSTS_COLUMNS / (endIndex - this.hostIndex);
        html.appendColumn(SERVER_GROUPS_COLUMN);
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            html.appendColumn(columnWidth);
        }
        html.appendHtmlConstant("</colgroup>");

        // first row contains host names
        html.appendHtmlConstant("<thead><tr><th class='cellTableHeader'>Hosts&nbsp;&rarr;<br/>Groups&nbsp;&darr;</th>");
        for (int i = this.hostIndex; i < endIndex; i++)
        {
            HostInfo host = hosts.get(i);
            html.appendHost(host);
        }
        html.appendHtmlConstant("</tr></thead>");

        // remaining rows contain server groups and server instances
        html.appendHtmlConstant("<tbody>");
        for (ServerGroup group : groups)
        {
            for (int serverIndex = 0; serverIndex < group.maxServersPerHost; serverIndex++)
            {
                html.appendHtmlConstant("<tr>");
                if (serverIndex == 0)
                {
                    html.appendServerGroup(group);
                }
                for (int i = this.hostIndex; i < endIndex; i++)
                {
                    HostInfo host = hosts.get(i);
                    List<ServerInstance> servers = group.serversPerHost.get(host);
                    if (servers.isEmpty() || serverIndex >= servers.size())
                    {
                        html.emptyCell();
                    }
                    else
                    {
                        html.appendServer(group, host.getName(), servers.get(serverIndex));
                    }
                }
                html.appendHtmlConstant("</tr>");
            }
        }
        html.appendHtmlConstant("</tbody>").endTable();

        // create html panel and register events
        HTMLPanel panel = html.createPanel();
        for (String id : html.getLifecycleIds())
        {
            com.google.gwt.user.client.Element element = panel.getElementById(id);
            if (element != null)
            {
                DOM.setEventListener(element, lifecycleLinkListener);
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

         HttpExtList copt)
  throws org.w3c.tools.resources.ProtocolException
    {
  if (cman != null) {
      Reply error = request.makeReply(HTTP.NOT_EXTENDED) ;
      HtmlGenerator content = new HtmlGenerator("Error");
      content.append("<h1>Mandatory extension(s) not supported:",
         "</h1><p>\n");
      content.append("<ul>\n");
      HttpExt exts[] = cman.getHttpExts();
      for (int i=0 ; i < exts.length ; i++)
    content.append("<li> "+exts[i].getName()+"\n");
      content.append("</ul>\n");
      error.setStream(content);
      return error;
  }
  return null;
    }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

//     setStatus(SC_SEE_OTHER);
//       } else {
    setStatus(SC_MOVED_TEMPORARILY);
//      }
      reply.setLocation(loc);
      HtmlGenerator g = new HtmlGenerator("Moved");
      g.append("<P>This resource has moved, click on the link if your"
         + " browser doesn't support automatic redirection<BR>"+
         "<A HREF=\""+loc.toExternalForm()+"\">"+
         loc.toExternalForm()+"</A>");
      reply.setStream(g);
  } catch (Exception ex) {
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  Reply   rep = null;
  if (checkHeaders(req)) {
      return null;
  }
  rep = req.makeReply(HTTP.FORBIDDEN);
  HtmlGenerator g = new HtmlGenerator("Forbidden - Headers missing");
  g.append("Some Headers, mandatory for this resource, are missing.");
  if (sendHeaderList && (headerNames != null)) {
      g.append("<ul>");
      for (int i=0; i<headerNames.length; i++) {
    g.append("<li>");
    g.appendAndEscape(headerNames[i]);
    g.append("</li>");
      }
      g.append("</ul>");
  }
  rep.setStream(g);
  return rep;
    }
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  Request request = (Request) req;
  int limit = getLimit();

  if (request.getURL().toExternalForm().length() > limit) {
      Reply error = request.makeReply(HTTP.REQUEST_URI_TOO_LONG);
      HtmlGenerator g = new HtmlGenerator("Request URI Too Long");
      g.append ("Your request should have an URI of less than " +
          limit + " bytes");
      error.setStream(g);
      return error;
  }
  return null;
View Full Code Here

Examples of org.w3c.jigsaw.html.HtmlGenerator

  newdiff.append(diff);
  return newdiff.toString();
    }

    protected HtmlGenerator parseLog (String log) {
  HtmlGenerator g = getHtmlGenerator("CVS log of "+name);
  String CVSURL = getCvsURL();
  String head =
      "[ <a href=\"./../\">Up to directory</a> ] &middot; "+
      "[ <a href=\""+CVSURL+"\">Back to CVS</a> ]";

  g.append("<center>",head,"<hr noshade width=\"80%\"></center><p>");
  g.append ("<span class=\"title\"> CVS log of ",name,"</span>\n");
  g.append ("<div class=\"box\"><pre>\n");
  //parse the log string
  ByteArrayOutputStream out =
      new ByteArrayOutputStream();
  byte unparsed[] = log.getBytes();
  int byteIdx = 0;
  int startIdx = 0;
  byte ch;
  byteIdx += 7;
  do {
      while(byteIdx < unparsed.length) {
    if( (ch = unparsed[byteIdx]) == (byte) 'n' ) {
        if(byteArrayNEquals(unparsed, byteIdx-7,
          pattern, 0,
          7)) {
      break;
        }
    }
    byteIdx += increments[ch>=0 ? ch : 0];
      }
      if(++byteIdx >= unparsed.length)
    break;
      //we just found 'revision'
      while ((byteIdx <= unparsed.length) &&
       isSpace(unparsed[byteIdx])) {
    byteIdx++;
      }
      out.write(unparsed, startIdx, byteIdx-startIdx);
      startIdx = byteIdx;
      //get the revision number
      while ((byteIdx <= unparsed.length) &&
       isDigitOrPoint(unparsed[byteIdx])) {
    byteIdx++;
      }
      //revision number startIdx, byteIdx-1;
      if (byteIdx-1 > startIdx) {
    String rev = new String(unparsed,
          startIdx,
          byteIdx-startIdx);
    try {
        checkRevisionNumber(rev);
        writeLinks(out, unparsed, startIdx, byteIdx-startIdx);
    } catch (Exception ex) {
        out.write(unparsed, startIdx, byteIdx-startIdx);
    }
      }
      startIdx = byteIdx;
  } while (byteIdx < unparsed.length) ;
  // Add the last chunk of unparsed text
  int length = unparsed.length-startIdx-1;
  if (length > 0)
      out.write(unparsed, startIdx, length);
  String parsedlog = out.toString();
  g.append(parsedlog);
  //end of parsing
  g.append ("\n</pre></div>\n");
  g.append("<hr noshade width=\"80%\"><center>",head,"</center><p>");
  return g;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.