com.ideo.sweetdevria.taglib
Class AbstractTagDrawer

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.ideo.sweetdevria.taglib.AbstractTagDrawer
All Implemented Interfaces:
IRiaTag, java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
Direct Known Subclasses:
AbstractComponentTagSupport, ContextTag, ResourcesImportTag

public abstract class AbstractTagDrawer
extends javax.servlet.jsp.tagext.TagSupport
implements IRiaTag

Highest abstraction level of a SweetDEV RIA tag. Does not define any additional tag attribute, except the mandatory ones (templates...). Contains the whole tags templates processing.

Author:
Julien Maupoux
See Also:
Serialized Form

Field Summary
protected  ComponentBuilder builder
          Builder.
protected  java.util.Map messageKeys
          Message Keys.
protected  java.lang.String templateEnd
          Velocity end template renderer override.
protected  java.lang.String templateStart
          Velocity start template renderer override.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
AbstractTagDrawer()
           
 
Method Summary
 int doEndTag()
          Default processing of the end tag returning EVAL_PAGE.
 int doStartTag()
          Default processing of the start tag.
protected  void generateHtmlContent(boolean start, java.lang.String template)
          Generate an HTML content SWTRIA-945
protected  ComponentBuilder getBuilder(AbstractTagDrawer tag, javax.servlet.jsp.PageContext pageContext)
          Get builder.
abstract  java.lang.String getBuilderId()
          Return the targeted builder id for this component as specified in the configuration file.
 java.util.Map getMessageKeys()
          Get messages keys.
 javax.servlet.jsp.PageContext getPageContext()
          Return the Page Context.
 java.lang.String getTemplateEnd()
          Get the specific Velocity template path used to render the end part set from taglib attribute.
 java.lang.String getTemplateStart()
          Get the specific Velocity template path used to render the start part set from taglib attribute.
 void release()
          Release method which must call super.release !
 void setPageContext(javax.servlet.jsp.PageContext pageContext)
          Used by HTTP container.
 void setTemplateEnd(java.lang.String templateEnd)
          Set a specific Velocity template path which will be used to render the end part.
 void setTemplateStart(java.lang.String templateStart)
          Set a specific Velocity template path which will be used to render the start part.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builder

protected ComponentBuilder builder
Builder.


templateStart

protected java.lang.String templateStart
Velocity start template renderer override.


templateEnd

protected java.lang.String templateEnd
Velocity end template renderer override.


messageKeys

protected java.util.Map messageKeys
Message Keys.

Constructor Detail

AbstractTagDrawer

public AbstractTagDrawer()
Method Detail

release

public void release()
Description copied from interface: IRiaTag
Release method which must call super.release !

Specified by:
release in interface IRiaTag
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport

getBuilder

protected ComponentBuilder getBuilder(AbstractTagDrawer tag,
                                      javax.servlet.jsp.PageContext pageContext)
                               throws java.lang.IllegalAccessException,
                                      java.lang.reflect.InvocationTargetException,
                                      java.lang.NoSuchMethodException,
                                      javax.servlet.jsp.JspException
Get builder.

Parameters:
tag - the tag that will be related to the builder
pageContext -
Returns:
a ComponentBuilder for this tag
Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
javax.servlet.jsp.JspException

generateHtmlContent

protected void generateHtmlContent(boolean start,
                                   java.lang.String template)
Generate an HTML content SWTRIA-945

Parameters:
start - (boolean) true if content is for start tag, false for end tag
template - (String) velocity template name

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Description copied from interface: IRiaTag
Default processing of the start tag.

Specified by:
doStartTag in interface IRiaTag
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
EVAL_BODY_AGAIN, EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY or SKIP_PAGE.
Throws:
javax.servlet.jsp.JspException
See Also:
IRiaTag.doStartTag()

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Description copied from interface: IRiaTag
Default processing of the end tag returning EVAL_PAGE.

Specified by:
doEndTag in interface IRiaTag
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Returns:
EVAL_PAGE or SKIP_PAGE.
Throws:
javax.servlet.jsp.JspException
See Also:
IRiaTag.doEndTag()

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pageContext)
Description copied from interface: IRiaTag
Used by HTTP container. We should release tag here.

Specified by:
setPageContext in interface IRiaTag
Specified by:
setPageContext in interface javax.servlet.jsp.tagext.Tag
Overrides:
setPageContext in class javax.servlet.jsp.tagext.TagSupport

getPageContext

public javax.servlet.jsp.PageContext getPageContext()
Description copied from interface: IRiaTag
Return the Page Context.

Specified by:
getPageContext in interface IRiaTag
Returns:
Page context.
See Also:
IRiaTag.getPageContext()

getTemplateStart

public java.lang.String getTemplateStart()
Description copied from interface: IRiaTag
Get the specific Velocity template path used to render the start part set from taglib attribute. If this attribute is not set, the drawer will use the default velocity template.

Specified by:
getTemplateStart in interface IRiaTag
Returns:
Velocity template path if set by taglib attribute else, null.
See Also:
IRiaTag.getTemplateStart()

setTemplateStart

public void setTemplateStart(java.lang.String templateStart)
Description copied from interface: IRiaTag
Set a specific Velocity template path which will be used to render the start part. If this attribute is not set, the drawer will use the default velocity template.

Specified by:
setTemplateStart in interface IRiaTag
Parameters:
templateStart - Velocity template path as defined in configuration file (ria-config.xml).
See Also:
IRiaTag.setTemplateStart(String templateStart)

getTemplateEnd

public java.lang.String getTemplateEnd()
Description copied from interface: IRiaTag
Get the specific Velocity template path used to render the end part set from taglib attribute. If this attribute is not set, the drawer will use the default velocity template.

Specified by:
getTemplateEnd in interface IRiaTag
Returns:
Velocity template path if set by taglib attribute else, null.
See Also:
IRiaTag.getTemplateEnd()

setTemplateEnd

public void setTemplateEnd(java.lang.String templateEnd)
Description copied from interface: IRiaTag
Set a specific Velocity template path which will be used to render the end part. If this attribute is not set, the drawer will use the default velocity template.

Specified by:
setTemplateEnd in interface IRiaTag
Parameters:
templateEnd - Velocity template path as defined in configuration file (ria-config.xml).
See Also:
IRiaTag.setTemplateEnd(String templateEnd)

getMessageKeys

public java.util.Map getMessageKeys()
Description copied from interface: IRiaTag
Get messages keys.

Specified by:
getMessageKeys in interface IRiaTag
Returns:
Returns messages keys.

getBuilderId

public abstract java.lang.String getBuilderId()
Description copied from interface: IRiaTag
Return the targeted builder id for this component as specified in the configuration file.

Specified by:
getBuilderId in interface IRiaTag
Returns:
id targeted builder id
See Also:
IRiaTag.getBuilderId()


Copyright © 2010 Ideo Technologies. All Rights Reserved.