Package org.jivesoftware.admin
Class SidebarTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
- org.jivesoftware.admin.SidebarTag
-
- All Implemented Interfaces:
Serializable
,javax.servlet.jsp.tagext.BodyTag
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
SubSidebarTag
public class SidebarTag extends javax.servlet.jsp.tagext.BodyTagSupport
A simple JSP tag for displaying sidebar information in the admin console. The
TabsTag
is similiar to this one.Attributes:
bean
(required) - the id of the request attribute which is aAdminPageBean
instance. This class holds information needed to properly render the admin console sidebar.css
(optional) - the CSS class name used to decorate the LI of the sidebar items.currentcss
(optional) - the CSS class name used to decorate the LI of the currently selected sidebar item.heaadercss
(optional) - the CSS class name used to decorate the LI of the header section.
This class assumes there is a request attribute with the name specified by the bean attribute.
This tag prints out minimal HTML. It basically prints an unordered list (UL element) with each LI containing an "A" tag specfied by the body content of this tag. For example, the body should contain a template A tag which will have its values replaced at runtime:
There is a subsidebar tag for rendering the sub-sidebars. For more info, see the<jive:sidebar bean="jivepageinfo"> <br> <a href="[url]" title="[description]">[name]</a> <br> <jive:subsidebar> ... </jive:subsidebar> <br> </jive:sidebar>
SubSidebarTag
class.Available tokens for the "A" tag are:
[id]
- the ID of the sidebar item, usually not needed.[name]
- the name of the sidebar item, should be thought of as the display name.[url]
- the URL of the sidebar item.[description]
- the description of the sidebar item, good for mouse rollovers.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SidebarTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
doEndTag()
Gets theAdminPageBean
instance from the request.int
doStartTag()
Does nothing, returnsBodyTag.EVAL_BODY_BUFFERED
always.String
getCss()
Returns the value of the CSS class to be used for tab decoration.String
getCurrentcss()
Returns the value of the CSS class to be used for the currently selected LI (tab).String
getHeadercss()
Returns the value of the CSS class to be used for sidebar header sections.SubSidebarTag
getSubsidebarTag()
Returns the subsidebar tag - should be declared in the body of this tag (see class description).void
setCss(String css)
Sets the CSS used for tab decoration.void
setCurrentcss(String currentcss)
Sets the CSS class value for the currently selected tab.void
setHeadercss(String headercss)
Sets the CSS value used for the sidebar header sections.void
setSubSidebar(SubSidebarTag subsidebarTag)
Sets the subsidebar tag - used by the container.-
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
-
-
-
-
Method Detail
-
getCss
public String getCss()
Returns the value of the CSS class to be used for tab decoration. If not set will return a blank string.- Returns:
- the CSS
-
setCss
public void setCss(String css)
Sets the CSS used for tab decoration.- Parameters:
css
- the CSS
-
getCurrentcss
public String getCurrentcss()
Returns the value of the CSS class to be used for the currently selected LI (tab). If not set will return a blank string.- Returns:
- the CSS class
-
setCurrentcss
public void setCurrentcss(String currentcss)
Sets the CSS class value for the currently selected tab.- Parameters:
currentcss
- the CSS class
-
getHeadercss
public String getHeadercss()
Returns the value of the CSS class to be used for sidebar header sections.- Returns:
- the CSS
-
setHeadercss
public void setHeadercss(String headercss)
Sets the CSS value used for the sidebar header sections.- Parameters:
headercss
- the CSS
-
getSubsidebarTag
public SubSidebarTag getSubsidebarTag()
Returns the subsidebar tag - should be declared in the body of this tag (see class description).- Returns:
- the sidebar tag
-
setSubSidebar
public void setSubSidebar(SubSidebarTag subsidebarTag)
Sets the subsidebar tag - used by the container.- Parameters:
subsidebarTag
- the sidebar tag
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException
Does nothing, returnsBodyTag.EVAL_BODY_BUFFERED
always.- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
-
doEndTag
public int doEndTag() throws javax.servlet.jsp.JspException
Gets theAdminPageBean
instance from the request. If it doesn't exist then execution is stopped and nothing is printed. If it exists, retrieve values from it and render the sidebar items. The body content of the tag is assumed to have an A tag in it with tokens to replace (see class description) as well as having a subsidebar tag..- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Returns:
Tag.EVAL_PAGE
after rendering the tabs.- Throws:
javax.servlet.jsp.JspException
- if an exception occurs while rendering the sidebar items.
-
-