org.codehaus.groovy.grails.web.sitemesh
Class GSPSitemeshPage

java.lang.Object
  extended by com.opensymphony.module.sitemesh.parser.AbstractPage
      extended by com.opensymphony.module.sitemesh.parser.AbstractHTMLPage
          extended by org.codehaus.groovy.grails.web.sitemesh.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 & body contents. No html parsing is required for templating since capture tags are added at GSP compilation time.

See Also:
SitemeshPreprocessor

Field Summary
 
Fields inherited from class com.opensymphony.module.sitemesh.parser.AbstractPage
pageData
 
Constructor Summary
GSPSitemeshPage()
           
GSPSitemeshPage(boolean renderingLayout)
           
 
Method Summary
 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()
           
 StreamCharBuffer getTitleBuffer()
           
 boolean isTitleCaptured()
           
 boolean isUsed()
           
 int originalLength()
           
 void setBodyBuffer(StreamCharBuffer bodyBuffer)
           
 void setContentBuffer(java.lang.String tagName, StreamCharBuffer buffer)
           
 void setHeadBuffer(StreamCharBuffer headBuffer)
           
 void setPageBuffer(StreamCharBuffer pageBuffer)
           
 void setTitleBuffer(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

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.module.sitemesh.Page
Specified by:
addProperty in interface com.opensymphony.sitemesh.Content
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.module.sitemesh.HTMLPage
Specified by:
writeHead in interface com.opensymphony.sitemesh.Content
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.module.sitemesh.Page
Specified by:
writeBody in interface com.opensymphony.sitemesh.Content
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(StreamCharBuffer headBuffer)

setBodyBuffer

public void setBodyBuffer(StreamCharBuffer bodyBuffer)

setPageBuffer

public void setPageBuffer(StreamCharBuffer pageBuffer)

setTitleBuffer

public void setTitleBuffer(StreamCharBuffer titleBuffer)

getTitleBuffer

public StreamCharBuffer getTitleBuffer()

isUsed

public boolean isUsed()

setUsed

public void setUsed(boolean used)

setContentBuffer

public void setContentBuffer(java.lang.String tagName,
                             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)