nl.gx.webmanager.taglib
Class RenderExtensionTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.SimpleTagSupport
      extended by nl.gx.webmanager.taglib.RenderExtensionTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.DynamicAttributes, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

public class RenderExtensionTag
extends javax.servlet.jsp.tagext.SimpleTagSupport
implements javax.servlet.jsp.tagext.DynamicAttributes

Implements the wm:renderExtension tag.

        <wm:renderExtension var="pollForm" presentationName="WM pollelement form" />
        <wm:renderExtension var="pollResult" presentationName="WM pollelement result" />
 
In this example a poll element object is rendered with two different presentations. In this case the default presentation of the poll element (wm_poll_element) is not used because the optional presentationName is provided. Additionally, no object is specified which means that the object that is being rendered is the same as the object that is rendered by the jsp this code is in. Actually this example comes from pollElement.jspf which is used to render the pollElement. Depending on weather the user has submitted the poll, either the form for doing so should be displayed or otherwise the poll results should be displayed. The example renders both the form and the results into separate variables. The remainder of the logic in pollElement.jspf determinse what is actually printed in the page. You can also explicitly specify an object and no presentation. This is done in content.jspf, for example:
   <wm:renderExtension object="${element}" />
 
This render tag renders the object ${element} (the jsp loops over all page elements) with whatever presentationname is associated with the object in GX WebManager.


Constructor Summary
RenderExtensionTag()
           
 
Method Summary
 void doTag()
           
static java.lang.String getContent(java.lang.Object object, Presentation presentation, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get rendered string for a presentable object given a presentation, request & response.
protected  java.lang.Object getExtension()
          Return object or null.
protected  java.lang.String getPresentationName()
          Return presentation name.
protected  java.lang.String getVar()
          Return var name or null if it is not set.
 void setDynamicAttribute(java.lang.String uri, java.lang.String localName, java.lang.Object value)
           
 void setExtension(java.lang.Object object)
          Setter for the optional attribute object.
 void setPresentationName(java.lang.String presentationName)
          Setter for the required attribute presentationName.
 void setVar(java.lang.String var)
          Setter for the optional attribute var.
 
Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderExtensionTag

public RenderExtensionTag()
Method Detail

setPresentationName

public void setPresentationName(java.lang.String presentationName)
Setter for the required attribute presentationName.

Parameters:
presentationName -

getPresentationName

protected java.lang.String getPresentationName()
Return presentation name.

Returns:
presentation name.

setVar

public void setVar(java.lang.String var)
Setter for the optional attribute var.

Parameters:
var -

getVar

protected java.lang.String getVar()
Return var name or null if it is not set.

Returns:
var name or null if it is not set.

setExtension

public void setExtension(java.lang.Object object)
Setter for the optional attribute object.

Parameters:
object -

getExtension

protected java.lang.Object getExtension()
Return object or null.

Returns:
object or null.

setDynamicAttribute

public void setDynamicAttribute(java.lang.String uri,
                                java.lang.String localName,
                                java.lang.Object value)
Specified by:
setDynamicAttribute in interface javax.servlet.jsp.tagext.DynamicAttributes

doTag

public void doTag()
           throws javax.servlet.jsp.JspException
Specified by:
doTag in interface javax.servlet.jsp.tagext.SimpleTag
Overrides:
doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
Throws:
javax.servlet.jsp.JspException

getContent

public static java.lang.String getContent(java.lang.Object object,
                                          Presentation presentation,
                                          javax.servlet.http.HttpServletRequest request,
                                          javax.servlet.http.HttpServletResponse response)
                                   throws java.io.IOException,
                                          javax.servlet.ServletException
Get rendered string for a presentable object given a presentation, request & response.

Parameters:
presentable -
presentation -
request -
response -
Returns:
rendered string
Throws:
java.io.IOException
javax.servlet.ServletException


Copyright © 2007-2011 GX Software BV. All Rights Reserved.