Package com.mgreau.wwsmad.websocket.messages

Examples of com.mgreau.wwsmad.websocket.messages.OutputMessage


  }
 
  public void html5RenderedEvent(@Observes @Backend("html5") AsciidocMessageEvent event){
    logger.info("::event:: received html5 event message");
    OutputMessage html = buildOutputMessage(TypeFormat.html5, event);
   
    long start = System.currentTimeMillis();
    try {
      html.setContent(processor.renderAsDocument(event.msg.getAdocSource()));
      html.setTimeToRender(System.currentTimeMillis() - start);
    } catch (RuntimeException rEx) {
      logger.severe("processing error." + rEx.getCause().toString());
    }

    // send the new HTML version to all connected peers
View Full Code Here


   *
   * @param event
   */
  public void dzslidesRenderedEvent(@Observes @Backend("dzslides") AsciidocMessageEvent event){
    logger.info("::event:: received dzslides event message");
    OutputMessage html = buildOutputMessage(TypeFormat.html5, event);
   
    final String templateDir = System.getProperty("jboss.server.data.dir")+"/asciidoctor-backends/slim/dzslides";
   
    long start = System.currentTimeMillis();
    try {
      html.setContent(processor.renderAsDocument(event.msg.getAdocSource(), "dzslides",
          new java.io.File(templateDir), event.msg.getPart()));
      html.setTimeToRender(System.currentTimeMillis() - start);
    } catch (RuntimeException rEx) {
      logger.severe("processing error." + rEx.toString());
    }
   
    // send the new HTML version to all connected peers
View Full Code Here

  public void pdfRenderedEvent(@Observes @Backend("pdf") AsciidocMessageEvent event){
    //NOT YET IMPLEMENTED
  }
 
  private OutputMessage buildOutputMessage(TypeFormat type, AsciidocMessageEvent event){
    final OutputMessage html = new OutputMessage(type);
    html.setAdocId(event.id);
    html.setType(TypeMessage.output);
    html.setCurrentWriter(event.msg.getCurrentWriter());
    html.setAdocSource(event.msg.getAdocSource());
    html.setTimeToRender(-1);
    html.setDocHeader(checkHeader(event.msg
        .getAdocSource()));
   
    return html;
  }
View Full Code Here

TOP

Related Classes of com.mgreau.wwsmad.websocket.messages.OutputMessage

Copyright © 2018 www.massapicom. 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.