nl.imsystems.atag.tags
Class ContainerBase

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by nl.imsystems.atag.tags.ATagBase
              extended by nl.imsystems.atag.tags.ContainerBase
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag
Direct Known Subclasses:
AutoRefreshTag, PageTag, PanelTag, ReferenceBase, WrapperTag

public class ContainerBase
extends ATagBase

Base class for container tags.

Author:
kayvan

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
ContainerBase()
           
 
Method Summary
protected  void addAction(ActionTag action)
          Adds an action by reading the values on an action tag.
protected  void addDependent(String dependent)
          Adds a single dependent to the list of dependents.
protected  void addParam(ParamTag param)
          Adds a param by reading the values from the tag.
protected  void addReference(ReferenceBase reference)
          Empty implementation.
protected static String compileActions(Map actions)
          Creates a String that contains all event handler attributes for this component.
 int doStartTag()
          Default implementation that returns EVAL_BODY_BUFFERED.
protected  Map getActions()
          Retuens a Map of ActionData instances mapped against the action type.
protected  List getActions(String event)
          Returns all actions registered for the given event type.
 String getContollerUrl()
          Returns controller url attribute.
protected  Set getDependentsList()
          Returns a Set of component ids (String) that should be refreshed when this component fires an event.
protected  Map getParams()
          Retuens a Map of parameter values mapped against their name.
protected  String getParamsCSV()
          Returns a semicolon ';' separated list of name/values, separated by and equals '=' sign.
 String getViewUrl()
          Returns the viewUrl attribute.
protected  boolean isParentDependent()
          Returns true if the parent of this tag is in its dependents list.
 void release()
          Resets the Tag handler.
 void setControllerUrl(String url)
          Sets the controllerUrl attribute.
protected  void setDependents(String csv)
          Sets the dependent given a comma separated list of relative or absolute ids.
 void setViewUrl(String viewUrl)
          Sets the viewUrl attribute.
 
Methods inherited from class nl.imsystems.atag.tags.ATagBase
getAlias, getATagContext, getContextPath, getNamingContext, getParentTag, getRefererId, getRequest, getResponse, getTagId, popContext, pushContext, resolveRelativeName
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doEndTag, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Constructor Detail

ContainerBase

public ContainerBase()
Method Detail

getContollerUrl

public String getContollerUrl()
Returns controller url attribute.

Returns:
Controller url attribute.

setControllerUrl

public void setControllerUrl(String url)
Sets the controllerUrl attribute.

Parameters:
url - The url to set. Values starting with a forward slash '/' will be resolved to app root.

getViewUrl

public String getViewUrl()
Returns the viewUrl attribute.

Returns:
The viewUrl attribute.

setViewUrl

public void setViewUrl(String viewUrl)
Sets the viewUrl attribute.

Parameters:
viewUrl - The viewUrl value.

addReference

protected void addReference(ReferenceBase reference)
                     throws JspException
Empty implementation. Overriden by subclasses.

Parameters:
reference -
Throws:
JspException

addDependent

protected void addDependent(String dependent)
Adds a single dependent to the list of dependents.

Parameters:
dependent - The dependent to add.

isParentDependent

protected boolean isParentDependent()
Returns true if the parent of this tag is in its dependents list. This is used to prevent components from being rendered twice; once outside the context of their panel, and again, when the container panel is rendered.

Returns:
true if the parent of this tag is in its dependents list.

setDependents

protected void setDependents(String csv)
Sets the dependent given a comma separated list of relative or absolute ids.

Parameters:
csv - The comma separated list of dependents.

getActions

protected List getActions(String event)
Returns all actions registered for the given event type.

Parameters:
event - The event type ('change', 'click', etc.)
Returns:
List of ActionData instances.

addAction

protected void addAction(ActionTag action)
                  throws JspException
Adds an action by reading the values on an action tag.

Parameters:
action - The action to read.
Throws:
JspException - If the action is added to a tag that does not support it.

getParamsCSV

protected String getParamsCSV()
Returns a semicolon ';' separated list of name/values, separated by and equals '=' sign.

Returns:
Semicolon ';' separated list of name/values.

addParam

protected void addParam(ParamTag param)
Adds a param by reading the values from the tag.

Parameters:
param - The tag to read.

getDependentsList

protected Set getDependentsList()
Returns a Set of component ids (String) that should be refreshed when this component fires an event.

Returns:
Set of component ids (String).

getActions

protected Map getActions()
Retuens a Map of ActionData instances mapped against the action type.

Returns:
Map of ActionData instances mapped against the action type.

getParams

protected Map getParams()
Retuens a Map of parameter values mapped against their name.

Returns:
Map of parameter values mapped against their name.

doStartTag

public int doStartTag()
               throws JspException
Default implementation that returns EVAL_BODY_BUFFERED.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspException

release

public void release()
Resets the Tag handler.

Specified by:
release in interface Tag
Overrides:
release in class BodyTagSupport

compileActions

protected static String compileActions(Map actions)
Creates a String that contains all event handler attributes for this component.

Parameters:
actions - Map of ActionData instances mapped against the action type.
Returns:
String containing all event handler attributes for this component.