Package org.opoo.press

Examples of org.opoo.press.Renderer


  @Override
  public void render(Map<String, Object> rootMap) {
    //comment this, call convert() separately.
    //convert();
   
    Renderer renderer = getRenderer();
    boolean isContentRenderRequired = renderer.isRenderRequired(getContent());
    boolean isValidLayout = renderer.isValidLayout(getLayout());
   
    if(!isValidLayout && !isContentRenderRequired){
      log.debug("Layout is nil and content is plain text, skip render file: "
          + getSource().getSourceEntry().getFile());
      //output = content;
      //do nothing
      return;
    }
   
    rootMap = new HashMap<String,Object>(rootMap);
    mergeRootMap(rootMap);
    //if content is plain text
    if(!isContentRenderRequired){
      rootMap.put("content", getContent());
    }
   
    String name = isContentRenderRequired ? renderer.prepareWorkingTemplate(getLayout(), isValidLayout,
        getContent(), isContentRenderRequired,
        getSource().getSourceEntry())
        : renderer.getLayoutWorkingTemplate(getLayout());
    String output = renderer.render(name, rootMap);
//    String output = getRenderer().render(getLayout(), getContent(), getSource().getSourceEntry(), rootMap);
    setContent(output);
  }
View Full Code Here

TOP

Related Classes of org.opoo.press.Renderer

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.