Class GSPSitemeshPage

  • All Implemented Interfaces:
    com.opensymphony.module.sitemesh.HTMLPage, com.opensymphony.module.sitemesh.Page, com.opensymphony.sitemesh.Content

    public class GSPSitemeshPage
    extends com.opensymphony.module.sitemesh.parser.AbstractHTMLPage
    implements com.opensymphony.sitemesh.Content
    Grails/GSP specific implementation of Sitemesh's AbstractHTMLPage g:capture* tags in RenderTagLib are used to capture head, meta, title, component and body contents. No html parsing is required for templating since capture tags are added at GSP compilation time.
    • Field Summary

      • Fields inherited from class com.opensymphony.module.sitemesh.parser.AbstractPage

        pageData
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addProperty​(java.lang.String name, java.lang.Object value)  
      void addProperty​(java.lang.String name, java.lang.String value)  
      static com.opensymphony.module.sitemesh.HTMLPage content2htmlPage​(com.opensymphony.sitemesh.Content content)  
      java.lang.String getBody()  
      java.lang.Object getContentBuffer​(java.lang.String name)  
      java.lang.String getHead()  
      java.lang.String getPage()  
      org.grails.buffer.StreamCharBuffer getTitleBuffer()  
      boolean isTitleCaptured()  
      boolean isUsed()  
      int originalLength()  
      void reset()  
      void setBodyBuffer​(org.grails.buffer.StreamCharBuffer bodyBuffer)  
      void setContentBuffer​(java.lang.String tagName, org.grails.buffer.StreamCharBuffer buffer)  
      void setHeadBuffer​(org.grails.buffer.StreamCharBuffer headBuffer)  
      void setPageBuffer​(org.grails.buffer.StreamCharBuffer pageBuffer)  
      void setTitleBuffer​(org.grails.buffer.StreamCharBuffer titleBuffer)  
      void setTitleCaptured​(boolean titleCaptured)  
      void setUsed​(boolean used)  
      void writeBody​(java.io.Writer out)  
      void writeHead​(java.io.Writer out)  
      void writeOriginal​(java.io.Writer writer)  
      void writePage​(java.io.Writer out)  
      • Methods inherited from class com.opensymphony.module.sitemesh.parser.AbstractHTMLPage

        isFrameSet, setFrameSet
      • Methods inherited from class com.opensymphony.module.sitemesh.parser.AbstractPage

        getBooleanProperty, getContentLength, getIntProperty, getLongProperty, getProperties, getProperty, getPropertyKeys, getRequest, getTitle, isPropertySet, noNull, setRequest
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.opensymphony.sitemesh.Content

        getProperty, getPropertyKeys, getTitle
      • Methods inherited from interface com.opensymphony.module.sitemesh.Page

        getBooleanProperty, getContentLength, getIntProperty, getLongProperty, getProperties, getProperty, getPropertyKeys, getRequest, getTitle, isPropertySet, setRequest
    • Constructor Detail

      • GSPSitemeshPage

        public GSPSitemeshPage()
      • GSPSitemeshPage

        public GSPSitemeshPage​(boolean renderingLayout)
    • Method Detail

      • reset

        public void reset()
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.Object value)
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.String value)
        Specified by:
        addProperty in interface com.opensymphony.sitemesh.Content
        Specified by:
        addProperty in interface com.opensymphony.module.sitemesh.Page
        Overrides:
        addProperty in class com.opensymphony.module.sitemesh.parser.AbstractPage
      • writeHead

        public void writeHead​(java.io.Writer out)
                       throws java.io.IOException
        Specified by:
        writeHead in interface com.opensymphony.sitemesh.Content
        Specified by:
        writeHead in interface com.opensymphony.module.sitemesh.HTMLPage
        Specified by:
        writeHead in class com.opensymphony.module.sitemesh.parser.AbstractHTMLPage
        Throws:
        java.io.IOException
      • writeBody

        public void writeBody​(java.io.Writer out)
                       throws java.io.IOException
        Specified by:
        writeBody in interface com.opensymphony.sitemesh.Content
        Specified by:
        writeBody in interface com.opensymphony.module.sitemesh.Page
        Specified by:
        writeBody in class com.opensymphony.module.sitemesh.parser.AbstractPage
        Throws:
        java.io.IOException
      • writePage

        public void writePage​(java.io.Writer out)
                       throws java.io.IOException
        Specified by:
        writePage in interface com.opensymphony.module.sitemesh.Page
        Overrides:
        writePage in class com.opensymphony.module.sitemesh.parser.AbstractPage
        Throws:
        java.io.IOException
      • getHead

        public java.lang.String getHead()
        Specified by:
        getHead in interface com.opensymphony.module.sitemesh.HTMLPage
      • getBody

        public java.lang.String getBody()
        Specified by:
        getBody in interface com.opensymphony.module.sitemesh.Page
        Overrides:
        getBody in class com.opensymphony.module.sitemesh.parser.AbstractPage
      • getPage

        public java.lang.String getPage()
        Specified by:
        getPage in interface com.opensymphony.module.sitemesh.Page
        Overrides:
        getPage in class com.opensymphony.module.sitemesh.parser.AbstractPage
      • originalLength

        public int originalLength()
        Specified by:
        originalLength in interface com.opensymphony.sitemesh.Content
      • writeOriginal

        public void writeOriginal​(java.io.Writer writer)
                           throws java.io.IOException
        Specified by:
        writeOriginal in interface com.opensymphony.sitemesh.Content
        Throws:
        java.io.IOException
      • setHeadBuffer

        public void setHeadBuffer​(org.grails.buffer.StreamCharBuffer headBuffer)
      • setBodyBuffer

        public void setBodyBuffer​(org.grails.buffer.StreamCharBuffer bodyBuffer)
      • setPageBuffer

        public void setPageBuffer​(org.grails.buffer.StreamCharBuffer pageBuffer)
      • setTitleBuffer

        public void setTitleBuffer​(org.grails.buffer.StreamCharBuffer titleBuffer)
      • getTitleBuffer

        public org.grails.buffer.StreamCharBuffer getTitleBuffer()
      • isUsed

        public boolean isUsed()
      • setUsed

        public void setUsed​(boolean used)
      • setContentBuffer

        public void setContentBuffer​(java.lang.String tagName,
                                     org.grails.buffer.StreamCharBuffer buffer)
        Parameters:
        tagName - "tagName" name of buffer (without "page." prefix)
        buffer -
      • getContentBuffer

        public java.lang.Object getContentBuffer​(java.lang.String name)
        Parameters:
        name - propertyName of contentBuffer (with "page." prefix)
        Returns:
        the buffer for the specified name
      • content2htmlPage

        public static com.opensymphony.module.sitemesh.HTMLPage content2htmlPage​(com.opensymphony.sitemesh.Content content)
      • isTitleCaptured

        public boolean isTitleCaptured()
      • setTitleCaptured

        public void setTitleCaptured​(boolean titleCaptured)